mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
184
src/BndLib/BndLib.cdl
Executable file
184
src/BndLib/BndLib.cdl
Executable file
@@ -0,0 +1,184 @@
|
||||
-- File: BndLib.cdl
|
||||
-- Created: Thu Jul 8 11:05:36 1993
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@sdsun2>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
package BndLib
|
||||
|
||||
---Purpose: The BndLib package provides functions to add a geometric primitive to a bounding box.
|
||||
-- Note: these functions work with gp objects, optionally
|
||||
-- limited by parameter values. If the curves and surfaces
|
||||
-- provided by the gp package are not explicitly
|
||||
-- parameterized, they still have an implicit parameterization,
|
||||
-- similar to that which they infer for the equivalent Geom or Geom2d objects.
|
||||
-- Add : Package to compute the bounding boxes for elementary
|
||||
-- objects from gp in 2d and 3d .
|
||||
--
|
||||
-- AddCurve2d : A class to compute the bounding box for a curve
|
||||
-- in 2d dimensions ;the curve is defined by a tool
|
||||
--
|
||||
-- AddCurve : A class to compute the bounding box for a curve
|
||||
-- in 3d dimensions ;the curve is defined by a tool
|
||||
--
|
||||
-- AddSurface : A class to compute the bounding box for a surface.
|
||||
-- The surface is defined by a tool for the geometry and another
|
||||
-- tool for the topology (only the edges in 2d dimensions)
|
||||
|
||||
---Level : Public.
|
||||
-- All methods of all classes will be public.
|
||||
|
||||
|
||||
uses TColgp,Bnd,gp,GeomAbs,Standard, Geom2d, Geom, Adaptor3d ,Adaptor2d
|
||||
|
||||
is
|
||||
class Add3dCurve;
|
||||
---Purpose: Bounding box for a curve in 3d.
|
||||
|
||||
class Add2dCurve;
|
||||
---Purpose: Bounding box for a curve in 2d.
|
||||
|
||||
class AddSurface;
|
||||
---Purpose: Bounding box for a surface trimmed or not
|
||||
|
||||
Add(L : Lin from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: Adds the segment of the line L limited by the two
|
||||
-- parameter values P1 and P2, to the bounding box B, and
|
||||
-- then enlarges B by the tolerance value Tol.
|
||||
-- Tol is the tolerance value to enlarge the minimun and maximum dimension
|
||||
-- P1 and P2 may represent infinite values.
|
||||
-- Exceptions
|
||||
-- Standard_Failure if P1 and P2 are either two negative
|
||||
-- infinite real numbers, or two positive infinite real numbers.
|
||||
|
||||
|
||||
Add(L : Lin2d from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box2d from Bnd);
|
||||
|
||||
|
||||
Add(C : Circ from gp; Tol : Real from Standard; B :in out Box from Bnd);
|
||||
|
||||
Add(C : Circ from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: P2-P1 can be in [0,2*pi]
|
||||
|
||||
Add(C : Circ2d from gp; Tol : Real from Standard;
|
||||
B : in out Box2d from Bnd);
|
||||
|
||||
Add(C : Circ2d from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box2d from Bnd);
|
||||
---Purpose: Adds the circle C, or the arc of the circle C
|
||||
-- limited by the two parameter values P1 and P2,
|
||||
-- to the bounding box B, and then enlarges B by the tolerance value Tol.
|
||||
-- P2-P1 can be in [0,2*pi]
|
||||
|
||||
Add(C : Elips from gp; Tol : Real from Standard; B :in out Box from Bnd);
|
||||
|
||||
Add(C : Elips from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: P2-P1 can be in [0,2*pi]
|
||||
|
||||
Add(C : Elips2d from gp; Tol : Real from Standard;
|
||||
B : in out Box2d from Bnd);
|
||||
|
||||
Add(C : Elips2d from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box2d from Bnd);
|
||||
---Purpose: Adds the ellipse E, or the arc of the ellipse E
|
||||
-- limited by the two parameter values P1 and P2,
|
||||
-- to the bounding box B, and then enlarges B by the tolerance value Tol.
|
||||
-- P2-P1 can be in [0,2*pi]
|
||||
|
||||
Add(P : Parab from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
|
||||
Add(P : Parab2d from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box2d from Bnd);
|
||||
--- Purpose: Adds the arc of the parabola P limited by the two
|
||||
-- parameter values P1 and P2, to the bounding box B, and
|
||||
-- then enlarges B by the tolerance value Tol.
|
||||
-- P1 and P2 may represent infinite values.
|
||||
-- Exceptions
|
||||
-- Standard_Failure if P1 and P2 are either two negative
|
||||
-- infinite real numbers, or two positive infinite real numbers.
|
||||
|
||||
Add(H : Hypr from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
|
||||
Add(H : Hypr2d from gp; P1,P2 : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box2d from Bnd);
|
||||
---Purpose: Adds the arc of the branch of hyperbola H limited by the
|
||||
-- two parameter values P1 and P2, to the bounding box B,
|
||||
-- and then enlarges B by the tolerance value Tol.
|
||||
-- P1 and P2 may represent infinite values.
|
||||
-- Exceptions
|
||||
-- Standard_Failure if P1 and P2 are either two negative
|
||||
-- infinite real numbers, or two positive infinite real numbers.
|
||||
|
||||
Add(S : Cylinder from gp; UMin,UMax,VMin,VMax : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: UMax -UMin can be in [0,2*pi]
|
||||
|
||||
Add(S : Cylinder from gp; VMin,VMax : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: Adds to the bounding box B, the patch of the cylinder S limited
|
||||
-- - in the v parametric direction, by the two parameter
|
||||
-- values VMin and VMax
|
||||
-- - and optionally in the u parametric direction, by the two
|
||||
-- parameter values UMin and UMax.
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- VMin and VMax may represent infinite values.
|
||||
-- Exceptions
|
||||
-- Standard_Failure if VMin and VMax are either two
|
||||
-- negative infinite real numbers, or two positive infinite real numbers.
|
||||
|
||||
Add(S : Cone from gp; UMin,UMax,VMin,VMax : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: UMax-UMin can be in [0,2*pi]
|
||||
|
||||
Add(S : Cone from gp; VMin,VMax : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: Adds to the bounding box B, the patch of the cone S limited
|
||||
-- - in the v parametric direction, by the two parameter
|
||||
-- values VMin and VMax
|
||||
-- - and optionally in the u parametric direction, by the two
|
||||
-- parameter values UMin and UMax,
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- VMin and VMax may represent infinite values.
|
||||
-- Exceptions
|
||||
-- Standard_Failure if VMin and VMax are either two
|
||||
-- negative infinite real numbers, or two positive infinite real numbers.
|
||||
|
||||
Add(S : Sphere from gp; Tol : Real from Standard;
|
||||
B : in out Box from Bnd);
|
||||
|
||||
Add(S : Sphere from gp; UMin,UMax,VMin,VMax : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: Adds to the bounding box B the sphere S, or
|
||||
-- - the patch of the sphere S, limited in the u parametric
|
||||
-- direction, by the two parameter values UMin and UMax,
|
||||
-- and in the v parametric direction, by the two parameter
|
||||
-- values VMin and VMax.
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- UMax-UMin can be in [0,2*pi]
|
||||
-- VMin,VMax can be [-pi/2,pi/2]
|
||||
|
||||
Add(P : Torus from gp; Tol : Real from Standard;
|
||||
B : in out Box from Bnd);
|
||||
|
||||
Add(P : Torus from gp; UMin,UMax,VMin,VMax : Real from Standard;
|
||||
Tol : Real from Standard; B : in out Box from Bnd);
|
||||
---Purpose: Adds to the bounding box B
|
||||
-- - the torus S, or
|
||||
-- - the patch of the torus S, limited in the u parametric
|
||||
-- direction, by the two parameter values UMin and UMax,
|
||||
-- and in the v parametric direction, by the two parameter
|
||||
-- values VMin and VMax.
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- UMax-UMin can be in [0,2*pi],
|
||||
-- VMin,VMax can be [-pi/2,pi/2]
|
||||
|
||||
end BndLib;
|
||||
|
824
src/BndLib/BndLib.cxx
Executable file
824
src/BndLib/BndLib.cxx
Executable file
@@ -0,0 +1,824 @@
|
||||
#include <BndLib.ixx> // BUG BUG BUG pas .hxx
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_XY.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <BndLib_Compute.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
|
||||
|
||||
static void OpenMin(const gp_Dir& V,Bnd_Box& B) {
|
||||
gp_Dir OX(1.,0.,0.);
|
||||
gp_Dir OY(0.,1.,0.);
|
||||
gp_Dir OZ(0.,0.,1.);
|
||||
if (V.IsParallel(OX,Precision::Angular()))
|
||||
B.OpenXmin();
|
||||
else if (V.IsParallel(OY,Precision::Angular()))
|
||||
B.OpenYmin();
|
||||
else if (V.IsParallel(OZ,Precision::Angular()))
|
||||
B.OpenZmin();
|
||||
else {
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
}
|
||||
}
|
||||
|
||||
static void OpenMax(const gp_Dir& V,Bnd_Box& B) {
|
||||
gp_Dir OX(1.,0.,0.);
|
||||
gp_Dir OY(0.,1.,0.);
|
||||
gp_Dir OZ(0.,0.,1.);
|
||||
if (V.IsParallel(OX,Precision::Angular()))
|
||||
B.OpenXmax();
|
||||
else if (V.IsParallel(OY,Precision::Angular()))
|
||||
B.OpenYmax();
|
||||
else if (V.IsParallel(OZ,Precision::Angular()))
|
||||
B.OpenZmax();
|
||||
else {
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
}
|
||||
|
||||
static void OpenMinMax(const gp_Dir& V,Bnd_Box& B) {
|
||||
gp_Dir OX(1.,0.,0.);
|
||||
gp_Dir OY(0.,1.,0.);
|
||||
gp_Dir OZ(0.,0.,1.);
|
||||
if (V.IsParallel(OX,Precision::Angular())) {
|
||||
B.OpenXmax();B.OpenXmin();
|
||||
}
|
||||
else if (V.IsParallel(OY,Precision::Angular())) {
|
||||
B.OpenYmax();B.OpenYmin();
|
||||
}
|
||||
else if (V.IsParallel(OZ,Precision::Angular())) {
|
||||
B.OpenZmax();B.OpenZmin();
|
||||
}
|
||||
else {
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
}
|
||||
|
||||
static void OpenMin(const gp_Dir2d& V,Bnd_Box2d& B) {
|
||||
gp_Dir2d OX(1.,0.);
|
||||
gp_Dir2d OY(0.,1.);
|
||||
if (V.IsParallel(OX,Precision::Angular()))
|
||||
B.OpenXmin();
|
||||
else if (V.IsParallel(OY,Precision::Angular()))
|
||||
B.OpenYmin();
|
||||
else {
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
}
|
||||
}
|
||||
|
||||
static void OpenMax(const gp_Dir2d& V,Bnd_Box2d& B) {
|
||||
gp_Dir2d OX(1.,0.);
|
||||
gp_Dir2d OY(0.,1.);
|
||||
if (V.IsParallel(OX,Precision::Angular()))
|
||||
B.OpenXmax();
|
||||
else if (V.IsParallel(OY,Precision::Angular()))
|
||||
B.OpenYmax();
|
||||
else {
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
}
|
||||
|
||||
static void OpenMinMax(const gp_Dir2d& V,Bnd_Box2d& B) {
|
||||
gp_Dir2d OX(1.,0.);
|
||||
gp_Dir2d OY(0.,1.);
|
||||
if (V.IsParallel(OX,Precision::Angular())) {
|
||||
B.OpenXmax();B.OpenXmin();
|
||||
}
|
||||
else if (V.IsParallel(OY,Precision::Angular())) {
|
||||
B.OpenYmax();B.OpenYmin();
|
||||
}
|
||||
else {
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BndLib::Add( const gp_Lin& L,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
if (Precision::IsNegativeInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
OpenMinMax(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(0.,L));
|
||||
}
|
||||
else {
|
||||
OpenMin(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(P2,L));
|
||||
}
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
OpenMinMax(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(0.,L));
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
OpenMax(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(P2,L));
|
||||
}
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P1,L));
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
OpenMin(L.Direction(),B);
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)){
|
||||
OpenMax(L.Direction(),B);
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,L));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Lin2d& L,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box2d& B) {
|
||||
|
||||
if (Precision::IsNegativeInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
OpenMinMax(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(0.,L));
|
||||
}
|
||||
else {
|
||||
OpenMin(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(P2,L));
|
||||
}
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
OpenMinMax(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(0.,L));
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
OpenMax(L.Direction(),B);
|
||||
B.Add(ElCLib::Value(P2,L));
|
||||
}
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P1,L));
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
OpenMin(L.Direction(),B);
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)){
|
||||
OpenMax(L.Direction(),B);
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,L));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Circ& C,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Standard_Real R = C.Radius();
|
||||
gp_XYZ O = C.Location().XYZ();
|
||||
gp_XYZ Xd = C.XAxis().Direction().XYZ();
|
||||
gp_XYZ Yd = C.YAxis().Direction().XYZ();
|
||||
B.Add(gp_Pnt(O -R*Xd -R*Yd));
|
||||
B.Add(gp_Pnt(O -R*Xd +R*Yd));
|
||||
B.Add(gp_Pnt(O +R*Xd -R*Yd));
|
||||
B.Add(gp_Pnt(O +R*Xd +R*Yd));
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Circ& C,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Compute(P1,P2,C.Radius(),C.Radius(),C.XAxis().Direction().XYZ(),
|
||||
C.YAxis().Direction().XYZ(),C.Location().XYZ(),B);
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Circ2d& C,const Standard_Real Tol, Bnd_Box2d& B) {
|
||||
|
||||
Standard_Real R = C.Radius();
|
||||
gp_XY O = C.Location().XY();
|
||||
gp_XY Xd = C.XAxis().Direction().XY();
|
||||
gp_XY Yd = C.YAxis().Direction().XY();
|
||||
B.Add(gp_Pnt2d(O -R*Xd -R*Yd));
|
||||
B.Add(gp_Pnt2d(O -R*Xd +R*Yd));
|
||||
B.Add(gp_Pnt2d(O +R*Xd -R*Yd));
|
||||
B.Add(gp_Pnt2d(O +R*Xd +R*Yd));
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add(const gp_Circ2d& C,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box2d& B) {
|
||||
|
||||
Compute(P1,P2,C.Radius(),C.Radius(),C.XAxis().Direction().XY(),
|
||||
C.YAxis().Direction().XY(),C.Location().XY(),B);
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Elips& C,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Standard_Real Ra = C.MajorRadius();
|
||||
Standard_Real Rb = C.MinorRadius();
|
||||
gp_XYZ Xd = C.XAxis().Direction().XYZ();
|
||||
gp_XYZ Yd = C.YAxis().Direction().XYZ();
|
||||
gp_XYZ O = C.Location().XYZ();
|
||||
B.Add(gp_Pnt(O +Ra*Xd +Rb*Yd));
|
||||
B.Add(gp_Pnt(O -Ra*Xd +Rb*Yd));
|
||||
B.Add(gp_Pnt(O -Ra*Xd -Rb*Yd));
|
||||
B.Add(gp_Pnt(O +Ra*Xd -Rb*Yd));
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Elips& C,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Compute(P1,P2,C.MajorRadius(),C.MinorRadius(),C.XAxis().Direction().XYZ(),
|
||||
C.YAxis().Direction().XYZ(),C.Location().XYZ(),B);
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Elips2d& C,const Standard_Real Tol, Bnd_Box2d& B) {
|
||||
|
||||
Standard_Real Ra= C.MajorRadius();
|
||||
Standard_Real Rb= C.MinorRadius();
|
||||
gp_XY Xd = C.XAxis().Direction().XY();
|
||||
gp_XY Yd = C.YAxis().Direction().XY();
|
||||
gp_XY O = C.Location().XY();
|
||||
B.Add(gp_Pnt2d(O +Ra*Xd +Rb*Yd));
|
||||
B.Add(gp_Pnt2d(O -Ra*Xd +Rb*Yd));
|
||||
B.Add(gp_Pnt2d(O -Ra*Xd -Rb*Yd));
|
||||
B.Add(gp_Pnt2d(O +Ra*Xd -Rb*Yd));
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Elips2d& C,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box2d& B) {
|
||||
|
||||
Compute(P1,P2,C.MajorRadius(),C.MinorRadius(),
|
||||
C.XAxis().Direction().XY(),
|
||||
C.YAxis().Direction().XY(),C.Location().XY(),B);
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Parab& P,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
if (Precision::IsNegativeInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,P));
|
||||
}
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,P));
|
||||
}
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P1,P));
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)){
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,P));
|
||||
if (P1*P2<0) B.Add(ElCLib::Value(0.,P));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Parab2d& P,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box2d& B) {
|
||||
|
||||
if (Precision::IsNegativeInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,P));
|
||||
}
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,P));
|
||||
}
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P1,P));
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)){
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,P));
|
||||
if (P1*P2<0) B.Add(ElCLib::Value(0.,P));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Hypr& H,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
if (Precision::IsNegativeInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,H));
|
||||
}
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,H));
|
||||
}
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P1,H));
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();B.OpenZmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)){
|
||||
B.OpenXmax();B.OpenYmax();B.OpenZmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,H));
|
||||
if (P1*P2<0) B.Add(ElCLib::Value(0.,H));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add(const gp_Hypr2d& H,const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Tol, Bnd_Box2d& B) {
|
||||
|
||||
if (Precision::IsNegativeInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,H));
|
||||
}
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P1)) {
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,H));
|
||||
}
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P1,H));
|
||||
if (Precision::IsNegativeInfinite(P2)) {
|
||||
B.OpenXmin();B.OpenYmin();
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(P2)){
|
||||
B.OpenXmax();B.OpenYmax();
|
||||
}
|
||||
else {
|
||||
B.Add(ElCLib::Value(P2,H));
|
||||
if (P1*P2<0) B.Add(ElCLib::Value(0.,H));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Cylinder& S,const Standard_Real UMin,
|
||||
const Standard_Real UMax,const Standard_Real VMin,
|
||||
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
if (Precision::IsNegativeInfinite(VMin)) {
|
||||
if (Precision::IsNegativeInfinite(VMax)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMax)) {
|
||||
OpenMinMax(S.Axis().Direction(),B);
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() + VMax*S.Axis().Direction().XYZ(),B);
|
||||
OpenMin(S.Axis().Direction(),B);
|
||||
}
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMin)) {
|
||||
if (Precision::IsNegativeInfinite(VMax)) {
|
||||
OpenMinMax(S.Axis().Direction(),B);
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMax)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() + VMax*S.Axis().Direction().XYZ(),B);
|
||||
OpenMax(S.Axis().Direction(),B);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() + VMin*S.Axis().Direction().XYZ(),B);
|
||||
if (Precision::IsNegativeInfinite(VMax)) {
|
||||
OpenMin(S.Axis().Direction(),B);
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMax)) {
|
||||
OpenMax(S.Axis().Direction(),B);
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() + VMax*S.Axis().Direction().XYZ(),B);
|
||||
}
|
||||
}
|
||||
|
||||
B.Enlarge(Tol);
|
||||
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Cylinder& S,const Standard_Real VMin,
|
||||
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
BndLib::Add(S,0.,2.*PI,VMin,VMax,Tol,B);
|
||||
}
|
||||
|
||||
void BndLib::Add(const gp_Cone& S,const Standard_Real UMin,
|
||||
const Standard_Real UMax,const Standard_Real VMin,
|
||||
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Standard_Real R = S.RefRadius();
|
||||
Standard_Real A = S.SemiAngle();
|
||||
if (Precision::IsNegativeInfinite(VMin)) {
|
||||
if (Precision::IsNegativeInfinite(VMax)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMax)) {
|
||||
gp_Dir D(Cos(A)*S.Axis().Direction());
|
||||
OpenMinMax(D,B);
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,R+VMax*Sin(A),R+VMax*Sin(A),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() +
|
||||
VMax*Cos(A)*S.Axis().Direction().XYZ(),B);
|
||||
gp_Dir D(Cos(A)*S.Axis().Direction());
|
||||
OpenMin(D,B);
|
||||
}
|
||||
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMin)) {
|
||||
if (Precision::IsNegativeInfinite(VMax)) {
|
||||
gp_Dir D(Cos(A)*S.Axis().Direction());
|
||||
OpenMinMax(D,B);
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMax)) {
|
||||
Standard_Failure::Raise("BndLib::bad parameter");
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,R+VMax*Sin(A),R+VMax*Sin(A),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() +
|
||||
VMax*Cos(A)*S.Axis().Direction().XYZ(),B);
|
||||
gp_Dir D(Cos(A)*S.Axis().Direction());
|
||||
OpenMax(D,B);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,R+VMin*Sin(A),R+VMin*Sin(A),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() +
|
||||
VMin*Cos(A)*S.Axis().Direction().XYZ(),B);
|
||||
if (Precision::IsNegativeInfinite(VMax)) {
|
||||
gp_Dir D(Cos(A)*S.Axis().Direction());
|
||||
OpenMin(D,B);
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(VMax)) {
|
||||
gp_Dir D(Cos(A)*S.Axis().Direction());
|
||||
OpenMax(D,B);
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,R+VMax*Sin(A),R+VMax*Sin(A),
|
||||
S.XAxis().Direction().XYZ(),
|
||||
S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() +
|
||||
VMax*Cos(A)*S.Axis().Direction().XYZ(),B);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Cone& S,const Standard_Real VMin,
|
||||
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
BndLib::Add(S,0.,2.*PI,VMin,VMax,Tol,B);
|
||||
}
|
||||
|
||||
void BndLib::Add(const gp_Sphere& S,const Standard_Real UMin,
|
||||
const Standard_Real UMax,const Standard_Real VMin,
|
||||
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
|
||||
//------------------------------------------------------------
|
||||
//-- lbr le 26 novembre 97
|
||||
//-- je ne comprends pas comment ce code marche
|
||||
//-- et en plus il ne marche pas sur certains cas
|
||||
//-- Temporairement on choisit une solution plus simple.
|
||||
//------------------------------------------------------------
|
||||
#if 0
|
||||
Standard_Real Fi1;
|
||||
Standard_Real Fi2;
|
||||
if (VMax<VMin) {
|
||||
Fi1 = VMax;
|
||||
Fi2 = VMin;
|
||||
}
|
||||
else {
|
||||
Fi1 = VMin;
|
||||
Fi2 = VMax;
|
||||
}
|
||||
|
||||
if (-Fi1>Precision::Angular()) {
|
||||
if (-Fi2>Precision::Angular()) {
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ(),B);
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ()- S.Radius()*S.Position().Axis().Direction().XYZ(),B);
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ()+ S.Radius()*S.Position().Axis().Direction().XYZ(),B);
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ()- S.Radius()*S.Position().Axis().Direction().XYZ(),B);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ(),B);
|
||||
Compute(UMin,UMax,S.Radius(),S.Radius(),
|
||||
S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),
|
||||
S.Location().XYZ() +S.Radius()*S.Position().Axis().Direction().XYZ(),B);
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
#else
|
||||
Standard_Real u,v,du,dv;
|
||||
Standard_Integer iu,iv;
|
||||
du = (UMax-UMin)/10;
|
||||
dv = (VMax-VMin)/10;
|
||||
Standard_Real COSV[11];
|
||||
Standard_Real SINV[11];
|
||||
for(iv=0,v=VMin;iv<=10;iv++) {
|
||||
COSV[iv]=cos(v);
|
||||
SINV[iv]=sin(v);
|
||||
v+=dv;
|
||||
}
|
||||
for(u=UMin,iu=0; iu<=10 ; iu++) {
|
||||
Standard_Real Radiuscosu=S.Radius()*cos(u);
|
||||
Standard_Real Radiussinu=S.Radius()*sin(u);
|
||||
for(v=VMin,iv=0; iv<=10 ; iv++) {
|
||||
Standard_Real sinv=SINV[iv];
|
||||
Standard_Real cosv=COSV[iv];
|
||||
gp_XYZ M;
|
||||
M.SetLinearForm (cosv*Radiuscosu, S.Position().XDirection().XYZ(),
|
||||
cosv*Radiussinu, S.Position().YDirection().XYZ(),
|
||||
S.Radius()*sinv, S.Position().Direction().XYZ() ,
|
||||
S.Position().Location().XYZ() );
|
||||
//-- static int t=0;
|
||||
//-- cout<<"point p"<<++t<<" "<<M.X()<<" "<<M.Y()<<" "<<M.Z()<<endl;
|
||||
B.Add(gp_Pnt(M));
|
||||
v+=dv;
|
||||
}
|
||||
u+=du;
|
||||
}
|
||||
|
||||
Standard_Real Maxduv = Max(du,dv)*0.5;
|
||||
Standard_Real Fleche = S.Radius() * (1 - cos(Maxduv));
|
||||
B.Enlarge(Fleche);
|
||||
B.Enlarge(10*Tol);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BndLib::Add( const gp_Sphere& S,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Standard_Real R = S.Radius();
|
||||
gp_XYZ O = S.Location().XYZ();
|
||||
gp_XYZ Xd = S.XAxis().Direction().XYZ();
|
||||
gp_XYZ Yd = S.YAxis().Direction().XYZ();
|
||||
gp_XYZ Zd = S.Position().Axis().Direction().XYZ();
|
||||
B.Add(gp_Pnt(O -R*Xd -R*Yd+ R*Zd));
|
||||
B.Add(gp_Pnt(O -R*Xd +R*Yd+ R*Zd));
|
||||
B.Add(gp_Pnt(O +R*Xd -R*Yd+ R*Zd));
|
||||
B.Add(gp_Pnt(O +R*Xd +R*Yd+ R*Zd));
|
||||
B.Add(gp_Pnt(O +R*Xd -R*Yd- R*Zd));
|
||||
B.Add(gp_Pnt(O -R*Xd -R*Yd- R*Zd));
|
||||
B.Add(gp_Pnt(O +R*Xd +R*Yd- R*Zd));
|
||||
B.Add(gp_Pnt(O -R*Xd +R*Yd- R*Zd));
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
void BndLib::Add(const gp_Torus& S,const Standard_Real UMin,
|
||||
const Standard_Real UMax,const Standard_Real VMin,
|
||||
const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Standard_Integer Fi1;
|
||||
Standard_Integer Fi2;
|
||||
if (VMax<VMin) {
|
||||
Fi1 = (Standard_Integer )( VMax/(PI/4.));
|
||||
Fi2 = (Standard_Integer )( VMin/(PI/4.));
|
||||
}
|
||||
else {
|
||||
Fi1 = (Standard_Integer )( VMin/(PI/4.));
|
||||
Fi2 = (Standard_Integer )( VMax/(PI/4.));
|
||||
}
|
||||
Fi2++;
|
||||
|
||||
Standard_Real Ra = S.MajorRadius();
|
||||
Standard_Real Ri = S.MinorRadius();
|
||||
|
||||
if (Fi2<Fi1) return;
|
||||
|
||||
#define SC 0.71
|
||||
#define addP0 (Compute(UMin,UMax,Ra+Ri,Ra+Ri,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ(),B))
|
||||
#define addP1 (Compute(UMin,UMax,Ra+Ri*SC,Ra+Ri*SC,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ()+(Ri*SC)*S.Axis().Direction().XYZ(),B))
|
||||
#define addP2 (Compute(UMin,UMax,Ra,Ra,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ()+Ri*S.Axis().Direction().XYZ(),B))
|
||||
#define addP3 (Compute(UMin,UMax,Ra-Ri*SC,Ra-Ri*SC,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ()+(Ri*SC)*S.Axis().Direction().XYZ(),B))
|
||||
#define addP4 (Compute(UMin,UMax,Ra-Ri,Ra-Ri,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ(),B))
|
||||
#define addP5 (Compute(UMin,UMax,Ra-Ri*SC,Ra-Ri*SC,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ()-(Ri*SC)*S.Axis().Direction().XYZ(),B))
|
||||
#define addP6 (Compute(UMin,UMax,Ra,Ra,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ()-Ri*S.Axis().Direction().XYZ(),B))
|
||||
#define addP7 (Compute(UMin,UMax,Ra+Ri*SC,Ra+Ri*SC,S.XAxis().Direction().XYZ(),S.YAxis().Direction().XYZ(),S.Location().XYZ()-(Ri*SC)*S.Axis().Direction().XYZ(),B))
|
||||
|
||||
switch (Fi1) {
|
||||
case 0 :
|
||||
{
|
||||
addP0;
|
||||
if (Fi2 <= 0) break;
|
||||
}
|
||||
case 1 :
|
||||
{
|
||||
addP1;
|
||||
if (Fi2 <= 1) break;
|
||||
}
|
||||
case 2 :
|
||||
{
|
||||
addP2;
|
||||
if (Fi2 <= 2) break;
|
||||
}
|
||||
case 3 :
|
||||
{
|
||||
addP3;
|
||||
if (Fi2 <= 3) break;
|
||||
}
|
||||
case 4 :
|
||||
{
|
||||
addP4;
|
||||
if (Fi2 <= 4) break;
|
||||
}
|
||||
case 5 :
|
||||
{
|
||||
addP5;
|
||||
if (Fi2 <= 5) break;
|
||||
}
|
||||
case 6 :
|
||||
{
|
||||
addP6;
|
||||
if (Fi2 <= 6) break;
|
||||
}
|
||||
case 7 :
|
||||
{
|
||||
addP7;
|
||||
if (Fi2 <= 7) break;
|
||||
}
|
||||
case 8 :
|
||||
default :
|
||||
{
|
||||
addP0;
|
||||
switch (Fi2) {
|
||||
case 15 :
|
||||
addP7;
|
||||
case 14 :
|
||||
addP6;
|
||||
case 13 :
|
||||
addP5;
|
||||
case 12 :
|
||||
addP4;
|
||||
case 11 :
|
||||
addP3;
|
||||
case 10 :
|
||||
addP2;
|
||||
case 9 :
|
||||
addP1;
|
||||
case 8 :
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
|
||||
void BndLib::Add( const gp_Torus& S,const Standard_Real Tol, Bnd_Box& B) {
|
||||
|
||||
Standard_Real RMa = S.MajorRadius();
|
||||
Standard_Real Rmi = S.MinorRadius();
|
||||
gp_XYZ O = S.Location().XYZ();
|
||||
gp_XYZ Xd = S.XAxis().Direction().XYZ();
|
||||
gp_XYZ Yd = S.YAxis().Direction().XYZ();
|
||||
gp_XYZ Zd = S.Axis().Direction().XYZ();
|
||||
B.Add(gp_Pnt(O -(RMa+Rmi)*Xd -(RMa+Rmi)*Yd+ Rmi*Zd));
|
||||
B.Add(gp_Pnt(O -(RMa+Rmi)*Xd -(RMa+Rmi)*Yd- Rmi*Zd));
|
||||
B.Add(gp_Pnt(O +(RMa+Rmi)*Xd -(RMa+Rmi)*Yd+ Rmi*Zd));
|
||||
B.Add(gp_Pnt(O +(RMa+Rmi)*Xd -(RMa+Rmi)*Yd- Rmi*Zd));
|
||||
B.Add(gp_Pnt(O -(RMa+Rmi)*Xd +(RMa+Rmi)*Yd+ Rmi*Zd));
|
||||
B.Add(gp_Pnt(O -(RMa+Rmi)*Xd +(RMa+Rmi)*Yd- Rmi*Zd));
|
||||
B.Add(gp_Pnt(O +(RMa+Rmi)*Xd +(RMa+Rmi)*Yd+ Rmi*Zd));
|
||||
B.Add(gp_Pnt(O +(RMa+Rmi)*Xd +(RMa+Rmi)*Yd- Rmi*Zd));
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
|
||||
|
||||
|
85
src/BndLib/BndLib_Add2dCurve.cdl
Executable file
85
src/BndLib/BndLib_Add2dCurve.cdl
Executable file
@@ -0,0 +1,85 @@
|
||||
-- File: BndLib_Add2dCurve.cdl
|
||||
-- Created: Fri Jul 9 10:35:47 1993
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@sdsun2>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class Add2dCurve from BndLib
|
||||
---Purpose: Computes the bounding box for a curve in 2d .
|
||||
-- Functions to add a 2D curve to a bounding box.
|
||||
-- The 2D curve is defined from a Geom2d curve.
|
||||
|
||||
uses Box2d from Bnd,
|
||||
Curve2d from Adaptor2d
|
||||
|
||||
|
||||
is
|
||||
|
||||
Add(myclass; C : Curve2d from Adaptor2d;
|
||||
Tol : Real from Standard;
|
||||
B : in out Box2d from Bnd);
|
||||
---Purpose: Adds to the bounding box B the curve C
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- Note: depending on the type of curve, one of the following
|
||||
-- representations of the curve C is used to include it in the bounding box B:
|
||||
-- - an exact representation if C is built from a line, a circle or a conic curve,
|
||||
-- - the poles of the curve if C is built from a Bezier curve or a BSpline curve,
|
||||
-- - if not, the points of an approximation of the curve C.
|
||||
-- Warning
|
||||
-- C is an adapted curve, that is, an object which is an interface between:
|
||||
-- - the services provided by a 2D curve from the package Geom2d
|
||||
-- - and those required of the curve by the computation algorithm.
|
||||
-- The adapted curve is created in the following way:
|
||||
-- Handle(Geom2d_Curve) mycurve = ...
|
||||
-- ;
|
||||
-- Geom2dAdaptor_Curve C(mycurve);
|
||||
-- The bounding box B is then enlarged by adding it:
|
||||
-- Bnd_Box2d B;
|
||||
-- // ...
|
||||
-- Standard_Real Tol = ... ;
|
||||
-- Add2dCurve::Add ( C, Tol, B );
|
||||
-- Exceptions
|
||||
-- Standard_Failure if the curve is built from:
|
||||
-- - a Geom_Line, or
|
||||
-- - a Geom_Parabola, or
|
||||
-- - a Geom_Hyperbola,
|
||||
-- and P1 and P2 are either two negative infinite real
|
||||
-- numbers, or two positive infinite real numbers.
|
||||
|
||||
Add(myclass; C : Curve2d from Adaptor2d;
|
||||
U1,U2 : Real from Standard;
|
||||
Tol : Real from Standard;
|
||||
B : in out Box2d from Bnd);
|
||||
---Purpose: Adds to the bounding box Bthe arc of the curve C limited by the two parameter
|
||||
-- values P1 and P2.
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- Note: depending on the type of curve, one of the following
|
||||
-- representations of the curve C is used to include it in the bounding box B:
|
||||
-- - an exact representation if C is built from a line, a circle or a conic curve,
|
||||
-- - the poles of the curve if C is built from a Bezier curve or a BSpline curve,
|
||||
-- - if not, the points of an approximation of the curve C.
|
||||
-- Warning
|
||||
-- C is an adapted curve, that is, an object which is an interface between:
|
||||
-- - the services provided by a 2D curve from the package Geom2d
|
||||
-- - and those required of the curve by the computation algorithm.
|
||||
-- The adapted curve is created in the following way:
|
||||
-- Handle(Geom2d_Curve) mycurve = ...
|
||||
-- ;
|
||||
-- Geom2dAdaptor_Curve C(mycurve);
|
||||
-- The bounding box B is then enlarged by adding it:
|
||||
-- Bnd_Box2d B;
|
||||
-- // ...
|
||||
-- Standard_Real Tol = ... ;
|
||||
-- Add2dCurve::Add ( C, Tol, B );
|
||||
-- Exceptions
|
||||
-- Standard_Failure if the curve is built from:
|
||||
-- - a Geom_Line, or
|
||||
-- - a Geom_Parabola, or
|
||||
-- - a Geom_Hyperbola,
|
||||
-- and P1 and P2 are either two negative infinite real
|
||||
-- numbers, or two positive infinite real numbers.
|
||||
|
||||
|
||||
end Add2dCurve;
|
151
src/BndLib/BndLib_Add2dCurve.cxx
Executable file
151
src/BndLib/BndLib_Add2dCurve.cxx
Executable file
@@ -0,0 +1,151 @@
|
||||
|
||||
#include <BndLib_Add2dCurve.ixx>
|
||||
#include <BndLib.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Elips2d.hxx>
|
||||
#include <gp_Parab2d.hxx>
|
||||
#include <gp_Hypr2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BndLib_Add2dCurve::Add(const Adaptor2d_Curve2d& C,
|
||||
const Standard_Real Tol,
|
||||
Bnd_Box2d& B )
|
||||
{
|
||||
BndLib_Add2dCurve::Add(C,
|
||||
C.FirstParameter(),
|
||||
C.LastParameter (),
|
||||
Tol,B);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BndLib_Add2dCurve::Add( const Adaptor2d_Curve2d& C,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real Tol,
|
||||
Bnd_Box2d& B )
|
||||
{
|
||||
GeomAbs_CurveType Type = C.GetType();
|
||||
|
||||
switch (Type) {
|
||||
|
||||
case GeomAbs_Line:
|
||||
{
|
||||
BndLib::Add(C.Line(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Circle:
|
||||
{
|
||||
BndLib::Add(C.Circle(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Ellipse:
|
||||
{
|
||||
BndLib::Add(C.Ellipse(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Hyperbola:
|
||||
{
|
||||
BndLib::Add(C.Hyperbola(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Parabola:
|
||||
{
|
||||
BndLib::Add(C.Parabola(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BezierCurve:
|
||||
{
|
||||
Handle(Geom2d_BezierCurve) Bz = C.Bezier();
|
||||
if(Abs(Bz->FirstParameter() - U1) > Precision::Parametric(Tol)||
|
||||
Abs(Bz->LastParameter() - U2) > Precision::Parametric(Tol)) {
|
||||
|
||||
Handle(Geom2d_Geometry) G = Bz->Copy();
|
||||
|
||||
const Handle(Geom2d_BezierCurve)& Bzaux = (*((Handle(Geom2d_BezierCurve)*)&G));
|
||||
|
||||
Bzaux->Segment(U1, U2);
|
||||
for (Standard_Integer i = 1; i <= Bzaux->NbPoles(); i++) {
|
||||
B.Add(Bzaux->Pole(i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
for (Standard_Integer i = 1;i<=Bz->NbPoles();i++) {
|
||||
B.Add(Bz->Pole(i));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BSplineCurve:
|
||||
{
|
||||
Handle(Geom2d_BSplineCurve) Bs = C.BSpline();
|
||||
if(Abs(Bs->FirstParameter() - U1) > Precision::Parametric(Tol)||
|
||||
Abs(Bs->LastParameter() - U2) > Precision::Parametric(Tol)) {
|
||||
|
||||
|
||||
Handle(Geom2d_Geometry) G = Bs->Copy();
|
||||
|
||||
const Handle(Geom2d_BSplineCurve)& Bsaux = (*((Handle(Geom2d_BSplineCurve)*)&G));
|
||||
// modified by NIZHNY-EAP Fri Dec 3 14:29:14 1999 ___BEGIN___
|
||||
// To avoid exeption in Segment
|
||||
Standard_Real u1 = U1, u2 = U2;
|
||||
if(Bsaux->FirstParameter() > U1) u1 = Bsaux->FirstParameter();
|
||||
if(Bsaux->LastParameter() < U2 ) u2 = Bsaux->LastParameter();
|
||||
// modified by NIZHNY-EAP Fri Dec 3 14:29:18 1999 ___END___
|
||||
|
||||
Bsaux->Segment(u1, u2);
|
||||
for (Standard_Integer i = 1; i <= Bsaux->NbPoles(); i++) {
|
||||
B.Add(Bsaux->Pole(i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
for (Standard_Integer i = 1;i<=Bs->NbPoles();i++) {
|
||||
B.Add(Bs->Pole(i));
|
||||
}
|
||||
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Standard_Real N = 33;
|
||||
gp_Pnt2d P;
|
||||
Standard_Real U = U1;
|
||||
Standard_Real DU = (U2-U1)/(N-1);
|
||||
for (Standard_Integer j=1;j<N;j++) {
|
||||
C.D0(U,P);
|
||||
U+=DU;
|
||||
B.Add(P);
|
||||
}
|
||||
C.D0(U2,P);
|
||||
B.Add(P);
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
80
src/BndLib/BndLib_Add3dCurve.cdl
Executable file
80
src/BndLib/BndLib_Add3dCurve.cdl
Executable file
@@ -0,0 +1,80 @@
|
||||
-- File: BndLib_Add3dCurve.cdl
|
||||
-- Created: Thu Jul 8 17:29:02 1993
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@sdsun2>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class Add3dCurve from BndLib
|
||||
---Purpose: Computes the bounding box for a curve in 3d.
|
||||
-- Functions to add a 3D curve to a bounding box.
|
||||
-- The 3D curve is defined from a Geom curve.
|
||||
|
||||
uses Box from Bnd,
|
||||
Curve from Adaptor3d
|
||||
|
||||
is
|
||||
Add(myclass; C : Curve from Adaptor3d;
|
||||
Tol : Real from Standard;
|
||||
B : in out Box from Bnd);
|
||||
---Purpose: Adds to the bounding box B the curve C
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- Note: depending on the type of curve, one of the following
|
||||
-- representations of the curve C is used to include it in the bounding box B:
|
||||
-- - an exact representation if C is built from a line, a circle or a conic curve,
|
||||
-- - the poles of the curve if C is built from a Bezier curve or a BSpline curve,
|
||||
--- if not, the points of an approximation of the curve C.
|
||||
-- Warning
|
||||
-- C is an adapted curve, that is, an object which is an interface between:
|
||||
-- - the services provided by a 3D curve from the package Geom
|
||||
-- - and those required of the curve by the computation algorithm.
|
||||
-- The adapted curve is created in the following way:
|
||||
-- Handle(Geom_Curve) mycurve = ... ;
|
||||
-- GeomAdaptor_Curve C(mycurve);
|
||||
-- The bounding box B is then enlarged by adding it:
|
||||
-- Bnd_Box B;
|
||||
-- // ...
|
||||
-- Standard_Real Tol = ... ;
|
||||
-- Add3dCurve::Add ( C, Tol, B );
|
||||
-- Exceptions
|
||||
-- Standard_Failure if the curve is built from:
|
||||
-- - a Geom_Line, or
|
||||
-- - a Geom_Parabola, or
|
||||
-- - a Geom_Hyperbola,
|
||||
-- and P1 and P2 are either two negative infinite real
|
||||
-- numbers, or two positive infinite real numbers.
|
||||
|
||||
|
||||
|
||||
Add(myclass; C : Curve from Adaptor3d;
|
||||
U1,U2 : Real from Standard;
|
||||
Tol : Real from Standard;
|
||||
B : in out Box from Bnd);
|
||||
---Purpose: Adds to the bounding box B the curve C
|
||||
-- the arc of the curve C limited by the two parameter values P1 and P2.
|
||||
-- Note: depending on the type of curve, one of the following
|
||||
-- representations of the curve C is used to include it in the bounding box B:
|
||||
-- - an exact representation if C is built from a line, a circle or a conic curve,
|
||||
-- - the poles of the curve if C is built from a Bezier curve or a BSpline curve,
|
||||
--- if not, the points of an approximation of the curve C.
|
||||
-- Warning
|
||||
-- C is an adapted curve, that is, an object which is an interface between:
|
||||
-- - the services provided by a 3D curve from the package Geom
|
||||
-- - and those required of the curve by the computation algorithm.
|
||||
-- The adapted curve is created in the following way:
|
||||
-- Handle(Geom_Curve) mycurve = ... ;
|
||||
-- GeomAdaptor_Curve C(mycurve);
|
||||
-- The bounding box B is then enlarged by adding it:
|
||||
-- Bnd_Box B;
|
||||
-- // ...
|
||||
-- Standard_Real Tol = ... ;
|
||||
-- Add3dCurve::Add ( C, Tol, B );
|
||||
-- Exceptions
|
||||
-- Standard_Failure if the curve is built from:
|
||||
-- - a Geom_Line, or
|
||||
-- - a Geom_Parabola, or
|
||||
-- - a Geom_Hyperbola,
|
||||
-- and P1 and P2 are either two negative infinite real
|
||||
-- numbers, or two positive infinite real numbers.
|
||||
|
||||
end Add3dCurve;
|
173
src/BndLib/BndLib_Add3dCurve.cxx
Executable file
173
src/BndLib/BndLib_Add3dCurve.cxx
Executable file
@@ -0,0 +1,173 @@
|
||||
#include <BndLib_Add3dCurve.ixx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <BndLib.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Parab.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
|
||||
const Standard_Real Tol,
|
||||
Bnd_Box& B )
|
||||
{
|
||||
BndLib_Add3dCurve::Add(C,
|
||||
C.FirstParameter(),
|
||||
C.LastParameter (),
|
||||
Tol,B);
|
||||
}
|
||||
|
||||
//OCC566(apo)->
|
||||
static Standard_Real FillBox(Bnd_Box& B, const Adaptor3d_Curve& C,
|
||||
const Standard_Real first, const Standard_Real last,
|
||||
const Standard_Integer N)
|
||||
{
|
||||
gp_Pnt P1, P2, P3;
|
||||
C.D0(first,P1); B.Add(P1);
|
||||
Standard_Real p = first, dp = last-first, tol= 0.;
|
||||
if(Abs(dp) > Precision::PConfusion()){
|
||||
Standard_Integer i;
|
||||
dp /= 2*N;
|
||||
for(i = 1; i <= N; i++){
|
||||
p += dp; C.D0(p,P2); B.Add(P2);
|
||||
p += dp; C.D0(p,P3); B.Add(P3);
|
||||
gp_Pnt Pc((P1.XYZ()+P3.XYZ())/2.0);
|
||||
tol = Max(tol,Pc.Distance(P2));
|
||||
P1 = P3;
|
||||
}
|
||||
}else{
|
||||
C.D0(first,P1); B.Add(P1);
|
||||
C.D0(last,P3); B.Add(P3);
|
||||
tol = 0.;
|
||||
}
|
||||
return tol;
|
||||
}
|
||||
//<-OCC566(apo)
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real Tol,
|
||||
Bnd_Box& B )
|
||||
{
|
||||
static Standard_Real weakness = 1.5; //OCC566(apo)
|
||||
Standard_Real tol = 0.0;
|
||||
switch (C.GetType()) {
|
||||
|
||||
case GeomAbs_Line:
|
||||
{
|
||||
BndLib::Add(C.Line(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Circle:
|
||||
{
|
||||
BndLib::Add(C.Circle(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Ellipse:
|
||||
{
|
||||
BndLib::Add(C.Ellipse(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Hyperbola:
|
||||
{
|
||||
BndLib::Add(C.Hyperbola(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Parabola:
|
||||
{
|
||||
BndLib::Add(C.Parabola(),U1,U2,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BezierCurve:
|
||||
{
|
||||
Handle(Geom_BezierCurve) Bz = C.Bezier();
|
||||
//OCC566(apo)->
|
||||
Standard_Integer N = Bz->Degree();
|
||||
GeomAdaptor_Curve GACurve(Bz);
|
||||
Bnd_Box B1;
|
||||
tol = FillBox(B1,GACurve,U1,U2,N);
|
||||
B1.Enlarge(weakness*tol);
|
||||
Standard_Real x, y, z, X, Y, Z;
|
||||
B1.Get(x, y, z, X, Y, Z);
|
||||
B.Update(x, y, z, X, Y, Z);
|
||||
B.Enlarge(Tol);
|
||||
//<-OCC566(apo)
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BSplineCurve:
|
||||
{
|
||||
Handle(Geom_BSplineCurve) Bs = C.BSpline();
|
||||
if(Abs(Bs->FirstParameter() - U1) > Precision::Parametric(Tol)||
|
||||
Abs(Bs->LastParameter() - U2) > Precision::Parametric(Tol)) {
|
||||
|
||||
Handle(Geom_Geometry) G = Bs->Copy();
|
||||
Handle(Geom_BSplineCurve)& Bsaux = (*((Handle(Geom_BSplineCurve)*)&G));
|
||||
Standard_Real u1 = U1, u2 = U2;
|
||||
//// modified by jgv, 24.10.01 for BUC61031 ////
|
||||
if (Bsaux->IsPeriodic())
|
||||
ElCLib::AdjustPeriodic( Bsaux->FirstParameter(), Bsaux->LastParameter(), Precision::PConfusion(), u1, u2 );
|
||||
////////////////////////////////////////////////
|
||||
// modified by NIZHNY-EAP Fri Dec 3 14:29:14 1999 ___BEGIN___
|
||||
// To avoid exeption in Segment
|
||||
if(Bsaux->FirstParameter() > U1) u1 = Bsaux->FirstParameter();
|
||||
if(Bsaux->LastParameter() < U2 ) u2 = Bsaux->LastParameter();
|
||||
// modified by NIZHNY-EAP Fri Dec 3 14:29:18 1999 ___END___
|
||||
Bsaux->Segment(u1, u2);
|
||||
Bs = Bsaux;
|
||||
}
|
||||
//OCC566(apo)->
|
||||
Bnd_Box B1;
|
||||
Standard_Integer k, k1 = Bs->FirstUKnotIndex(), k2 = Bs->LastUKnotIndex(),
|
||||
N = Bs->Degree(), NbKnots = Bs->NbKnots();
|
||||
TColStd_Array1OfReal Knots(1,NbKnots);
|
||||
Bs->Knots(Knots);
|
||||
GeomAdaptor_Curve GACurve(Bs);
|
||||
Standard_Real first = Knots(k1), last;
|
||||
for(k = k1 + 1; k <= k2; k++){
|
||||
last = Knots(k);
|
||||
tol = Max(FillBox(B1,GACurve,first,last,N), tol);
|
||||
first = last;
|
||||
}
|
||||
B1.Enlarge(weakness*tol);
|
||||
Standard_Real x, y, z, X, Y, Z;
|
||||
B1.Get(x, y, z, X, Y, Z);
|
||||
B.Update(x, y, z, X, Y, Z);
|
||||
B.Enlarge(Tol);
|
||||
//<-OCC566(apo)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Bnd_Box B1;
|
||||
static Standard_Integer N = 33;
|
||||
tol = FillBox(B1,C,U1,U2,N);
|
||||
B1.Enlarge(weakness*tol);
|
||||
Standard_Real x, y, z, X, Y, Z;
|
||||
B1.Get(x, y, z, X, Y, Z);
|
||||
B.Update(x, y, z, X, Y, Z);
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
}
|
||||
}
|
87
src/BndLib/BndLib_AddSurface.cdl
Executable file
87
src/BndLib/BndLib_AddSurface.cdl
Executable file
@@ -0,0 +1,87 @@
|
||||
-- File: BndLib_AddSurface.cdl
|
||||
-- Created: Mon Jul 24 14:17:25 1995
|
||||
-- Author: Modelistation
|
||||
-- <model@metrox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
class AddSurface from BndLib
|
||||
|
||||
---Purpose: computes the box from a surface
|
||||
-- Functions to add a surface to a bounding box.
|
||||
-- The surface is defined from a Geom surface.
|
||||
uses Box from Bnd,
|
||||
Surface from Adaptor3d
|
||||
|
||||
|
||||
is
|
||||
Add(myclass; S : Surface from Adaptor3d;
|
||||
Tol : Real from Standard;
|
||||
B : in out Box from Bnd);
|
||||
|
||||
---Purpose: Adds to the bounding box B the surface S
|
||||
-- B is then enlarged by the tolerance value Tol.
|
||||
-- Note: depending on the type of curve, one of the following
|
||||
-- representations of the surface S is used to include it in the bounding box B:
|
||||
-- - an exact representation if S is built from a plane, a
|
||||
-- cylinder, a cone, a sphere or a torus,
|
||||
-- - the poles of the surface if S is built from a Bezier
|
||||
-- surface or a BSpline surface,
|
||||
-- - the points of an approximation of the surface S in
|
||||
-- cases other than offset surfaces;
|
||||
-- - in the case of an offset surface, the basis surface is first
|
||||
-- included according to the previous rules; then the
|
||||
-- bounding box is enlarged by the offset value.
|
||||
-- Warning
|
||||
-- Do not use these functions to add a non-finite surface to
|
||||
-- the bounding box B.
|
||||
-- If UMin, UMax, VMin or VMax is an infinite value B will become WholeSpace.
|
||||
-- S is an adapted surface, that is, an object which is an interface between:
|
||||
-- - the services provided by a surface from the package Geom
|
||||
-- - and those required of the surface by the computation algorithm.
|
||||
-- The adapted surface is created in the following way:
|
||||
-- Handle(Geom_Surface) mysurface = ... ;
|
||||
-- GeomAdaptor_Surface S(mysurface);
|
||||
-- The bounding box B is then enlarged by adding this surface:
|
||||
-- Bnd_Box B;
|
||||
-- // ...
|
||||
-- Standard_Real Tol = ... ;
|
||||
-- AddSurface::Add ( S, Tol, B );
|
||||
|
||||
Add(myclass; S : Surface from Adaptor3d;
|
||||
UMin,UMax,VMin,VMax : Real from Standard;
|
||||
Tol : Real from Standard;
|
||||
B : in out Box from Bnd);
|
||||
---Purpose: Adds to the bounding box B the surface S
|
||||
-- the patch of the surface S limited in the u parametric
|
||||
-- direction by the two parameter values UMin, UMax, and
|
||||
-- in the v parametric direction by the two parameter
|
||||
-- values VMin, VMax.
|
||||
-- Note: depending on the type of curve, one of the following
|
||||
-- representations of the surface S is used to include it in the bounding box B:
|
||||
-- - an exact representation if S is built from a plane, a
|
||||
-- cylinder, a cone, a sphere or a torus,
|
||||
-- - the poles of the surface if S is built from a Bezier
|
||||
-- surface or a BSpline surface,
|
||||
-- - the points of an approximation of the surface S in
|
||||
-- cases other than offset surfaces;
|
||||
-- - in the case of an offset surface, the basis surface is first
|
||||
-- included according to the previous rules; then the
|
||||
-- bounding box is enlarged by the offset value.
|
||||
-- Warning
|
||||
-- Do not use these functions to add a non-finite surface to
|
||||
-- the bounding box B.
|
||||
-- If UMin, UMax, VMin or VMax is an infinite value B will become WholeSpace.
|
||||
-- S is an adapted surface, that is, an object which is an interface between:
|
||||
-- - the services provided by a surface from the package Geom
|
||||
-- - and those required of the surface by the computation algorithm.
|
||||
-- The adapted surface is created in the following way:
|
||||
-- Handle(Geom_Surface) mysurface = ... ;
|
||||
-- GeomAdaptor_Surface S(mysurface);
|
||||
-- The bounding box B is then enlarged by adding this surface:
|
||||
-- Bnd_Box B;
|
||||
-- // ...
|
||||
-- Standard_Real Tol = ... ;
|
||||
-- AddSurface::Add ( S, Tol, B );
|
||||
end AddSurface;
|
||||
|
299
src/BndLib/BndLib_AddSurface.cxx
Executable file
299
src/BndLib/BndLib_AddSurface.cxx
Executable file
@@ -0,0 +1,299 @@
|
||||
// File: BndLib_AddSurface.gxx
|
||||
// Created: Mon Jul 24 14:18:23 1995
|
||||
// Author: Modelistation
|
||||
// <model@metrox>
|
||||
|
||||
// Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503
|
||||
|
||||
|
||||
#include <BndLib_AddSurface.ixx>
|
||||
|
||||
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <BndLib.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
|
||||
const Standard_Real Tol,
|
||||
Bnd_Box& B )
|
||||
{
|
||||
|
||||
BndLib_AddSurface::Add(S,
|
||||
S.FirstUParameter(),
|
||||
S.LastUParameter (),
|
||||
S.FirstVParameter(),
|
||||
S.LastVParameter (),Tol,B);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbUSamples
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer NbUSamples(const Adaptor3d_Surface& S)
|
||||
{
|
||||
Standard_Integer N;
|
||||
GeomAbs_SurfaceType Type = S.GetType();
|
||||
switch (Type) {
|
||||
case GeomAbs_BezierSurface:
|
||||
{
|
||||
N = 2*S.NbUPoles();
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
const Handle(Geom_BSplineSurface)& BS = S.BSpline();
|
||||
N = 2*(BS->UDegree() + 1)*(BS->NbUKnots() -1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
N = 33;
|
||||
}
|
||||
return Min (50,N);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVSamples
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer NbVSamples(const Adaptor3d_Surface& S)
|
||||
{
|
||||
Standard_Integer N;
|
||||
GeomAbs_SurfaceType Type = S.GetType();
|
||||
switch (Type) {
|
||||
case GeomAbs_BezierSurface:
|
||||
{
|
||||
N = 2*S.NbVPoles();
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
const Handle(Geom_BSplineSurface)& BS = S.BSpline();
|
||||
N = 2*(BS->VDegree() + 1)*(BS->NbVKnots() - 1) ;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
N = 33;
|
||||
}
|
||||
return Min(50,N);
|
||||
}
|
||||
|
||||
// Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503 Begin
|
||||
static gp_Pnt BaryCenter(const gp_Pln &aPlane,
|
||||
const Standard_Real aUMin,
|
||||
const Standard_Real aUMax,
|
||||
const Standard_Real aVMin,
|
||||
const Standard_Real aVMax)
|
||||
{
|
||||
Standard_Real aU, aV;
|
||||
Standard_Boolean isU1Inf = Precision::IsInfinite(aUMin);
|
||||
Standard_Boolean isU2Inf = Precision::IsInfinite(aUMax);
|
||||
Standard_Boolean isV1Inf = Precision::IsInfinite(aVMin);
|
||||
Standard_Boolean isV2Inf = Precision::IsInfinite(aVMax);
|
||||
|
||||
if (isU1Inf && isU2Inf)
|
||||
aU = 0;
|
||||
else if (isU1Inf)
|
||||
aU = aUMax - 10.;
|
||||
else if (isU2Inf)
|
||||
aU = aUMin + 10.;
|
||||
else
|
||||
aU = (aUMin + aUMax)/2.;
|
||||
|
||||
if (isV1Inf && isV2Inf)
|
||||
aV = 0;
|
||||
else if (isV1Inf)
|
||||
aV = aVMax - 10.;
|
||||
else if (isV2Inf)
|
||||
aV = aVMin + 10.;
|
||||
else
|
||||
aV = (aVMin + aVMax)/2.;
|
||||
|
||||
gp_Pnt aCenter = ElSLib::Value(aU, aV, aPlane);
|
||||
|
||||
return aCenter;
|
||||
}
|
||||
|
||||
static void TreatInfinitePlane(const gp_Pln &aPlane,
|
||||
const Standard_Real aUMin,
|
||||
const Standard_Real aUMax,
|
||||
const Standard_Real aVMin,
|
||||
const Standard_Real aVMax,
|
||||
const Standard_Real aTol,
|
||||
Bnd_Box &aB)
|
||||
{
|
||||
// Get 3 coordinate axes of the plane.
|
||||
const gp_Dir &aNorm = aPlane.Axis().Direction();
|
||||
const gp_Dir &aXDir = aPlane.XAxis().Direction();
|
||||
const gp_Dir &aYDir = aPlane.YAxis().Direction();
|
||||
const Standard_Real anAngularTol = RealEpsilon();
|
||||
|
||||
// Get location of the plane as its barycenter
|
||||
gp_Pnt aLocation = BaryCenter(aPlane, aUMin, aUMax, aVMin, aVMax);
|
||||
|
||||
if (aNorm.IsParallel(gp::DX(), anAngularTol)) {
|
||||
aB.Add(aLocation);
|
||||
aB.OpenYmin();
|
||||
aB.OpenYmax();
|
||||
aB.OpenZmin();
|
||||
aB.OpenZmax();
|
||||
} else if (aNorm.IsParallel(gp::DY(), anAngularTol)) {
|
||||
aB.Add(aLocation);
|
||||
aB.OpenXmin();
|
||||
aB.OpenXmax();
|
||||
aB.OpenZmin();
|
||||
aB.OpenZmax();
|
||||
} else if (aNorm.IsParallel(gp::DZ(), anAngularTol)) {
|
||||
aB.Add(aLocation);
|
||||
aB.OpenXmin();
|
||||
aB.OpenXmax();
|
||||
aB.OpenYmin();
|
||||
aB.OpenYmax();
|
||||
} else {
|
||||
aB.SetWhole();
|
||||
return;
|
||||
}
|
||||
|
||||
aB.Enlarge(aTol);
|
||||
}
|
||||
// Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503 End
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
|
||||
const Standard_Real UMin,
|
||||
const Standard_Real UMax,
|
||||
const Standard_Real VMin,
|
||||
const Standard_Real VMax,
|
||||
const Standard_Real Tol,
|
||||
Bnd_Box& B )
|
||||
{
|
||||
GeomAbs_SurfaceType Type = S.GetType(); // skv OCC6503
|
||||
|
||||
if (Precision::IsInfinite(VMin) ||
|
||||
Precision::IsInfinite(VMax) ||
|
||||
Precision::IsInfinite(UMin) ||
|
||||
Precision::IsInfinite(UMax) ) {
|
||||
// Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503 Begin
|
||||
// B.SetWhole();
|
||||
// return;
|
||||
switch (Type) {
|
||||
case GeomAbs_Plane:
|
||||
{
|
||||
TreatInfinitePlane(S.Plane(), UMin, UMax, VMin, VMax, Tol, B);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
{
|
||||
B.SetWhole();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503 End
|
||||
}
|
||||
|
||||
// GeomAbs_SurfaceType Type = S.GetType(); // skv OCC6503
|
||||
|
||||
switch (Type) {
|
||||
|
||||
case GeomAbs_Plane:
|
||||
{
|
||||
gp_Pln Plan = S.Plane();
|
||||
B.Add(ElSLib::Value(UMin,VMin,Plan));
|
||||
B.Add(ElSLib::Value(UMin,VMax,Plan));
|
||||
B.Add(ElSLib::Value(UMax,VMin,Plan));
|
||||
B.Add(ElSLib::Value(UMax,VMax,Plan));
|
||||
B.Enlarge(Tol);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Cylinder:
|
||||
{
|
||||
BndLib::Add(S.Cylinder(),UMin,UMax,VMin,VMax,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Cone:
|
||||
{
|
||||
BndLib::Add(S.Cone(),UMin,UMax,VMin,VMax,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Torus:
|
||||
{
|
||||
BndLib::Add(S.Torus(),UMin,UMax,VMin,VMax,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_Sphere:
|
||||
{
|
||||
if (Abs(UMin) < Precision::Angular() &&
|
||||
Abs(UMax - 2.*PI) < Precision::Angular() &&
|
||||
Abs(VMin + PI/2.) < Precision::Angular() &&
|
||||
Abs(VMax - PI/2.) < Precision::Angular()) // a whole sphere
|
||||
BndLib::Add(S.Sphere(),Tol,B);
|
||||
else
|
||||
BndLib::Add(S.Sphere(),UMin,UMax,VMin,VMax,Tol,B);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_OffsetSurface:
|
||||
{
|
||||
Handle(Adaptor3d_HSurface) HS = S.BasisSurface();
|
||||
Add (HS->Surface(),UMin,UMax,VMin,VMax,Tol,B);
|
||||
B.Enlarge(S.OffsetValue());
|
||||
B.Enlarge(Tol);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BezierSurface:
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
Standard_Real PTol = Precision::Parametric(Precision::Confusion());
|
||||
if (Abs(UMin-S.FirstUParameter()) < PTol &&
|
||||
Abs(VMin-S.FirstVParameter()) < PTol &&
|
||||
Abs(UMax-S.LastUParameter ()) < PTol &&
|
||||
Abs(VMax-S.LastVParameter ()) < PTol ) {
|
||||
TColgp_Array2OfPnt Tp(1,S.NbUPoles(),1,S.NbVPoles());
|
||||
if (Type == GeomAbs_BezierSurface) {
|
||||
S.Bezier()->Poles(Tp);
|
||||
}
|
||||
else {
|
||||
S.BSpline()->Poles(Tp);
|
||||
}
|
||||
for (Standard_Integer i = Tp.LowerRow();i<=Tp.UpperRow();i++) {
|
||||
for (Standard_Integer j = Tp.LowerCol();j<=Tp.UpperCol();j++) {
|
||||
B.Add(Tp(i,j));
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
Standard_Integer Nu = NbUSamples(S);
|
||||
Standard_Integer Nv = NbVSamples(S);
|
||||
gp_Pnt P;
|
||||
for (Standard_Integer i =1 ;i<=Nu;i++){
|
||||
Standard_Real U = UMin + ((UMax-UMin)*(i-1)/(Nu-1));
|
||||
for (Standard_Integer j=1 ;j<=Nv;j++){
|
||||
Standard_Real V = VMin + ((VMax-VMin)*(j-1)/(Nv-1));
|
||||
S.D0(U,V,P);
|
||||
B.Add(P);
|
||||
}
|
||||
}
|
||||
B.Enlarge(Tol);
|
||||
}
|
||||
}
|
||||
}
|
161
src/BndLib/BndLib_Compute.gxx
Executable file
161
src/BndLib/BndLib_Compute.gxx
Executable file
@@ -0,0 +1,161 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
|
||||
void Compute(const Standard_Real P1,
|
||||
const Standard_Real P2,
|
||||
const Standard_Real Ra,
|
||||
const Standard_Real Rb,
|
||||
const Coord& Xd,
|
||||
const Coord& Yd,
|
||||
const Coord& O,
|
||||
Bound& B) {
|
||||
|
||||
Standard_Real Teta1;
|
||||
Standard_Real Teta2;
|
||||
if (P2<P1) {
|
||||
Teta1 = P2;
|
||||
Teta2 = P1;
|
||||
}
|
||||
else {
|
||||
Teta1 = P1;
|
||||
Teta2 = P2;
|
||||
}
|
||||
Standard_Real Delta =Abs(Teta2-Teta1);
|
||||
|
||||
if (Delta > 2. * PI) {
|
||||
Teta1 = 0.;
|
||||
Teta2 = 2. * PI;
|
||||
}
|
||||
else {
|
||||
|
||||
if (Teta1 < 0.) {
|
||||
do { Teta1+=2.*PI;} while (Teta1< 0.);
|
||||
}
|
||||
else if (Teta1> 2.*PI) {
|
||||
do { Teta1-=2.*PI;} while (Teta1> 2.*PI);
|
||||
}
|
||||
Teta2 = Teta1 + Delta;
|
||||
|
||||
}
|
||||
|
||||
// One places already both ends
|
||||
Standard_Real Cn1,Sn1,Cn2,Sn2;
|
||||
Cn1 = Cos(Teta1); Sn1 = Sin(Teta1);
|
||||
Cn2 = Cos(Teta2); Sn2 = Sin(Teta2);
|
||||
B.Add(Point(O +Ra*Cn1*Xd +Rb*Sn1*Yd));
|
||||
B.Add(Point(O +Ra*Cn2*Xd +Rb*Sn2*Yd));
|
||||
|
||||
Standard_Real Ram,Rbm;
|
||||
if (Delta > PI/8.) {
|
||||
// Main radiuses to take into account only 8 points (/cos(Pi/8.))
|
||||
Ram=Ra/0.92387953251128674;
|
||||
Rbm=Rb/0.92387953251128674;
|
||||
}
|
||||
else {
|
||||
// Main radiuses to take into account the arrow
|
||||
Standard_Real tc=cos(Delta/2);
|
||||
Ram=Ra/tc;
|
||||
Rbm=Rb/tc;
|
||||
}
|
||||
B.Add(Point(O +Ram*Cn1*Xd +Rbm*Sn1*Yd));
|
||||
B.Add(Point(O +Ram*Cn2*Xd +Rbm*Sn2*Yd));
|
||||
|
||||
|
||||
// cos or sin PI/4.
|
||||
#define PI4 0.70710678118654746
|
||||
|
||||
// 8 points of the polygon
|
||||
#define addP0 B.Add(Point(O +Ram*Xd ))
|
||||
#define addP1 B.Add(Point(O +Ram*PI4*Xd +Rbm*PI4*Yd))
|
||||
#define addP2 B.Add(Point(O +Rbm*Yd))
|
||||
#define addP3 B.Add(Point(O -Ram*PI4*Xd +Rbm*PI4*Yd))
|
||||
#define addP4 B.Add(Point(O -Ram*Xd ))
|
||||
#define addP5 B.Add(Point(O -Ram*PI4*Xd -Rbm*PI4*Yd))
|
||||
#define addP6 B.Add(Point(O -Rbm*Yd));
|
||||
#define addP7 B.Add(Point(O +Ram*PI4*Xd -Rbm*PI4*Yd))
|
||||
|
||||
Standard_Integer deb = (Standard_Integer )( Teta1/(PI/4.));
|
||||
Standard_Integer fin = (Standard_Integer )( Teta2/(PI/4.));
|
||||
deb++;
|
||||
|
||||
if (deb>fin) return;
|
||||
|
||||
switch (deb) {
|
||||
case 1 :
|
||||
{
|
||||
addP1;
|
||||
if (fin <= 1) break;
|
||||
}
|
||||
case 2 :
|
||||
{
|
||||
addP2;
|
||||
if (fin <= 2) break;
|
||||
}
|
||||
case 3 :
|
||||
{
|
||||
addP3;
|
||||
if (fin <= 3) break;
|
||||
}
|
||||
case 4 :
|
||||
{
|
||||
addP4;
|
||||
if (fin <= 4) break;
|
||||
}
|
||||
case 5 :
|
||||
{
|
||||
addP5;
|
||||
if (fin <= 5) break;
|
||||
}
|
||||
case 6 :
|
||||
{
|
||||
addP6;
|
||||
if (fin <= 6) break;
|
||||
}
|
||||
case 7 :
|
||||
{
|
||||
addP7;
|
||||
if (fin <= 7) break;
|
||||
}
|
||||
case 8 :
|
||||
{
|
||||
addP0;
|
||||
if (fin <= 8) break;
|
||||
}
|
||||
case 9 :
|
||||
{
|
||||
addP1;
|
||||
if (fin <= 9) break;
|
||||
}
|
||||
case 10 :
|
||||
{
|
||||
addP2;
|
||||
if (fin <= 10) break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
addP3;
|
||||
if (fin <= 11) break;
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
addP4;
|
||||
if (fin <= 12) break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
addP5;
|
||||
if (fin <= 13) break;
|
||||
}
|
||||
case 14:
|
||||
{
|
||||
addP6;
|
||||
if (fin <= 14) break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
addP7;
|
||||
if (fin <= 15) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
7
src/BndLib/BndLib_Compute.hxx
Executable file
7
src/BndLib/BndLib_Compute.hxx
Executable file
@@ -0,0 +1,7 @@
|
||||
void Compute(const Standard_Real P1,const Standard_Real P2,
|
||||
const Standard_Real Ra,const Standard_Real Rb,const gp_XY& Xd,const gp_XY& Yd,
|
||||
const gp_XY& O,Bnd_Box2d& B) ;
|
||||
|
||||
void Compute(const Standard_Real P1,const Standard_Real P2,
|
||||
const Standard_Real Ra,const Standard_Real Rb,const gp_XYZ& Xd,const gp_XYZ& Yd,
|
||||
const gp_XYZ& O,Bnd_Box& B) ;
|
11
src/BndLib/BndLib_Compute2d.cxx
Executable file
11
src/BndLib/BndLib_Compute2d.cxx
Executable file
@@ -0,0 +1,11 @@
|
||||
#include <gp_XY.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Bnd_Box2d.hxx>
|
||||
#define Coord gp_XY
|
||||
#define Point gp_Pnt2d
|
||||
#define Bound Bnd_Box2d
|
||||
#include <BndLib_Compute.gxx>
|
||||
#undef Coord
|
||||
#undef Point
|
||||
#undef Bound
|
||||
|
10
src/BndLib/BndLib_Compute3d.cxx
Executable file
10
src/BndLib/BndLib_Compute3d.cxx
Executable file
@@ -0,0 +1,10 @@
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#define Coord gp_XYZ
|
||||
#define Point gp_Pnt
|
||||
#define Bound Bnd_Box
|
||||
#include <BndLib_Compute.gxx>
|
||||
#undef Coord
|
||||
#undef Point
|
||||
#undef Bound
|
4
src/BndLib/FILES
Executable file
4
src/BndLib/FILES
Executable file
@@ -0,0 +1,4 @@
|
||||
BndLib_Compute2d.cxx
|
||||
BndLib_Compute3d.cxx
|
||||
BndLib_Compute.hxx
|
||||
BndLib_Compute.gxx
|
Reference in New Issue
Block a user