mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
228
src/Adaptor3d/Adaptor3d.cdl
Executable file
228
src/Adaptor3d/Adaptor3d.cdl
Executable file
@@ -0,0 +1,228 @@
|
||||
-- File: Adaptor3d.cdl
|
||||
-- Created: Thu Oct 8 10:33:07 1992
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@sdsun2>
|
||||
---Copyright: Matra Davision 1992
|
||||
|
||||
|
||||
|
||||
|
||||
package Adaptor3d
|
||||
|
||||
---Purpose: The Adaptor3d package is used to help defining
|
||||
-- reusable geometric algorithms. i.e. that can be
|
||||
-- used on curves and surfaces.
|
||||
--
|
||||
-- It defines general services for 3 kind of objects :
|
||||
--
|
||||
-- - the 2d curve. Curve2d
|
||||
-- - the 3d curve. Curve
|
||||
-- - the 3d surface. Surface
|
||||
--
|
||||
-- The services are :
|
||||
--
|
||||
-- - Usual services found in Geom or Geom2d :
|
||||
--
|
||||
-- * parameter range, value and derivatives, etc...
|
||||
--
|
||||
-- - Continuity breakout services :
|
||||
--
|
||||
-- * Allows to divide a curve or a surfaces in
|
||||
-- parts with a given derivation order.
|
||||
--
|
||||
-- - Special geometries detection services :
|
||||
--
|
||||
-- * Allows to test for special cases that can
|
||||
-- be processed more easily :
|
||||
-- - Conics, Quadrics, Bezier, BSpline ...
|
||||
--
|
||||
-- And to get the correponding data form the
|
||||
-- package gp or Geom. The special type
|
||||
-- OtherCurve means that no special case has
|
||||
-- been detected and the algorithm may use
|
||||
-- only the evaluation methods (D0, D1, ...)
|
||||
--
|
||||
--
|
||||
-- For each category Curve2d, Curve, Surface we
|
||||
-- define three classes, we illustrate now the
|
||||
-- principles with the Curve, the same applies to
|
||||
-- Curve2d and Surface.
|
||||
--
|
||||
-- The class Curve is the abstract root for all
|
||||
-- Curves used by algorithms, it is handled by value
|
||||
-- and provides as deferred methods the services
|
||||
-- described above.
|
||||
--
|
||||
-- Some services (breakout) requires to create new
|
||||
-- curves, this leads to memory allocation
|
||||
-- considerations (who create the curve, who deletes
|
||||
-- it ?). To solve this problem elegantly the curve
|
||||
-- will return a HCurve, the HCurve is a curve
|
||||
-- handled by reference so it will be deallocated
|
||||
-- automatically when it is not used.
|
||||
--
|
||||
-- A third class GenHCurve is provided, this class is
|
||||
-- generic and its utility is to provide automatic
|
||||
-- generation of the HCurve class when you have
|
||||
-- written the Curve class.
|
||||
--
|
||||
--
|
||||
-- * Let us show an example (with 2d curves) :
|
||||
--
|
||||
-- Imagine an algorithm to intersect curves, this
|
||||
-- algorithms is written to process Curve2d from
|
||||
-- Adaptor3d :
|
||||
--
|
||||
-- A method may look like :
|
||||
--
|
||||
-- Intersect(C1,C2 : Curve2d from Adaptor3d);
|
||||
--
|
||||
-- Which will look like in C++
|
||||
--
|
||||
-- Intersect(const Adaptor2d_Curve2d& C1,
|
||||
-- const Adaptor2d_Curve2d& C2)
|
||||
-- {
|
||||
-- // you can call any method
|
||||
-- Standard_Real first1 = C1.FirstParameter();
|
||||
--
|
||||
-- // but avoid to copy in an Adaptor3d_Curve which
|
||||
-- // is an Abstract class, use a reference or a pointer
|
||||
--
|
||||
-- const Adaptor3d_Curve& C = C1;
|
||||
-- const Adaptor3d_Curve *pC = &C1;
|
||||
--
|
||||
-- // If you are interseted in Intervals you must
|
||||
-- // store them in a HCurve to ensure they are kept
|
||||
-- // in memory. Then a referrence may be used.
|
||||
--
|
||||
-- Handle(Adaptor3d_HCurve) HCI = C1.Interval(1);
|
||||
--
|
||||
-- const Adaptor3d_Curve& CI = HCI->Curve();
|
||||
-- pC = &(HCI->Curve());
|
||||
--
|
||||
--
|
||||
-- * The Adaptor3d provides also Generic classes
|
||||
-- implementing algorithmic curves and surfaces.
|
||||
--
|
||||
-- - IsoCurve : Isoparametric curve on a surface.
|
||||
-- - CurveOnSurface : 2D curve in the parametric
|
||||
-- space of a surface.
|
||||
--
|
||||
--
|
||||
-- - OffsetCurve2d : 2d offset curve
|
||||
-- - ProjectedCurve : 3d curve projected on a plane
|
||||
-- - SurfaceOfLinearExtrusion
|
||||
-- - SurfaceOfRevolution
|
||||
--
|
||||
-- They are instantiated with HCurve, HSurface, HCurved2d
|
||||
|
||||
uses
|
||||
Standard,
|
||||
MMgt,
|
||||
TColStd,
|
||||
GeomAbs,
|
||||
TopAbs,
|
||||
TColgp,
|
||||
gp,
|
||||
Geom2d,
|
||||
Geom,
|
||||
math,
|
||||
Adaptor2d
|
||||
|
||||
is
|
||||
|
||||
deferred class Curve;
|
||||
---Purpose: Root of the 3d curve.
|
||||
|
||||
pointer CurvePtr to Curve from Adaptor3d;
|
||||
|
||||
deferred class HCurve;
|
||||
---Purpose: deferred class for the curves manipulated with
|
||||
-- Handle.
|
||||
|
||||
generic class GenHCurve;
|
||||
---Purpose: Generic class used to create a curve inheriting
|
||||
-- from HCurve.
|
||||
|
||||
|
||||
deferred class Surface;
|
||||
---Purpose: Root of the surface.
|
||||
|
||||
pointer SurfacePtr to Surface from Adaptor3d;
|
||||
|
||||
deferred class HSurface;
|
||||
---Purpose: deferred class for the surfaces manipulated with
|
||||
-- Handle.
|
||||
|
||||
generic class GenHSurface;
|
||||
---Purpose: Generic class used to create a surface inheriting
|
||||
-- from HSurface.
|
||||
|
||||
|
||||
--
|
||||
-- The following classes are used to define an abstract
|
||||
-- simplified "topology" for surfaces. This is used by
|
||||
-- algorithm as mass properties or surface intersections.
|
||||
--
|
||||
|
||||
|
||||
class HVertex;
|
||||
|
||||
class HSurfaceTool;
|
||||
|
||||
class TopolTool;
|
||||
|
||||
--
|
||||
-- The following classes provides algorithmic curves and
|
||||
-- surface, they are inheriting from Curve and Surface and the
|
||||
-- correponding HCurve and HSurface is instantiated.
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
class IsoCurve;
|
||||
---Purpose: Algorithmic 3d curv, isoparametric on a surface.
|
||||
|
||||
class HIsoCurve instantiates GenHCurve from Adaptor3d
|
||||
(IsoCurve from Adaptor3d);
|
||||
|
||||
|
||||
class CurveOnSurface;
|
||||
---Purpose: Algorithmic 3d curve from a surface and a 2d curve
|
||||
-- in the parameter space.
|
||||
|
||||
pointer CurveOnSurfacePtr to CurveOnSurface from Adaptor3d;
|
||||
|
||||
class HCurveOnSurface instantiates GenHCurve from Adaptor3d
|
||||
(CurveOnSurface from Adaptor3d);
|
||||
|
||||
|
||||
|
||||
class OffsetCurve;
|
||||
---Purpose: Algorithmic 2d curve.
|
||||
|
||||
class HOffsetCurve instantiates GenHCurve2d from Adaptor2d
|
||||
(OffsetCurve from Adaptor3d);
|
||||
|
||||
|
||||
class SurfaceOfRevolution;
|
||||
---Purpose: Algorithmic Surface from a Curve and an Axis
|
||||
-- Curve and Axis are coplanar.
|
||||
-- Curve doesn't intersect Axis.
|
||||
|
||||
class HSurfaceOfRevolution instantiates GenHSurface from Adaptor3d
|
||||
(SurfaceOfRevolution from Adaptor3d);
|
||||
|
||||
|
||||
|
||||
class SurfaceOfLinearExtrusion;
|
||||
---Purpose: Algorithmic Surface from a curve and a direction
|
||||
|
||||
class HSurfaceOfLinearExtrusion instantiates GenHSurface from Adaptor3d
|
||||
(SurfaceOfLinearExtrusion from Adaptor3d);
|
||||
|
||||
private class InterFunc;
|
||||
---Purpose: function to find the Cn discontinuity point. Used to
|
||||
-- find the roots of the functions
|
||||
|
||||
end Adaptor3d;
|
242
src/Adaptor3d/Adaptor3d_Curve.cdl
Executable file
242
src/Adaptor3d/Adaptor3d_Curve.cdl
Executable file
@@ -0,0 +1,242 @@
|
||||
-- File: Adaptor3d_Curve.cdl
|
||||
-- Created: Wed Mar 31 10:43:11 1993
|
||||
-- Author: Bruno DUMORTIER
|
||||
-- <dub@sdsun1>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
deferred class Curve from Adaptor3d
|
||||
|
||||
---Purpose: Root class for 3D curves on which geometric
|
||||
-- algorithms work.
|
||||
-- An adapted curve is an interface between the
|
||||
-- services provided by a curve and those required of
|
||||
-- the curve by algorithms which use it.
|
||||
-- Two derived concrete classes are provided:
|
||||
-- - GeomAdaptor_Curve for a curve from the Geom package
|
||||
-- - Adaptor3d_CurveOnSurface for a curve lying on
|
||||
-- a surface from the Geom package.
|
||||
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec from gp,
|
||||
Pnt from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Parab from gp,
|
||||
Lin from gp,
|
||||
BezierCurve from Geom,
|
||||
BSplineCurve from Geom,
|
||||
HCurve from Adaptor3d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
Delete(me:out) is virtual;
|
||||
---C++: alias "Standard_EXPORT virtual ~Adaptor3d_Curve(){Delete();}"
|
||||
|
||||
FirstParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
LastParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
--
|
||||
-- Services to break the curves to the expected continuity
|
||||
--
|
||||
-- If for example you need the curve to be C2 and the method
|
||||
-- Continuity returns you something lower than C2 (say C1 for
|
||||
-- example).
|
||||
--
|
||||
-- First compute the number of intervals with the requested
|
||||
-- continuity with the method NbIntervals(). Note that if the
|
||||
-- continuity is higher than the one you need NbIntervals will
|
||||
-- return 1.
|
||||
--
|
||||
-- Then you get the parameters bounding the intervals with the
|
||||
-- method Intervals, using an array of length at least
|
||||
-- NbIntervals()+1.
|
||||
--
|
||||
-- If you need to create a curve with a restricted span you can
|
||||
-- use the method Trim().
|
||||
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs
|
||||
---Purpose:
|
||||
is virtual;
|
||||
|
||||
NbIntervals(me:in out; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of intervals for continuity
|
||||
-- <S>. May be one if Continuity(me) >= <S>
|
||||
is virtual;
|
||||
|
||||
Intervals(me:in out; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is virtual;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is virtual;
|
||||
|
||||
|
||||
IsClosed(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is virtual;
|
||||
|
||||
Value(me; U : Real) returns Pnt from gp
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is virtual;
|
||||
|
||||
D0 (me; U : Real; P : out Pnt from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is virtual;
|
||||
|
||||
D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve with its
|
||||
-- first derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C1.
|
||||
is virtual;
|
||||
|
||||
D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first and second
|
||||
-- derivatives V1 and V2.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C2.
|
||||
is virtual;
|
||||
|
||||
D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first, the second
|
||||
-- and the third derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C3.
|
||||
is virtual;
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec from gp
|
||||
--- Purpose :
|
||||
-- The returned vector gives the value of the derivative for the
|
||||
-- order of derivation N.
|
||||
raises
|
||||
DomainError from Standard,
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not CN.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if N < 1.
|
||||
is virtual;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is virtual;
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs
|
||||
---Purpose: Returns the type of the curve in the current
|
||||
-- interval : Line, Circle, Ellipse, Hyperbola,
|
||||
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
is virtual;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Circle(me) returns Circ from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Ellipse(me) returns Elips from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Hyperbola(me) returns Hypr from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Parabola(me) returns Parab from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Degree(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
end Curve;
|
||||
|
||||
|
350
src/Adaptor3d/Adaptor3d_Curve.cxx
Executable file
350
src/Adaptor3d/Adaptor3d_Curve.cxx
Executable file
@@ -0,0 +1,350 @@
|
||||
// File: Adaptor3d_Curve.cxx
|
||||
// Created: Thu Jul 1 16:09:31 1993
|
||||
// Author: Bruno DUMORTIER
|
||||
// <dub@sdsun1>
|
||||
|
||||
#include <Adaptor3d_Curve.ixx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
void Adaptor3d_Curve::Delete()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Curve::FirstParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::FirstParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Curve::LastParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::LastParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_Curve::Continuity() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Continuity");
|
||||
return GeomAbs_C0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Integer Adaptor3d_Curve::NbIntervals(const GeomAbs_Shape S) const
|
||||
Standard_Integer Adaptor3d_Curve::NbIntervals(const GeomAbs_Shape )
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::NbIntervals");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Intervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Curve::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
void Adaptor3d_Curve::Intervals(TColStd_Array1OfReal& , const GeomAbs_Shape )
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Intervals");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Handle(Adaptor3d_HCurve) Adaptor3d_Curve::Trim(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
|
||||
Handle(Adaptor3d_HCurve) Adaptor3d_Curve::Trim(const Standard_Real , const Standard_Real , const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Trim");
|
||||
return Handle(Adaptor3d_HCurve)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Curve::IsClosed() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::IsClosed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Curve::IsPeriodic() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::IsPeriodic");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Curve::Period() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Period");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//gp_Pnt Adaptor3d_Curve::Value(const Standard_Real U) const
|
||||
gp_Pnt Adaptor3d_Curve::Value(const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Value");
|
||||
return gp_Pnt();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Curve::D0(const Standard_Real U, gp_Pnt& P) const
|
||||
void Adaptor3d_Curve::D0(const Standard_Real , gp_Pnt& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::D0");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Curve::D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) const
|
||||
void Adaptor3d_Curve::D1(const Standard_Real , gp_Pnt& , gp_Vec& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::D1");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Curve::D2(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
|
||||
void Adaptor3d_Curve::D2(const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::D2");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Curve::D3(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
|
||||
void Adaptor3d_Curve::D3(const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::D3");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//gp_Vec Adaptor3d_Curve::DN(const Standard_Real U, const Standard_Integer N) const
|
||||
gp_Vec Adaptor3d_Curve::DN(const Standard_Real , const Standard_Integer ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::DN");
|
||||
return gp_Vec();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Real Adaptor3d_Curve::Resolution(const Standard_Real R3d) const
|
||||
Standard_Real Adaptor3d_Curve::Resolution(const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Resolution");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_CurveType Adaptor3d_Curve::GetType() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::GetType");
|
||||
return GeomAbs_OtherCurve;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Lin Adaptor3d_Curve::Line() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Line");
|
||||
return gp_Lin();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Circ Adaptor3d_Curve::Circle() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Circle");
|
||||
return gp_Circ();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Ellipse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Elips Adaptor3d_Curve::Ellipse() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Ellipse");
|
||||
return gp_Elips();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Hyperbola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Hypr Adaptor3d_Curve::Hyperbola() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Hyperbola");
|
||||
return gp_Hypr();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Parabola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Parab Adaptor3d_Curve::Parabola() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Parabola");
|
||||
return gp_Parab();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Degree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Curve::Degree() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Degree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Curve::IsRational() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::IsRational");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Curve::NbPoles() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::NbPoles");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Curve::NbKnots() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::NbKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BezierCurve) Adaptor3d_Curve::Bezier() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::Bezier");
|
||||
return Handle(Geom_BezierCurve)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineCurve) Adaptor3d_Curve::BSpline() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Curve::BSpline");
|
||||
return Handle(Geom_BSplineCurve)();
|
||||
}
|
317
src/Adaptor3d/Adaptor3d_CurveOnSurface.cdl
Executable file
317
src/Adaptor3d/Adaptor3d_CurveOnSurface.cdl
Executable file
@@ -0,0 +1,317 @@
|
||||
-- File: Adaptor3d_CurveOnSurface.cdl
|
||||
-- Created: Mon Feb 22 12:37:00 1993
|
||||
-- Author: Modelistation
|
||||
-- <model@sdsun2>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class CurveOnSurface from Adaptor3d inherits Curve from Adaptor3d
|
||||
|
||||
---Purpose: An interface between the services provided by a curve
|
||||
-- lying on a surface from the package Geom and those
|
||||
-- required of the curve by algorithms which use it. The
|
||||
-- curve is defined as a 2D curve from the Geom2d
|
||||
-- package, in the parametric space of the surface.
|
||||
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Parab from gp,
|
||||
Lin from gp,
|
||||
CurveType from GeomAbs,
|
||||
Shape from GeomAbs,
|
||||
BezierCurve from Geom,
|
||||
BSplineCurve from Geom,
|
||||
BSplineSurface from Geom,
|
||||
HCurve from Adaptor3d,
|
||||
HCurve2d from Adaptor2d,
|
||||
HSurface from Adaptor3d,
|
||||
HArray1OfReal from TColStd,
|
||||
|
||||
Pnt2d from gp,
|
||||
Vec2d from gp
|
||||
raises NoSuchObject from Standard,
|
||||
DomainError from Standard,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns CurveOnSurface;
|
||||
|
||||
Create(S : HSurface from Adaptor3d) returns CurveOnSurface;
|
||||
|
||||
Create (C : HCurve2d from Adaptor2d; S : HSurface from Adaptor3d)
|
||||
returns CurveOnSurface;
|
||||
---Purpose: Creates a CurveOnSurface from the 2d curve <C> and
|
||||
-- the surface <S>.
|
||||
|
||||
Load(me : in out;S : HSurface from Adaptor3d)
|
||||
---Purpose: Changes the surface.
|
||||
is static;
|
||||
|
||||
Load(me : in out; C : HCurve2d from Adaptor2d)
|
||||
---Purpose: Changes the 2d curve.
|
||||
is static;
|
||||
|
||||
GetCurve(me) returns HCurve2d from Adaptor2d
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
GetSurface(me) returns HSurface from Adaptor3d
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
ChangeCurve(me : in out) returns HCurve2d from Adaptor2d
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
ChangeSurface(me : in out) returns HSurface from Adaptor3d
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
--
|
||||
-- Implementation of Curve from Adaptor3d methods
|
||||
--
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
FirstParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
LastParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
NbIntervals(me: in out; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of intervals for continuity
|
||||
-- <S>. May be one if Continuity(me) >= <S>
|
||||
is redefined static;
|
||||
|
||||
Intervals(me:in out; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is redefined static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static;
|
||||
|
||||
IsClosed(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
Value(me; U : Real) returns Pnt from gp
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is redefined static;
|
||||
|
||||
D0 (me; U : Real; P : out Pnt from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is redefined static;
|
||||
|
||||
D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve with its
|
||||
-- first derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C1.
|
||||
is redefined static;
|
||||
|
||||
D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first and second
|
||||
-- derivatives V1 and V2.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C2.
|
||||
is redefined static;
|
||||
|
||||
D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first, the second
|
||||
-- and the third derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C3.
|
||||
is redefined static;
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec from gp
|
||||
--- Purpose :
|
||||
-- The returned vector gives the value of the derivative for the
|
||||
-- order of derivation N.
|
||||
raises
|
||||
DomainError from Standard,
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not CN.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if N < 1.
|
||||
is redefined static;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is redefined static;
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs
|
||||
---Purpose: Returns the type of the curve in the current
|
||||
-- interval : Line, Circle, Ellipse, Hyperbola,
|
||||
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
is redefined static;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Circle(me) returns Circ from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Ellipse(me) returns Elips from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Hyperbola(me) returns Hypr from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Parabola(me) returns Parab from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Degree(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
---Warning: will raize if this asked on a curve
|
||||
-- that is not planar
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
EvalKPart(me : in out)
|
||||
is static private;
|
||||
|
||||
EvalFirstLastSurf(me : in out)
|
||||
---Purpose: Evaluates myFirstSurf and myLastSurf
|
||||
-- for trimming the curve on surface.
|
||||
is static private;
|
||||
|
||||
|
||||
---Purpose: Following methods output left-bottom and right-top points
|
||||
-- of located part on surface
|
||||
-- for trimming the curve on surface.
|
||||
|
||||
LocatePart(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
|
||||
S : HSurface from Adaptor3d;
|
||||
LeftBot, RightTop : out Pnt2d from gp)
|
||||
is static private;
|
||||
|
||||
LocatePart_RevExt(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
|
||||
S : HSurface from Adaptor3d;
|
||||
LeftBot, RightTop : out Pnt2d from gp)
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
LocatePart_Offset(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
|
||||
S : HSurface from Adaptor3d;
|
||||
LeftBot, RightTop : out Pnt2d from gp)
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
FindBounds(me; Arr : Array1OfReal from TColStd;
|
||||
XYComp : Real from Standard;
|
||||
DUVComp : Real from Standard;
|
||||
Bnd1 : out Integer from Standard;
|
||||
Bnd2 : out Integer from Standard;
|
||||
DerIsNull : out Boolean from Standard)
|
||||
---Purpose: Extracts the numbers of knots which equal
|
||||
-- the point and checks derivative components
|
||||
-- by zero equivalence.
|
||||
is static private;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
mySurface : HSurface from Adaptor3d;
|
||||
myCurve : HCurve2d from Adaptor2d;
|
||||
|
||||
myType : CurveType from GeomAbs;
|
||||
myCirc : Circ from gp;
|
||||
myLin : Lin from gp;
|
||||
|
||||
myFirstSurf : HSurface from Adaptor3d;
|
||||
myLastSurf : HSurface from Adaptor3d;
|
||||
|
||||
myIntervals : HArray1OfReal from TColStd;
|
||||
myIntCont : Shape from GeomAbs;
|
||||
|
||||
end CurveOnSurface;
|
||||
|
||||
|
||||
|
||||
|
1657
src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx
Executable file
1657
src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx
Executable file
File diff suppressed because it is too large
Load Diff
76
src/Adaptor3d/Adaptor3d_GenHCurve.cdl
Executable file
76
src/Adaptor3d/Adaptor3d_GenHCurve.cdl
Executable file
@@ -0,0 +1,76 @@
|
||||
-- File: Adaptor3d_GenHCurve.cdl
|
||||
-- Created: Wed Feb 23 12:16:10 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
generic class GenHCurve from Adaptor3d
|
||||
(TheCurve as Curve from Adaptor3d)
|
||||
|
||||
inherits HCurve from Adaptor3d
|
||||
|
||||
---Purpose: Generic class used to create a curve manipulated
|
||||
-- with Handle from a curve described by the class Curve.
|
||||
|
||||
uses
|
||||
Curve from Adaptor3d
|
||||
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Creates an empty GenHCurve.
|
||||
returns mutable GenHCurve from Adaptor3d;
|
||||
|
||||
|
||||
Create(C: TheCurve)
|
||||
|
||||
---Purpose: Creates a GenHCurve from a Curve
|
||||
returns mutable GenHCurve from Adaptor3d;
|
||||
|
||||
|
||||
Set(me: mutable; C: TheCurve)
|
||||
|
||||
---Purpose: Sets the field of the GenHCurve.
|
||||
is static;
|
||||
|
||||
Curve(me)
|
||||
|
||||
---Purpose: Returns the curve used to create the GenHCurve.
|
||||
-- This is redefined from HCurve, cannot be inline.
|
||||
--
|
||||
---C++: return const &
|
||||
|
||||
returns Curve from Adaptor3d;
|
||||
|
||||
GetCurve(me:mutable)
|
||||
|
||||
---Purpose: Returns the curve used to create the GenHCurve.
|
||||
-- This is redefined from HCurve, cannot be inline.
|
||||
--
|
||||
---C++: return &
|
||||
|
||||
returns Curve from Adaptor3d;
|
||||
|
||||
|
||||
ChangeCurve(me : mutable)
|
||||
|
||||
---Purpose: Returns the curve used to create the GenHCurve.
|
||||
--
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
|
||||
returns TheCurve;
|
||||
|
||||
fields
|
||||
|
||||
myCurve : TheCurve is protected;
|
||||
|
||||
end GenHCurve;
|
39
src/Adaptor3d/Adaptor3d_GenHCurve.gxx
Executable file
39
src/Adaptor3d/Adaptor3d_GenHCurve.gxx
Executable file
@@ -0,0 +1,39 @@
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_GenHCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_GenHCurve::Adaptor3d_GenHCurve () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_GenHCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_GenHCurve::Adaptor3d_GenHCurve (const TheCurve& C)
|
||||
{myCurve = C;}
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_GenHCurve::Set(const TheCurve& C)
|
||||
{
|
||||
myCurve = C;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Adaptor3d_Curve& Adaptor3d_GenHCurve::Curve () const
|
||||
{
|
||||
return myCurve;
|
||||
}
|
||||
|
||||
Adaptor3d_Curve& Adaptor3d_GenHCurve::GetCurve ()
|
||||
{
|
||||
return myCurve;
|
||||
}
|
10
src/Adaptor3d/Adaptor3d_GenHCurve.lxx
Executable file
10
src/Adaptor3d/Adaptor3d_GenHCurve.lxx
Executable file
@@ -0,0 +1,10 @@
|
||||
// File: Adaptor3d_GenHCurve.lxx
|
||||
// Created: Tue May 9 16:08:58 1995
|
||||
// Author: Xavier BENVENISTE
|
||||
// <xab@nonox>
|
||||
|
||||
|
||||
inline TheCurve& Adaptor3d_GenHCurve::ChangeCurve()
|
||||
{
|
||||
return myCurve;
|
||||
}
|
71
src/Adaptor3d/Adaptor3d_GenHSurface.cdl
Executable file
71
src/Adaptor3d/Adaptor3d_GenHSurface.cdl
Executable file
@@ -0,0 +1,71 @@
|
||||
-- File: Adaptor3d_GenHSurface.cdl
|
||||
-- Created: Mon Feb 14 15:13:04 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
generic class GenHSurface from Adaptor3d
|
||||
(TheSurface as Surface from Adaptor3d)
|
||||
|
||||
inherits HSurface from Adaptor3d
|
||||
|
||||
---Purpose: Generic class used to create a surface manipulated
|
||||
-- with Handle from a surface described by the class Surface.
|
||||
|
||||
uses
|
||||
|
||||
Surface from Adaptor3d
|
||||
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
---Purpose: Creates an empty GenHSurface.
|
||||
returns mutable GenHSurface from Adaptor3d;
|
||||
|
||||
|
||||
Create(S: TheSurface)
|
||||
|
||||
---Purpose: Creates a GenHSurface from a Surface.
|
||||
returns mutable GenHSurface from Adaptor3d;
|
||||
|
||||
|
||||
Set(me: mutable; S: TheSurface)
|
||||
|
||||
---Purpose: Sets the field of the GenHSurface.
|
||||
is static;
|
||||
|
||||
--
|
||||
-- Access to the surface
|
||||
--
|
||||
|
||||
Surface(me) returns Surface from Adaptor3d;
|
||||
---Purpose: Returns a reference to the Surface inside the HSurface.
|
||||
-- This is redefined from HSurface, cannot be inline.
|
||||
--
|
||||
---C++: return const &
|
||||
|
||||
ChangeSurface(me : mutable)
|
||||
|
||||
---Purpose: Returns the surface used to create the GenHSurface.
|
||||
--
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
|
||||
returns TheSurface;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
mySurf: TheSurface is protected;
|
||||
|
||||
end GenHSurface;
|
36
src/Adaptor3d/Adaptor3d_GenHSurface.gxx
Executable file
36
src/Adaptor3d/Adaptor3d_GenHSurface.gxx
Executable file
@@ -0,0 +1,36 @@
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_GenHSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_GenHSurface::Adaptor3d_GenHSurface () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_GenHSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_GenHSurface::Adaptor3d_GenHSurface (const TheSurface& S):
|
||||
mySurf(S)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_GenHSurface::Set (const TheSurface& S)
|
||||
{
|
||||
mySurf = S;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Surface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Adaptor3d_Surface& Adaptor3d_GenHSurface::Surface () const
|
||||
{
|
||||
return mySurf;
|
||||
}
|
||||
|
10
src/Adaptor3d/Adaptor3d_GenHSurface.lxx
Executable file
10
src/Adaptor3d/Adaptor3d_GenHSurface.lxx
Executable file
@@ -0,0 +1,10 @@
|
||||
// File: Adaptor3d_GenHSurface.lxx
|
||||
// Created: Tue May 9 16:09:21 1995
|
||||
// Author: Xavier BENVENISTE
|
||||
// <xab@nonox>
|
||||
|
||||
|
||||
inline TheSurface& Adaptor3d_GenHSurface::ChangeSurface()
|
||||
{
|
||||
return mySurf;
|
||||
}
|
214
src/Adaptor3d/Adaptor3d_HCurve.cdl
Executable file
214
src/Adaptor3d/Adaptor3d_HCurve.cdl
Executable file
@@ -0,0 +1,214 @@
|
||||
-- File: Adaptor3d_HCurve.cdl
|
||||
-- Created: Wed Feb 23 11:56:42 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
deferred class HCurve from Adaptor3d inherits TShared from MMgt
|
||||
|
||||
---Purpose: Root class for 3D curves manipulated by handles, on
|
||||
-- which geometric algorithms work.
|
||||
-- An adapted curve is an interface between the
|
||||
-- services provided by a curve and those required of
|
||||
-- the curve by algorithms which use it.
|
||||
-- Two derived concrete classes are provided:
|
||||
-- - GeomAdaptor_HCurve for a curve from the Geom package
|
||||
-- - Adaptor3d_HCurveOnSurface for a curve lying
|
||||
-- on a surface from the Geom package.
|
||||
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec from gp,
|
||||
Pnt from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Parab from gp,
|
||||
Lin from gp,
|
||||
BezierCurve from Geom,
|
||||
BSplineCurve from Geom,
|
||||
Curve from Adaptor3d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
|
||||
--
|
||||
-- Access to the curve
|
||||
--
|
||||
|
||||
Curve(me) returns Curve from Adaptor3d
|
||||
---Purpose: Returns a pointer to the Curve inside the HCurve.
|
||||
--
|
||||
---C++: return const &
|
||||
is deferred;
|
||||
|
||||
GetCurve(me:mutable) returns Curve from Adaptor3d
|
||||
---Purpose: Returns a pointer to the Curve inside the HCurve.
|
||||
--
|
||||
---C++: return &
|
||||
is deferred;
|
||||
|
||||
--
|
||||
-- Curve methods, they are provided for convenience. Each
|
||||
-- method M() is defined inline as :
|
||||
--
|
||||
-- Adaptor3d_HCurve::M() { Curve().M(); }
|
||||
--
|
||||
-- See the class Curve for comments on the methods.
|
||||
--
|
||||
|
||||
FirstParameter(me) returns Real;
|
||||
---C++: inline
|
||||
|
||||
LastParameter(me) returns Real;
|
||||
---C++: inline
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs ;
|
||||
---C++: inline
|
||||
|
||||
NbIntervals(me: mutable; S : Shape from GeomAbs) returns Integer;
|
||||
---C++: inline
|
||||
|
||||
Intervals(me: mutable; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
--
|
||||
---C++: inline
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
--
|
||||
---C++: inline
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is static;
|
||||
|
||||
|
||||
IsClosed(me) returns Boolean;
|
||||
---C++: inline
|
||||
|
||||
IsPeriodic(me) returns Boolean;
|
||||
---C++: inline
|
||||
|
||||
Period(me) returns Real
|
||||
---C++: inline
|
||||
raises
|
||||
DomainError from Standard;
|
||||
|
||||
Value(me; U : Real) returns Pnt from gp;
|
||||
---C++: inline
|
||||
|
||||
D0 (me; U : Real; P : out Pnt from gp);
|
||||
---C++: inline
|
||||
|
||||
D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
|
||||
---C++: inline
|
||||
raises
|
||||
DomainError from Standard;
|
||||
|
||||
D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
|
||||
---C++: inline
|
||||
raises
|
||||
DomainError from Standard;
|
||||
|
||||
D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
|
||||
---C++: inline
|
||||
raises
|
||||
DomainError from Standard;
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec from gp
|
||||
---C++: inline
|
||||
raises
|
||||
DomainError from Standard,
|
||||
OutOfRange from Standard;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real;
|
||||
---C++: inline
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs;
|
||||
---C++: inline
|
||||
|
||||
Line(me) returns Lin from gp
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
Circle(me) returns Circ from gp
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
Ellipse(me) returns Elips from gp
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
Hyperbola(me) returns Hypr from gp
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
Parabola(me) returns Parab from gp
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
Degree(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
|
||||
end HCurve;
|
||||
|
||||
|
||||
|
2
src/Adaptor3d/Adaptor3d_HCurve.cxx
Executable file
2
src/Adaptor3d/Adaptor3d_HCurve.cxx
Executable file
@@ -0,0 +1,2 @@
|
||||
#include <Adaptor3d_HCurve.ixx>
|
||||
|
283
src/Adaptor3d/Adaptor3d_HCurve.lxx
Executable file
283
src/Adaptor3d/Adaptor3d_HCurve.lxx
Executable file
@@ -0,0 +1,283 @@
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HCurve::FirstParameter() const
|
||||
{
|
||||
return Curve().FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HCurve::LastParameter() const
|
||||
{
|
||||
return Curve().LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_Shape Adaptor3d_HCurve::Continuity() const
|
||||
{
|
||||
return Curve().Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HCurve::NbIntervals(const GeomAbs_Shape S)
|
||||
{
|
||||
return GetCurve().NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Intervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HCurve::Intervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape S)
|
||||
{
|
||||
GetCurve().Intervals(T,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Adaptor3d_HCurve) Adaptor3d_HCurve::Trim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
return Curve().Trim(First,Last,Tol);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HCurve::IsClosed() const
|
||||
{
|
||||
return Curve().IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HCurve::IsPeriodic() const
|
||||
{
|
||||
return Curve().IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HCurve::Period() const
|
||||
{
|
||||
return Curve().Period();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Pnt Adaptor3d_HCurve::Value(const Standard_Real U) const
|
||||
{
|
||||
return Curve().Value(U);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HCurve::D0(const Standard_Real U, gp_Pnt& P) const
|
||||
{
|
||||
Curve().D0(U,P);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HCurve::D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) const
|
||||
{
|
||||
Curve().D1(U,P,V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HCurve::D2(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
|
||||
{
|
||||
Curve().D2(U,P,V1,V2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HCurve::D3(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
|
||||
{
|
||||
Curve().D3(U,P,V1,V2,V3);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Vec Adaptor3d_HCurve::DN(const Standard_Real U, const Standard_Integer N) const
|
||||
{
|
||||
return Curve().DN(U,N);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HCurve::Resolution(const Standard_Real R3d) const
|
||||
{
|
||||
return Curve().Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_CurveType Adaptor3d_HCurve::GetType() const
|
||||
{
|
||||
return Curve().GetType();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Lin Adaptor3d_HCurve::Line() const
|
||||
{
|
||||
return Curve().Line();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Circ Adaptor3d_HCurve::Circle() const
|
||||
{
|
||||
return Curve().Circle();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Ellipse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Elips Adaptor3d_HCurve::Ellipse() const
|
||||
{
|
||||
return Curve().Ellipse();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Hyperbola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Hypr Adaptor3d_HCurve::Hyperbola() const
|
||||
{
|
||||
return Curve().Hyperbola();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parabola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Parab Adaptor3d_HCurve::Parabola() const
|
||||
{
|
||||
return Curve().Parabola();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Degree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HCurve::Degree() const
|
||||
{
|
||||
return Curve().Degree() ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HCurve::IsRational() const
|
||||
{
|
||||
return Curve().IsRational() ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer Adaptor3d_HCurve::NbPoles() const
|
||||
{
|
||||
return Curve().NbPoles() ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HCurve::NbKnots() const
|
||||
{
|
||||
return Curve().NbKnots() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom_BezierCurve) Adaptor3d_HCurve::Bezier() const
|
||||
{
|
||||
return Curve().Bezier();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom_BSplineCurve) Adaptor3d_HCurve::BSpline() const
|
||||
{
|
||||
return Curve().BSpline();
|
||||
}
|
||||
|
231
src/Adaptor3d/Adaptor3d_HSurface.cdl
Executable file
231
src/Adaptor3d/Adaptor3d_HSurface.cdl
Executable file
@@ -0,0 +1,231 @@
|
||||
-- File: Adaptor3d_HSurface.cdl
|
||||
-- Created: Mon Feb 14 15:01:34 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
deferred class HSurface from Adaptor3d
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
---Purpose: Root class for surfaces manipulated by handles, on
|
||||
-- which geometric algorithms work.
|
||||
-- An adapted surface is an interface between the
|
||||
-- services provided by a surface and those required of
|
||||
-- the surface by algorithms which use it.
|
||||
-- A derived concrete class is provided:
|
||||
-- GeomAdaptor_HSurface for a surface from the Geom package.
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
SurfaceType from GeomAbs,
|
||||
Vec from gp,
|
||||
Dir from gp,
|
||||
Pnt from gp,
|
||||
Pln from gp,
|
||||
Cone from gp,
|
||||
Cylinder from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp,
|
||||
Ax1 from gp,
|
||||
BezierSurface from Geom,
|
||||
BSplineSurface from Geom,
|
||||
Surface from Adaptor3d,
|
||||
HCurve from Adaptor3d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard,
|
||||
NotImplemented from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
|
||||
--
|
||||
-- Access to the surface
|
||||
--
|
||||
|
||||
Surface(me) returns Surface from Adaptor3d
|
||||
---Purpose: Returns a reference to the Surface inside the HSurface.
|
||||
--
|
||||
---C++: return const &
|
||||
is deferred;
|
||||
|
||||
|
||||
--
|
||||
-- Surface methods, they are provided for convenience. Each
|
||||
-- method M() is defined inline as :
|
||||
--
|
||||
-- Adaptor3d_HSurface::M() { Surface()->M(); }
|
||||
--
|
||||
-- See the class Surface for comments on the methods.
|
||||
--
|
||||
--
|
||||
|
||||
FirstUParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
LastUParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
FirstVParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
LastVParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
UContinuity(me) returns Shape from GeomAbs ;
|
||||
---C++: inline
|
||||
|
||||
VContinuity(me) returns Shape from GeomAbs ;
|
||||
---C++: inline
|
||||
|
||||
NbUIntervals(me ; S : Shape from GeomAbs) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
NbVIntervals(me ; S : Shape from GeomAbs) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
UIntervals(me ;T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs ) ;
|
||||
---C++: inline
|
||||
|
||||
VIntervals(me ; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs ) ;
|
||||
---C++: inline
|
||||
--
|
||||
UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d ;
|
||||
---C++: inline
|
||||
--
|
||||
VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d ;
|
||||
---C++: inline
|
||||
--
|
||||
IsUClosed(me) returns Boolean ;
|
||||
---C++: inline
|
||||
|
||||
IsVClosed(me) returns Boolean ;
|
||||
---C++: inline
|
||||
|
||||
IsUPeriodic(me) returns Boolean ;
|
||||
---C++: inline
|
||||
|
||||
UPeriod(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
IsVPeriodic(me) returns Boolean ;
|
||||
---C++: inline
|
||||
|
||||
VPeriod(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
Value (me; U, V : Real) returns Pnt from gp;
|
||||
---C++: inline
|
||||
|
||||
D0 (me; U, V : Real; P : out Pnt from gp) ;
|
||||
---C++: inline
|
||||
|
||||
D1 (me; U, V : Real; P : out Pnt from gp;
|
||||
D1U, D1V : out Vec from gp) ;
|
||||
---C++: inline
|
||||
|
||||
D2 (me; U, V : Real; P : out Pnt from gp;
|
||||
D1U, D1V, D2U, D2V, D2UV : out Vec from gp) ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
D3 (me; U, V : Real; P : out Pnt from gp;
|
||||
D1U, D1V, D2U, D2V, D2UV,
|
||||
D3U, D3V, D3UUV, D3UVV : out Vec from gp) ;
|
||||
---C++: inline
|
||||
|
||||
DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp ;
|
||||
---C++: inline
|
||||
|
||||
UResolution(me; R3d : Real ) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
VResolution(me; R3d : Real ) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
GetType(me) returns SurfaceType from GeomAbs ;
|
||||
---C++: inline
|
||||
|
||||
Plane(me) returns Pln from gp ;
|
||||
---C++: inline
|
||||
|
||||
Cylinder(me) returns Cylinder from gp ;
|
||||
---C++: inline
|
||||
|
||||
Cone(me) returns Cone from gp ;
|
||||
---C++: inline
|
||||
|
||||
Sphere(me) returns Sphere from gp ;
|
||||
---C++: inline
|
||||
|
||||
Torus(me) returns Torus from gp ;
|
||||
---C++: inline
|
||||
|
||||
UDegree(me) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
NbUPoles(me) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
VDegree(me) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
NbVPoles(me) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
|
||||
NbUKnots(me) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
NbVKnots(me) returns Integer ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
IsURational(me) returns Boolean ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
IsVRational(me) returns Boolean ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
Bezier(me) returns BezierSurface from Geom ;
|
||||
---C++: inline
|
||||
|
||||
BSpline(me) returns BSplineSurface from Geom ;
|
||||
---C++: inline
|
||||
|
||||
AxeOfRevolution(me) returns Ax1 from gp ;
|
||||
---C++: inline
|
||||
|
||||
Direction(me) returns Dir from gp ;
|
||||
---C++: inline
|
||||
|
||||
BasisCurve(me) returns HCurve from Adaptor3d ;
|
||||
---C++: inline
|
||||
|
||||
BasisSurface(me) returns HSurface from Adaptor3d;
|
||||
---C++: inline
|
||||
|
||||
OffsetValue(me) returns Real from Standard;
|
||||
---C++: inline
|
||||
|
||||
end HSurface;
|
||||
|
||||
|
||||
|
||||
|
2
src/Adaptor3d/Adaptor3d_HSurface.cxx
Executable file
2
src/Adaptor3d/Adaptor3d_HSurface.cxx
Executable file
@@ -0,0 +1,2 @@
|
||||
#include <Adaptor3d_HSurface.ixx>
|
||||
|
473
src/Adaptor3d/Adaptor3d_HSurface.lxx
Executable file
473
src/Adaptor3d/Adaptor3d_HSurface.lxx
Executable file
@@ -0,0 +1,473 @@
|
||||
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::FirstUParameter() const
|
||||
{
|
||||
return Surface().FirstUParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::LastUParameter() const
|
||||
{
|
||||
return Surface().LastUParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::FirstVParameter() const
|
||||
{
|
||||
return Surface().FirstVParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::LastVParameter() const
|
||||
{
|
||||
return Surface().LastVParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_Shape Adaptor3d_HSurface::UContinuity() const
|
||||
{
|
||||
return Surface().UContinuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_Shape Adaptor3d_HSurface::VContinuity() const
|
||||
{
|
||||
return Surface().VContinuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::NbUIntervals(const GeomAbs_Shape S) const
|
||||
{
|
||||
return Surface().NbUIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::NbVIntervals(const GeomAbs_Shape S) const
|
||||
{
|
||||
return Surface().NbVIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UInterval
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HSurface::UIntervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape S) const
|
||||
{
|
||||
Surface().UIntervals(T,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VInterval
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HSurface::VIntervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape S) const
|
||||
{
|
||||
Surface().VIntervals(T, S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : inline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurface::UTrim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
return Surface().UTrim(First,Last,Tol);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : inline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurface::VTrim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
return Surface().VTrim(First,Last,Tol);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurface::IsUClosed() const
|
||||
{
|
||||
return Surface().IsUClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurface::IsVClosed() const
|
||||
{
|
||||
return Surface().IsVClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurface::IsUPeriodic() const
|
||||
{
|
||||
return Surface().IsUPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::UPeriod() const
|
||||
{
|
||||
return Surface().UPeriod();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurface::IsVPeriodic() const
|
||||
{
|
||||
return Surface().IsVPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::VPeriod() const
|
||||
{
|
||||
return Surface().VPeriod();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Pnt Adaptor3d_HSurface::Value(const Standard_Real U, const Standard_Real V) const
|
||||
{
|
||||
return Surface().Value(U,V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HSurface::D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const
|
||||
{
|
||||
Surface().D0(U,V,P);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HSurface::D1(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const
|
||||
{
|
||||
Surface().D1(U,V,P,D1U,D1V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HSurface::D2(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const
|
||||
{
|
||||
Surface().D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor3d_HSurface::D3(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const
|
||||
{
|
||||
Surface().D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Vec Adaptor3d_HSurface::DN(const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const
|
||||
{
|
||||
return Surface().DN(U,V,Nu,Nv);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::UResolution(const Standard_Real R3d) const
|
||||
{
|
||||
return Surface().UResolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::VResolution(const Standard_Real R3d) const
|
||||
{
|
||||
return Surface().VResolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_SurfaceType Adaptor3d_HSurface::GetType() const
|
||||
{
|
||||
return Surface().GetType();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Pln Adaptor3d_HSurface::Plane() const
|
||||
{
|
||||
return Surface().Plane();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Cylinder Adaptor3d_HSurface::Cylinder() const
|
||||
{
|
||||
return Surface().Cylinder();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Cone Adaptor3d_HSurface::Cone() const
|
||||
{
|
||||
return Surface().Cone();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Sphere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Sphere Adaptor3d_HSurface::Sphere() const
|
||||
{
|
||||
return Surface().Sphere();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Torus Adaptor3d_HSurface::Torus() const
|
||||
{
|
||||
return Surface().Torus();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : UDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::UDegree() const
|
||||
{
|
||||
return Surface().UDegree();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbUPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::NbUPoles() const
|
||||
{
|
||||
return Surface().NbUPoles();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : VDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::VDegree() const
|
||||
{
|
||||
return Surface().VDegree();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbVPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::NbVPoles() const
|
||||
{
|
||||
return Surface().NbVPoles();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbUKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::NbUKnots() const
|
||||
{
|
||||
return Surface().NbUKnots();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurface::NbVKnots() const
|
||||
{
|
||||
return Surface().NbVKnots();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurface::IsURational() const
|
||||
{
|
||||
return Surface().IsURational();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurface::IsVRational() const
|
||||
{
|
||||
return Surface().IsVRational();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom_BezierSurface) Adaptor3d_HSurface::Bezier() const
|
||||
{
|
||||
return Surface().Bezier();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom_BSplineSurface) Adaptor3d_HSurface::BSpline() const
|
||||
{
|
||||
return Surface().BSpline();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Ax1 Adaptor3d_HSurface::AxeOfRevolution() const
|
||||
{
|
||||
return Surface().AxeOfRevolution();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Dir Adaptor3d_HSurface::Direction() const
|
||||
{
|
||||
return Surface().Direction();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Adaptor3d_HCurve) Adaptor3d_HSurface::BasisCurve() const
|
||||
{
|
||||
return Surface().BasisCurve();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurface::BasisSurface() const
|
||||
{
|
||||
return Surface().BasisSurface();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OffsetValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurface::OffsetValue() const
|
||||
{
|
||||
return Surface().OffsetValue();
|
||||
}
|
235
src/Adaptor3d/Adaptor3d_HSurfaceTool.cdl
Executable file
235
src/Adaptor3d/Adaptor3d_HSurfaceTool.cdl
Executable file
@@ -0,0 +1,235 @@
|
||||
-- File : Adaptor3d_HSurfaceTool.cdl
|
||||
-- Created : Fri Jul 2 16:59:47 1993
|
||||
-- Author : Laurent BUCHARD
|
||||
---Copyright : Matra Datavision 1993
|
||||
|
||||
|
||||
class HSurfaceTool from Adaptor3d
|
||||
|
||||
uses
|
||||
|
||||
Shape from GeomAbs,
|
||||
SurfaceType from GeomAbs,
|
||||
Pln from gp,
|
||||
Cone from gp,
|
||||
Cylinder from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp,
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
Array1OfReal from TColStd,
|
||||
BezierSurface from Geom,
|
||||
BSplineSurface from Geom,
|
||||
HSurface from Adaptor3d,
|
||||
HCurve from Adaptor3d,
|
||||
Ax1 from gp,
|
||||
Dir from gp
|
||||
|
||||
raises
|
||||
|
||||
NoSuchObject from Standard,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
FirstUParameter(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
FirstVParameter(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
LastUParameter(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
LastVParameter(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
|
||||
NbUIntervals(myclass; S: HSurface from Adaptor3d;
|
||||
Sh : Shape from GeomAbs)
|
||||
---C++: inline
|
||||
returns Integer from Standard;
|
||||
|
||||
NbVIntervals(myclass; S: HSurface from Adaptor3d;
|
||||
Sh : Shape from GeomAbs)
|
||||
---C++: inline
|
||||
returns Integer from Standard;
|
||||
|
||||
|
||||
|
||||
UIntervals(myclass; S : HSurface from Adaptor3d;
|
||||
T : in out Array1OfReal from TColStd;
|
||||
Sh : Shape from GeomAbs);
|
||||
---C++: inline
|
||||
|
||||
VIntervals(myclass; S : HSurface from Adaptor3d;
|
||||
T : in out Array1OfReal from TColStd;
|
||||
Sh : Shape from GeomAbs) ;
|
||||
---C++: inline
|
||||
|
||||
|
||||
UTrim(myclass; S : HSurface from Adaptor3d;
|
||||
First, Last, Tol : Real)
|
||||
---C++: inline
|
||||
returns HSurface from Adaptor3d
|
||||
raises
|
||||
OutOfRange from Standard;
|
||||
---Purpose: If <First> >= <Last>
|
||||
|
||||
VTrim(myclass; S : HSurface from Adaptor3d;
|
||||
First, Last, Tol : Real)
|
||||
---C++: inline
|
||||
returns HSurface from Adaptor3d
|
||||
raises
|
||||
OutOfRange from Standard;
|
||||
---Purpose: If <First> >= <Last>
|
||||
|
||||
|
||||
IsUClosed(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsVClosed(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
IsUPeriodic(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Boolean from Standard;
|
||||
|
||||
UPeriod(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
IsVPeriodic(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Boolean from Standard;
|
||||
|
||||
VPeriod(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
|
||||
Value(myclass; S : HSurface from Adaptor3d;
|
||||
u,v : Real from Standard)
|
||||
---C++: inline
|
||||
returns Pnt from gp;
|
||||
|
||||
D0(myclass; S : HSurface from Adaptor3d;
|
||||
u,v : Real from Standard;
|
||||
P : out Pnt from gp);
|
||||
---C++: inline
|
||||
|
||||
D1(myclass; S : HSurface from Adaptor3d;
|
||||
u,v : Real from Standard;
|
||||
P : out Pnt from gp;
|
||||
D1u,D1v: out Vec from gp);
|
||||
---C++: inline
|
||||
|
||||
D2(myclass; S : HSurface from Adaptor3d;
|
||||
u,v : Real from Standard;
|
||||
P : out Pnt from gp;
|
||||
D1U,D1V,D2U,D2V,D2UV: out Vec from gp);
|
||||
---C++: inline
|
||||
|
||||
D3(myclass; S : HSurface from Adaptor3d;
|
||||
u,v : Real from Standard;
|
||||
P : out Pnt from gp;
|
||||
D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV: out Vec from gp);
|
||||
---C++: inline
|
||||
|
||||
DN(myclass; S : HSurface from Adaptor3d;
|
||||
u,v : Real from Standard;
|
||||
Nu,Nv : Integer from Standard)
|
||||
---C++: inline
|
||||
returns Vec from gp;
|
||||
|
||||
|
||||
|
||||
UResolution(myclass; S:HSurface from Adaptor3d; R3d: Real from Standard)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
VResolution(myclass; S:HSurface from Adaptor3d; R3d: Real from Standard)
|
||||
---C++: inline
|
||||
returns Real from Standard;
|
||||
|
||||
GetType(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns SurfaceType from GeomAbs;
|
||||
|
||||
|
||||
Plane(myclass; S: HSurface from Adaptor3d)
|
||||
---C++: inline
|
||||
returns Pln from gp;
|
||||
|
||||
Cylinder(myclass; S : HSurface from Adaptor3d) returns Cylinder from gp
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
|
||||
Cone(myclass; S : HSurface from Adaptor3d) returns Cone from gp
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
Torus(myclass; S : HSurface from Adaptor3d) returns Torus from gp
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
|
||||
Sphere(myclass; S : HSurface from Adaptor3d) returns Sphere from gp
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
Bezier(myclass; S : HSurface from Adaptor3d) returns BezierSurface from Geom
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
BSpline(myclass; S : HSurface from Adaptor3d) returns BSplineSurface from Geom
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
AxeOfRevolution(myclass; S: HSurface from Adaptor3d) returns Ax1 from gp
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
Direction(myclass; S: HSurface from Adaptor3d) returns Dir from gp
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
BasisCurve(myclass; S:HSurface from Adaptor3d) returns HCurve from Adaptor3d
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
BasisSurface(myclass; S:HSurface from Adaptor3d) returns HSurface from Adaptor3d
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
OffsetValue(myclass; S:HSurface from Adaptor3d) returns Real from Standard
|
||||
raises NoSuchObject from Standard;
|
||||
---C++: inline
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
NbSamplesU(myclass; S : HSurface from Adaptor3d) returns Integer from Standard;
|
||||
|
||||
|
||||
NbSamplesV(myclass; S : HSurface from Adaptor3d) returns Integer from Standard;
|
||||
|
||||
|
||||
NbSamplesU(myclass; S : HSurface from Adaptor3d; u1,u2: Real from Standard) returns Integer from Standard;
|
||||
|
||||
|
||||
NbSamplesV(myclass; S : HSurface from Adaptor3d; v1,v2: Real from Standard) returns Integer from Standard;
|
||||
|
||||
|
||||
end HSurfaceTool;
|
77
src/Adaptor3d/Adaptor3d_HSurfaceTool.cxx
Executable file
77
src/Adaptor3d/Adaptor3d_HSurfaceTool.cxx
Executable file
@@ -0,0 +1,77 @@
|
||||
// File : Adaptor3d_HSurfaceTool.cxx
|
||||
// Created : Wed Jui 7 18:00:00 1993
|
||||
// Author : Laurent BUCHARD
|
||||
// Copyright : Matra Datavision 1993
|
||||
|
||||
#include <Adaptor3d_HSurfaceTool.ixx>
|
||||
|
||||
Standard_Integer Adaptor3d_HSurfaceTool::NbSamplesU(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
switch (S->GetType())
|
||||
{
|
||||
case GeomAbs_Plane: return 2;
|
||||
case GeomAbs_BezierSurface: return (3 + S->NbUPoles());
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
const Standard_Integer nbs = S->NbUKnots() * S->UDegree();
|
||||
return (nbs < 2 ? 2 : nbs);
|
||||
}
|
||||
case GeomAbs_Torus: return 20;
|
||||
}
|
||||
return 10;
|
||||
}
|
||||
|
||||
Standard_Integer Adaptor3d_HSurfaceTool::NbSamplesV(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
switch (S->GetType())
|
||||
{
|
||||
case GeomAbs_Plane: return 2;
|
||||
case GeomAbs_BezierSurface: return (3 + S->NbVPoles());
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
const Standard_Integer nbs = S->NbVKnots() * S->VDegree();
|
||||
return (nbs < 2 ? 2 : nbs);
|
||||
}
|
||||
case GeomAbs_Cylinder:
|
||||
case GeomAbs_Cone:
|
||||
case GeomAbs_Sphere:
|
||||
case GeomAbs_Torus:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
case GeomAbs_SurfaceOfExtrusion: return 15;
|
||||
}
|
||||
return 10;
|
||||
}
|
||||
|
||||
Standard_Integer Adaptor3d_HSurfaceTool::NbSamplesU(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real u1,
|
||||
const Standard_Real u2)
|
||||
{
|
||||
const Standard_Integer nbs = NbSamplesU(S);
|
||||
Standard_Integer n = nbs;
|
||||
if(nbs>10)
|
||||
{
|
||||
const Standard_Real uf = FirstUParameter(S);
|
||||
const Standard_Real ul = LastUParameter(S);
|
||||
n *= (Standard_Integer)((u2-u1)/(ul-uf));
|
||||
if (n>nbs || n>50) n = nbs;
|
||||
if (n<5) n = 5;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
Standard_Integer Adaptor3d_HSurfaceTool::NbSamplesV(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real v1,
|
||||
const Standard_Real v2)
|
||||
{
|
||||
const Standard_Integer nbs = NbSamplesV(S);
|
||||
Standard_Integer n = nbs;
|
||||
if(nbs>10)
|
||||
{
|
||||
const Standard_Real vf = FirstVParameter(S);
|
||||
const Standard_Real vl = LastVParameter(S);
|
||||
n *= (Standard_Integer)((v2-v1)/(vl-vf));
|
||||
if (n>nbs || n>50) n = nbs;
|
||||
if (n<5) n = 5;
|
||||
}
|
||||
return n;
|
||||
}
|
250
src/Adaptor3d/Adaptor3d_HSurfaceTool.lxx
Executable file
250
src/Adaptor3d/Adaptor3d_HSurfaceTool.lxx
Executable file
@@ -0,0 +1,250 @@
|
||||
// File : Adaptor3d_HSurfaceTool.lxx
|
||||
// Created : Wed Jui 7 18:00:00 1993
|
||||
// Author : Laurent BUCHARD
|
||||
// Copyright : Matra Datavision 1993
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Handle_Geom_BezierSurface.hxx>
|
||||
#include <Handle_Geom_BSplineSurface.hxx>
|
||||
#include <Handle_Adaptor3d_HSurface.hxx>
|
||||
#include <Handle_Adaptor3d_HCurve.hxx>
|
||||
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::FirstUParameter(const Handle(Adaptor3d_HSurface)& Surf)
|
||||
{
|
||||
return Surf->FirstUParameter();
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::FirstVParameter(const Handle(Adaptor3d_HSurface)& Surf)
|
||||
{
|
||||
return Surf->FirstVParameter();
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::LastUParameter(const Handle(Adaptor3d_HSurface)& Surf)
|
||||
{
|
||||
return Surf->LastUParameter();
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::LastVParameter(const Handle(Adaptor3d_HSurface)& Surf)
|
||||
{
|
||||
return Surf->LastVParameter();
|
||||
}
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurfaceTool::NbUIntervals(const Handle(Adaptor3d_HSurface)& Surf, const GeomAbs_Shape S)
|
||||
{
|
||||
return Surf->NbUIntervals(S);
|
||||
}
|
||||
|
||||
inline Standard_Integer Adaptor3d_HSurfaceTool::NbVIntervals(const Handle(Adaptor3d_HSurface)& Surf, const GeomAbs_Shape S)
|
||||
{
|
||||
return Surf->NbVIntervals(S);
|
||||
}
|
||||
|
||||
inline void Adaptor3d_HSurfaceTool::UIntervals(const Handle(Adaptor3d_HSurface)& Surf,
|
||||
TColStd_Array1OfReal& Tab,
|
||||
const GeomAbs_Shape S)
|
||||
{
|
||||
Surf->UIntervals(Tab,S);
|
||||
}
|
||||
|
||||
inline void Adaptor3d_HSurfaceTool::VIntervals(const Handle(Adaptor3d_HSurface)& Surf,
|
||||
TColStd_Array1OfReal& Tab,
|
||||
const GeomAbs_Shape S)
|
||||
{
|
||||
Surf->VIntervals(Tab,S);
|
||||
}
|
||||
|
||||
inline Handle_Adaptor3d_HSurface Adaptor3d_HSurfaceTool::UTrim(const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Standard_Real F,
|
||||
const Standard_Real L,
|
||||
const Standard_Real Tol)
|
||||
{
|
||||
return Surf->UTrim(F,L,Tol);
|
||||
}
|
||||
|
||||
inline Handle_Adaptor3d_HSurface Adaptor3d_HSurfaceTool::VTrim(const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Standard_Real F,
|
||||
const Standard_Real L,
|
||||
const Standard_Real Tol)
|
||||
{
|
||||
return Surf->VTrim(F,L,Tol);
|
||||
}
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsUClosed(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->IsUClosed();
|
||||
}
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsVClosed(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->IsVClosed();
|
||||
}
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsUPeriodic(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->IsUPeriodic();
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::UPeriod(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->UPeriod();
|
||||
}
|
||||
|
||||
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsVPeriodic(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->IsVPeriodic();
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::VPeriod(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->VPeriod();
|
||||
}
|
||||
|
||||
inline gp_Pnt Adaptor3d_HSurfaceTool::Value(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V )
|
||||
{
|
||||
return S->Value(U,V);
|
||||
}
|
||||
|
||||
inline void Adaptor3d_HSurfaceTool::D0(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P)
|
||||
{
|
||||
S->D0(U,V,P);
|
||||
}
|
||||
|
||||
inline void Adaptor3d_HSurfaceTool::D1(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U,
|
||||
gp_Vec& D1V)
|
||||
{
|
||||
S->D1(U,V,P,D1U,D1V);
|
||||
}
|
||||
|
||||
inline void Adaptor3d_HSurfaceTool::D2(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U,
|
||||
gp_Vec& D1V,
|
||||
gp_Vec& D2U,
|
||||
gp_Vec& D2V,
|
||||
gp_Vec& D2UV)
|
||||
{
|
||||
S->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
|
||||
}
|
||||
|
||||
inline void Adaptor3d_HSurfaceTool::D3(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U,
|
||||
gp_Vec& D1V,
|
||||
gp_Vec& D2U,
|
||||
gp_Vec& D2V,
|
||||
gp_Vec& D2UV,
|
||||
gp_Vec& D3U,
|
||||
gp_Vec& D3V,
|
||||
gp_Vec& D3UUV,
|
||||
gp_Vec& D3UVV)
|
||||
{
|
||||
S->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
}
|
||||
|
||||
inline gp_Vec Adaptor3d_HSurfaceTool::DN(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
const Standard_Integer Nu,
|
||||
const Standard_Integer Nv)
|
||||
{
|
||||
return S->DN(U,V,Nu,Nv);
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::UResolution(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real R3d)
|
||||
{
|
||||
return S->UResolution(R3d);
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::VResolution(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real R3d)
|
||||
{
|
||||
return S->VResolution(R3d);
|
||||
}
|
||||
|
||||
inline GeomAbs_SurfaceType Adaptor3d_HSurfaceTool::GetType(const Handle(Adaptor3d_HSurface)& S )
|
||||
{
|
||||
return S->GetType();
|
||||
}
|
||||
|
||||
inline gp_Pln Adaptor3d_HSurfaceTool::Plane(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->Plane();
|
||||
}
|
||||
|
||||
inline gp_Cylinder Adaptor3d_HSurfaceTool::Cylinder(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->Cylinder();
|
||||
}
|
||||
|
||||
inline gp_Cone Adaptor3d_HSurfaceTool::Cone(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->Cone();
|
||||
}
|
||||
|
||||
inline gp_Sphere Adaptor3d_HSurfaceTool::Sphere(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->Sphere();
|
||||
}
|
||||
|
||||
inline gp_Torus Adaptor3d_HSurfaceTool::Torus(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return S->Torus();
|
||||
}
|
||||
|
||||
inline Handle(Geom_BezierSurface) Adaptor3d_HSurfaceTool::Bezier(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return(S->Bezier());
|
||||
}
|
||||
|
||||
inline Handle(Geom_BSplineSurface) Adaptor3d_HSurfaceTool::BSpline(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return(S->BSpline());
|
||||
}
|
||||
|
||||
inline gp_Ax1 Adaptor3d_HSurfaceTool::AxeOfRevolution(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return(S->AxeOfRevolution());
|
||||
}
|
||||
|
||||
inline gp_Dir Adaptor3d_HSurfaceTool::Direction(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return(S->Direction());
|
||||
}
|
||||
|
||||
inline Handle(Adaptor3d_HCurve) Adaptor3d_HSurfaceTool::BasisCurve(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return(S->BasisCurve());
|
||||
}
|
||||
|
||||
inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurfaceTool::BasisSurface(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return(S->BasisSurface());
|
||||
}
|
||||
|
||||
inline Standard_Real Adaptor3d_HSurfaceTool::OffsetValue(const Handle(Adaptor3d_HSurface)& S)
|
||||
{
|
||||
return(S->OffsetValue());
|
||||
}
|
70
src/Adaptor3d/Adaptor3d_HVertex.cdl
Executable file
70
src/Adaptor3d/Adaptor3d_HVertex.cdl
Executable file
@@ -0,0 +1,70 @@
|
||||
-- File: Adaptor3d_HVertex.cdl
|
||||
-- Created: Fri Mar 25 12:31:39 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
class HVertex from Adaptor3d
|
||||
|
||||
---Purpose:
|
||||
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Orientation from TopAbs,
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
returns mutable HVertex from Adaptor3d;
|
||||
|
||||
|
||||
Create(P: Pnt2d from gp; Ori: Orientation from TopAbs;
|
||||
Resolution: Real from Standard)
|
||||
|
||||
returns mutable HVertex from Adaptor3d;
|
||||
|
||||
|
||||
Value(me: mutable)
|
||||
|
||||
returns Pnt2d from gp
|
||||
is virtual;
|
||||
|
||||
|
||||
Parameter(me: mutable; C: HCurve2d from Adaptor2d)
|
||||
|
||||
returns Real from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Resolution(me: mutable; C: HCurve2d from Adaptor2d)
|
||||
|
||||
---Purpose: Parametric resolution (2d).
|
||||
|
||||
returns Real from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Orientation(me: mutable)
|
||||
|
||||
returns Orientation from TopAbs
|
||||
is virtual;
|
||||
|
||||
|
||||
IsSame(me: mutable; Other: mutable like me)
|
||||
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myPnt : Pnt2d from gp;
|
||||
myTol : Real from Standard;
|
||||
myOri : Orientation from TopAbs;
|
||||
|
||||
end HVertex;
|
44
src/Adaptor3d/Adaptor3d_HVertex.cxx
Executable file
44
src/Adaptor3d/Adaptor3d_HVertex.cxx
Executable file
@@ -0,0 +1,44 @@
|
||||
#include <Adaptor3d_HVertex.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
|
||||
|
||||
Adaptor3d_HVertex::Adaptor3d_HVertex ()
|
||||
{}
|
||||
|
||||
|
||||
Adaptor3d_HVertex::Adaptor3d_HVertex (const gp_Pnt2d& P,
|
||||
const TopAbs_Orientation Or,
|
||||
const Standard_Real Resolution):
|
||||
myPnt(P),myTol(Resolution),myOri(Or)
|
||||
{}
|
||||
|
||||
|
||||
gp_Pnt2d Adaptor3d_HVertex::Value ()
|
||||
{
|
||||
return myPnt;
|
||||
}
|
||||
|
||||
Standard_Real Adaptor3d_HVertex::Parameter (const Handle(Adaptor2d_HCurve2d)& C)
|
||||
{
|
||||
return ElCLib::Parameter(C->Line(),myPnt);
|
||||
}
|
||||
|
||||
Standard_Real Adaptor3d_HVertex::Resolution (const Handle(Adaptor2d_HCurve2d)&)
|
||||
{
|
||||
return myTol;
|
||||
}
|
||||
|
||||
TopAbs_Orientation Adaptor3d_HVertex::Orientation ()
|
||||
{
|
||||
return myOri;
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean Adaptor3d_HVertex::IsSame(const Handle(Adaptor3d_HVertex)& Other)
|
||||
{
|
||||
return (myPnt.Distance(Other->Value())<= Precision::Confusion());
|
||||
}
|
||||
|
61
src/Adaptor3d/Adaptor3d_InterFunc.cdl
Executable file
61
src/Adaptor3d/Adaptor3d_InterFunc.cdl
Executable file
@@ -0,0 +1,61 @@
|
||||
-- File: Adaptor3d_InterFunc.cdl
|
||||
-- Created: Wed Feb 18 09:06:58 1998
|
||||
-- Author: Jeanine PANCIATICI
|
||||
-- <jpi@sgi38>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
private class InterFunc from Adaptor3d inherits FunctionWithDerivative from math
|
||||
|
||||
---Purpose: Used to find the points U(t) = U0 or V(t) = V0 in
|
||||
-- order to determine the Cn discontinuities of an
|
||||
-- Adpator_CurveOnSurface relativly to the
|
||||
-- discontinuities of the surface.
|
||||
|
||||
uses
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
raises ConstructionError
|
||||
|
||||
is
|
||||
Create (C : HCurve2d from Adaptor2d; FixVal: Real from Standard;
|
||||
Fix: Integer)
|
||||
returns InterFunc
|
||||
raises ConstructionError from Standard;
|
||||
---Purpose: build the function U(t)=FixVal if Fix =1 or
|
||||
-- V(t)=FixVal if Fix=2
|
||||
|
||||
Value(me: in out; X: Real; F: out Real)
|
||||
---Purpose: computes the value <F>of the function for the variable <X>.
|
||||
-- Returns True if the calculation were successfully done,
|
||||
-- False otherwise.
|
||||
|
||||
returns Boolean;
|
||||
|
||||
|
||||
Derivative(me: in out; X: Real; D: out Real)
|
||||
---Purpose: computes the derivative <D> of the function
|
||||
-- for the variable <X>.
|
||||
-- Returns True if the calculation were successfully done,
|
||||
-- False otherwise.
|
||||
|
||||
returns Boolean;
|
||||
|
||||
|
||||
Values(me: in out; X: Real; F, D: out Real)
|
||||
---Purpose: computes the value <F> and the derivative <D> of the
|
||||
-- function for the variable <X>.
|
||||
-- Returns True if the calculation were successfully done,
|
||||
-- False otherwise.
|
||||
|
||||
returns Boolean;
|
||||
|
||||
fields
|
||||
|
||||
myCurve2d : HCurve2d from Adaptor2d;
|
||||
myFixVal : Real from Standard;
|
||||
myFix : Integer from Standard;
|
||||
|
||||
|
||||
|
||||
end InterFunc;
|
||||
|
46
src/Adaptor3d/Adaptor3d_InterFunc.cxx
Executable file
46
src/Adaptor3d/Adaptor3d_InterFunc.cxx
Executable file
@@ -0,0 +1,46 @@
|
||||
// File: Adaptor3d_InterFunc.cxx
|
||||
// Created: Wed Feb 18 09:29:56 1998
|
||||
// Author: Jeanine PANCIATICI
|
||||
// <jpi@sgi38>
|
||||
|
||||
|
||||
#include <Adaptor3d_InterFunc.ixx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
Adaptor3d_InterFunc::Adaptor3d_InterFunc(const Handle(Adaptor2d_HCurve2d)& C, const Standard_Real FixVal, const Standard_Integer Fix) : myCurve2d(C),myFixVal(FixVal),myFix(Fix)
|
||||
{
|
||||
if(Fix != 1 && Fix != 2 ) Standard_ConstructionError::Raise();
|
||||
|
||||
}
|
||||
|
||||
Standard_Boolean Adaptor3d_InterFunc::Value(const Standard_Real X , Standard_Real& F)
|
||||
{
|
||||
gp_Pnt2d C;
|
||||
myCurve2d->D0(X,C);
|
||||
if(myFix == 1)
|
||||
F=C.X()-myFixVal;
|
||||
else
|
||||
F=C.Y()-myFixVal;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
Standard_Boolean Adaptor3d_InterFunc::Derivative(const Standard_Real X , Standard_Real& D)
|
||||
{
|
||||
Standard_Real F;
|
||||
return Values(X,F,D);
|
||||
}
|
||||
Standard_Boolean Adaptor3d_InterFunc::Values(const Standard_Real X , Standard_Real& F,Standard_Real& D)
|
||||
{
|
||||
gp_Pnt2d C;
|
||||
gp_Vec2d DC;
|
||||
myCurve2d->D1(X,C,DC);
|
||||
if(myFix == 1) {
|
||||
F=C.X()-myFixVal;
|
||||
D=DC.X();}
|
||||
else {
|
||||
F=C.Y()-myFixVal;
|
||||
D=DC.Y();}
|
||||
return Standard_True;
|
||||
}
|
289
src/Adaptor3d/Adaptor3d_IsoCurve.cdl
Executable file
289
src/Adaptor3d/Adaptor3d_IsoCurve.cdl
Executable file
@@ -0,0 +1,289 @@
|
||||
-- File: Adaptor3d_IsoCurve.cdl
|
||||
-- Created: Thu Mar 11 17:15:21 1993
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@bravox>
|
||||
-- modified 01-1994 by rob (time comsumption)
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class IsoCurve from Adaptor3d inherits Curve from Adaptor3d
|
||||
|
||||
---Purpose: Defines an isoparametric curve on a surface. The
|
||||
-- type of isoparametric curve (U or V) is defined
|
||||
-- with the enumeration IsoType from GeomAbs if
|
||||
-- NoneIso is given an error is raised.
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
IsoType from GeomAbs,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec from gp,
|
||||
Pnt from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Parab from gp,
|
||||
Lin from gp,
|
||||
BezierCurve from Geom,
|
||||
BSplineCurve from Geom,
|
||||
HCurve from Adaptor3d,
|
||||
HSurface from Adaptor3d
|
||||
|
||||
raises
|
||||
NoSuchObject from Standard,
|
||||
OutOfRange from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Methods specific of IsoCurve
|
||||
--
|
||||
|
||||
Create returns IsoCurve from Adaptor3d;
|
||||
---Purpose: The iso is set to NoneIso.
|
||||
|
||||
Create(S : HSurface from Adaptor3d) returns IsoCurve from Adaptor3d;
|
||||
---Purpose: The surface is loaded. The iso is set to NoneIso.
|
||||
|
||||
Create(S : HSurface from Adaptor3d;
|
||||
Iso : IsoType from GeomAbs; Param : Real)
|
||||
returns IsoCurve from Adaptor3d;
|
||||
---Purpose: Creates an IsoCurve curve. Iso defines the
|
||||
-- type (isoU or isoU) Param defines the value of
|
||||
-- the iso. The bounds of the iso are the bounds
|
||||
-- of the surface.
|
||||
|
||||
Create(S : HSurface from Adaptor3d;
|
||||
Iso : IsoType from GeomAbs; Param : Real; WFirst,WLast : Real)
|
||||
returns IsoCurve from Adaptor3d;
|
||||
---Purpose: Create an IsoCurve curve. Iso defines the type
|
||||
-- (isoU or isov). Param defines the value of the
|
||||
-- iso. WFirst,WLast define the bounds of the iso.
|
||||
|
||||
|
||||
Load( me:in out ;S : HSurface from Adaptor3d)
|
||||
---Purpose: Changes the surface. The iso is reset to
|
||||
-- NoneIso.
|
||||
is static;
|
||||
|
||||
Load (me : in out ; Iso : IsoType from GeomAbs; Param : Real)
|
||||
---Purpose: Changes the iso on the current surface.
|
||||
is static;
|
||||
|
||||
Load (me : in out ;
|
||||
Iso : IsoType from GeomAbs; Param : Real; WFirst,WLast : Real)
|
||||
---Purpose: Changes the iso on the current surface.
|
||||
is static;
|
||||
|
||||
Surface(me) returns HSurface from Adaptor3d
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
Iso(me) returns IsoType from GeomAbs
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
Parameter(me) returns Real
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
--
|
||||
-- Implementation of Curve from Adaptor3d methods
|
||||
--
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
FirstParameter(me) returns Real
|
||||
---C++: inline
|
||||
is redefined static;
|
||||
|
||||
LastParameter(me) returns Real
|
||||
---C++: inline
|
||||
is redefined static;
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
NbIntervals(me:in out; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of intervals for continuity
|
||||
-- <S>. May be one if Continuity(me) >= <S>
|
||||
is redefined static;
|
||||
|
||||
Intervals(me:in out; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is redefined static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static;
|
||||
|
||||
|
||||
IsClosed(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
Value(me; U : Real) returns Pnt from gp
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is redefined static;
|
||||
|
||||
D0 (me; U : Real; P : out Pnt from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is redefined static;
|
||||
|
||||
D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve with its
|
||||
-- first derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C1.
|
||||
is redefined static;
|
||||
|
||||
D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first and second
|
||||
-- derivatives V1 and V2.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C2.
|
||||
is redefined static;
|
||||
|
||||
D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first, the second
|
||||
-- and the third derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C3.
|
||||
is redefined static;
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec from gp
|
||||
--- Purpose :
|
||||
-- The returned vector gives the value of the derivative for the
|
||||
-- order of derivation N.
|
||||
raises
|
||||
DomainError from Standard,
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not CN.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if N < 1.
|
||||
is redefined static;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is redefined static;
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs
|
||||
---Purpose: Returns the type of the curve in the current
|
||||
-- interval : Line, Circle, Ellipse, Hyperbola,
|
||||
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
is redefined static;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Circle(me) returns Circ from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Ellipse(me) returns Elips from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Hyperbola(me) returns Hypr from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Parabola(me) returns Parab from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
|
||||
Degree(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
mySurface : HSurface from Adaptor3d;
|
||||
myIso : IsoType from GeomAbs;
|
||||
myFirst : Real;
|
||||
myLast : Real;
|
||||
myParameter : Real;
|
||||
end IsoCurve;
|
||||
|
||||
|
||||
|
||||
|
||||
|
1110
src/Adaptor3d/Adaptor3d_IsoCurve.cxx
Executable file
1110
src/Adaptor3d/Adaptor3d_IsoCurve.cxx
Executable file
File diff suppressed because it is too large
Load Diff
50
src/Adaptor3d/Adaptor3d_IsoCurve.lxx
Executable file
50
src/Adaptor3d/Adaptor3d_IsoCurve.lxx
Executable file
@@ -0,0 +1,50 @@
|
||||
|
||||
//=======================================================================
|
||||
//function : Surface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Adaptor3d_HSurface)& Adaptor3d_IsoCurve::Surface() const
|
||||
{
|
||||
return mySurface;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Iso
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_IsoType Adaptor3d_IsoCurve::Iso() const
|
||||
{
|
||||
return myIso;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_IsoCurve::Parameter() const
|
||||
{
|
||||
return myParameter;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_IsoCurve::FirstParameter() const
|
||||
{
|
||||
return myFirst;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_IsoCurve::LastParameter() const {
|
||||
return myLast;
|
||||
}
|
||||
|
269
src/Adaptor3d/Adaptor3d_OffsetCurve.cdl
Executable file
269
src/Adaptor3d/Adaptor3d_OffsetCurve.cdl
Executable file
@@ -0,0 +1,269 @@
|
||||
-- File: Adaptor3d_OffsetCurve.cdl
|
||||
-- Created: Thu Apr 15 11:59:28 1993
|
||||
-- Author: Bruno DUMORTIER
|
||||
-- <dub@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class OffsetCurve from Adaptor3d inherits Curve2d from Adaptor2d
|
||||
|
||||
---Purpose: Defines an Offset curve.
|
||||
--
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec2d from gp,
|
||||
Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Lin2d from gp,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
|
||||
raises
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard,
|
||||
OutOfRange from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Methods specific of OffsetCurve
|
||||
--
|
||||
|
||||
Create returns OffsetCurve from Adaptor3d;
|
||||
---Purpose: The Offset is set to 0.
|
||||
|
||||
Create(C : HCurve2d from Adaptor2d) returns OffsetCurve from Adaptor3d;
|
||||
---Purpose: The curve is loaded. The Offset is set to 0.
|
||||
|
||||
Create(C : HCurve2d from Adaptor2d; Offset : Real)
|
||||
returns OffsetCurve from Adaptor3d;
|
||||
---Purpose: Creates an OffsetCurve curve.
|
||||
-- The Offset is set to Offset.
|
||||
--
|
||||
|
||||
Create(C : HCurve2d from Adaptor2d; Offset : Real; WFirst,WLast : Real)
|
||||
returns OffsetCurve from Adaptor3d;
|
||||
---Purpose: Create an Offset curve.
|
||||
-- WFirst,WLast define the bounds of the Offset curve.
|
||||
|
||||
|
||||
Load( me:in out ;S : HCurve2d from Adaptor2d)
|
||||
---Purpose: Changes the curve. The Offset is reset to 0.
|
||||
is static;
|
||||
|
||||
Load (me : in out ; Offset : Real)
|
||||
---Purpose: Changes the Offset on the current Curve.
|
||||
is static;
|
||||
|
||||
Load (me : in out ; Offset : Real; WFirst,WLast : Real)
|
||||
---Purpose: Changes the Offset Curve on the current Curve.
|
||||
is static;
|
||||
|
||||
Curve(me) returns HCurve2d from Adaptor2d
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
Offset(me) returns Real
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
--
|
||||
-- Implementation of Curve2d from Adaptor2d methods
|
||||
--
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
FirstParameter(me) returns Real
|
||||
---C++: inline
|
||||
is redefined static;
|
||||
|
||||
LastParameter(me) returns Real
|
||||
---C++: inline
|
||||
is redefined static;
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
NbIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: If necessary, breaks the curve in intervals of
|
||||
-- continuity <S>. And returns the number of
|
||||
-- intervals.
|
||||
is redefined static;
|
||||
|
||||
Intervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is redefined static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static;
|
||||
|
||||
IsClosed(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
Value(me; U : Real) returns Pnt2d from gp
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is redefined static;
|
||||
|
||||
D0 (me; U : Real; P : out Pnt2d from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is redefined static;
|
||||
|
||||
D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve with its
|
||||
-- first derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C1.
|
||||
is redefined static;
|
||||
|
||||
D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first and second
|
||||
-- derivatives V1 and V2.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C2.
|
||||
is redefined static;
|
||||
|
||||
D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first, the second
|
||||
-- and the third derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C3.
|
||||
is redefined static;
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec2d from gp
|
||||
--- Purpose :
|
||||
-- The returned vector gives the value of the derivative for the
|
||||
-- order of derivation N.
|
||||
raises
|
||||
DomainError from Standard,
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not CN.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if N < 1.
|
||||
is redefined static;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is redefined static;
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs
|
||||
---Purpose: Returns the type of the curve in the current
|
||||
-- interval : Line, Circle, Ellipse, Hyperbola,
|
||||
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
is redefined static;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Circle(me) returns Circ2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Ellipse(me) returns Elips2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Hyperbola(me) returns Hypr2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Parabola(me) returns Parab2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
Degree(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
fields
|
||||
|
||||
myCurve : HCurve2d from Adaptor2d;
|
||||
myOffset : Real;
|
||||
myFirst : Real;
|
||||
myLast : Real;
|
||||
|
||||
end OffsetCurve;
|
||||
|
633
src/Adaptor3d/Adaptor3d_OffsetCurve.cxx
Executable file
633
src/Adaptor3d/Adaptor3d_OffsetCurve.cxx
Executable file
@@ -0,0 +1,633 @@
|
||||
#include <Adaptor3d_OffsetCurve.ixx>
|
||||
|
||||
#include <Adaptor3d_HOffsetCurve.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <gp_VectorWithNullMagnitude.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp_Ax22d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_OffsetCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve() :
|
||||
myOffset( 0.)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_OffsetCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C)
|
||||
{
|
||||
Load(C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_OffsetCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C,
|
||||
const Standard_Real Offset)
|
||||
{
|
||||
Load(C);
|
||||
Load(Offset);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_OffsetCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_OffsetCurve::Adaptor3d_OffsetCurve(const Handle(Adaptor2d_HCurve2d)& C,
|
||||
const Standard_Real Offset,
|
||||
const Standard_Real WFirst,
|
||||
const Standard_Real WLast)
|
||||
{
|
||||
Load(C);
|
||||
Load(Offset,WFirst,WLast);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_OffsetCurve::Load(const Handle(Adaptor2d_HCurve2d)& C )
|
||||
{
|
||||
myCurve = C;
|
||||
myOffset = 0.;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_OffsetCurve::Load( const Standard_Real Offset)
|
||||
{
|
||||
myOffset = Offset;
|
||||
myFirst = myCurve->FirstParameter();
|
||||
myLast = myCurve->LastParameter();
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_OffsetCurve::Load(const Standard_Real Offset,
|
||||
const Standard_Real WFirst,
|
||||
const Standard_Real WLast)
|
||||
{
|
||||
myOffset = Offset;
|
||||
myFirst = WFirst;
|
||||
myLast = WLast;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_OffsetCurve::Continuity() const
|
||||
{
|
||||
switch (myCurve->Continuity()) {
|
||||
case GeomAbs_CN: return GeomAbs_CN;
|
||||
case GeomAbs_C3: return GeomAbs_C2;
|
||||
case GeomAbs_C2: return GeomAbs_G2;
|
||||
case GeomAbs_G2: return GeomAbs_C1;
|
||||
case GeomAbs_C1: return GeomAbs_G1;
|
||||
case GeomAbs_G1: return GeomAbs_C0;
|
||||
case GeomAbs_C0:
|
||||
// No Continuity !!
|
||||
Standard_TypeMismatch::Raise("Adaptor3d_OffsetCurve::IntervalContinuity");
|
||||
break;
|
||||
}
|
||||
|
||||
//portage WNT
|
||||
return GeomAbs_C0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_OffsetCurve::NbIntervals(const GeomAbs_Shape S) const
|
||||
{
|
||||
GeomAbs_Shape Sh;
|
||||
if ( S >= GeomAbs_C2) Sh = GeomAbs_CN;
|
||||
else
|
||||
Sh = (GeomAbs_Shape)((Standard_Integer)S + 2);
|
||||
|
||||
Standard_Integer nbInter = myCurve->NbIntervals(Sh);
|
||||
|
||||
if(nbInter == 1) return nbInter;
|
||||
|
||||
TColStd_Array1OfReal T(1,nbInter+1);
|
||||
|
||||
myCurve->Intervals(T,Sh);
|
||||
|
||||
Standard_Integer first = 1;
|
||||
while (T(first) <= myFirst) first++;
|
||||
Standard_Integer last = nbInter+1;
|
||||
while (T(last) >= myLast) last--;
|
||||
return (last - first + 2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Intervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_OffsetCurve::Intervals(TColStd_Array1OfReal& TI,
|
||||
const GeomAbs_Shape S) const
|
||||
{
|
||||
GeomAbs_Shape Sh;
|
||||
if ( S >= GeomAbs_C2) Sh = GeomAbs_CN;
|
||||
else
|
||||
Sh = (GeomAbs_Shape)((Standard_Integer)S + 2);
|
||||
|
||||
Standard_Integer nbInter = myCurve->NbIntervals(Sh);
|
||||
|
||||
|
||||
if(nbInter == 1) {
|
||||
TI(TI.Lower()) = myFirst ;
|
||||
TI(TI.Lower() + 1) = myLast ;
|
||||
return;
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal T(1,nbInter+1);
|
||||
myCurve->Intervals(T,Sh);
|
||||
|
||||
Standard_Integer first = 1;
|
||||
while (T(first) <= myFirst) first++;
|
||||
Standard_Integer last = nbInter+1;
|
||||
while (T(last) >= myLast) last--;
|
||||
|
||||
Standard_Integer i = TI.Lower(), j;
|
||||
for (j = first-1; j <= last+1; j++) {
|
||||
TI(i) = T(j);
|
||||
i++;
|
||||
}
|
||||
|
||||
TI(TI.Lower()) = myFirst ;
|
||||
TI(TI.Lower() + last-first + 2) = myLast ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor2d_HCurve2d) Adaptor3d_OffsetCurve::Trim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real) const
|
||||
{
|
||||
Handle(Adaptor3d_HOffsetCurve) HO = new Adaptor3d_HOffsetCurve(*this);
|
||||
HO->ChangeCurve2d().Load(myOffset,First,Last);
|
||||
return HO;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_OffsetCurve::IsClosed() const
|
||||
{
|
||||
if ( myOffset == 0.) {
|
||||
return myCurve->IsClosed();
|
||||
}
|
||||
else {
|
||||
if (myCurve->Continuity() == GeomAbs_C0)
|
||||
return Standard_False;
|
||||
else {
|
||||
if ( myCurve->IsClosed()) {
|
||||
gp_Vec2d Dummy[2];
|
||||
gp_Pnt2d P;
|
||||
myCurve->D1
|
||||
(myCurve->FirstParameter(),P,Dummy[0]);
|
||||
myCurve->D1
|
||||
(myCurve->LastParameter(),P,Dummy[1]);
|
||||
if (Dummy[0].IsParallel(Dummy[1],Precision::Angular()) &&
|
||||
!(Dummy[0].IsOpposite(Dummy[1],Precision::Angular())))
|
||||
return Standard_True;
|
||||
else
|
||||
return Standard_False;
|
||||
}
|
||||
else
|
||||
return Standard_False;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_OffsetCurve::IsPeriodic() const
|
||||
{
|
||||
return myCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_OffsetCurve::Period() const
|
||||
{
|
||||
return myCurve->Period();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt2d Adaptor3d_OffsetCurve::Value(const Standard_Real U) const
|
||||
{
|
||||
if ( myOffset != 0.) {
|
||||
gp_Pnt2d P;
|
||||
gp_Vec2d V;
|
||||
Standard_Real Norme;
|
||||
myCurve->D1(U, P, V);
|
||||
Norme = V.Magnitude();
|
||||
V.SetCoord(-V.Y(),V.X());
|
||||
if (Norme >= gp::Resolution()) {
|
||||
return gp_Pnt2d(P.XY()+myOffset*V.XY()/Norme);
|
||||
}
|
||||
else {
|
||||
gp_VectorWithNullMagnitude::Raise("Adaptor3d_OffsetCurve::Value");
|
||||
return gp_Pnt2d();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return myCurve->Value(U);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_OffsetCurve::D0(const Standard_Real U, gp_Pnt2d& P) const
|
||||
{
|
||||
P = Value( U);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_OffsetCurve::D1
|
||||
(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const
|
||||
{
|
||||
gp_Vec2d V1,V2,V3;
|
||||
gp_Pnt2d PP;
|
||||
Standard_Real Norme;
|
||||
if ( myOffset != 0. ) {
|
||||
myCurve->D2(U,PP,V1,V2);
|
||||
Norme = V1.Magnitude();
|
||||
V3.SetCoord( -V1.Y(),V1.X());
|
||||
V2.SetCoord( -V2.Y(),V2.X());
|
||||
if ( Norme >= gp::Resolution()) {
|
||||
P = gp_Pnt2d( PP.XY()+myOffset*V3.XY()/Norme);
|
||||
V = gp_Vec2d( V1.XY()+
|
||||
(myOffset/Norme)*(V2.XY()-V3.XY()*
|
||||
(V2.XY()*V3.XY())/(Norme*Norme)));
|
||||
}
|
||||
else {
|
||||
gp_VectorWithNullMagnitude::Raise("Adaptor3d_OffsetCurve::D1");
|
||||
}
|
||||
}
|
||||
else {
|
||||
myCurve->D1(U,P,V);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_OffsetCurve::D2
|
||||
(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const
|
||||
{
|
||||
if ( myOffset != 0.) {
|
||||
gp_Vec2d T1,T2,T3;
|
||||
gp_Pnt2d PP;
|
||||
Standard_Real Norme;
|
||||
myCurve->D3(U,PP,T1,T2,T3);
|
||||
|
||||
Norme = T1.Magnitude();
|
||||
if ( Norme >= gp::Resolution()) {
|
||||
gp_Vec2d N1,N2,N3; // Ni = Z ^ Ti
|
||||
N1.SetCoord( -T1.Y(), T1.X());
|
||||
N2.SetCoord( -T2.Y(), T2.X());
|
||||
N3.SetCoord( -T3.Y(), T3.X());
|
||||
Standard_Real d12,d13,d22,Nor3,Nor11;
|
||||
d12 = T1*T2;
|
||||
d22 = T2*T2;
|
||||
d13 = T1*T3;
|
||||
Nor3 = Norme*Norme*Norme;
|
||||
Nor11 = Nor3*Nor3*Nor3*Norme*Norme;
|
||||
V2 = gp_Vec2d( -1 * ( (d22+d13)/Nor3 + 3*d12*d12/Nor11) * N1.XY());
|
||||
V2 = gp_Vec2d( V2.XY() - (2*d12/Nor3)*N2.XY() + N3.XY()/Norme);
|
||||
V2 = gp_Vec2d( myOffset*V2.XY() + T2.XY());
|
||||
|
||||
D1( U,P,V1);
|
||||
}
|
||||
else {
|
||||
gp_VectorWithNullMagnitude::Raise("Adaptor3d_OffsetCurve::D2");
|
||||
}
|
||||
}
|
||||
else {
|
||||
myCurve->D2(U,P,V1,V2);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_OffsetCurve::D3
|
||||
// (const Standard_Real T,
|
||||
// gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const
|
||||
void Adaptor3d_OffsetCurve::D3
|
||||
(const Standard_Real ,
|
||||
gp_Pnt2d& , gp_Vec2d& , gp_Vec2d& , gp_Vec2d& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_OffsetCurve::D3");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Vec2d Adaptor3d_OffsetCurve::DN
|
||||
// (const Standard_Real T, const Standard_Integer N) const
|
||||
(const Standard_Real , const Standard_Integer ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_OffsetCurve::DN");
|
||||
return gp_Vec2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_OffsetCurve::Resolution(const Standard_Real R3d) const
|
||||
{
|
||||
return Precision::PConfusion(R3d);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_CurveType Adaptor3d_OffsetCurve::GetType() const {
|
||||
|
||||
if ( myOffset == 0.) {
|
||||
return myCurve->GetType();
|
||||
}
|
||||
else {
|
||||
switch (myCurve->GetType()) {
|
||||
|
||||
case GeomAbs_Line:
|
||||
return GeomAbs_Line;
|
||||
|
||||
case GeomAbs_Circle:
|
||||
return GeomAbs_Circle;
|
||||
|
||||
default:
|
||||
return GeomAbs_OtherCurve;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Lin2d Adaptor3d_OffsetCurve::Line() const
|
||||
{
|
||||
if ( GetType() == GeomAbs_Line) {
|
||||
gp_Pnt2d P;
|
||||
gp_Vec2d V;
|
||||
D1(0,P,V);
|
||||
return gp_Lin2d(P,V);
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::Line");
|
||||
return gp_Lin2d();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Circ2d Adaptor3d_OffsetCurve::Circle() const
|
||||
{
|
||||
if ( GetType() == GeomAbs_Circle) {
|
||||
if (myOffset == 0.) {
|
||||
return myCurve->Circle();
|
||||
}
|
||||
else {
|
||||
gp_Circ2d C1( myCurve->Circle());
|
||||
Standard_Real radius = C1.Radius();
|
||||
gp_Ax22d axes( C1.Axis());
|
||||
gp_Dir2d Xd = axes.XDirection();
|
||||
gp_Dir2d Yd = axes.YDirection();
|
||||
Standard_Real Crossed = Xd.X()*Yd.Y()-Xd.Y()*Yd.X();
|
||||
Standard_Real Signe = ( Crossed > 0.) ? 1. : -1.;
|
||||
|
||||
radius += Signe*myOffset;
|
||||
if ( radius > 0.) {
|
||||
return gp_Circ2d( axes,radius);
|
||||
}
|
||||
else if ( radius < 0.) {
|
||||
radius = - radius;
|
||||
axes.SetXDirection( (axes.XDirection()).Reversed());
|
||||
return gp_Circ2d( axes,radius);
|
||||
}
|
||||
else { // Cercle de rayon Nul
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::Circle");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::Circle");
|
||||
}
|
||||
// portage WNT
|
||||
return gp_Circ2d();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Ellipse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Elips2d Adaptor3d_OffsetCurve::Ellipse() const
|
||||
{
|
||||
if (myCurve->GetType() == GeomAbs_Ellipse && myOffset == 0.) {
|
||||
return myCurve->Ellipse();;
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve:Ellipse");
|
||||
}
|
||||
// portage WNT
|
||||
return gp_Elips2d();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Hyperbola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Hypr2d Adaptor3d_OffsetCurve::Hyperbola() const
|
||||
{
|
||||
if (myCurve->GetType()==GeomAbs_Hyperbola && myOffset==0.) {
|
||||
return myCurve->Hyperbola();
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve:Hyperbola");
|
||||
}
|
||||
// portage WNT
|
||||
return gp_Hypr2d();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parabola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Parab2d Adaptor3d_OffsetCurve::Parabola() const
|
||||
{
|
||||
if (myCurve->GetType() == GeomAbs_Parabola && myOffset == 0.) {
|
||||
return myCurve->Parabola();
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve:Parabola");
|
||||
}
|
||||
// portage WNT
|
||||
return gp_Parab2d();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Degree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_OffsetCurve::Degree() const
|
||||
{
|
||||
GeomAbs_CurveType type = myCurve->GetType();
|
||||
if ( (type==GeomAbs_BezierCurve || type==GeomAbs_BSplineCurve)
|
||||
&& myOffset == 0.) {
|
||||
return myCurve->Degree();
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_offsetCurve::Degree");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_OffsetCurve::IsRational() const
|
||||
{
|
||||
if ( myOffset == 0.) {
|
||||
return myCurve->IsRational();
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_OffsetCurve::NbPoles() const
|
||||
{
|
||||
GeomAbs_CurveType type = myCurve->GetType();
|
||||
if ( (type==GeomAbs_BezierCurve || type==GeomAbs_BSplineCurve)
|
||||
&& myOffset == 0.) {
|
||||
return myCurve->NbPoles();
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::NbPoles");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_OffsetCurve::NbKnots() const
|
||||
{
|
||||
if( myOffset == 0.) {
|
||||
return myCurve->NbKnots();
|
||||
}
|
||||
else {
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_OffsetCurve::NbKnots");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_BezierCurve) Adaptor3d_OffsetCurve::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( myOffset != 0.0e0 || GetType() != GeomAbs_BezierCurve, "");
|
||||
return myCurve->Bezier();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_BSplineCurve) Adaptor3d_OffsetCurve::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( myOffset != 0.0e0 || GetType() != GeomAbs_BSplineCurve, "");
|
||||
|
||||
return myCurve->BSpline();
|
||||
}
|
||||
|
||||
|
42
src/Adaptor3d/Adaptor3d_OffsetCurve.lxx
Executable file
42
src/Adaptor3d/Adaptor3d_OffsetCurve.lxx
Executable file
@@ -0,0 +1,42 @@
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Adaptor2d_HCurve2d)& Adaptor3d_OffsetCurve::Curve() const
|
||||
{
|
||||
return myCurve;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Offset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_OffsetCurve::Offset() const
|
||||
{
|
||||
return myOffset;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_OffsetCurve::FirstParameter() const
|
||||
{
|
||||
return myFirst;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor3d_OffsetCurve::LastParameter() const
|
||||
{
|
||||
return myLast;
|
||||
}
|
319
src/Adaptor3d/Adaptor3d_Surface.cdl
Executable file
319
src/Adaptor3d/Adaptor3d_Surface.cdl
Executable file
@@ -0,0 +1,319 @@
|
||||
-- File: Adaptor3d_Surface.cdl
|
||||
-- Created: Wed Mar 31 12:12:54 1993
|
||||
-- Author: Bruno DUMORTIER
|
||||
-- <dub@sdsun1>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
deferred class Surface from Adaptor3d
|
||||
|
||||
---Purpose: Root class for surfaces on which geometric algorithms work.
|
||||
-- An adapted surface is an interface between the
|
||||
-- services provided by a surface and those required of
|
||||
-- the surface by algorithms which use it.
|
||||
-- A derived concrete class is provided:
|
||||
-- GeomAdaptor_Surface for a surface from the Geom package.
|
||||
-- The Surface class describes the standard behaviour
|
||||
-- of a surface for generic algorithms.
|
||||
--
|
||||
-- The Surface can be decomposed in intervals of any
|
||||
-- continuity in U and V using the method
|
||||
-- NbIntervals. A current interval can be set. Most
|
||||
-- of the methods apply to the current interval.
|
||||
-- Warning: All the methods are virtual and implemented with a
|
||||
-- raise to allow to redefined only the methods realy
|
||||
-- used.
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
SurfaceType from GeomAbs,
|
||||
Vec from gp,
|
||||
Dir from gp,
|
||||
Pnt from gp,
|
||||
Pln from gp,
|
||||
Cone from gp,
|
||||
Cylinder from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp,
|
||||
Ax1 from gp,
|
||||
BezierSurface from Geom,
|
||||
BSplineSurface from Geom,
|
||||
HSurface from Adaptor3d,
|
||||
HCurve from Adaptor3d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole surface.
|
||||
--
|
||||
|
||||
Delete(me:out) is virtual;
|
||||
---C++: alias "Standard_EXPORT virtual ~Adaptor3d_Surface(){Delete();}"
|
||||
|
||||
FirstUParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
LastUParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
FirstVParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
LastVParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
UContinuity(me) returns Shape from GeomAbs
|
||||
is virtual;
|
||||
|
||||
VContinuity(me) returns Shape from GeomAbs
|
||||
is virtual;
|
||||
|
||||
NbUIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of U intervals for continuity
|
||||
-- <S>. May be one if UContinuity(me) >= <S>
|
||||
is virtual;
|
||||
|
||||
NbVIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of V intervals for continuity
|
||||
-- <S>. May be one if VContinuity(me) >= <S>
|
||||
is virtual;
|
||||
|
||||
UIntervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs )
|
||||
---Purpose: Returns the intervals with the requested continuity
|
||||
-- in the U direction.
|
||||
raises
|
||||
OutOfRange from Standard -- if the Length of the array does
|
||||
-- have enought slots to accomodate
|
||||
-- the result.
|
||||
is virtual;
|
||||
|
||||
VIntervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs )
|
||||
---Purpose: Returns the intervals with the requested continuity
|
||||
-- in the V direction.
|
||||
raises
|
||||
OutOfRange from Standard -- if the Length of the array does
|
||||
-- have enought slots to accomodate
|
||||
-- the result.
|
||||
is virtual;
|
||||
|
||||
UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
|
||||
---Purpose: Returns a surface trimmed in the U direction
|
||||
-- equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is virtual ;
|
||||
|
||||
VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
|
||||
---Purpose: Returns a surface trimmed in the V direction between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is virtual ;
|
||||
|
||||
IsUClosed(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
IsVClosed(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
IsUPeriodic(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
UPeriod(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is virtual;
|
||||
|
||||
IsVPeriodic(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
VPeriod(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is virtual;
|
||||
|
||||
Value (me; U, V : Real) returns Pnt from gp
|
||||
--- Purpose : Computes the point of parameters U,V on the surface.
|
||||
is virtual;
|
||||
|
||||
D0 (me; U, V : Real; P : out Pnt from gp)
|
||||
--- Purpose : Computes the point of parameters U,V on the surface.
|
||||
is virtual;
|
||||
|
||||
D1 (me; U, V : Real; P : out Pnt from gp; D1U, D1V : out Vec from gp)
|
||||
--- Purpose : Computes the point and the first derivatives on
|
||||
-- the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C1.
|
||||
is virtual;
|
||||
|
||||
D2 (me; U, V : Real; P : out Pnt from gp; D1U, D1V, D2U, D2V, D2UV : out Vec from gp)
|
||||
--- Purpose : Computes the point, the first and second
|
||||
-- derivatives on the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C2.
|
||||
is virtual;
|
||||
|
||||
D3 (me; U, V : Real; P : out Pnt from gp;
|
||||
D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec from gp)
|
||||
--- Purpose : Computes the point, the first, second and third
|
||||
-- derivatives on the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C3.
|
||||
is virtual;
|
||||
|
||||
DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp
|
||||
--- Purpose : Computes the derivative of order Nu in the direction U and Nv
|
||||
-- in the direction V at the point P(U, V).
|
||||
raises DomainError from Standard,
|
||||
--- Purpose : Raised if the current U interval is not not CNu
|
||||
-- and the current V interval is not CNv.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
|
||||
is virtual;
|
||||
|
||||
UResolution(me; R3d : Real ) returns Real
|
||||
---Purpose : Returns the parametric U resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is virtual;
|
||||
|
||||
VResolution(me; R3d : Real ) returns Real
|
||||
---Purpose : Returns the parametric V resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is virtual;
|
||||
|
||||
GetType(me) returns SurfaceType from GeomAbs
|
||||
---Purpose: Returns the type of the surface : Plane, Cylinder,
|
||||
-- Cone, Sphere, Torus, BezierSurface,
|
||||
-- BSplineSurface, SurfaceOfRevolution,
|
||||
-- SurfaceOfExtrusion, OtherSurface
|
||||
is virtual;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Plane(me) returns Pln from gp
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Cylinder(me) returns Cylinder from gp
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Cone(me) returns Cone from gp
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Sphere(me) returns Sphere from gp
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Torus(me) returns Torus from gp
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
UDegree(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
NbUPoles(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
VDegree(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
NbVPoles(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
NbUKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
NbVKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
IsURational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
IsVRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
|
||||
Bezier(me) returns BezierSurface from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
BSpline(me) returns BSplineSurface from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
AxeOfRevolution(me) returns Ax1 from gp
|
||||
raises
|
||||
NoSuchObject from Standard -- only for SurfaceOfRevolution
|
||||
is virtual;
|
||||
|
||||
Direction(me) returns Dir from gp
|
||||
raises
|
||||
NoSuchObject from Standard -- only for SurfaceOfExtrusion
|
||||
is virtual;
|
||||
|
||||
BasisCurve(me) returns HCurve from Adaptor3d
|
||||
raises
|
||||
NoSuchObject from Standard -- only for SurfaceOfExtrusion
|
||||
is virtual;
|
||||
|
||||
BasisSurface(me) returns HSurface from Adaptor3d
|
||||
raises
|
||||
NoSuchObject from Standard -- only for Offset Surface
|
||||
is virtual;
|
||||
|
||||
OffsetValue(me) returns Real from Standard
|
||||
raises
|
||||
NoSuchObject from Standard -- only for Offset Surface
|
||||
is virtual;
|
||||
|
||||
end Surface;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
582
src/Adaptor3d/Adaptor3d_Surface.cxx
Executable file
582
src/Adaptor3d/Adaptor3d_Surface.cxx
Executable file
@@ -0,0 +1,582 @@
|
||||
// File: Adaptor3d_Surface.cxx
|
||||
// Created: Thu Jul 1 16:08:34 1993
|
||||
// Author: Bruno DUMORTIER
|
||||
// <dub@sdsun1>
|
||||
|
||||
|
||||
#include <Adaptor3d_Surface.ixx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
void Adaptor3d_Surface::Delete()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Surface::FirstUParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::FirstUParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Surface::LastUParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::LastUParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Surface::FirstVParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::FirstVParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Surface::LastVParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::LastVParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_Surface::UContinuity() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::UContinuity");
|
||||
return GeomAbs_C0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_Surface::VContinuity() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::VContinuity");
|
||||
return GeomAbs_C0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Integer Adaptor3d_Surface::NbUIntervals(const GeomAbs_Shape S) const
|
||||
Standard_Integer Adaptor3d_Surface::NbUIntervals(const GeomAbs_Shape ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::NbUIntervals");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Integer Adaptor3d_Surface::NbVIntervals(const GeomAbs_Shape S) const
|
||||
Standard_Integer Adaptor3d_Surface::NbVIntervals(const GeomAbs_Shape ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::NbVIntervals");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
void Adaptor3d_Surface::UIntervals(TColStd_Array1OfReal& , const GeomAbs_Shape ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::UIntervals");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
void Adaptor3d_Surface::VIntervals(TColStd_Array1OfReal& , const GeomAbs_Shape ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::VIntervals");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Handle(Adaptor3d_HSurface) Adaptor3d_Surface::UTrim(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_Surface::UTrim(const Standard_Real , const Standard_Real , const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::UTrim");
|
||||
return Handle(Adaptor3d_HSurface)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Handle(Adaptor3d_HSurface) Adaptor3d_Surface::VTrim(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_Surface::VTrim(const Standard_Real , const Standard_Real , const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::VTrim");
|
||||
return Handle(Adaptor3d_HSurface)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Surface::IsUClosed() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::IsUClosed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Surface::IsVClosed() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::IsVClosed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Surface::IsUPeriodic() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::IsUPeriodic");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Surface::UPeriod() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::UPeriod");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Surface::IsVPeriodic() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::IsVPeriodic");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Surface::VPeriod() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::VPeriod");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//gp_Pnt Adaptor3d_Surface::Value(const Standard_Real U, const Standard_Real V) const
|
||||
gp_Pnt Adaptor3d_Surface::Value(const Standard_Real , const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Value");
|
||||
return gp_Pnt();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Surface::D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const
|
||||
void Adaptor3d_Surface::D0(const Standard_Real , const Standard_Real , gp_Pnt& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::D0");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Surface::D1(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const
|
||||
void Adaptor3d_Surface::D1(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::D1");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Surface::D2(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const
|
||||
void Adaptor3d_Surface::D2(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::D2");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor3d_Surface::D3(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const
|
||||
void Adaptor3d_Surface::D3(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::D3");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//gp_Vec Adaptor3d_Surface::DN(const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const
|
||||
gp_Vec Adaptor3d_Surface::DN(const Standard_Real , const Standard_Real , const Standard_Integer , const Standard_Integer ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::DN");
|
||||
return gp_Vec();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Real Adaptor3d_Surface::UResolution(const Standard_Real R3d) const
|
||||
Standard_Real Adaptor3d_Surface::UResolution(const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::UResolution");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Real Adaptor3d_Surface::VResolution(const Standard_Real R3d) const
|
||||
Standard_Real Adaptor3d_Surface::VResolution(const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::VResolution");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_SurfaceType Adaptor3d_Surface::GetType() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::GetType");
|
||||
return GeomAbs_OtherSurface;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pln Adaptor3d_Surface::Plane() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Plane");
|
||||
return gp_Pln();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cylinder Adaptor3d_Surface::Cylinder() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Cylinder");
|
||||
return gp_Cylinder();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Cone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cone Adaptor3d_Surface::Cone() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Cone");
|
||||
return gp_Cone();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Sphere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Sphere Adaptor3d_Surface::Sphere() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Sphere");
|
||||
return gp_Sphere();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Torus Adaptor3d_Surface::Torus() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Torus");
|
||||
return gp_Torus();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Surface::UDegree() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::UDegree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Surface::NbUPoles() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::NbUPoles");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Surface::VDegree() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::VDegree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Surface::NbVPoles() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::NbVPoles");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Surface::NbUKnots() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::NbUKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_Surface::NbVKnots() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::NbVKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Surface::IsURational() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::IsURational");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_Surface::IsVRational() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::IsVRational");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BezierSurface) Adaptor3d_Surface::Bezier() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Bezier");
|
||||
return Handle(Geom_BezierSurface)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) Adaptor3d_Surface::BSpline() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::BSpline");
|
||||
return Handle(Geom_BSplineSurface)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AxeOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax1 Adaptor3d_Surface::AxeOfRevolution() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::AxeOfRevolution");
|
||||
return gp_Ax1();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Dir Adaptor3d_Surface::Direction() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::Direction");
|
||||
return gp_Dir();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) Adaptor3d_Surface::BasisCurve() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::BasisCurve");
|
||||
return Handle(Adaptor3d_HCurve)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_Surface::BasisSurface() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::BasisSurface");
|
||||
return Handle(Adaptor3d_HSurface)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OffsetValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_Surface::OffsetValue() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor3d_Surface::OffsetValue");
|
||||
return 0.;
|
||||
}
|
323
src/Adaptor3d/Adaptor3d_SurfaceOfLinearExtrusion.cdl
Executable file
323
src/Adaptor3d/Adaptor3d_SurfaceOfLinearExtrusion.cdl
Executable file
@@ -0,0 +1,323 @@
|
||||
-- File: Adaptor3d_SurfaceOfLinearExtrusion.cdl
|
||||
-- Created: Wed Apr 21 12:39:17 1993
|
||||
-- Author: Bruno DUMORTIER
|
||||
-- <dub@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class SurfaceOfLinearExtrusion from Adaptor3d inherits Surface from Adaptor3d
|
||||
|
||||
--- Purpose: Generalised cylinder. This surface is obtained by sweeping a curve in a given
|
||||
-- direction. The parametrization range for the parameter U is defined
|
||||
-- with referenced the curve.
|
||||
-- The parametrization range for the parameter V is ]-infinite,+infinite[
|
||||
-- The position of the curve gives the origin for the
|
||||
-- parameter V.
|
||||
-- The continuity of the surface is CN in the V direction.
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
SurfaceType from GeomAbs,
|
||||
Vec from gp,
|
||||
Pnt from gp,
|
||||
Pln from gp,
|
||||
Cone from gp,
|
||||
Cylinder from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp,
|
||||
Ax1 from gp,
|
||||
Dir from gp,
|
||||
BezierSurface from Geom,
|
||||
BSplineSurface from Geom,
|
||||
HSurface from Adaptor3d,
|
||||
HCurve from Adaptor3d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
--
|
||||
-- Methods specific of SurfaceOfLinearExtrusion.
|
||||
--
|
||||
|
||||
Create returns SurfaceOfLinearExtrusion from Adaptor3d;
|
||||
|
||||
|
||||
Create(C : HCurve from Adaptor3d)
|
||||
returns SurfaceOfLinearExtrusion from Adaptor3d;
|
||||
---Purpose: The Curve is loaded.
|
||||
|
||||
Create(C : HCurve from Adaptor3d; V : Dir from gp)
|
||||
returns SurfaceOfLinearExtrusion from Adaptor3d;
|
||||
---Purpose: Thew Curve and the Direction are loaded.
|
||||
|
||||
|
||||
Load( me : in out ; C : HCurve from Adaptor3d)
|
||||
---Purpose: Changes the Curve
|
||||
is static;
|
||||
|
||||
Load( me : in out ; V : Dir from gp)
|
||||
---Purpose: Changes the Direction
|
||||
is static;
|
||||
|
||||
|
||||
--
|
||||
-- Implementation of Surface from Adaptor3d methods.
|
||||
--
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole surface.
|
||||
--
|
||||
|
||||
FirstUParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
LastUParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
FirstVParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
LastVParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
UContinuity(me) returns Shape from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
VContinuity(me) returns Shape from GeomAbs
|
||||
---Purpose: Return CN.
|
||||
is redefined static;
|
||||
|
||||
NbUIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of U intervals for continuity
|
||||
-- <S>. May be one if UContinuity(me) >= <S>
|
||||
is redefined static;
|
||||
|
||||
NbVIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of V intervals for continuity
|
||||
-- <S>. May be one if VContinuity(me) >= <S>
|
||||
is redefined static;
|
||||
|
||||
UIntervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs )
|
||||
---Purpose: Returns the intervals with the requested continuity
|
||||
-- in the U direction.
|
||||
|
||||
raises
|
||||
OutOfRange from Standard -- if Index < 1 or Index > NbIntervals
|
||||
is redefined static;
|
||||
|
||||
VIntervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs )
|
||||
---Purpose: Returns the intervals with the requested continuity
|
||||
-- in the V direction.
|
||||
raises
|
||||
OutOfRange from Standard -- if Index < 1 or Index > NbIntervals
|
||||
is redefined static;
|
||||
|
||||
UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
|
||||
---Purpose: Returns a surface trimmed in the U direction
|
||||
-- equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static ;
|
||||
|
||||
VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
|
||||
---Purpose: Returns a surface trimmed in the V direction between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static ;
|
||||
|
||||
IsUClosed(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
IsVClosed(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
IsUPeriodic(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
UPeriod(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
IsVPeriodic(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
VPeriod(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
Value (me; U, V : Real) returns Pnt from gp
|
||||
--- Purpose : Computes the point of parameters U,V on the surface.
|
||||
is redefined static;
|
||||
|
||||
D0 (me; U, V : Real; P : out Pnt from gp)
|
||||
--- Purpose : Computes the point of parameters U,V on the surface.
|
||||
is redefined static;
|
||||
|
||||
D1 (me; U, V : Real; P : out Pnt from gp; D1U, D1V : out Vec from gp)
|
||||
--- Purpose : Computes the point and the first derivatives on
|
||||
-- the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C1.
|
||||
is redefined static;
|
||||
|
||||
D2 (me; U, V : Real; P : out Pnt from gp; D1U, D1V, D2U, D2V, D2UV : out Vec from gp)
|
||||
--- Purpose : Computes the point, the first and second
|
||||
-- derivatives on the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C2.
|
||||
is redefined static;
|
||||
|
||||
D3 (me; U, V : Real; P : out Pnt from gp;
|
||||
D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec from gp)
|
||||
--- Purpose : Computes the point, the first, second and third
|
||||
-- derivatives on the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C3.
|
||||
is redefined static;
|
||||
|
||||
DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp
|
||||
--- Purpose : Computes the derivative of order Nu in the direction U and Nv
|
||||
-- in the direction V at the point P(U, V).
|
||||
raises DomainError from Standard,
|
||||
--- Purpose : Raised if the current U interval is not not CNu
|
||||
-- and the current V interval is not CNv.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
|
||||
is redefined static;
|
||||
|
||||
UResolution(me; R3d : Real ) returns Real
|
||||
---Purpose : Returns the parametric U resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is redefined static;
|
||||
|
||||
VResolution(me; R3d : Real ) returns Real
|
||||
---Purpose : Returns the parametric V resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is redefined static;
|
||||
|
||||
GetType(me) returns SurfaceType from GeomAbs
|
||||
---Purpose: Returns the type of the surface : Plane, Cylinder,
|
||||
-- Cone, Sphere, Torus, BezierSurface,
|
||||
-- BSplineSurface, SurfaceOfRevolution,
|
||||
-- SurfaceOfExtrusion, OtherSurface
|
||||
is redefined static;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Plane(me) returns Pln from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Cylinder(me) returns Cylinder from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Cone(me) returns Cone from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Sphere(me) returns Sphere from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Torus(me) returns Torus from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
UDegree(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbUPoles(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
VDegree(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbVPoles(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
NbUKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
NbVKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
IsURational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
IsVRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
|
||||
Bezier(me) returns BezierSurface from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
BSpline(me) returns BSplineSurface from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
AxeOfRevolution(me) returns Ax1 from gp
|
||||
raises
|
||||
NoSuchObject from Standard -- only for SurfaceOfRevolution
|
||||
is redefined static;
|
||||
|
||||
Direction(me) returns Dir from gp
|
||||
raises
|
||||
NoSuchObject from Standard -- only for SurfaceOfExtrusion
|
||||
is redefined static;
|
||||
|
||||
BasisCurve(me) returns HCurve from Adaptor3d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
-- Only for SurfaceOfExtrusion and SurfaceOfRevolution
|
||||
is redefined static;
|
||||
|
||||
fields
|
||||
|
||||
myBasisCurve : HCurve from Adaptor3d;
|
||||
myDirection : Dir from gp;
|
||||
|
||||
|
||||
|
||||
end SurfaceOfLinearExtrusion;
|
722
src/Adaptor3d/Adaptor3d_SurfaceOfLinearExtrusion.cxx
Executable file
722
src/Adaptor3d/Adaptor3d_SurfaceOfLinearExtrusion.cxx
Executable file
@@ -0,0 +1,722 @@
|
||||
// File: Adaptor3d_SurfaceOfLinearExtrusion.gxx
|
||||
// Created: Wed Apr 21 15:55:14 1993
|
||||
// Author: Bruno DUMORTIER
|
||||
// <dub@phylox>
|
||||
|
||||
#include <Adaptor3d_SurfaceOfLinearExtrusion.ixx>
|
||||
#include <Adaptor3d_HSurfaceOfLinearExtrusion.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfLinearExtrusion::Adaptor3d_SurfaceOfLinearExtrusion()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfLinearExtrusion::Adaptor3d_SurfaceOfLinearExtrusion
|
||||
(const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
Load( C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfLinearExtrusion::Adaptor3d_SurfaceOfLinearExtrusion
|
||||
(const Handle(Adaptor3d_HCurve)& C,
|
||||
const gp_Dir& V)
|
||||
{
|
||||
Load( C);
|
||||
Load( V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::Load( const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
myBasisCurve = C;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::Load( const gp_Dir& V)
|
||||
{
|
||||
myDirection = V;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::FirstUParameter() const
|
||||
{
|
||||
return myBasisCurve->FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::LastUParameter() const
|
||||
{
|
||||
return myBasisCurve->LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::FirstVParameter() const
|
||||
{
|
||||
return RealFirst();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::LastVParameter() const
|
||||
{
|
||||
return RealLast();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfLinearExtrusion::UContinuity() const
|
||||
{
|
||||
return myBasisCurve->Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfLinearExtrusion::VContinuity() const
|
||||
{
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbUIntervals
|
||||
(const GeomAbs_Shape S) const
|
||||
{
|
||||
return myBasisCurve->NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbVIntervals
|
||||
(const GeomAbs_Shape ) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::UIntervals
|
||||
(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
{
|
||||
myBasisCurve->Intervals(T,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::VIntervals
|
||||
//(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
(TColStd_Array1OfReal& T, const GeomAbs_Shape ) const
|
||||
{
|
||||
T(T.Lower()) = FirstVParameter() ;
|
||||
T(T.Lower() + 1) = LastVParameter() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfLinearExtrusion::VTrim
|
||||
(const Standard_Real First ,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
Handle(Adaptor3d_HCurve) newBasisCurve =
|
||||
myBasisCurve->Trim(First,
|
||||
Last,
|
||||
Tol) ;
|
||||
Adaptor3d_SurfaceOfLinearExtrusion * SurfacePtr =
|
||||
new Adaptor3d_SurfaceOfLinearExtrusion(newBasisCurve, myDirection) ;
|
||||
|
||||
return new Adaptor3d_HSurfaceOfLinearExtrusion(*SurfacePtr);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfLinearExtrusion::UTrim
|
||||
//(const Standard_Real First ,
|
||||
// const Standard_Real Last,
|
||||
// const Standard_Real Tol) const
|
||||
(const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ) const
|
||||
{
|
||||
Adaptor3d_SurfaceOfLinearExtrusion * SurfacePtr =
|
||||
new Adaptor3d_SurfaceOfLinearExtrusion(myBasisCurve,myDirection);
|
||||
|
||||
return new Adaptor3d_HSurfaceOfLinearExtrusion(*SurfacePtr) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsUClosed() const
|
||||
{
|
||||
return myBasisCurve->IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsVClosed() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsUPeriodic() const
|
||||
{
|
||||
return myBasisCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::UPeriod() const
|
||||
{
|
||||
return myBasisCurve->Period() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsVPeriodic() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::VPeriod() const
|
||||
{
|
||||
Standard_DomainError::Raise("Adaptor3d_SurfaceOfLinearExtrusion::VPeriod");
|
||||
return 0.0e0 ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt Adaptor3d_SurfaceOfLinearExtrusion::Value(const Standard_Real U,
|
||||
const Standard_Real V)
|
||||
const
|
||||
{
|
||||
gp_Pnt P;
|
||||
P = myBasisCurve->Value(U);
|
||||
P.Translate( V * gp_Vec(myDirection));
|
||||
return P;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D0(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P) const
|
||||
{
|
||||
myBasisCurve->D0(U,P);
|
||||
P.Translate( V * gp_Vec(myDirection));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D1(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U,
|
||||
gp_Vec& D1V) const
|
||||
{
|
||||
myBasisCurve->D1(U,P,D1U);
|
||||
D0(U,V,P);
|
||||
D1V = gp_Vec(myDirection);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D2(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U, gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V,
|
||||
gp_Vec& D2UV) const
|
||||
{
|
||||
myBasisCurve->D2(U,P,D1U,D2U);
|
||||
D1V = gp_Vec(myDirection);
|
||||
D2V.SetCoord( 0., 0., 0.);
|
||||
D2UV.SetCoord( 0., 0., 0.);
|
||||
D0(U,V,P);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D3(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U, gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V,
|
||||
gp_Vec& D2UV,
|
||||
gp_Vec& D3U, gp_Vec& D3V,
|
||||
gp_Vec& D3UUV, gp_Vec& D3UVV) const
|
||||
{
|
||||
myBasisCurve->D3(U,P,D1U,D2U,D3U);
|
||||
D1V = gp_Vec(myDirection);
|
||||
D2V.SetCoord( 0., 0., 0.);
|
||||
D2UV.SetCoord( 0., 0., 0.);
|
||||
D3V.SetCoord( 0., 0., 0.);
|
||||
D3UUV.SetCoord( 0., 0., 0.);
|
||||
D3UVV.SetCoord( 0., 0., 0.);
|
||||
D0(U,V,P);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Vec Adaptor3d_SurfaceOfLinearExtrusion::DN
|
||||
(const Standard_Real U,
|
||||
// const Standard_Real V,
|
||||
const Standard_Real ,
|
||||
const Standard_Integer NU,
|
||||
const Standard_Integer NV) const
|
||||
{
|
||||
if ( (NU+NV)<1 || NU<0 || NV<0) {
|
||||
Standard_DomainError::Raise("Adaptor3d_SurfaceOfLinearExtrusion::DN");
|
||||
return gp_Vec();
|
||||
}
|
||||
else {
|
||||
if (NU == 0 && NV ==1) return gp_Vec( myDirection);
|
||||
else if (NV == 0) return myBasisCurve->DN(U,NU);
|
||||
else return gp_Vec( 0., 0., 0.);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::UResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return myBasisCurve->Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::VResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return R3d;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_SurfaceType Adaptor3d_SurfaceOfLinearExtrusion::GetType() const
|
||||
{
|
||||
switch ( myBasisCurve->GetType()) {
|
||||
|
||||
case GeomAbs_Line:
|
||||
{
|
||||
gp_Dir D = myBasisCurve->Line().Direction();
|
||||
if (myDirection.IsParallel( D, Precision::Angular())) {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Circle:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Circle()).Axis().Direction();
|
||||
if ( myDirection.IsParallel( D, Precision::Angular())) {
|
||||
return GeomAbs_Cylinder;
|
||||
}
|
||||
// JAG 10.11.95
|
||||
else if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
break;
|
||||
}
|
||||
// JAG 10.11.95
|
||||
|
||||
case GeomAbs_Ellipse:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Ellipse()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Parabola:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Parabola()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Hyperbola:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Hyperbola()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
|
||||
}
|
||||
|
||||
// portage WNT
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pln Adaptor3d_SurfaceOfLinearExtrusion::Plane() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if (GetType() != GeomAbs_Plane,
|
||||
"Adaptor3d_SurfaceOfLinearExtrusion::Plane");
|
||||
/*
|
||||
gp_Pnt P;
|
||||
gp_Vec Ox, Oy;
|
||||
D1( 0., 0., P, Ox, Oy);
|
||||
gp_Ax3 Ax3(P,gp_Dir(Ox^Oy),gp_Dir(Ox));
|
||||
if (gp_Dir(Oy).Dot(Ax3.YDirection())<0.){
|
||||
Ax3.YReverse();
|
||||
}
|
||||
return gp_Pln(Ax3);
|
||||
*/
|
||||
|
||||
gp_Pnt P;
|
||||
gp_Vec D1u, newZ;
|
||||
Standard_Real UFirst = myBasisCurve->FirstParameter();
|
||||
Standard_Real ULast = myBasisCurve->LastParameter();
|
||||
if (Precision::IsNegativeInfinite(UFirst) &&
|
||||
Precision::IsPositiveInfinite(ULast)) {
|
||||
UFirst = -100.;
|
||||
ULast = 100.;
|
||||
}
|
||||
else if (Precision::IsNegativeInfinite(UFirst)) {
|
||||
UFirst = ULast - 200.;
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(ULast)) {
|
||||
ULast = UFirst + 200.;
|
||||
}
|
||||
Standard_Real deltau = (ULast-UFirst)/20.;
|
||||
for (Standard_Integer i =1; i<=21; i++) {
|
||||
Standard_Real prm = UFirst + (i-1)*deltau;
|
||||
myBasisCurve->D1(prm,P,D1u);
|
||||
newZ = D1u.Normalized().Crossed(myDirection);
|
||||
if (newZ.Magnitude() > 1.e-12) break;
|
||||
}
|
||||
gp_Ax3 Ax3(P,gp_Dir(newZ),gp_Dir(D1u));
|
||||
if (myDirection.Dot(Ax3.YDirection())<0.){
|
||||
Ax3.YReverse();
|
||||
}
|
||||
return gp_Pln(Ax3);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cylinder Adaptor3d_SurfaceOfLinearExtrusion::Cylinder() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Cylinder,
|
||||
"Adaptor3d_SurfaceOfLinearExtrusion::Cylinder");
|
||||
|
||||
gp_Circ C = myBasisCurve->Circle() ;
|
||||
gp_Ax3 Ax3(C.Position());
|
||||
if(myDirection.Dot((C.Axis()).Direction())<0.){
|
||||
Ax3.ZReverse();
|
||||
}
|
||||
return gp_Cylinder(Ax3,C.Radius());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cone Adaptor3d_SurfaceOfLinearExtrusion::Cone() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Cone");
|
||||
return gp_Cone();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Sphere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Sphere Adaptor3d_SurfaceOfLinearExtrusion::Sphere() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Sphere");
|
||||
return gp_Sphere();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Torus Adaptor3d_SurfaceOfLinearExtrusion::Torus() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Torus");
|
||||
return gp_Torus();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax1 Adaptor3d_SurfaceOfLinearExtrusion::AxeOfRevolution() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Axes");
|
||||
return gp_Ax1();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::UDegree() const
|
||||
{
|
||||
return myBasisCurve -> Degree();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbUPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbUPoles() const
|
||||
{
|
||||
return myBasisCurve->NbPoles();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : VDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::VDegree() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::VDegree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbVPoles() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::NbVPoles");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbUKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("Adaptor3d_SurfaceOfLinearExtrusion::NbUKnots");
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbVKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::NbVKnots");
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsURational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("Adaptor3d_SurfaceOfLinearExtrusion::IsURational");
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsVRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsVRational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("Adaptor3d_SurfaceOfLinearExtrusion::IsVRational");
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
Handle(Geom_BezierSurface) Adaptor3d_SurfaceOfLinearExtrusion::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Axes");
|
||||
return Handle(Geom_BezierSurface)() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) Adaptor3d_SurfaceOfLinearExtrusion::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Axes");
|
||||
return Handle(Geom_BSplineSurface)() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Dir Adaptor3d_SurfaceOfLinearExtrusion::Direction() const
|
||||
{
|
||||
return myDirection;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) Adaptor3d_SurfaceOfLinearExtrusion::BasisCurve() const
|
||||
{
|
||||
return myBasisCurve;
|
||||
}
|
346
src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cdl
Executable file
346
src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cdl
Executable file
@@ -0,0 +1,346 @@
|
||||
-- File: Adaptor3d_SurfaceOfRevolution.cdl
|
||||
-- Created: Wed Apr 21 12:39:17 1993
|
||||
-- Author: Bruno DUMORTIER
|
||||
-- <dub@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class SurfaceOfRevolution from Adaptor3d inherits Surface from Adaptor3d
|
||||
|
||||
|
||||
--- Purpose : This class defines a complete surface of revolution.
|
||||
-- The surface is obtained by rotating a curve a complete revolution
|
||||
-- about an axis. The curve and the axis must be in the same plane.
|
||||
-- If the curve and the axis are not in the same plane it is always
|
||||
-- possible to be in the previous case after a cylindrical projection
|
||||
-- of the curve in a referenced plane.
|
||||
-- For a complete surface of revolution the parametric range is
|
||||
-- 0 <= U <= 2*PI. --
|
||||
-- The parametric range for V is defined with the revolved curve.
|
||||
-- The origin of the U parametrization is given by the position
|
||||
-- of the revolved curve (reference). The direction of the revolution
|
||||
-- axis defines the positive sense of rotation (trigonometric sense)
|
||||
-- corresponding to the increasing of the parametric value U.
|
||||
-- The derivatives are always defined for the u direction.
|
||||
-- For the v direction the definition of the derivatives depends on
|
||||
-- the degree of continuity of the referenced curve.
|
||||
|
||||
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
SurfaceType from GeomAbs,
|
||||
Vec from gp,
|
||||
Pnt from gp,
|
||||
Pln from gp,
|
||||
Cone from gp,
|
||||
Cylinder from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp,
|
||||
Ax3 from gp,
|
||||
Ax1 from gp,
|
||||
Dir from gp,
|
||||
BezierSurface from Geom,
|
||||
BSplineSurface from Geom,
|
||||
HSurface from Adaptor3d,
|
||||
HCurve from Adaptor3d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
--
|
||||
-- Methods specific of SurfaceOfRevolution.
|
||||
--
|
||||
|
||||
Create returns SurfaceOfRevolution from Adaptor3d;
|
||||
|
||||
|
||||
Create(C : HCurve from Adaptor3d) returns SurfaceOfRevolution from Adaptor3d;
|
||||
---Purpose: The Curve is loaded.
|
||||
|
||||
Create(C : HCurve from Adaptor3d; V : Ax1 from gp)
|
||||
returns SurfaceOfRevolution from Adaptor3d;
|
||||
---Purpose: The Curve and the Direction are loaded.
|
||||
|
||||
|
||||
Load( me : in out ; C : HCurve from Adaptor3d)
|
||||
---Purpose: Changes the Curve
|
||||
is static;
|
||||
|
||||
Load( me : in out ; V : Ax1 from gp)
|
||||
---Purpose: Changes the Direction
|
||||
is static;
|
||||
|
||||
|
||||
AxeOfRevolution( me) returns Ax1 from gp
|
||||
is redefined static;
|
||||
|
||||
|
||||
--
|
||||
-- Implementation of Surface from Adaptor3d methods.
|
||||
--
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole surface.
|
||||
--
|
||||
|
||||
FirstUParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
LastUParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
FirstVParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
LastVParameter(me) returns Real
|
||||
is redefined static;
|
||||
|
||||
UContinuity(me) returns Shape from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
VContinuity(me) returns Shape from GeomAbs
|
||||
---Purpose: Return CN.
|
||||
is redefined static;
|
||||
|
||||
NbUIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of U intervals for continuity
|
||||
-- <S>. May be one if UContinuity(me) >= <S>
|
||||
is redefined static;
|
||||
|
||||
NbVIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: Returns the number of V intervals for continuity
|
||||
-- <S>. May be one if VContinuity(me) >= <S>
|
||||
is redefined static;
|
||||
|
||||
UIntervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs )
|
||||
---Purpose: Returns the intervals with the requested continuity
|
||||
-- in the U direction.
|
||||
raises
|
||||
OutOfRange from Standard -- if the Length of the array does
|
||||
-- have enought slots to accomodate
|
||||
-- the result.
|
||||
is redefined static ;
|
||||
|
||||
VIntervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs )
|
||||
---Purpose: Returns the intervals with the requested continuity
|
||||
-- in the V direction.
|
||||
raises
|
||||
OutOfRange from Standard -- if the Length of the array does
|
||||
-- have enought slots to accomodate
|
||||
-- the result.
|
||||
is redefined static ;
|
||||
|
||||
UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
|
||||
---Purpose: Returns a surface trimmed in the U direction
|
||||
-- equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static ;
|
||||
|
||||
VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
|
||||
---Purpose: Returns a surface trimmed in the V direction between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static ;
|
||||
|
||||
IsUClosed(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
IsVClosed(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
IsUPeriodic(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
UPeriod(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
IsVPeriodic(me) returns Boolean
|
||||
is redefined static;
|
||||
|
||||
VPeriod(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
Value (me; U, V : Real) returns Pnt from gp
|
||||
--- Purpose : Computes the point of parameters U,V on the surface.
|
||||
is redefined static;
|
||||
|
||||
D0 (me; U, V : Real; P : out Pnt from gp)
|
||||
--- Purpose : Computes the point of parameters U,V on the surface.
|
||||
is redefined static;
|
||||
|
||||
D1 (me; U, V : Real; P : out Pnt from gp; D1U, D1V : out Vec from gp)
|
||||
--- Purpose : Computes the point and the first derivatives on
|
||||
-- the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C1.
|
||||
is redefined static;
|
||||
|
||||
D2 (me; U, V : Real;
|
||||
P : out Pnt from gp;
|
||||
D1U, D1V, D2U, D2V, D2UV : out Vec from gp)
|
||||
--- Purpose : Computes the point, the first and second
|
||||
-- derivatives on the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C2.
|
||||
is redefined static;
|
||||
|
||||
D3 (me; U, V : Real;
|
||||
P : out Pnt from gp;
|
||||
D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec from gp)
|
||||
--- Purpose : Computes the point, the first, second and third
|
||||
-- derivatives on the surface.
|
||||
raises DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current
|
||||
-- intervals is not C3.
|
||||
is redefined static;
|
||||
|
||||
DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp
|
||||
--- Purpose : Computes the derivative of order Nu
|
||||
-- in the direction U and Nv in the direction V
|
||||
-- at the point P(U, V).
|
||||
raises DomainError from Standard,
|
||||
--- Purpose : Raised if the current U interval is not not CNu
|
||||
-- and the current V interval is not CNv.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
|
||||
is redefined static;
|
||||
|
||||
UResolution(me; R3d : Real ) returns Real
|
||||
---Purpose : Returns the parametric U resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is redefined static;
|
||||
|
||||
VResolution(me; R3d : Real ) returns Real
|
||||
---Purpose : Returns the parametric V resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is redefined static;
|
||||
|
||||
GetType(me) returns SurfaceType from GeomAbs
|
||||
---Purpose: Returns the type of the surface : Plane, Cylinder,
|
||||
-- Cone, Sphere, Torus, BezierSurface,
|
||||
-- BSplineSurface, SurfaceOfRevolution,
|
||||
-- SurfaceOfExtrusion, OtherSurface
|
||||
is redefined static;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Plane(me) returns Pln from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Cylinder(me) returns Cylinder from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Cone(me) returns Cone from gp
|
||||
raises NoSuchObject from Standard
|
||||
---Purpose : Apex of the Cone = Cone.Position().Location()
|
||||
-- ==> ReferenceRadius = 0.
|
||||
is redefined static;
|
||||
|
||||
Sphere(me) returns Sphere from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Torus(me) returns Torus from gp
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
UDegree(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbUPoles(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
VDegree(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbVPoles(me) returns Integer
|
||||
raises NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbUKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
NbVKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
IsURational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
IsVRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
Bezier(me) returns BezierSurface from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
BSpline(me) returns BSplineSurface from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Axis(me) returns Ax3 from gp
|
||||
raises
|
||||
NoSuchObject from Standard -- only for SurfaceOfRevolution
|
||||
is static;
|
||||
|
||||
Direction(me) returns Dir from gp
|
||||
raises
|
||||
NoSuchObject from Standard -- only for SurfaceOfExtrusion
|
||||
is redefined static;
|
||||
|
||||
BasisCurve(me) returns HCurve from Adaptor3d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
-- Only for SurfaceOfExtrusion and SurfaceOfRevolution
|
||||
is redefined static;
|
||||
fields
|
||||
|
||||
myBasisCurve : HCurve from Adaptor3d;
|
||||
myAxis : Ax1 from gp;
|
||||
myHaveAxis : Boolean from Standard;
|
||||
myAxeRev : Ax3 from gp;
|
||||
|
||||
|
||||
end SurfaceOfRevolution;
|
855
src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cxx
Executable file
855
src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cxx
Executable file
@@ -0,0 +1,855 @@
|
||||
// File: Adaptor3d_SurfaceOfRevolution.gxx
|
||||
// Created: Wed Apr 21 15:55:14 1993
|
||||
// Author: Bruno DUMORTIER
|
||||
// <dub@phylox>
|
||||
|
||||
#include <Adaptor3d_SurfaceOfRevolution.ixx>
|
||||
|
||||
#include <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfRevolution::Adaptor3d_SurfaceOfRevolution()
|
||||
:myHaveAxis(Standard_False)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfRevolution::Adaptor3d_SurfaceOfRevolution
|
||||
(const Handle(Adaptor3d_HCurve)& C)
|
||||
:myHaveAxis(Standard_False)
|
||||
{
|
||||
Load( C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfRevolution::Adaptor3d_SurfaceOfRevolution
|
||||
(const Handle(Adaptor3d_HCurve)& C,
|
||||
const gp_Ax1& V)
|
||||
:myHaveAxis(Standard_False)
|
||||
{
|
||||
Load( C);
|
||||
Load( V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::Load( const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
myBasisCurve = C;
|
||||
if ( myHaveAxis) Load(myAxis); // to evaluate the new myAxeRev.
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::Load( const gp_Ax1& V)
|
||||
{
|
||||
myHaveAxis = Standard_True;
|
||||
myAxis = V;
|
||||
|
||||
// Eval myAxeRev : axe of revolution ( Determination de Ox).
|
||||
gp_Pnt P,Q;
|
||||
gp_Pnt O = myAxis.Location();
|
||||
gp_Dir Ox;
|
||||
gp_Dir Oz = myAxis.Direction();
|
||||
Standard_Boolean yrev = Standard_False;
|
||||
if (myBasisCurve->GetType() == GeomAbs_Line) {
|
||||
if((myBasisCurve->Line().Direction()).Dot(Oz) < 0.){
|
||||
yrev = Standard_True;
|
||||
Oz.Reverse();
|
||||
}
|
||||
}
|
||||
|
||||
if (myBasisCurve->GetType() == GeomAbs_Circle) {
|
||||
Q = P = (myBasisCurve->Circle()).Location();
|
||||
}
|
||||
else {
|
||||
Standard_Real First = myBasisCurve->FirstParameter();
|
||||
P = Value( 0., 0.);// ce qui ne veut pas dire grand chose
|
||||
if ( GetType() == GeomAbs_Cone) {
|
||||
if ( gp_Lin(myAxis).Distance(P) <= Precision::Confusion())
|
||||
Q = ElCLib::Value(1.,myBasisCurve->Line());
|
||||
else
|
||||
Q = P;
|
||||
}
|
||||
else if (Precision::IsInfinite(First))
|
||||
Q = P;
|
||||
else
|
||||
Q = Value( 0., First);
|
||||
}
|
||||
|
||||
gp_Dir DZ = myAxis.Direction();
|
||||
O.SetXYZ( O.XYZ() + ( gp_Vec(O,P) * DZ) * DZ.XYZ());
|
||||
if ( gp_Lin(myAxis).Distance(Q) > Precision::Confusion()) {
|
||||
Ox = gp_Dir(Q.XYZ() - O.XYZ());
|
||||
}
|
||||
else {
|
||||
Standard_Real First = myBasisCurve->FirstParameter();
|
||||
Standard_Real Last = myBasisCurve->LastParameter();
|
||||
Standard_Integer Ratio = 1;
|
||||
Standard_Real Dist;
|
||||
gp_Pnt PP;
|
||||
do {
|
||||
PP = myBasisCurve->Value(First+(Last-First)/Ratio);
|
||||
Dist = gp_Lin(myAxis).Distance(PP);
|
||||
Ratio++;
|
||||
}
|
||||
while ( Dist < Precision::Confusion() && Ratio < 100);
|
||||
|
||||
if ( Ratio >= 100 ) {
|
||||
Standard_ConstructionError::Raise
|
||||
("Adaptor3d_SurfaceOfRevolution : Axe and meridian are confused");
|
||||
}
|
||||
Ox = ( (Oz^gp_Vec(PP.XYZ()-O.XYZ()))^Oz);
|
||||
}
|
||||
|
||||
myAxeRev = gp_Ax3(O,Oz,Ox);
|
||||
|
||||
if (yrev) {
|
||||
myAxeRev.YReverse();
|
||||
}
|
||||
else if (myBasisCurve->GetType() == GeomAbs_Circle) {
|
||||
gp_Dir DC = (myBasisCurve->Circle()).Axis().Direction();
|
||||
if ((Ox.Crossed(Oz)).Dot(DC) < 0.) myAxeRev.ZReverse();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AxeOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax1 Adaptor3d_SurfaceOfRevolution::AxeOfRevolution() const
|
||||
{
|
||||
return myAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::FirstUParameter() const
|
||||
{
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::LastUParameter() const
|
||||
{
|
||||
return 2*PI;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::FirstVParameter() const
|
||||
{
|
||||
return myBasisCurve->FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::LastVParameter() const
|
||||
{
|
||||
return myBasisCurve->LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfRevolution::UContinuity() const
|
||||
{
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfRevolution::VContinuity() const
|
||||
{
|
||||
return myBasisCurve->Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbUIntervals
|
||||
//(const GeomAbs_Shape S) const
|
||||
(const GeomAbs_Shape ) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbVIntervals
|
||||
( const GeomAbs_Shape S) const
|
||||
{
|
||||
return myBasisCurve->NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::UIntervals (TColStd_Array1OfReal& T,
|
||||
// const GeomAbs_Shape S) const
|
||||
const GeomAbs_Shape ) const
|
||||
{
|
||||
T(T.Lower() ) = 0.;
|
||||
T(T.Lower()+1) = 2*PI;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::VIntervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape S) const
|
||||
{
|
||||
myBasisCurve->Intervals(T,S);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfRevolution::UTrim
|
||||
(const Standard_Real
|
||||
#ifndef No_Exception
|
||||
First
|
||||
#endif
|
||||
,const Standard_Real
|
||||
#ifndef No_Exception
|
||||
Last
|
||||
#endif
|
||||
,const Standard_Real
|
||||
#ifndef No_Exception
|
||||
Tol
|
||||
#endif
|
||||
) const
|
||||
{
|
||||
#ifndef No_Exception
|
||||
Standard_Real Eps = Precision::PConfusion();
|
||||
#endif
|
||||
Standard_OutOfRange_Raise_if
|
||||
( Abs(First) > Eps || Abs(Last - 2.*PI) > Eps,
|
||||
"Adaptor3d_SurfaceOfRevolution : UTrim : Parameters out of range");
|
||||
|
||||
Handle(Adaptor3d_HSurfaceOfRevolution) HR =
|
||||
new Adaptor3d_HSurfaceOfRevolution(*this);
|
||||
return HR;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfRevolution::VTrim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
Handle(Adaptor3d_HSurfaceOfRevolution) HR =
|
||||
new Adaptor3d_HSurfaceOfRevolution(*this);
|
||||
Handle(Adaptor3d_HCurve) HC = BasisCurve()->Trim(First,Last,Tol);
|
||||
HR->ChangeSurface().
|
||||
Load(HC);
|
||||
return HR;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsUClosed() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsVClosed() const
|
||||
{
|
||||
return myBasisCurve->IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsUPeriodic() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::UPeriod() const
|
||||
{
|
||||
return 2*PI;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsVPeriodic() const
|
||||
{
|
||||
return myBasisCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::VPeriod() const
|
||||
{
|
||||
return myBasisCurve->Period();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt Adaptor3d_SurfaceOfRevolution::Value(const Standard_Real U,
|
||||
const Standard_Real V) const
|
||||
{
|
||||
gp_Pnt P;
|
||||
myBasisCurve->D0(V,P);
|
||||
P.Rotate( myAxis, U);
|
||||
return P;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D0(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P) const
|
||||
{
|
||||
myBasisCurve->D0(V,P);
|
||||
P.Rotate( myAxis, U);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D1(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P, gp_Vec& D1U,
|
||||
gp_Vec& D1V) const
|
||||
{
|
||||
myBasisCurve->D1(V,P,D1V);
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
|
||||
D0( U,V,P);
|
||||
D1V.Rotate( myAxis, U);
|
||||
D1U = R*(myAxeRev.YDirection());
|
||||
D1U.Rotate( myAxis, U);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D2(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P, gp_Vec& D1U,
|
||||
gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V,
|
||||
gp_Vec& D2UV) const
|
||||
{
|
||||
myBasisCurve->D2(V,P,D1V,D2V);
|
||||
|
||||
gp_Vec D1 = (myAxeRev.YDirection()).Rotated( myAxis, U);
|
||||
gp_Vec D2 = (myAxeRev.XDirection()).Rotated( myAxis, U);
|
||||
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
Standard_Real D1R = D1V * myAxeRev.XDirection(); // D1R = dR/dV
|
||||
// et R=AP*XDirection
|
||||
|
||||
D0( U,V,P);
|
||||
D1V.Rotate( myAxis, U);
|
||||
D2V.Rotate( myAxis, U);
|
||||
D1U = R * D1;
|
||||
D2U = -R * D2;
|
||||
D2UV = D1R * D1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D3(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,gp_Vec& D1U, gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV,
|
||||
gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV,
|
||||
gp_Vec& D3UVV) const
|
||||
{
|
||||
myBasisCurve->D3(V,P,D1V,D2V,D3V);
|
||||
|
||||
gp_Vec D1 = (myAxeRev.YDirection()).Rotated( myAxis, U);
|
||||
gp_Vec D2 = (myAxeRev.XDirection()).Rotated( myAxis, U);
|
||||
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
Standard_Real D1R = D1V * myAxeRev.XDirection(); // D1R = dR/dV et
|
||||
// R=AP*XDirection
|
||||
Standard_Real D2R = D2V * myAxeRev.XDirection();
|
||||
|
||||
D0( U,V,P);
|
||||
D1V.Rotate( myAxis, U);
|
||||
D2V.Rotate( myAxis, U);
|
||||
D3V.Rotate( myAxis, U);
|
||||
D1U = R * D1;
|
||||
D2U = -R * D2;
|
||||
D3U = -R * D1;
|
||||
D2UV = D1R * D1;
|
||||
D3UUV = -D1R * D2;
|
||||
D3UVV = D2R * D1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Vec Adaptor3d_SurfaceOfRevolution::DN(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
const Standard_Integer NU,
|
||||
const Standard_Integer NV) const
|
||||
{
|
||||
if ( (NU+NV)<1 || NU<0 || NV<0) {
|
||||
Standard_DomainError::Raise("Adaptor3d_SurfaceOfRevolution::DN");
|
||||
}
|
||||
else {
|
||||
gp_Vec DNv = myBasisCurve->DN( V, NV);
|
||||
if ( NU == 0) {
|
||||
return DNv.Rotated( myAxis, U);
|
||||
}
|
||||
else {
|
||||
Standard_Real DNR = DNv * myAxeRev.XDirection();
|
||||
gp_Vec DNu = ( myAxeRev.XDirection()).Rotated( myAxis, U + NU*PI/2);
|
||||
return ( DNR * DNu);
|
||||
}
|
||||
}
|
||||
// portage WNT
|
||||
return gp_Vec();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::UResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return Precision::Parametric(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::VResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return myBasisCurve->Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_SurfaceType Adaptor3d_SurfaceOfRevolution::GetType() const
|
||||
{
|
||||
|
||||
Standard_Real TolConf = Precision::Confusion();
|
||||
Standard_Real TolAng = Precision::Angular();
|
||||
switch ( myBasisCurve->GetType()) {
|
||||
|
||||
case GeomAbs_Line:
|
||||
{
|
||||
const gp_Ax1& Axe = (myBasisCurve->Line()).Position();
|
||||
|
||||
if (myAxis.IsParallel(Axe, TolAng)) {
|
||||
return GeomAbs_Cylinder;
|
||||
}
|
||||
else if (myAxis.IsNormal( Axe, TolAng)) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
Standard_Real uf = myBasisCurve->FirstParameter();
|
||||
Standard_Real ul = myBasisCurve->LastParameter();
|
||||
Standard_Boolean istrim = (!Precision::IsInfinite(uf) &&
|
||||
!Precision::IsInfinite(ul));
|
||||
if(istrim){
|
||||
gp_Pnt pf = myBasisCurve->Value(uf);
|
||||
gp_Pnt pl = myBasisCurve->Value(ul);
|
||||
Standard_Real len = pf.Distance(pl);
|
||||
//on calcule la distance projetee sur l axe.
|
||||
gp_Vec vlin(pf,pl);
|
||||
gp_Vec vaxe(myAxis.Direction());
|
||||
Standard_Real projlen = Abs(vaxe.Dot(vlin));
|
||||
Standard_Real aTolConf = len*TolAng;
|
||||
if ((len - projlen) <= aTolConf) {
|
||||
return GeomAbs_Cylinder;
|
||||
}
|
||||
else if (projlen <= aTolConf) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
}
|
||||
gp_Vec V(myAxis.Location(),
|
||||
myBasisCurve->Line().Location());
|
||||
gp_Vec W(Axe.Direction());
|
||||
if (Abs(V.DotCross(myAxis.Direction(),W)) <= TolConf){
|
||||
return GeomAbs_Cone;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfRevolution;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Circle:
|
||||
{
|
||||
const gp_Circ& C = myBasisCurve->Circle();
|
||||
if (!C.Position().IsCoplanar(myAxis,TolConf,TolAng)) {
|
||||
return GeomAbs_SurfaceOfRevolution;
|
||||
}
|
||||
else if( gp_Lin(myAxis).Distance(C.Location()) <= TolConf) {
|
||||
return GeomAbs_Sphere;
|
||||
}
|
||||
else {
|
||||
Standard_Real MajorRadius = gp_Lin(myAxis).Distance(C.Location());
|
||||
if(MajorRadius > C.Radius()) return GeomAbs_Torus;
|
||||
return GeomAbs_SurfaceOfRevolution;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return GeomAbs_SurfaceOfRevolution;
|
||||
}
|
||||
|
||||
// portage WNT
|
||||
return GeomAbs_SurfaceOfRevolution;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pln Adaptor3d_SurfaceOfRevolution::Plane() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Plane, "Adaptor3d_SurfaceOfRevolution:Plane");
|
||||
|
||||
gp_Ax3 Axe = myAxeRev;
|
||||
gp_Pnt P;
|
||||
|
||||
// P = Projection du Point Debut de la generatrice sur l axe de rotation.
|
||||
P.SetXYZ((myAxis.Location()).XYZ() +
|
||||
(Value(0.,0.).XYZ()-(myAxis.Location()).XYZ()).
|
||||
Dot((myAxis.Direction()).XYZ())
|
||||
*(myAxis.Direction()).XYZ());
|
||||
Axe.SetLocation( P);
|
||||
//// modified by jgv, 8.01.03 for OCC1226 ////
|
||||
if (Axe.XDirection().
|
||||
Dot(myBasisCurve->Line().Direction()) >= -Precision::Confusion()) // > 0.
|
||||
Axe.XReverse();
|
||||
//////////////////////////////////////////////
|
||||
|
||||
return gp_Pln( Axe);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cylinder Adaptor3d_SurfaceOfRevolution::Cylinder() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Cylinder, "Adaptor3d_SurfaceOfRevolution::Cylinder");
|
||||
|
||||
gp_Pnt P = Value( 0., 0.);
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
return gp_Cylinder( myAxeRev, R);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cone Adaptor3d_SurfaceOfRevolution::Cone() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( GetType() != GeomAbs_Cone, "Adaptor3d_SurfaceOfRevolution:Cone");
|
||||
|
||||
gp_Ax3 Axe = myAxeRev;
|
||||
gp_Dir ldir = (myBasisCurve->Line()).Direction();
|
||||
Standard_Real Angle = (Axe.Direction()).Angle(ldir);
|
||||
gp_Pnt P0 = Value(0., 0.);
|
||||
Standard_Real R = (Axe.Location()).Distance(P0);
|
||||
if ( R >= Precision::Confusion()) {
|
||||
gp_Pnt O = Axe.Location();
|
||||
gp_Vec OP0(O,P0);
|
||||
Standard_Real t = OP0.Dot(Axe.XDirection());
|
||||
t /= ldir.Dot(Axe.XDirection());
|
||||
OP0.Add(-t * gp_Vec(ldir));
|
||||
if ( OP0.Dot(Axe.Direction()) > 0.) Angle = -Angle;
|
||||
}
|
||||
return gp_Cone( Axe, Angle, R);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Sphere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Sphere Adaptor3d_SurfaceOfRevolution::Sphere() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( GetType() != GeomAbs_Sphere, "Adaptor3d_SurfaceOfRevolution:Sphere");
|
||||
|
||||
gp_Circ C = myBasisCurve->Circle();
|
||||
gp_Ax3 Axe = myAxeRev;
|
||||
Axe.SetLocation( C.Location());
|
||||
return gp_Sphere( Axe, C.Radius());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Torus Adaptor3d_SurfaceOfRevolution::Torus() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Torus, "Adaptor3d_SurfaceOfRevolution:Torus");
|
||||
|
||||
gp_Circ C = myBasisCurve->Circle();
|
||||
Standard_Real MajorRadius = gp_Lin(myAxis).Distance(C.Location());
|
||||
return gp_Torus( myAxeRev, MajorRadius, C.Radius());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::UDegree() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::UDegree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbUPoles() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::NbUPoles");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::VDegree() const
|
||||
{
|
||||
return myBasisCurve->Degree();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbVPoles() const
|
||||
{
|
||||
return myBasisCurve -> NbPoles();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbUKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::NbUKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbVKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::NbVKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsURational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::IsURational");
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsVRational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::IsVRational");
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BezierSurface) Adaptor3d_SurfaceOfRevolution::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("");
|
||||
Handle(Geom_BezierSurface) Dummy;
|
||||
return Dummy;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) Adaptor3d_SurfaceOfRevolution::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("");
|
||||
Handle(Geom_BSplineSurface) Dummy;
|
||||
return Dummy;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax3 Adaptor3d_SurfaceOfRevolution::Axis() const
|
||||
{
|
||||
return myAxeRev;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Dir Adaptor3d_SurfaceOfRevolution::Direction() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("");
|
||||
return gp_Dir();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) Adaptor3d_SurfaceOfRevolution::BasisCurve() const
|
||||
{
|
||||
return myBasisCurve;
|
||||
}
|
273
src/Adaptor3d/Adaptor3d_TopolTool.cdl
Executable file
273
src/Adaptor3d/Adaptor3d_TopolTool.cdl
Executable file
@@ -0,0 +1,273 @@
|
||||
-- File: Adaptor3d_TopolTool.cdl
|
||||
-- Created: Thu Mar 24 12:02:07 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
class TopolTool from Adaptor3d
|
||||
|
||||
---Purpose: This class provides a default topological tool,
|
||||
-- based on the Umin,Vmin,Umax,Vmax of an HSurface
|
||||
-- from Adaptor3d.
|
||||
-- All methods and fields may be redefined when
|
||||
-- inheriting from this class.
|
||||
-- This class is used to instantiate algorithmes
|
||||
-- as Intersection, outlines,...
|
||||
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
uses HSurface from Adaptor3d,
|
||||
HCurve2d from Adaptor2d,
|
||||
HVertex from Adaptor3d,
|
||||
HLine2d from Adaptor2d,
|
||||
Pnt2d from gp,
|
||||
Pnt from gp,
|
||||
State from TopAbs,
|
||||
Orientation from TopAbs,
|
||||
HArray1OfReal from TColStd,
|
||||
Array1OfReal from TColStd
|
||||
|
||||
raises DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
returns mutable TopolTool from Adaptor3d;
|
||||
|
||||
|
||||
Create(Surface: HSurface from Adaptor3d)
|
||||
|
||||
returns mutable TopolTool from Adaptor3d;
|
||||
|
||||
|
||||
Initialize(me: mutable)
|
||||
is virtual;
|
||||
|
||||
Initialize(me: mutable; S: HSurface from Adaptor3d)
|
||||
is virtual;
|
||||
|
||||
|
||||
Initialize(me: mutable; Curve: HCurve2d from Adaptor2d)
|
||||
is virtual;
|
||||
|
||||
|
||||
|
||||
--- Arc iterator
|
||||
|
||||
|
||||
Init(me: mutable)
|
||||
is virtual;
|
||||
|
||||
|
||||
More(me: mutable)
|
||||
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Value(me: mutable)
|
||||
|
||||
returns mutable HCurve2d from Adaptor2d
|
||||
raises DomainError from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Next(me: mutable)
|
||||
is virtual;
|
||||
|
||||
|
||||
--- Vertex iterator
|
||||
|
||||
|
||||
InitVertexIterator(me: mutable)
|
||||
is virtual;
|
||||
|
||||
|
||||
MoreVertex(me: mutable)
|
||||
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Vertex(me: mutable)
|
||||
|
||||
returns mutable HVertex from Adaptor3d
|
||||
raises DomainError from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
NextVertex(me: mutable)
|
||||
is virtual;
|
||||
|
||||
|
||||
--- Other methods
|
||||
|
||||
Classify(me: mutable;
|
||||
P: Pnt2d from gp;
|
||||
Tol: Real from Standard;
|
||||
ReacdreOnPeriodic: Boolean from Standard = Standard_True)
|
||||
|
||||
returns State from TopAbs
|
||||
is virtual;
|
||||
|
||||
IsThePointOn(me: mutable;
|
||||
P: Pnt2d from gp;
|
||||
Tol: Real from Standard;
|
||||
ReacdreOnPeriodic: Boolean from Standard = Standard_True)
|
||||
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Orientation(me: mutable; C: HCurve2d from Adaptor2d)
|
||||
|
||||
---Purpose: If the function returns the orientation of the arc.
|
||||
-- If the orientation is FORWARD or REVERSED, the arc is
|
||||
-- a "real" limit of the surface.
|
||||
-- If the orientation is INTERNAL or EXTERNAL, the arc is
|
||||
-- considered as an arc on the surface.
|
||||
|
||||
returns Orientation from TopAbs
|
||||
is virtual;
|
||||
|
||||
|
||||
Orientation(me: mutable; V: HVertex from Adaptor3d)
|
||||
|
||||
---Purpose: Returns the orientation of the vertex V.
|
||||
-- The vertex has been found with an exploration on
|
||||
-- a given arc. The orientation is the orientation
|
||||
-- of the vertex on this arc.
|
||||
|
||||
returns Orientation from TopAbs
|
||||
is virtual;
|
||||
|
||||
|
||||
Identical(me: mutable; V1,V2: HVertex from Adaptor3d)
|
||||
|
||||
---Purpose: Returns True if the vertices V1 and V2 are identical.
|
||||
-- This method does not take the orientation of the
|
||||
-- vertices in account.
|
||||
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Has3d(me)
|
||||
---Purpose: answers if arcs and vertices may have 3d representations,
|
||||
-- so that we could use Tol3d and Pnt methods.
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Tol3d(me; C: HCurve2d from Adaptor2d)
|
||||
---Purpose: returns 3d tolerance of the arc C
|
||||
returns Real from Standard
|
||||
raises DomainError from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Tol3d(me; V: HVertex from Adaptor3d)
|
||||
---Purpose: returns 3d tolerance of the vertex V
|
||||
returns Real from Standard
|
||||
raises DomainError from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Pnt(me; V: HVertex from Adaptor3d)
|
||||
---Purpose: returns 3d point of the vertex V
|
||||
returns Pnt from gp
|
||||
raises DomainError from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
--- sample points tools
|
||||
|
||||
ComputeSamplePoints(me: mutable)
|
||||
is virtual;
|
||||
|
||||
|
||||
NbSamplesU(me: mutable)
|
||||
---Purpose: compute the sample-points for the intersections algorithms
|
||||
returns Integer from Standard
|
||||
is virtual;
|
||||
|
||||
NbSamplesV(me: mutable)
|
||||
---Purpose: compute the sample-points for the intersections algorithms
|
||||
returns Integer from Standard
|
||||
is virtual;
|
||||
|
||||
NbSamples(me: mutable)
|
||||
---Purpose: compute the sample-points for the intersections algorithms
|
||||
returns Integer from Standard
|
||||
is virtual;
|
||||
|
||||
UParameters(me; theArray: out Array1OfReal from TColStd);
|
||||
---Purpose: return the set of U parameters on the surface
|
||||
-- obtained by the method SamplePnts
|
||||
|
||||
VParameters(me; theArray: out Array1OfReal from TColStd);
|
||||
---Purpose: return the set of V parameters on the surface
|
||||
-- obtained by the method SamplePnts
|
||||
|
||||
SamplePoint(me: mutable; Index: Integer from Standard;
|
||||
P2d : out Pnt2d from gp;
|
||||
P3d : out Pnt from gp)
|
||||
is virtual;
|
||||
|
||||
DomainIsInfinite(me: mutable)
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
--modified by NIZNHY-PKV Mon Apr 23 15:54:51 2001 f
|
||||
Edge (me)
|
||||
returns Address from Standard
|
||||
is virtual;
|
||||
--modified by NIZNHY-PKV Mon Apr 23 15:54:46 2001 t
|
||||
|
||||
--modified by NIZNHY-IFV Mon Sep 16 16:01:38 2005 f
|
||||
|
||||
SamplePnts(me: mutable; theDefl: Real from Standard; theNUmin, theNVmin: Integer from Standard)
|
||||
---Purpose: compute the sample-points for the intersections algorithms
|
||||
-- by adaptive algorithm for BSpline surfaces. For other surfaces algorithm
|
||||
-- is the same as in method ComputeSamplePoints(), but only fill arrays of U
|
||||
-- and V sample parameters;
|
||||
-- theDefl is a requred deflection
|
||||
-- theNUmin, theNVmin are minimal nb points for U and V.
|
||||
is virtual;
|
||||
|
||||
BSplSamplePnts(me: mutable; theDefl: Real from Standard; theNUmin, theNVmin: Integer from Standard)
|
||||
---Purpose: compute the sample-points for the intersections algorithms
|
||||
-- by adaptive algorithm for BSpline surfaces - is used in SamplePnts
|
||||
-- theDefl is a requred deflection
|
||||
-- theNUmin, theNVmin are minimal nb points for U and V.
|
||||
is virtual;
|
||||
|
||||
IsUniformSampling(me)
|
||||
---Purpose: Returns true if provide uniform sampling of points.
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
fields
|
||||
|
||||
nbRestr : Integer from Standard;
|
||||
idRestr : Integer from Standard;
|
||||
Uinf : Real from Standard;
|
||||
Usup : Real from Standard;
|
||||
Vinf : Real from Standard;
|
||||
Vsup : Real from Standard;
|
||||
myRestr : HLine2d from Adaptor2d [4];
|
||||
nbVtx : Integer from Standard;
|
||||
idVtx : Integer from Standard;
|
||||
myVtx : HVertex from Adaptor3d [2];
|
||||
|
||||
myS : HSurface from Adaptor3d is protected;
|
||||
myNbSamplesU : Integer from Standard is protected;
|
||||
myNbSamplesV : Integer from Standard is protected;
|
||||
|
||||
myUPars : HArray1OfReal from TColStd is protected;
|
||||
myVPars : HArray1OfReal from TColStd is protected;
|
||||
|
||||
end TopolTool;
|
1245
src/Adaptor3d/Adaptor3d_TopolTool.cxx
Executable file
1245
src/Adaptor3d/Adaptor3d_TopolTool.cxx
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user