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

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

109
src/GeomPlate/GeomPlate.cdl Executable file
View File

@@ -0,0 +1,109 @@
-- File: GeomPlate.cdl<2>
-- Created: Thu Mar 7 15:02:41 1996
-- Author: Stagiaire Frederic CALOONE
-- <cfc@stylox>
-- Modified: Wed Mar 5 09:45:42 1997
-- by: Joelle CHAUVET
-- G1134 : convertion of a GeomPlate_Surface to a Geom_BSplineSurface
-- by approximation with G0 or G1 criterion
-- + no more reference to TopoDS
---Copyright: Matra Datavision 1996
package GeomPlate
uses gp,
Adaptor3d,
Adaptor2d,
Law,
GeomFill,
TColgp,
Plate,
Geom,
math,
TColGeom,
TColGeom2d,
GeomAbs,
TCollection,
ElSLib,
StdFail,
ProjLib,
TColStd,
AdvApp2Var,
Geom2d,
Extrema,
GeomLProp
is
class BuildPlateSurface ;
---Purpose:
-- this class computes the plate surface corresponding to the constraints.
class Array1OfHCurveOnSurface
instantiates Array1 from TCollection ( HCurveOnSurface from Adaptor3d);
class HArray1OfHCurveOnSurface
instantiates HArray1 from TCollection (HCurveOnSurface from Adaptor3d, Array1OfHCurveOnSurface from GeomPlate);
class CurveConstraint;
class PointConstraint;
class Array1OfSequenceOfReal instantiates
Array1 from TCollection (SequenceOfReal from TColStd);
class HArray1OfSequenceOfReal instantiates
HArray1 from TCollection (SequenceOfReal from TColStd,
Array1OfSequenceOfReal from GeomPlate);
class SequenceOfCurveConstraint
instantiates Sequence from TCollection (CurveConstraint from GeomPlate);
class SequenceOfPointConstraint
instantiates Sequence from TCollection (PointConstraint from GeomPlate);
class HSequenceOfCurveConstraint
instantiates HSequence from TCollection (CurveConstraint from GeomPlate, SequenceOfCurveConstraint from GeomPlate );
class HSequenceOfPointConstraint
instantiates HSequence from TCollection (PointConstraint from GeomPlate, SequenceOfPointConstraint from GeomPlate );
class BuildAveragePlane;
--- Purpose:
-- this class computes the initial surface (average plane) in the cases when the initial surface is not
-- given.
class Surface;
---Purpose:
-- this class describes the characteristics of the plate surface
class MakeApprox;
---Purpose:
-- this class converts a GeomPlate_Surface to a Geom_BSplineSurface
class PlateG0Criterion;
---Purpose:
-- inherits class Criterion from AdvApp2Var ;
-- this class contains a specific G0 criterion for GeomPlate_MakeApprox
class PlateG1Criterion;
---Purpose:
-- inherits class Criterion from AdvApp2Var ;
-- this class contains a specific G1 criterion for GeomPlate_MakeApprox
class Aij;
class SequenceOfAij instantiates
Sequence from TCollection (Aij from GeomPlate);
end;

31
src/GeomPlate/GeomPlate_Aij.cdl Executable file
View File

@@ -0,0 +1,31 @@
-- File: GeomPlate_Aij.cdl
-- Created: Wed Nov 25 11:34:31 1998
-- Author: Julia GERASIMOVA
-- <jgv@redfox.nnov.matra-dtv.fr>
---Copyright: Matra Datavision 1998
class Aij from GeomPlate
---Purpose: A structure containing indexes of two normals and its cross product
uses
Vec from gp
is
Create returns Aij from GeomPlate;
Create( anInd1 : Integer from Standard;
anInd2 : Integer from Standard;
aVec : Vec from gp )
returns Aij from GeomPlate;
fields
Ind1 : Integer from Standard;
Ind2 : Integer from Standard;
Vec : Vec from gp;
friends
class BuildAveragePlane from GeomPlate
end Aij;

20
src/GeomPlate/GeomPlate_Aij.cxx Executable file
View File

@@ -0,0 +1,20 @@
// File: GeomPlate_Aij.cxx
// Created: Wed Nov 25 11:47:25 1998
// Author: Julia GERASIMOVA
// <jgv@redfox.nnov.matra-dtv.fr>
#include <GeomPlate_Aij.ixx>
GeomPlate_Aij::GeomPlate_Aij()
{
}
GeomPlate_Aij::GeomPlate_Aij( const Standard_Integer anInd1,
const Standard_Integer anInd2,
const gp_Vec& aVec )
{
Ind1 = anInd1;
Ind2 = anInd2;
Vec = aVec;
}

View File

@@ -0,0 +1,116 @@
-- File: GeomPlate_BuildAveragePlane.cdl
-- Created: Mon Mar 18 15:15:54 1996
-- Author: Stagiaire Frederic CALOONE
-- <cfc@stylox>
-- Modified: Wed Mar 5 09:45:42 1997
-- by: Joelle CHAUVET
-- G1134 : convertion of a GeomPlate_Surface to a Geom_BSplineSurface
-- by approximation with G0 or G1 criterion
-- modification of Create, BasePlan and DefPlan for options
---Copyright: Matra Datavision 1996
class BuildAveragePlane from GeomPlate
---Purpose: This class computes an average inertial plane with an
-- array of points.
uses
Jacobi from math,
Matrix from math,
Vector from math,
Pnt from gp,
HArray1OfPnt from TColgp,
Plane from Geom,
Vec from gp,
Line from Geom,
SequenceOfVec from TColgp,
SequenceOfAij from GeomPlate
raises
NoSuchObject from Standard
is
Create ( Pts : HArray1OfPnt from TColgp;
NbBoundPoints : Integer from Standard;
Tol : Real from Standard;
POption : Integer from Standard ;
NOption : Integer from Standard )
returns BuildAveragePlane from GeomPlate;
---Purpose: Tol is a Tolerance to make the difference between
-- the result plane and the result line.
--- if POption = 1 : automatical parametrisation
--- if POption = 2 : parametrisation by eigen vectors
--- if NOption = 1 : the average plane is the inertial plane.
--- if NOption = 2 : the average plane is the plane of max. flux.
Create ( Normals : SequenceOfVec from TColgp;
Pts : HArray1OfPnt from TColgp )
returns BuildAveragePlane from GeomPlate;
---Purpose: Creates the plane from the "best vector"
BasePlan ( me : in out ; N :Vec from gp)
---Purpose: Computes a base of the average plane defined by (myG,N)
--- using eigen vectors
is private;
DefPlan ( me : in out ; NOption : Integer from Standard )
---Purpose: Defines the average plane.
--- if NOption = 1 : the average plane is the inertial plane.
--- if NOption = 2 : the average plane is the plane of max. flux.
returns Vec from gp
is private;
Plane ( me ) returns Plane from Geom
---Purpose:
-- Return the average Plane.
raises NoSuchObject from Standard;
-- Raises if the computed object is not a Plane.
Line ( me ) returns Line from Geom
---Purpose :
-- Return a Line when 2 eigenvalues are null.
raises NoSuchObject from Standard;
-- Raises if the computed object is not a Line.
IsPlane ( me )
---Purpose: return OK if is a plane.
returns Boolean from Standard;
IsLine ( me )
---Purpose: return OK if is a line.
returns Boolean from Standard;
MinMaxBox ( me ; Umin,Umax,Vmin,Vmax : out Real from Standard);
---Purpose: computes the minimal box to include all normal
-- projection points of the initial array on the plane.
HalfSpace( myclass ; NewNormals : SequenceOfVec from TColgp;
Normals : in out SequenceOfVec from TColgp;
Bset : in out SequenceOfAij from GeomPlate;
LinTol : Real from Standard;
AngTol : Real from Standard )
returns Boolean from Standard;
fields
myPts : HArray1OfPnt from TColgp;
myUmax : Real from Standard;
myVmax : Real from Standard;
myVmin : Real from Standard;
myUmin : Real from Standard;
myPlane: Plane from Geom;
myTol : Real from Standard;
myLine : Line from Geom;
myOX : Vec from gp;
myOY : Vec from gp;
myG : Pnt from gp;
myNbBoundPoints : Integer from Standard;
end;

View File

@@ -0,0 +1,665 @@
// File: GeomPlate_BuildAveragePlane.cxx
// Created: Mon Mar 18 15:36:29 1996
// Author: Stagiaire Frederic CALOONE
// <cfc@stylox>
// Modified: Wed Mar 5 09:45:42 1997
// by: Joelle CHAUVET
// ajout de la methode DefPlan et des options POption et NOption
// modif des methodes Create et BasePlan
// Modified: Thu Mar 20 09:15:36 1997
// by: Joelle CHAUVET
// correction sur le tri des valeurs propres quand valeurs egales
#include <GeomPlate_BuildAveragePlane.ixx>
#include <TColgp_Array1OfVec.hxx>
#include <math_Matrix.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <math_Jacobi.hxx>
#include <gp_Vec.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax3.hxx>
#include <gp_Dir.hxx>
#include <ElSLib.hxx>
#include <Geom_Line.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <gp_Lin2d.hxx>
#include <ElCLib.hxx>
#include <GeomLib.hxx>
#include <GeomPlate_Aij.hxx>
//=======================================================================
//function : GeomPlate_BuildAveragePlane
//purpose :
//=======================================================================
GeomPlate_BuildAveragePlane::
GeomPlate_BuildAveragePlane(const Handle(TColgp_HArray1OfPnt)& Pts,
const Standard_Integer NbBoundPoints,
const Standard_Real Tol,
const Standard_Integer POption,
const Standard_Integer NOption) :
myPts(Pts),
myTol(Tol),
myNbBoundPoints(NbBoundPoints)
{
gp_Vec OZ = DefPlan(NOption);
if (OZ.SquareMagnitude()>0) {
if (POption==1) {
myPlane = new Geom_Plane(myG,OZ);
myOX = myPlane->Pln().XAxis().Direction();
myOY = myPlane->Pln().YAxis().Direction();
}
else {
BasePlan(OZ);
gp_Dir NDir(myOX^myOY);
gp_Dir UDir(myOX);
gp_Ax3 triedre(myG,NDir,UDir);
myPlane = new Geom_Plane(triedre);
}
Standard_Integer i,nb=myPts->Length();
gp_Pln P=myPlane->Pln();
ElSLib::Parameters(P,myG,myUmax,myVmax);
myUmin=myUmax;
myVmin=myVmax;
Standard_Real U=0,V=0;
for (i=1; i<=nb; i++) {
ElSLib::Parameters(P,myPts->Value(i),U,V);
if ( myUmax < U ) myUmax=U;
if ( myUmin > U ) myUmin=U;
if ( myVmax < V ) myVmax=V;
if ( myVmin > V ) myVmin=V;
}
}
if (IsLine()) {
myLine = new Geom_Line(myG,myOX);
}
}
GeomPlate_BuildAveragePlane::GeomPlate_BuildAveragePlane( const TColgp_SequenceOfVec& Normals,
const Handle( TColgp_HArray1OfPnt )& Pts ) :
myPts(Pts)
{
Standard_Integer i, j, k, n, m;
gp_Vec BestVec;
Standard_Integer NN = Normals.Length();
if (NN == 1)
BestVec = Normals(1);
else if (NN == 2)
{
BestVec = Normals(1) + Normals(2);
BestVec.Normalize();
}
else //the common case
{
Standard_Real MaxAngle = 0.;
for (i = 1; i <= NN-1; i++)
for (j = i+1; j <= NN; j++)
{
Standard_Real Angle = Normals(i).Angle( Normals(j) );
if (Angle > MaxAngle)
MaxAngle = Angle;
}
MaxAngle *= 1.2;
MaxAngle /= 2.;
Standard_Integer Nint = 50;
TColgp_Array1OfVec OptVec( 1, NN*(NN-1)/2 );
TColStd_Array1OfReal OptScal( 1, NN*(NN-1)/2 );
gp_Vec Vec, Vec1;
gp_Dir Cross1, Cross2;
k = 1;
for (i = 1; i <= NN-1; i++)
for (j = i+1; j <= NN; j++)
{
Standard_Real Step = MaxAngle/Nint;
Vec = Normals(i) + Normals(j);
Vec.Normalize();
Cross1 = Normals(i) ^ Normals(j);
Cross2 = Vec ^ Cross1;
gp_Ax1 Axe( gp_Pnt(0,0,0), Cross2 );
Vec1 = Vec.Rotated( Axe, -MaxAngle );
//Vec2 = Vec.Rotated( Axe, MaxAngle );
OptScal(k) = RealFirst();
for (n = 0; n <= 2*Nint; n++)
{
Vec1.Rotate( Axe, Step );
Standard_Real minScal = RealLast();
for (m = 1; m <= NN; m++)
{
Standard_Real Scal = Vec1 * Normals(m);
if (Scal < minScal)
minScal = Scal;
}
if (minScal > OptScal(k))
{
OptScal(k) = minScal;
OptVec(k) = Vec1;
}
}
k++;
} // for i, for j
//Find maximum among all maximums
Standard_Real BestScal = RealFirst();
Standard_Integer Index=0;
for (k = 1; k <= OptScal.Length(); k++)
if (OptScal(k) > BestScal)
{
BestScal = OptScal(k);
Index = k;
}
BestVec = OptVec(Index);
}
//Making the plane myPlane
gp_Ax2 Axe;
Standard_Boolean IsSingular;
TColgp_Array1OfPnt PtsArray( 1, myPts->Length() );
for (i = 1; i <= myPts->Length(); i++)
PtsArray(i) = myPts->Value(i);
GeomLib::AxeOfInertia( PtsArray, Axe, IsSingular );
gp_Dir BestDir( BestVec );
gp_Dir XDir = BestDir ^ Axe.XDirection();
XDir ^= BestDir;
gp_Ax3 Axe3( Axe.Location(), BestDir, XDir );
myPlane = new Geom_Plane( Axe3 );
//Initializing myUmin, myVmin, myUmax, myVmax
gp_Pln Pln = myPlane->Pln();
ElSLib::Parameters( Pln, Axe.Location(), myUmax, myVmax );
myUmin = myUmax;
myVmin = myVmax;
Standard_Real U,V;
for (i = 1; i <= myPts->Length(); i++)
{
gp_Vec aVec( Pln.Location(), myPts->Value(i) );
gp_Vec NormVec = Pln.Axis().Direction();
NormVec = (aVec * NormVec) * NormVec;
ElSLib::Parameters( Pln, myPts->Value(i).Translated( -NormVec ), U, V ); //????? Real projecting?
if (U > myUmax)
myUmax = U;
if (U < myUmin)
myUmin = U;
if (V > myVmax)
myVmax = V;
if (V < myVmin)
myVmin = V;
}
//Initializing myOX, myOY
myOX = myPlane->Pln().XAxis().Direction();
myOY = myPlane->Pln().YAxis().Direction();
}
//=======================================================================
//function : Plane
//purpose :
//=======================================================================
Handle(Geom_Plane) GeomPlate_BuildAveragePlane::Plane() const
{
Standard_NoSuchObject_Raise_if ( IsLine() , "Cannot use the function 'GeomPlate_BuildAveragePlane::Plane()', the Object is a 'Geom_Line'");
return myPlane;
}
//=======================================================================
//function : MinMaxBox
//purpose :
//=======================================================================
void GeomPlate_BuildAveragePlane::MinMaxBox(Standard_Real& Umin, Standard_Real& Umax, Standard_Real& Vmin, Standard_Real& Vmax) const
{
Umax=myUmax;
Umin=myUmin;
Vmax=myVmax;
Vmin=myVmin;
}
//=======================================================================
//function : DefPlan
//purpose :
//=======================================================================
gp_Vec GeomPlate_BuildAveragePlane::DefPlan(const Standard_Integer NOption)
{
gp_Pnt GB;
gp_Vec A,B,C,D;
gp_Vec OZ;
Standard_Integer i,nb=myPts->Length();
GB.SetCoord(0.,0.,0.);
for (i=1; i<=nb; i++) {
GB.SetCoord(1,(GB.Coord(1)+myPts->Value(i).Coord(1)));
GB.SetCoord(2,(GB.Coord(2)+myPts->Value(i).Coord(2)));
GB.SetCoord(3,(GB.Coord(3)+myPts->Value(i).Coord(3)));
}
myG.SetCoord(1,(GB.Coord(1)/nb));
myG.SetCoord(2,(GB.Coord(2)/nb));
myG.SetCoord(3,(GB.Coord(3)/nb));
if (NOption==1) {
gp_Ax2 Axe;
Standard_Boolean IsSingular;
GeomLib::AxeOfInertia( myPts->Array1(), Axe, IsSingular, myTol );
myOX = Axe.XDirection();
myOY = Axe.YDirection();
OZ = Axe.Direction();
if (myNbBoundPoints != 0 && myPts->Length() != myNbBoundPoints)
{
A.SetCoord(0.,0.,0.);
for (i = 3; i <= myNbBoundPoints; i++)
{
B.SetCoord(myPts->Value(i-1).Coord(1)-myPts->Value(1).Coord(1),
myPts->Value(i-1).Coord(2)-myPts->Value(1).Coord(2),
myPts->Value(i-1).Coord(3)-myPts->Value(1).Coord(3));
C.SetCoord(myPts->Value(i).Coord(1)-myPts->Value(1).Coord(1),
myPts->Value(i).Coord(2)-myPts->Value(1).Coord(2),
myPts->Value(i).Coord(3)-myPts->Value(1).Coord(3));
D=B^C;
A.SetCoord(1,A.Coord(1)+D.Coord(1));
A.SetCoord(2,A.Coord(2)+D.Coord(2));
A.SetCoord(3,A.Coord(3)+D.Coord(3));
}
gp_Vec OZ1 = A;
Standard_Real theAngle = OZ.Angle( OZ1 );
if (theAngle > PI/2)
theAngle = PI - theAngle;
if (theAngle > PI/3)
OZ = OZ1;
}
}
else if (NOption==2) {
A.SetCoord(0.,0.,0.);
for (i = 3; i <= myNbBoundPoints; i++) {
B.SetCoord(myPts->Value(i-1).Coord(1)-myPts->Value(1).Coord(1),
myPts->Value(i-1).Coord(2)-myPts->Value(1).Coord(2),
myPts->Value(i-1).Coord(3)-myPts->Value(1).Coord(3));
C.SetCoord(myPts->Value(i).Coord(1)-myPts->Value(1).Coord(1),
myPts->Value(i).Coord(2)-myPts->Value(1).Coord(2),
myPts->Value(i).Coord(3)-myPts->Value(1).Coord(3));
D=B^C;
A.SetCoord(1,A.Coord(1)+D.Coord(1));
A.SetCoord(2,A.Coord(2)+D.Coord(2));
A.SetCoord(3,A.Coord(3)+D.Coord(3));
}
OZ = A;
}
return OZ;
}
//=======================================================================
//function : BasePlan
//purpose :
//=======================================================================
void GeomPlate_BuildAveragePlane::BasePlan(const gp_Vec& OZ)
{
math_Matrix M (1, 3, 1, 3);
M.Init(0.);
gp_Vec Proj;
Standard_Integer i,nb=myPts->Length();
Standard_Real scal;
for (i=1; i<=nb; i++) {
Proj.SetCoord(1,myPts->Value(i).Coord(1) - myG.Coord(1));
Proj.SetCoord(2,myPts->Value(i).Coord(2) - myG.Coord(2));
Proj.SetCoord(3,myPts->Value(i).Coord(3) - myG.Coord(3));
scal = Proj.Coord(1)*OZ.Coord(1)
+ Proj.Coord(2)*OZ.Coord(2)
+ Proj.Coord(3)*OZ.Coord(3);
scal /= OZ.Coord(1)*OZ.Coord(1)
+ OZ.Coord(2)*OZ.Coord(2)
+ OZ.Coord(3)*OZ.Coord(3);
Proj.SetCoord(1,Proj.Coord(1) - scal*OZ.Coord(1));
Proj.SetCoord(2,Proj.Coord(2) - scal*OZ.Coord(2));
Proj.SetCoord(3,Proj.Coord(3) - scal*OZ.Coord(3));
M(1,1) += Proj.Coord(1)*Proj.Coord(1);
M(2,2) += Proj.Coord(2)*Proj.Coord(2);
M(3,3) += Proj.Coord(3)*Proj.Coord(3);
M(1,2) += Proj.Coord(1)*Proj.Coord(2);
M(1,3) += Proj.Coord(1)*Proj.Coord(3);
M(2,3) += Proj.Coord(2)*Proj.Coord(3);
}
M(2,1) = M(1,2) ;
M(3,1) = M(1,3) ;
M(3,2) = M(2,3) ;
math_Jacobi J(M);
Standard_Real n1,n2,n3;
math_Vector V1(1,3),V2(1,3),V3(1,3);
n1=J.Value(1);
n2=J.Value(2);
n3=J.Value(3);
Standard_Real r1 = Min(Min(n1,n2),n3), r2;
Standard_Integer m1, m2, m3;
if (r1==n1) {
m1 = 1;
r2 = Min(n2,n3);
if (r2==n2) {
m2 = 2;
m3 = 3;
}
else {
m2 = 3;
m3 = 2;
}
}
else {
if (r1==n2) {
m1 = 2 ;
r2 = Min(n1,n3);
if (r2==n1) {
m2 = 1;
m3 = 3;
}
else {
m2 = 3;
m3 = 1;
}
}
else {
m1 = 3 ;
r2 = Min(n1,n2);
if (r2==n1) {
m2 = 1;
m3 = 2;
}
else {
m2 = 2;
m3 = 1;
}
}
}
J.Vector(m1,V1);
J.Vector(m2,V2);
J.Vector(m3,V3);
if (((Abs(n1)<=myTol)&&(Abs(n2)<=myTol))
|| ((Abs(n2)<=myTol)&&(Abs(n3)<=myTol))
|| ((Abs(n1)<=myTol)&&(Abs(n3)<=myTol))) {
myOX.SetCoord(V3(1),V3(2),V3(3));
myOY.SetCoord(0,0,0);
}
else {
myOX.SetCoord(V3(1),V3(2),V3(3));
myOY.SetCoord(V2(1),V2(2),V2(3));
}
}
//=======================================================================
//function : Line
//purpose :
//=======================================================================
Handle(Geom_Line) GeomPlate_BuildAveragePlane::Line() const
{
Standard_NoSuchObject_Raise_if ( IsPlane() , "Cannot use the function 'GeomPlate_BuildAveragePlane::Line()', the Object is a 'Geom_Plane'");
return myLine;
}
//=======================================================================
//function : IsPlane
//purpose :
//=======================================================================
Standard_Boolean GeomPlate_BuildAveragePlane::IsPlane() const
{
gp_Vec OZ=myOX^myOY;
if (OZ.SquareMagnitude()==0)
return Standard_False;
else
return Standard_True;
}
//=======================================================================
//function : IsLine
//purpose :
//=======================================================================
Standard_Boolean GeomPlate_BuildAveragePlane::IsLine() const
{
gp_Vec OZ=myOX^myOY;
if (OZ.SquareMagnitude()==0)
return Standard_True;
else
return Standard_False;
}
Standard_Boolean GeomPlate_BuildAveragePlane::HalfSpace( const TColgp_SequenceOfVec& NewNormals,
TColgp_SequenceOfVec& Normals,
GeomPlate_SequenceOfAij& Bset,
const Standard_Real LinTol,
const Standard_Real AngTol )
{
Standard_Real SquareTol = LinTol * LinTol;
TColgp_SequenceOfVec SaveNormals;
GeomPlate_SequenceOfAij SaveBset;
// 1
SaveNormals = Normals;
SaveBset = Bset;
gp_Vec Cross, NullVec( 0, 0, 0 );
GeomPlate_SequenceOfAij B1set, B2set;
Standard_Integer i, j, k;
i = 1;
if (Normals.IsEmpty())
{
if (NewNormals.Length() == 1)
{
Normals.Append( NewNormals.Last() );
return Standard_True;
}
// 2
Cross = NewNormals(1) ^ NewNormals(2);
if (Cross.SquareMagnitude() <= SquareTol)
return Standard_False;
Cross.Normalize();
#if DEB
GeomPlate_Aij A1( 1, 2, Cross );
#endif
Bset.Append( GeomPlate_Aij( 1, 2, Cross ) );
Bset.Append( GeomPlate_Aij( 2, 1, -Cross) );
Normals.Append( NewNormals(1) );
Normals.Append( NewNormals(2) );
i = 3;
}
for (; i <= NewNormals.Length(); i++)
{
// 3
Standard_Real Scal;
for (j = 1; j <= Bset.Length(); j++)
if ((Scal = Bset(j).Vec * NewNormals(i)) >= -LinTol)
B2set.Append( Bset(j) );
Standard_Integer ii = Normals.Length()+1;
for (j = 1; j <= ii-1; j++)
{
if (Normals(j).SquareMagnitude() == 0.)
continue;
// 4
Cross = NewNormals(i) ^ Normals(j);
if (Cross.SquareMagnitude() <= SquareTol)
{
Normals = SaveNormals;
Bset = SaveBset;
return Standard_False;
}
Cross.Normalize();
Standard_Boolean isNew = Standard_True;
for (k = 1; k <= B2set.Length(); k++)
if (B2set(k).Vec.IsOpposite( -Cross, AngTol )) //if (B2set(k).Vec.IsEqual( Cross, LinTol, AngTol ))
{
gp_Vec Cross1, Cross2;
Standard_Integer ind1 = B2set(k).Ind1, ind2 = B2set(k).Ind2;
if (ind1 == ii || ind2 == ii)
{
isNew = Standard_False;
break;
}
Cross1 = Normals( ind1 ) ^ NewNormals(i);
Cross2 = Normals( ind2 ) ^ NewNormals(i);
if (Cross1.SquareMagnitude() <= SquareTol || Cross2.SquareMagnitude() <= SquareTol)
{
Normals = SaveNormals;
Bset = SaveBset;
return Standard_False;
}
if (Cross1.IsOpposite( Cross2, AngTol ))
{
Cross2 = Normals( ind1 ) ^ Normals( ind2 );
if (Cross1.IsOpposite( Cross2, AngTol ))
{
Normals = SaveNormals;
Bset = SaveBset;
return Standard_False;
}
}
else
{
if (NewNormals(i).Angle( Normals( ind1 ) ) > NewNormals(i).Angle( Normals( ind2 ) ))
{
B2set(k).Ind2 = ind1;
B2set(k).Ind1 = ii;
}
else
B2set(k).Ind1 = ii;
}
isNew = Standard_False;
break;
}
if (isNew)
B1set.Append( GeomPlate_Aij( ii, j, Cross ) );
Cross.Reverse();
isNew = Standard_True;
for (k = 1; k <= B2set.Length(); k++)
if (B2set(k).Vec.IsOpposite( -Cross, AngTol )) //if (B2set(k).Vec.IsEqual( Cross, LinTol, AngTol ))
{
gp_Vec Cross1, Cross2;
Standard_Integer ind1 = B2set(k).Ind1, ind2 = B2set(k).Ind2;
if (ind1 == ii || ind2 == ii)
{
isNew = Standard_False;
break;
}
Cross1 = Normals( ind1 ) ^ NewNormals(i);
Cross2 = Normals( ind2 ) ^ NewNormals(i);
if (Cross1.SquareMagnitude() <= SquareTol || Cross2.SquareMagnitude() <= SquareTol)
{
Normals = SaveNormals;
Bset = SaveBset;
return Standard_False;
}
if (Cross1.IsOpposite( Cross2, AngTol ))
{
Cross2 = Normals( ind1 ) ^ Normals( ind2 );
if (Cross1.IsOpposite( Cross2, AngTol ))
{
Normals = SaveNormals;
Bset = SaveBset;
return Standard_False;
}
}
else
{
if (NewNormals(i).Angle( Normals( ind1 ) ) > NewNormals(i).Angle( Normals( ind2 ) ))
{
B2set(k).Ind2 = ind1;
B2set(k).Ind1 = ii;
}
else
B2set(k).Ind1 = ii;
}
isNew = Standard_False;
break;
}
if (isNew)
B1set.Append( GeomPlate_Aij( ii, j, Cross ) );
}
// 5
for (j = 1; j <= B1set.Length(); j++)
{
Standard_Boolean isGEnull = Standard_True;
for (k = 1; k <= Normals.Length(); k++)
{
if (Normals(k).SquareMagnitude() == 0.)
continue;
if (B1set(j).Vec * Normals(k) < -LinTol)
{
isGEnull = Standard_False;
break;
}
}
if (isGEnull)
B2set.Append( B1set(j) );
}
// 6
if (B2set.IsEmpty())
{
Normals = SaveNormals;
Bset = SaveBset;
return Standard_False;
}
// 7
Bset = B2set;
B2set.Clear();
B1set.Clear();
Normals.Append( NewNormals(i) );
// 8
for (j = 1; j <= Normals.Length(); j++)
{
if (Normals(j).SquareMagnitude() == 0.)
continue;
Standard_Boolean isFound = Standard_False;
for (k = 1; k <= Bset.Length(); k++)
if (j == Bset(k).Ind1 || j == Bset(k).Ind2)
{
isFound = Standard_True;
break;
}
if (! isFound)
Normals(j) = NullVec;
}
}
return Standard_True;
}

View File

@@ -0,0 +1,335 @@
-- File: GeomPlate_BuildPlateSurface.cdl
-- Created: Wed Apr 3 13:53:53 1996
-- Author: Stagiaire Frederic CALOONE
-- <cfc@stylox>
-- Modified: Wed Mar 5 09:45:42 1997
-- by: Joelle CHAUVET
-- G1134 : New methods EcartContraintes, EcartContour,
-- Disc2dContour, Disc3dContour,
-- Surface, Sense, Curves2d,
-- for using of GeomPlate_MakeApprox
-- + no more reference to TopoDS (suppression of method Face)
-- Modified:
-- New fields myTolCurv, myAnisotropie
-- and new method ComputeAnisotropie
-- New methods G0Eror( Index ), G1Error( Index ), G2Error( Index )
---Copyright: Matra Datavision 1996
class BuildPlateSurface from GeomPlate
---Purpose:
-- This class provides an algorithm for constructing such a plate surface that
-- it conforms to given curve and/or point constraints.
-- The algorithm accepts or constructs an initial surface
-- and looks for a deformation of it satisfying the
-- constraints and minimizing energy input.
-- A BuildPlateSurface object provides a framework for:
-- - defining or setting constraints
-- - implementing the construction algorithm
-- - consulting the result.
uses Pnt from gp,
Plate from Plate,
Surface from GeomPlate,
Surface from Geom,
HArray1OfInteger from TColStd,
Array1OfInteger from TColStd,
HArray1OfReal from TColStd,
HArray2OfReal from TColStd,
HArray1OfCurve from TColGeom2d,
SequenceOfXY from TColgp,
SequenceOfXYZ from TColgp,
HArray1OfHCurveOnSurface from GeomPlate,
Array1OfHCurveOnSurface from GeomPlate,
CurveConstraint from GeomPlate,
PointConstraint from GeomPlate,
HSequenceOfCurveConstraint from GeomPlate,
HSequenceOfPointConstraint from GeomPlate,
HArray1OfPnt2d from TColgp,
HArray1OfSequenceOfReal from GeomPlate,
ExtPS from Extrema,
Pnt2d from gp,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
Curve from Geom2d
raises
ConstructionError from Standard,
RangeError from Standard
is
Create( NPoints : HArray1OfInteger from TColStd;
TabCurve : HArray1OfHCurveOnSurface from GeomPlate;
Tang : HArray1OfInteger from TColStd;
Degree : Integer from Standard;
NbIter : Integer from Standard = 3;
Tol2d : Real from Standard = 0.00001;
Tol3d : Real from Standard = 0.0001;
TolAng : Real from Standard = 0.01;
TolCurv : Real from Standard = 0.1;
Anisotropie : Boolean from Standard = Standard_False )
returns BuildPlateSurface from GeomPlate
raises ConstructionError;
--- Purpose : Constructor compatible with the old version
-- with this constructor the constraint are given in a Array of Curve on Surface
-- The array NbPoints contains the number of points for each constraint.
-- The Array Tang contains the order of constraint for each Constraint: The possible values for this
-- order has to be -1 , 0 , 1 , 2 . Order i means constraint Gi.
-- NbIter is the maximum number of iteration to optimise the number of points for resolution
-- Degree is the degree of resolution for Plate
-- Tol2d is the tolerance used to test if two points of different constraint are identical in the
-- parametric space of the initial surface
-- Tol3d is used to test if two identical points in the 2d space are identical in 3d space
-- TolAng is used to compare the angle between normal of two identical points in the 2d space
-- Raises ConstructionError;
--if NbIter<1 or length of TabCurve is <1 or Degree < 2
Create ( Surf : Surface from Geom;
Degree : Integer from Standard = 3;
NbPtsOnCur : Integer from Standard = 10 ;
NbIter : Integer from Standard = 3;
Tol2d : Real from Standard = 0.00001;
Tol3d : Real from Standard = 0.0001;
TolAng : Real from Standard = 0.01;
TolCurv : Real from Standard = 0.1;
Anisotropie : Boolean from Standard = Standard_False )
returns BuildPlateSurface from GeomPlate
raises ConstructionError;
--if NbIter<1 or Degree < 2
Create (Degree : Integer from Standard = 3;
NbPtsOnCur : Integer from Standard = 10;
NbIter : Integer from Standard = 3;
Tol2d : Real from Standard = 0.00001;
Tol3d : Real from Standard = 0.0001;
TolAng : Real from Standard = 0.01;
TolCurv : Real from Standard = 0.1;
Anisotropie : Boolean from Standard = Standard_False )
returns BuildPlateSurface from GeomPlate
raises ConstructionError;
---Purpose: Initializes the BuildPlateSurface framework for
-- deforming plate surfaces using curve and point
-- constraints. You use the first constructor if you have
-- an initial surface to work with at construction time. If
-- not, you use the second. You can add one later by
-- using the method LoadInitSurface. If no initial
-- surface is loaded, one will automatically be computed.
-- The curve and point constraints will be defined by
-- using the method Add.
-- Before the call to the algorithm, the curve constraints
-- will be transformed into sequences of discrete points.
-- Each curve defined as a constraint will be given the
-- value of NbPtsOnCur as the average number of points on it.
-- Several arguments serve to improve performance of
-- the algorithm. NbIter, for example, expresses the
-- number of iterations allowed and is used to control the
-- duration of computation. To optimize resolution,
-- Degree will have the default value of 3.
-- The surface generated must respect several tolerance values:
-- - 2d tolerance given by Tol2d, with a default value of 0.00001
-- - 3d tolerance expressed by Tol3d, with a default value of 0.0001
-- - angular tolerance given by TolAng, with a default
-- value of 0.01, defining the greatest angle allowed
-- between the constraint and the target surface.
-- Exceptions
-- Standard_ConstructionError if NbIter is less than 1 or Degree is less than 3.
Init (me: in out);
--- Purpose: Resets all constraints
LoadInitSurface (me : in out; Surf : Surface from Geom);
--- Purpose: Loads the initial Surface
Add (me : in out;Cont : CurveConstraint from GeomPlate);
---Purpose: Adds the linear constraint cont.
SetNbBounds (me : in out; NbBounds : Integer from Standard);
Add (me : in out;Cont : PointConstraint from GeomPlate);
---Purpose: Adds the point constraint cont.
Perform ( me: in out )
raises RangeError;
---Purpose:
-- Calls the algorithm and computes the plate surface using
-- the loaded constraints. If no initial surface is given, the
-- algorithm automatically computes one.
-- Exceptions
-- Standard_RangeError if the value of the constraint is
-- null or if plate is not done.
CurveConstraint(me ; order : Integer from Standard)
returns CurveConstraint from GeomPlate;
--- Purpose : returns the CurveConstraints of order order
--
PointConstraint(me ; order : Integer from Standard)
returns PointConstraint from GeomPlate ;
---Purpose : returns the PointConstraint of order order
--
Disc2dContour (me :in out; nbp : Integer from Standard;
Seq2d : out SequenceOfXY from TColgp);
-- for the moment, nbp can be equal to 1, 2 or 4 if nbp = 1, the
-- evaluation takes place only on constraints points (*)
--
-- --*-------*---------------*-------------------*---------------*--
--
-- if nbp = 2, middle points (+) are added to constraints points
--
-- --*---+---*-------+-------*---------+---------*-------+-------*--
--
-- if nbp = 4, quarter points (o) and middle points (+) are added to constraints points
--
-- --*-o-+-o-*---o---+---o---*----o----+----o----*---o---+---o---*--
-- computes 2d constraints on Frontiere
-- see EcartContraintes for nbp
Disc3dContour (me :in out; nbp : Integer from Standard;
iordre : Integer from Standard;
Seq3d : out SequenceOfXYZ from TColgp);
-- computes 3d G0 constraints on Frontiere if iordre = 0
-- computes 3d G1 constraints on Frontiere if iordre = 1
-- see Disc2dContour for nbp
IsDone ( me ) returns Boolean;
--- Purpose:
-- Tests whether computation of the plate has been completed.
Surface ( me ) returns Surface from GeomPlate;
---Purpose:
-- Returns the result of the computation. This surface can
-- then be used by GeomPlate_MakeApprox for
-- converting the resulting surface into a BSpline.
SurfInit (me) returns Surface from Geom;
---Purpose: Returns the initial surface
Sense ( me ) returns HArray1OfInteger from TColStd;
---Purpose:
-- Allows you to ensure that the array of curves returned by
-- Curves2d has the correct orientation. Returns the
-- orientation of the curves in the the array returned by
-- Curves2d. Computation changes the orientation of
-- these curves. Consequently, this method returns the
-- orientation prior to computation.
Curves2d ( me ) returns HArray1OfCurve from TColGeom2d;
--- Purpose:
-- Extracts the array of curves on the plate surface which
-- correspond to the curve constraints set in Add.
Order ( me ) returns HArray1OfInteger from TColStd;
---Purpose:
-- Returns the order of the curves in the array returned by
-- Curves2d. Computation changes this order.
-- Consequently, this method returns the order of the
-- curves prior to computation.
G0Error (me) returns Real from Standard;
---Purpose: Returns the max distance betwen the result and the constraints
G1Error (me) returns Real from Standard;
---Purpose: Returns the max angle betwen the result and the constraints
G2Error (me) returns Real from Standard;
---Purpose: Returns the max difference of curvature betwen the result and the constraints
--
G0Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
---Purpose: Returns the max distance between the result and the constraint Index
G1Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
---Purpose: Returns the max angle between the result and the constraint Index
G2Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
---Purpose: Returns the max difference of curvature between the result and the constraint Index
--
EcartContraintesMil (me : in out; c : Integer from Standard;
d,an,courb : out HArray1OfReal from TColStd ) is private;
--- Purpose: Evaluates the distance, the angle between normals, and the "courbure"
-- on middle points of contraints an corresponding points on the GeomPlate_Surface
-- the results are given for a curve c
----Private methods
ProjectPoint (me :in out ; P : Pnt from gp)
returns Pnt2d from gp is private;
ProjectCurve (me :in out ; Curv : HCurve from Adaptor3d)
returns Curve from Geom2d is private;
ProjectedCurve (me :in out ; Curv : in out HCurve from Adaptor3d)
returns HCurve2d from Adaptor2d is private;
ComputeSurfInit (me : in out)
is private;
Intersect (me : in out;
PntInter : out HArray1OfSequenceOfReal from GeomPlate;
PntG1G1 : out HArray1OfSequenceOfReal from GeomPlate )
is private;
Discretise (me : in out;
PntInter : HArray1OfSequenceOfReal from GeomPlate;
PntG1G1 : HArray1OfSequenceOfReal from GeomPlate )
is private;
LoadCurve (me : in out; NbBoucle : Integer from Standard;
OrderMax : Integer = 2)
is private;
LoadPoint (me : in out; NbBoucle : Integer from Standard;
OrderMax : Integer = 2)
is private;
CalculNbPtsInit (me : in out) is private;
VerifSurface (me : in out ; NbLoop : Integer)
returns Boolean from Standard
is private;
VerifPoints (me; dist,ang,curv : out Real from Standard) is private;
CourbeJointive (me : in out; tolerance : Real from Standard)
returns Boolean from Standard is private;
ComputeAnisotropie(me) returns Real from Standard
is private;
IsOrderG1(me) returns Boolean from Standard
is private;
fields
myLinCont : HSequenceOfCurveConstraint from GeomPlate;
myParCont : HArray1OfSequenceOfReal from GeomPlate;
myPlateCont : HArray1OfSequenceOfReal from GeomPlate;
myPntCont : HSequenceOfPointConstraint from GeomPlate;
mySurfInit : Surface from Geom;
myPlanarSurfInit : Surface from Geom;
myGeomPlateSurface : Surface from GeomPlate;
myPlate : Plate from Plate;
myPrevPlate : Plate from Plate;
myAnisotropie : Boolean from Standard;
mySense : HArray1OfInteger from TColStd;
myDegree : Integer from Standard;
myInitOrder : HArray1OfInteger from TColStd;
myG0Error : Real from Standard;
myG1Error : Real from Standard;
myG2Error : Real from Standard;
myNbPtsOnCur : Integer from Standard;
mySurfInitIsPlane : Boolean from Standard;
mySurfInitIsGive : Boolean from Standard;
myNbIter : Integer from Standard;
myProj : ExtPS from Extrema;
-- TOLERANCE
myTol2d : Real from Standard;
myTol3d : Real from Standard;
myTolAng : Real from Standard;
myTolCurv : Real from Standard;
myTolU : Real from Standard;
myTolV : Real from Standard;
myNbBounds : Integer from Standard;
myIsLinear : Boolean from Standard;
myFree : Boolean from Standard;
end;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,211 @@
-- File: GeomPlate_CurveConstraint.cdl
-- Created: Mon May 5 12:12:26 1997
-- Author: Jerome LEMONIER
-- <jlr@sgi64>
-- Modified: Mon Nov 3 10:24:07 1997
-- Author: Joelle CHAUVET
-- constructeur vide et champs proteges
---Copyright: Matra Datavision 1997
--
class CurveConstraint from GeomPlate inherits TShared from MMgt
---Purpose:
-- Defines curves as constraints to be used to deform a surface.
uses
Pnt from gp,
Pnt2d from gp,
Vec from gp,
HCurveOnSurface from Adaptor3d,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
Surface from Geom,
Curve from Geom2d,
Function from Law,
SLProps from GeomLProp
raises
ConstructionError from Standard
is
Create returns CurveConstraint from GeomPlate;
---Purpose:
-- Initializes an empty curve constraint object.
Create (Boundary : HCurveOnSurface from Adaptor3d;
Order : Integer from Standard ;
NPt : Integer from Standard = 10;
TolDist : Real from Standard = 0.0001;
TolAng : Real from Standard = 0.01;
TolCurv : Real from Standard = 0.1
)
returns CurveConstraint from GeomPlate
raises ConstructionError;
--- Purpose: Create a constraint
-- Order is the order of the constraint. The possible values for order are -1,0,1,2.
-- Order i means constraints Gi
-- Npt is the number of points associated with the constraint.
-- TolDist is the maximum error to satisfy for G0 constraints
-- TolAng is the maximum error to satisfy for G1 constraints
-- TolCurv is the maximum error to satisfy for G2 constraints
-- These errors can be replaced by laws of criterion.
-- Raises ConstructionError if Order is not -1 , 0, 1, 2
Create (Boundary : HCurve from Adaptor3d;
Tang : Integer from Standard;
NPt : Integer from Standard = 10;
TolDist : Real from Standard = 0.0001)
returns CurveConstraint from GeomPlate
raises ConstructionError;
--- Purpose: Create a constraint
-- Order is the order of the constraint. The possible values for order are -1,0.
-- Order i means constraints Gi
-- Npt is the number of points associated with the constraint.
-- TolDist is the maximum error to satisfy for G0 constraints
-- These errors can be replaced by laws of criterion.
-- Raises ConstructionError if Order is not 0 or -1
SetOrder(me : mutable ; Order : Integer from Standard);
--- Purpose: Allows you to set the order of continuity required for
-- the constraints: G0, G1, and G2, controlled
-- respectively by G0Criterion G1Criterion and G2Criterion.
Order(me) returns Integer from Standard;
--- Purpose: Returns the order of constraint, one of G0, G1 or G2.
NbPoints(me) returns Integer from Standard;
---Purpose: Returns the number of points on the curve used as a
-- constraint. The default setting is 10. This parameter
-- affects computation time, which increases by the cube of
-- the number of points.
SetNbPoints(me : mutable ; NewNb : Integer from Standard);
---Purpose:
-- Allows you to set the number of points on the curve
-- constraint. The default setting is 10. This parameter
-- affects computation time, which increases by the cube of
-- the number of points.
SetG0Criterion(me : mutable ;G0Crit :Function from Law );
--- Purpose:
-- Allows you to set the G0 criterion. This is the law
-- defining the greatest distance allowed between the
-- constraint and the target surface for each point of the
-- constraint. If this criterion is not set, TolDist, the
-- distance tolerance from the constructor, is used.
SetG1Criterion(me : mutable ;G1Crit :Function from Law)
raises ConstructionError;
---Purpose:
-- Allows you to set the G1 criterion. This is the law
-- defining the greatest angle allowed between the
-- constraint and the target surface. If this criterion is not
-- set, TolAng, the angular tolerance from the constructor, is used.
-- Raises ConstructionError if the curve is not on a surface
SetG2Criterion(me : mutable ;G2Crit : Function from Law)
raises ConstructionError;
---Rurpose:
-- Allows you to set the G2 criterion. This is the law
-- defining the greatest difference in curvature allowed
-- between the constraint and the target surface. If this
-- criterion is not set, TolCurv, the curvature tolerance from
-- the constructor, is used.
-- Raises ConstructionError if the curve is not on a surface
G0Criterion(me ;U : Real from Standard) returns Real from Standard;
---Purpose: Returns the G0 criterion at the parametric point U on
-- the curve. This is the greatest distance allowed between
-- the constraint and the target surface at U.
G1Criterion(me ;U : Real from Standard) returns Real from Standard
raises ConstructionError;
---Purpose: Returns the G1 criterion at the parametric point U on
-- the curve. This is the greatest angle allowed between
-- the constraint and the target surface at U.
-- Raises ConstructionError if the curve is not on a surface
G2Criterion(me ;U : Real from Standard) returns Real from Standard
raises ConstructionError;
---Purpose: Returns the G2 criterion at the parametric point U on
-- the curve. This is the greatest difference in curvature
-- allowed between the constraint and the target surface at U.
-- Raises ConstructionError if the curve is not on a surface
FirstParameter (me) returns Real from Standard;
LastParameter (me) returns Real from Standard;
Length (me) returns Real from Standard;
LPropSurf (me : mutable;U : Real from Standard)
---C++: return &
returns SLProps from GeomLProp
raises ConstructionError;
--if the curve is not on a surface
D0(me ;U : Real from Standard; P : out Pnt);
D1(me ;U : Real from Standard; P : out Pnt; V1, V2 : out Vec )
raises ConstructionError;
--if the curve is not on a surface
D2(me ;U : Real from Standard; P : out Pnt; V1, V2 , V3, V4, V5 : out Vec)
raises ConstructionError;
--if the curve is not on a surface
--
Curve3d (me ) returns HCurve from Adaptor3d;
SetCurve2dOnSurf(me : mutable; Curve2d : Curve from Geom2d);
---Purpose: loads a 2d curve associated the surface resulting of the constraints
Curve2dOnSurf ( me ) returns Curve from Geom2d;
---Purpose: Returns a 2d curve associated the surface resulting of the constraints
--
--Private methods:
--
SetProjectedCurve(me : mutable; Curve2d : HCurve2d from Adaptor2d; TolU,TolV : Real from Standard);
---Purpose: loads a 2d curve resulting from the normal projection of
-- the curve on the initial surface
--
ProjectedCurve ( me ) returns HCurve2d from Adaptor2d ;
---Purpose: Returns the projected curve resulting from the normal projection of the
-- curve on the initial surface
--
fields
myFrontiere : HCurveOnSurface from Adaptor3d is protected;
myNbPoints : Integer from Standard is protected;
myOrder : Integer from Standard is protected;
my3dCurve : HCurve from Adaptor3d is protected;
myTang : Integer from Standard is protected;
my2dCurve : Curve from Geom2d is protected;
myHCurve2d : HCurve2d from Adaptor2d is protected;
myG0Crit : Function from Law is protected;
myG1Crit : Function from Law is protected;
myG2Crit : Function from Law is protected;
myConstG0 : Boolean from Standard is protected;
myConstG1 : Boolean from Standard is protected;
myConstG2 : Boolean from Standard is protected;
myLProp : SLProps from GeomLProp is protected;
--Tolerance
myTolDist : Real from Standard is protected;
myTolAng : Real from Standard is protected;
myTolCurv : Real from Standard is protected;
myTolU : Real from Standard is protected;
myTolV : Real from Standard is protected;
end;

View File

@@ -0,0 +1,335 @@
// File: GeomPlate_CurveConstraint.cxx
// Created: Mon May 5 16:01:23 1997
// Author: Jerome LEMONIER
// <jlr@sgi64>
// Modified: Mon Nov 3 10:24:07 1997
// Author: Joelle CHAUVET
// ne traite que les GeomAdaptor_Surface;
// plus de reference a BRepAdaptor
#include <GeomPlate_CurveConstraint.ixx>
#include <GCPnts_AbscissaPoint.hxx>
#include <Adaptor2d_HCurve2d.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <GeomAdaptor.hxx>
#include <Precision.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <ProjLib_ProjectedCurve.hxx>
#include <Approx_Curve2d.hxx>
#include <GeomAbs_Shape.hxx>
//---------------------------------------------------------
// Constructeur vide
//---------------------------------------------------------
GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint () :
myLProp(2,1.e-4)
{
}
//---------------------------------------------------------
// Constructeurs avec courbe sur surface
//---------------------------------------------------------
GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_HCurveOnSurface)& Boundary,
const Standard_Integer Tang,
const Standard_Integer NPt,
const Standard_Real TolDist,
const Standard_Real TolAng,
const Standard_Real TolCurv
) :
myFrontiere(Boundary),
myLProp(2,TolDist),
myTolDist(TolDist),
myTolAng(TolAng),
myTolCurv(TolCurv)
{ myOrder=Tang;
if ((Tang<-1)||(Tang>2))
Standard_Failure::Raise("GeomPlate : The continuity is not G0 G1 or G2");
myNbPoints=NPt;
myConstG0=Standard_True;
myConstG1=Standard_True;
myConstG2=Standard_True;
if (myFrontiere.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint : Curve must be on a Surface");
Handle(Geom_Surface) Surf;
Handle(GeomAdaptor_HSurface) GS1;
GS1 = Handle(GeomAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
if (!GS1.IsNull()) {
Surf=GS1->ChangeSurface().Surface();
}
else {
// Handle(BRepAdaptor_HSurface) BS1;
// BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
// Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face());
Standard_Failure::Raise("GeomPlate_CurveConstraint : Surface must be GeomAdaptor_Surface");
}
myLProp.SetSurface(Surf);
my2dCurve.Nullify();
myHCurve2d.Nullify();
myTolU=0.;
myTolV=0.;
myG0Crit.Nullify();
myG1Crit.Nullify();
myG2Crit.Nullify();
}
//---------------------------------------------------------
// Constructeurs avec courbe 3d (pour continuite G0 G-1)
//---------------------------------------------------------
GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_HCurve)& Boundary,
const Standard_Integer Tang,
const Standard_Integer NPt,
const Standard_Real TolDist) :
my3dCurve(Boundary),
myLProp(2,TolDist),
myTolDist(TolDist)
{ myOrder=Tang;
if ((Tang!=-1)&&(Tang!=0))
Standard_Failure::Raise("GeomPlate : The continuity is not G0 or G-1");
myNbPoints=NPt;
myConstG0=Standard_True;
myConstG1=Standard_True;
myConstG2=Standard_True;
my2dCurve.Nullify();
myHCurve2d.Nullify();
myTolU=0.;
myTolV=0.;
myG0Crit.Nullify();
myG1Crit.Nullify();
myG2Crit.Nullify();
}
//---------------------------------------------------------
// Fonction : FirstParameter
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: FirstParameter() const
{
if (!myHCurve2d.IsNull())
return myHCurve2d->FirstParameter();
else if (my3dCurve.IsNull())
return myFrontiere->FirstParameter();
else
return my3dCurve->FirstParameter();
}
//---------------------------------------------------------
// Fonction : LastParameter
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: LastParameter() const
{
if (!myHCurve2d.IsNull())
return myHCurve2d->LastParameter();
else if (my3dCurve.IsNull())
return myFrontiere->LastParameter();
else
return my3dCurve->LastParameter();
}
//---------------------------------------------------------
// Fonction : Length
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: Length() const
{ GCPnts_AbscissaPoint AP;
if (my3dCurve.IsNull())
{// GCPnts_AbscissaPoint A(myFrontiere->Curve(),AP.Length(myFrontiere->Curve())/2,myFrontiere->FirstParameter());
// Standard_Real toto=A.Parameter();
//cout<<toto<<endl;
return AP.Length(myFrontiere->GetCurve());
}
else
{ // GCPnts_AbscissaPoint A(my3dCurve->Curve(),AP.Length(my3dCurve->Curve())/2,my3dCurve->FirstParameter());
// Standard_Real toto=A.Parameter();
//cout<<toto<<endl;
return AP.Length(my3dCurve->GetCurve());
}
}
//---------------------------------------------------------
// Fonction : D0
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: D0(const Standard_Real U,gp_Pnt& P) const
{ gp_Pnt2d P2d;
if (my3dCurve.IsNull())
{ P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D0(P2d.Coord(1),P2d.Coord(2),P);
}
else
my3dCurve->D0(U,P);
}
//---------------------------------------------------------
// Fonction : D1
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: D1(const Standard_Real U,
gp_Pnt& P,gp_Vec& V1,gp_Vec& V2) const
{ gp_Pnt2d P2d;
if (!my3dCurve.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D1(P2d.Coord(1),P2d.Coord(2),P,V1,V2);
}
//---------------------------------------------------------
// Fonction : D2
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: D2(const Standard_Real U,
gp_Pnt& P,gp_Vec& V1,gp_Vec& V2,
gp_Vec& V3,gp_Vec& V4,gp_Vec& V5) const
{ gp_Pnt2d P2d;
if (!my3dCurve.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D2(P2d.Coord(1),P2d.Coord(2),P,V1,V2,V3,V4,V5);
}
//---------------------------------------------------------
// Fonction : SetG0Criterion
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetG0Criterion(const Handle_Law_Function &G0Crit)
{ myG0Crit=G0Crit;
myConstG0=Standard_False;
}
//---------------------------------------------------------
// Fonction : SetG1Criterion
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetG1Criterion(const Handle_Law_Function &G1Crit)
{ if (!my3dCurve.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
myG1Crit=G1Crit;
myConstG1=Standard_False;
}
//---------------------------------------------------------
// Fonction : SetG2Criterion
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetG2Criterion(const Handle_Law_Function &G2Crit)
{ if (!my3dCurve.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
myG2Crit=G2Crit;
myConstG2=Standard_False;
}
//---------------------------------------------------------
// Fonction : G0Criterion
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: G0Criterion(const Standard_Real U) const
{ if (myConstG0)
return myTolDist;
else
return myG0Crit->Value(U);
}
//---------------------------------------------------------
// Fonction : G1Criterion
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: G1Criterion(const Standard_Real U) const
{ if (!my3dCurve.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
if (myConstG1)
return myTolAng;
else
return myG1Crit->Value(U);
}
//---------------------------------------------------------
// Fonction : G2Criterion
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: G2Criterion(const Standard_Real U) const
{ if (!my3dCurve.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
if (myConstG2)
return myTolCurv;
else
return myG2Crit->Value(U);
}
//---------------------------------------------------------
// Fonction : Curve2dOnSurf
//---------------------------------------------------------
Handle(Geom2d_Curve) GeomPlate_CurveConstraint :: Curve2dOnSurf () const
{
if(my2dCurve.IsNull() && !myHCurve2d.IsNull())
{
Handle(Geom2d_Curve) C2d;
GeomAbs_Shape Continuity = GeomAbs_C1;
Standard_Integer MaxDegree = 10;
Standard_Integer MaxSeg=20+myHCurve2d->NbIntervals(GeomAbs_C3);
Approx_Curve2d appr(myHCurve2d,myHCurve2d->FirstParameter(),myHCurve2d->LastParameter(),
myTolU,myTolV,Continuity,MaxDegree,MaxSeg);
C2d = appr.Curve();
return C2d;
}
else return my2dCurve;
}
//---------------------------------------------------------
// Fonction : SetCurve2dOnSurf
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetCurve2dOnSurf (const Handle(Geom2d_Curve) &Curve)
{ my2dCurve=Curve;
}
//---------------------------------------------------------
// Fonction : ProjectedCurve
//---------------------------------------------------------
Handle(Adaptor2d_HCurve2d) GeomPlate_CurveConstraint :: ProjectedCurve () const
{
return myHCurve2d;
}
//---------------------------------------------------------
// Fonction : SetProjectedCurve
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetProjectedCurve (const Handle(Adaptor2d_HCurve2d) &Curve,
const Standard_Real TolU,const Standard_Real TolV)
{ myHCurve2d=Curve;
myTolU=TolU;
myTolV=TolV;
}
//---------------------------------------------------------
// Fonction : Curve3d
//---------------------------------------------------------
Handle(Adaptor3d_HCurve) GeomPlate_CurveConstraint :: Curve3d () const
{ if (my3dCurve.IsNull())
return myFrontiere;
else
return my3dCurve;
}
//------------------------------------------------------------
//Fonction : NbPoints
//------------------------------------------------------------
Standard_Integer GeomPlate_CurveConstraint::NbPoints() const
{
return myNbPoints;
}
//------------------------------------------------------------
//Fonction : Order
//------------------------------------------------------------
Standard_Integer GeomPlate_CurveConstraint::Order() const
{
return myOrder;
}
//------------------------------------------------------------
//Fonction : SetNbPoints
//------------------------------------------------------------
void GeomPlate_CurveConstraint::SetNbPoints(const Standard_Integer NewNb)
{
myNbPoints = NewNb;
}
//------------------------------------------------------------
//Fonction : SetOrder
//------------------------------------------------------------
void GeomPlate_CurveConstraint::SetOrder(const Standard_Integer Order)
{
myOrder = Order;
}
//------------------------------------------------------------
//Fonction : LPropSurf
//------------------------------------------------------------
GeomLProp_SLProps &GeomPlate_CurveConstraint::LPropSurf(const Standard_Real U)
{ if (myFrontiere.IsNull())
Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
gp_Pnt2d P2d= myFrontiere->ChangeCurve().GetCurve()->Value(U);
myLProp.SetParameters(P2d.X(),P2d.Y());
return myLProp;
}

View File

@@ -0,0 +1,69 @@
-- File: GeomPlate_MakeApprox.cdl
-- Created: Wed Mar 5 11:49:39 1996
-- Author: Joelle CHAUVET
-- <jct@sgi38>
---Copyright: Matra Datavision 1996
class MakeApprox from GeomPlate
---Purpose:
-- Allows you to convert a GeomPlate surface into a BSpline.
uses
Surface from GeomPlate,
BSplineSurface from Geom,
Shape from GeomAbs,
Criterion from AdvApp2Var
is
Create(SurfPlate: Surface from GeomPlate;
PlateCrit: Criterion from AdvApp2Var;
Tol3d: Real;
Nbmax: Integer;
dgmax: Integer;
Continuity: Shape from GeomAbs = GeomAbs_C1;
EnlargeCoeff : Real from Standard = 1.1)
returns MakeApprox;
---Purpose: Converts SurfPlate into a Geom_BSplineSurface with
-- n Bezier pieces (n<=Nbmax) of degree <= dgmax
-- and an approximation error < Tol3d if possible
-- the criterion CritPlate is satisfied if possible
Create(SurfPlate: Surface from GeomPlate;
Tol3d: Real;
Nbmax: Integer;
dgmax: Integer;
dmax : Real;
CritOrder: Integer = 0;
Continuity: Shape from GeomAbs = GeomAbs_C1;
EnlargeCoeff : Real from Standard = 1.1)
returns MakeApprox;
---Purpose: Converts SurfPlate into a Geom_BSplineSurface with
-- n Bezier pieces (n<=Nbmax) of degree <= dgmax
-- and an approximation error < Tol3d if possible
-- if CritOrder = -1 , no criterion is used
-- if CritOrder = 0 , a PlateG0Criterion is used with max value > 10*dmax
-- if CritOrder = 1 , a PlateG1Criterion is used with max value > 10*dmax
-- WARNING : for CritOrder = 0 or 1, only the constraints points of SurfPlate
-- are used to evaluate the value of the criterion
Surface(me) returns BSplineSurface from Geom;
---Purpose: Returns the BSpline surface extracted from the
-- GeomPlate_MakeApprox object.
ApproxError(me) returns Real;
---Purpose: Returns the error in computation of the approximation
-- surface. This is the distance between the entire target
-- BSpline surface and the entire original surface
-- generated by BuildPlateSurface and converted by GeomPlate_Surface.
CriterionError(me) returns Real;
---Purpose: Returns the criterion error in computation of the
-- approximation surface. This is estimated relative to the
-- curve and point constraints only.
fields
myPlate : Surface from GeomPlate;
mySurface : BSplineSurface from Geom;
myAppError,myCritError : Real;
end;

View File

@@ -0,0 +1,468 @@
// File: GeomPlate_MakeApprox.cxx
// Created: Wed Mar 5 11:01:17 1996
// Author: Joelle CHAUVET
// <jct@sgi38>
// PMN : 7/07/1997 : cout en #if DEB ... #endif
#include <GeomPlate_MakeApprox.ixx>
#include <GeomPlate_Surface.hxx>
#include <GeomPlate_PlateG0Criterion.hxx>
#include <GeomPlate_PlateG1Criterion.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_Surface.hxx>
#include <TColgp_SequenceOfXY.hxx>
#include <TColgp_SequenceOfXYZ.hxx>
#include <gp_Vec.hxx>
#include <gp_Pnt.hxx>
#include <gp_XY.hxx>
#include <PLib.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <Handle_TColStd_HArray1OfReal.hxx>
#include <Handle_TColStd_HArray2OfReal.hxx>
#include <AdvApp2Var_Criterion.hxx>
#include <AdvApp2Var_ApproxAFunc2Var.hxx>
#include <AdvApprox_PrefCutting.hxx>
#include <AdvApprox_Cutting.hxx>
#include <AdvApprox_DichoCutting.hxx>
#include <Plate_Plate.hxx>
static Handle(Geom_Surface) fonct = NULL;
extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
// Dimension
Standard_Real * UStartEnd,
// StartEnd[2] in U
Standard_Real * VStartEnd,
// StartEnd[2] in V
Standard_Integer * FavorIso,
// Choice of constante, 1 for U, 2 for V
Standard_Real * ConstParam,
// Value of constant parameter
Standard_Integer * NbParams,
// Number of parameters N
Standard_Real * Parameters,
// Values of parameters,
Standard_Integer * UOrder,
// Derivative Request in U
Standard_Integer * VOrder,
// Derivative Request in V
Standard_Real * Result,
// Result[Dimension,N]
Standard_Integer * ErrorCode)
// Error Code
{
*ErrorCode = 0;
Standard_Integer idim,jpar;
Standard_Real Upar,Vpar;
// Dimension incorrecte
if (*Dimension!=3) {
*ErrorCode = 1;
}
// Parametres incorrects
if (*FavorIso==1) {
Upar = *ConstParam;
if (( Upar < UStartEnd[0] ) || ( Upar > UStartEnd[1] )) {
*ErrorCode = 2;
}
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
if (( Vpar < VStartEnd[0] ) || ( Vpar > VStartEnd[1] )) {
*ErrorCode = 2;
}
}
}
else {
Vpar = *ConstParam;
if (( Vpar < VStartEnd[0] ) || ( Vpar > VStartEnd[1] )) {
*ErrorCode = 2;
}
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
if (( Upar < UStartEnd[0] ) || ( Upar > UStartEnd[1] )) {
*ErrorCode = 2;
}
}
}
// Initialisation
for (idim=1;idim<=*Dimension;idim++) {
for (jpar=1;jpar<=*NbParams;jpar++) {
Result[idim-1+(jpar-1)*(*Dimension)] = 0.;
}
}
Standard_Integer Order = *UOrder + *VOrder;
gp_Pnt pnt;
// gp_Vec vect, v1, v2, v3, v4, v5, v6, v7, v8, v9;
gp_Vec v1, v2, v3, v4, v5;
if (*FavorIso==1) {
Upar = *ConstParam;
switch (Order) {
case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
pnt = fonct->Value(Upar,Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
}
break;
case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
fonct->D1(Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y();
Result[2+(jpar-1)*(*Dimension)] = v1.Z();
}
else {
Result[(jpar-1)*(*Dimension)] = v2.X();
Result[1+(jpar-1)*(*Dimension)] = v2.Y();
Result[2+(jpar-1)*(*Dimension)] = v2.Z();
}
}
break;
case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
fonct->D2(Upar, Vpar, pnt, v1, v2, v3, v4, v5);
if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y();
Result[2+(jpar-1)*(*Dimension)] = v3.Z();
}
else if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v5.X();
Result[1+(jpar-1)*(*Dimension)] = v5.Y();
Result[2+(jpar-1)*(*Dimension)] = v5.Z();
}
else if (*UOrder==0) {
Result[(jpar-1)*(*Dimension)] = v4.X();
Result[1+(jpar-1)*(*Dimension)] = v4.Y();
Result[2+(jpar-1)*(*Dimension)] = v4.Z();
}
}
break;
}
}
else {
Vpar = *ConstParam;
switch (Order) {
case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
pnt = fonct->Value(Upar,Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
}
break;
case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
fonct->D1(Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y();
Result[2+(jpar-1)*(*Dimension)] = v1.Z();
}
else {
Result[(jpar-1)*(*Dimension)] = v2.X();
Result[1+(jpar-1)*(*Dimension)] = v2.Y();
Result[2+(jpar-1)*(*Dimension)] = v2.Z();
}
}
break;
case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
fonct->D2(Upar, Vpar, pnt, v1, v2, v3, v4, v5);
if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y();
Result[2+(jpar-1)*(*Dimension)] = v3.Z();
}
else if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v5.X();
Result[1+(jpar-1)*(*Dimension)] = v5.Y();
Result[2+(jpar-1)*(*Dimension)] = v5.Z();
}
else if (*UOrder==0) {
Result[(jpar-1)*(*Dimension)] = v4.X();
Result[1+(jpar-1)*(*Dimension)] = v4.Y();
Result[2+(jpar-1)*(*Dimension)] = v4.Z();
}
}
break;
}
}
}
//=======================================================================
//function : GeomPlate_MakeApprox
//purpose :
//=======================================================================
GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& SurfPlate,
const AdvApp2Var_Criterion& PlateCrit,
const Standard_Real Tol3d,
const Standard_Integer Nbmax,
const Standard_Integer dgmax,
const GeomAbs_Shape Continuity,
const Standard_Real EnlargeCoeff)
{
myPlate = SurfPlate;
fonct = myPlate;
Standard_Real U0=0., U1=0., V0=0., V1=0.;
myPlate->RealBounds(U0, U1, V0, V1);
U0 = EnlargeCoeff * U0;
U1 = EnlargeCoeff * U1;
V0 = EnlargeCoeff * V0;
V1 = EnlargeCoeff * V1;
Standard_Integer nb1 = 0, nb2 = 0, nb3 = 1;
Handle(TColStd_HArray1OfReal) nul1 =
new TColStd_HArray1OfReal(1,1);
nul1->Init(0.);
Handle(TColStd_HArray2OfReal) nul2 =
new TColStd_HArray2OfReal(1,1,1,4);
nul2->Init(0.);
Handle(TColStd_HArray1OfReal) eps3D =
new TColStd_HArray1OfReal(1,1);
eps3D->Init(Tol3d);
Handle(TColStd_HArray2OfReal) epsfr =
new TColStd_HArray2OfReal(1,1,1,4);
epsfr->Init(Tol3d);
GeomAbs_IsoType myType = GeomAbs_IsoV;
Standard_Integer myPrec = 0;
AdvApprox_DichoCutting myDec;
//POP pour WNT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
U0,U1,V0,V1,
myType,
Continuity, Continuity,
myPrec,
dgmax,dgmax,Nbmax,ev,
// dgmax,dgmax,Nbmax,myPlateSurfEval,
PlateCrit,myDec,myDec);
mySurface = AppPlate.Surface(1);
myAppError = AppPlate.MaxError(3,1);
myCritError = AppPlate.CritError(3,1);
#if DEB
cout<<"Approximation results"<<endl;
cout<<" Approximation error : "<<myAppError<<endl;
cout<<" Criterium error : "<<myCritError<<endl;
#endif
}
//=======================================================================
//function : GeomPlate_MakeApprox
//purpose :
//=======================================================================
GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& SurfPlate,
const Standard_Real Tol3d,
const Standard_Integer Nbmax,
const Standard_Integer dgmax,
const Standard_Real dmax,
const Standard_Integer CritOrder,
const GeomAbs_Shape Continuity,
const Standard_Real EnlargeCoeff)
{
myPlate = SurfPlate;
fonct = myPlate;
TColgp_SequenceOfXY Seq2d;
TColgp_SequenceOfXYZ Seq3d;
if (CritOrder>=0) {
// contraintes 2d d'ordre 0
myPlate->Constraints(Seq2d);
// contraintes 3d correspondantes sur plate
Standard_Integer i,nbp=Seq2d.Length();
for(i=1;i<=nbp;i++){
gp_XY P2d=Seq2d.Value(i);
gp_Pnt PP;
gp_Vec v1h,v2h,v3h;
if (CritOrder==0) {
// a l'ordre 0
fonct->D0(P2d.X(),P2d.Y(),PP);
gp_XYZ P3d(PP.X(),PP.Y(),PP.Z());
Seq3d.Append(P3d);
}
else {
// a l'ordre 1
fonct->D1(P2d.X(),P2d.Y(),PP,v1h,v2h);
v3h=v1h^v2h;
gp_XYZ P3d(v3h.X(),v3h.Y(),v3h.Z());
Seq3d.Append(P3d);
}
}
}
Standard_Real U0=0., U1=0., V0=0., V1=0.;
myPlate->RealBounds(U0, U1, V0, V1);
U0 = EnlargeCoeff * U0;
U1 = EnlargeCoeff * U1;
V0 = EnlargeCoeff * V0;
V1 = EnlargeCoeff * V1;
Standard_Real seuil = Tol3d;
if (CritOrder==0&&Tol3d<10*dmax) {
seuil=10*dmax;
#if DEB
cout<<"Seuil G0 choisi trop faible par rapport au contour. On prend "<<seuil<<endl;
#endif
}
if (CritOrder==1&&Tol3d<10*dmax) {
seuil=10*dmax;
#if DEB
cout<<"Seuil G1 choisi trop faible par rapport au contour. On prend "<<seuil<<endl;
#endif
}
Standard_Integer nb1 = 0, nb2 = 0, nb3 = 1;
Handle(TColStd_HArray1OfReal) nul1 =
new TColStd_HArray1OfReal(1,1);
nul1->Init(0.);
Handle(TColStd_HArray2OfReal) nul2 =
new TColStd_HArray2OfReal(1,1,1,4);
nul2->Init(0.);
Handle(TColStd_HArray1OfReal) eps3D =
new TColStd_HArray1OfReal(1,1);
eps3D->Init(Tol3d);
Handle(TColStd_HArray2OfReal) epsfr =
new TColStd_HArray2OfReal(1,1,1,4);
epsfr->Init(Tol3d);
GeomAbs_IsoType myType = GeomAbs_IsoV;
Standard_Integer myPrec = 0;
AdvApprox_DichoCutting myDec;
if (CritOrder==-1) {
myPrec = 1;
// POP pour NT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
U0,U1,V0,V1,
myType,
Continuity, Continuity,
myPrec,
dgmax,dgmax,Nbmax,ev,
myDec,myDec);
mySurface = AppPlate.Surface(1);
myAppError = AppPlate.MaxError(3,1);
myCritError = 0.;
#if DEB
cout<<"Approximation results"<<endl;
cout<<" Approximation error : "<<myAppError<<endl;
#endif
}
else if (CritOrder==0) {
GeomPlate_PlateG0Criterion Crit0(Seq2d,Seq3d,seuil);
// POP pour NT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
U0,U1,V0,V1,
myType,
Continuity, Continuity,
myPrec,
dgmax,dgmax,Nbmax,ev,
// dgmax,dgmax,Nbmax,myPlateSurfEval,
Crit0,myDec,myDec);
mySurface = AppPlate.Surface(1);
myAppError = AppPlate.MaxError(3,1);
myCritError = AppPlate.CritError(3,1);
#if DEB
cout<<"Approximation results"<<endl;
cout<<" Approximation error : "<<myAppError<<endl;
cout<<" Criterium error : "<<myCritError<<endl;
#endif
}
else if (CritOrder==1) {
GeomPlate_PlateG1Criterion Crit1(Seq2d,Seq3d,seuil);
// POP pour NT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
U0,U1,V0,V1,
myType,
Continuity, Continuity,
myPrec,
dgmax,dgmax,Nbmax,ev,
// dgmax,dgmax,Nbmax,myPlateSurfEval,
Crit1,myDec,myDec);
mySurface = AppPlate.Surface(1);
myAppError = AppPlate.MaxError(3,1);
myCritError = AppPlate.CritError(3,1);
#if DEB
cout<<"Approximation results"<<endl;
cout<<" Approximation error : "<<myAppError<<endl;
cout<<" Criterium error : "<<myCritError<<endl;
#endif
}
}
//=======================================================================
//function : Surface
//purpose :
//=======================================================================
Handle(Geom_BSplineSurface) GeomPlate_MakeApprox::Surface() const
{
return mySurface;
}
//=======================================================================
//function : ApproxError
//purpose :
//=======================================================================
Standard_Real GeomPlate_MakeApprox::ApproxError() const
{
return myAppError;
}
//=======================================================================
//function : CriterionError
//purpose :
//=======================================================================
Standard_Real GeomPlate_MakeApprox::CriterionError() const
{
return myCritError;
}

View File

@@ -0,0 +1,37 @@
-- File: GeomPlate_PlateG0Criterion.cdl
-- Created: Wed Mar 5 11:46:39 1997
-- Author: Joelle CHAUVET
-- <jct@sgi38>
---Copyright: Matra Datavision 1997
class PlateG0Criterion from GeomPlate inherits Criterion from AdvApp2Var
uses
SequenceOfXY,SequenceOfXYZ from TColgp,
Patch,Context from AdvApp2Var,
CriterionType,CriterionRepartition from AdvApp2Var
is
Create( Data : SequenceOfXY;
G0Data : SequenceOfXYZ;
Maximum : Real;
Type : CriterionType = AdvApp2Var_Absolute;
Repart : CriterionRepartition = AdvApp2Var_Regular) returns PlateG0Criterion;
Value(me; P : in out Patch; C : Context )
is redefined;
IsSatisfied(me; P : Patch ) returns Boolean
is redefined;
fields
myData : SequenceOfXY;
myXYZ : SequenceOfXYZ;
end PlateG0Criterion;

View File

@@ -0,0 +1,135 @@
// File: GeomPlate_PlateG0Criterion.cxx
// Created: Wed Mar 5 10:04:41 1997
// Author: Joelle CHAUVET
// <jct@sgi38>
//Modified by Jerome LEMONIER
// Tue Jun 17 10:20:35 1997
// Modification de la comparaison dans la methode
// Value (Appel a des distances remplace par le calcul
// de la distance au carre)
#include <GeomPlate_PlateG0Criterion.ixx>
#include <AdvApp2Var_Criterion.hxx>
#include <TColgp_SequenceOfXY.hxx>
#include <TColgp_SequenceOfXYZ.hxx>
#include <gp_Vec.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <PLib.hxx>
//============================================================================
//function : GeomPlate_PlateG0Criterion
//purpose :
//============================================================================
GeomPlate_PlateG0Criterion::
GeomPlate_PlateG0Criterion(const TColgp_SequenceOfXY& Data,
const TColgp_SequenceOfXYZ& G0Data,
const Standard_Real Maximum,
const AdvApp2Var_CriterionType Type,
const AdvApp2Var_CriterionRepartition Repart)
{
myData=Data;
myXYZ=G0Data;
myMaxValue = Maximum;
myType = Type;
myRepartition = Repart;
}
//============================================================================
//function : Value
//purpose :
//============================================================================
void GeomPlate_PlateG0Criterion::Value(AdvApp2Var_Patch& P,
const AdvApp2Var_Context& C) const
{
Standard_Real UInt[2],VInt[2];
Standard_Integer MaxNbCoeff[2], NbCoeff[2];
Standard_Real * adrCoeff = NULL ;
adrCoeff = (Standard_Real *) &P.Coefficients(1,C) ->ChangeArray1()(P.Coefficients(1,C)->Lower());
MaxNbCoeff[0] = C.ULimit();
MaxNbCoeff[1] = C.VLimit();
NbCoeff[0] = P.NbCoeffInU();
NbCoeff[1] = P.NbCoeffInV();
UInt[0] = P.U0();
UInt[1] = P.U1();
VInt[0] = P.V0();
VInt[1] = P.V1();
Standard_Real up,vp, dist = 0.;
Standard_Integer dimension = 3 * NbCoeff[1];
TColStd_Array1OfReal Patch(1, NbCoeff[0] * dimension);
TColStd_Array1OfReal Curve(1, dimension);
TColStd_Array1OfReal Point(1, 3);
Standard_Real * Coeffs = (Standard_Real *) &Patch.ChangeValue(1);
#ifdef DEB
Standard_Real * Result =
#endif
(Standard_Real *) &Curve.ChangeValue(1);
Standard_Real * Digit = (Standard_Real *) &Point.ChangeValue(1);
Standard_Integer k1, k2, pos, ll=1;
for (k1 = 1; k1 <= NbCoeff[0]; k1++) {
// JAG 99.04.29 pos = 3*(MaxNbCoeff[0])*(k1-1);
pos = 3*(MaxNbCoeff[1])*(k1-1);
for (k2 = 1; k2 <= NbCoeff[1]; k2++, pos+=3 ) {
Patch(ll) = adrCoeff[pos];
Patch(ll+1) = adrCoeff[pos+1];
Patch(ll+2) = adrCoeff[pos+2];
ll += 3;
}
}
Standard_Integer i, NbCtr = myData.Length();
for(i=1; i<=NbCtr; i++) {
gp_XY P2d = myData.Value(i);
// gp_Pnt PP = myXYZ.Value(i);
gp_Pnt P3d;
if ( UInt[0]<P2d.X() && P2d.X()<UInt[1]
&& VInt[0]<P2d.Y() && P2d.Y()<VInt[1] ) {
// u,v recadres sur (-1,1)
up = (2*P2d.X()-UInt[0]-UInt[1])
/ (UInt[1]-UInt[0]) ;
vp = (2*P2d.Y()-VInt[0]-VInt[1])
/ (VInt[1]-VInt[0]) ;
PLib::EvalPoly2Var(up,vp,
0,0,
NbCoeff[0]-1,NbCoeff[1]-1,3,
Coeffs[0],
Digit[0]);
P3d.SetCoord(1,Digit[0]);
P3d.SetCoord(2,Digit[1]);
P3d.SetCoord(3,Digit[2]);
Standard_Real x=(P3d.Coord(1)-myXYZ.Value(i).Coord(1)),
y=(P3d.Coord(2)-myXYZ.Value(i).Coord(2)),
z=(P3d.Coord(3)-myXYZ.Value(i).Coord(3)),
DistTmp= x*x+y*y+z*z;
if( DistTmp>dist ) {
dist = DistTmp;
}
}
}
P.SetCritValue(Sqrt(dist));
}
//============================================================================
//function : IsSatisfied
//purpose :
//============================================================================
Standard_Boolean GeomPlate_PlateG0Criterion::IsSatisfied(const AdvApp2Var_Patch& P) const
{
return (P.CritValue() < myMaxValue);
}

View File

@@ -0,0 +1,38 @@
-- File: GeomPlate_PlateG1Criterion.cdl
-- Created: Wed Mar 5 11:46:39 1997
-- Author: Joelle CHAUVET
-- <jct@sgi38>
---Copyright: Matra Datavision 1997
class PlateG1Criterion from GeomPlate inherits Criterion from AdvApp2Var
uses
SequenceOfXY,SequenceOfXYZ from TColgp,
Patch,Context from AdvApp2Var,
CriterionType,CriterionRepartition from AdvApp2Var
is
Create( Data : SequenceOfXY;
G1Data : SequenceOfXYZ;
Maximum : Real;
Type : CriterionType = AdvApp2Var_Absolute;
Repart : CriterionRepartition = AdvApp2Var_Regular)
returns PlateG1Criterion;
Value(me; P : in out Patch; C : Context )
is redefined;
IsSatisfied(me; P : Patch ) returns Boolean
is redefined;
fields
myData : SequenceOfXY;
myXYZ : SequenceOfXYZ;
end PlateG1Criterion;

View File

@@ -0,0 +1,148 @@
// File: GeomPlate_PlateG1Criterion.cxx
// Created: Wed Mar 5 10:04:41 1997
// Author: Joelle CHAUVET
// <jct@sgi38>
#include <GeomPlate_PlateG1Criterion.ixx>
#include <AdvApp2Var_Criterion.hxx>
#include <TColgp_SequenceOfXY.hxx>
#include <TColgp_SequenceOfXYZ.hxx>
#include <gp_Vec.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <PLib.hxx>
// static Standard_Boolean first = Standard_True;
//============================================================================
//function : GeomPlate_PlateG1Criterion
//purpose :
//============================================================================
GeomPlate_PlateG1Criterion::
GeomPlate_PlateG1Criterion(const TColgp_SequenceOfXY& Data,
const TColgp_SequenceOfXYZ& G1Data,
const Standard_Real Maximum,
const AdvApp2Var_CriterionType Type,
const AdvApp2Var_CriterionRepartition Repart)
{
myData=Data;
myXYZ=G1Data;
myMaxValue = Maximum;
myType = Type;
myRepartition = Repart;
}
//============================================================================
//function : Value
//purpose :
//============================================================================
void GeomPlate_PlateG1Criterion::Value(AdvApp2Var_Patch& P,
const AdvApp2Var_Context& C) const
{
Standard_Real UInt[2],VInt[2];
Standard_Integer MaxNbCoeff[2], NbCoeff[2];
Standard_Real * adrCoeff = NULL ;
adrCoeff = (Standard_Real *) &P.Coefficients(1,C) ->ChangeArray1()(P.Coefficients(1,C)->Lower());
MaxNbCoeff[0] = C.ULimit();
MaxNbCoeff[1] = C.VLimit();
NbCoeff[0] = P.NbCoeffInU();
NbCoeff[1] = P.NbCoeffInV();
UInt[0] = P.U0();
UInt[1] = P.U1();
VInt[0] = P.V0();
VInt[1] = P.V1();
Standard_Real up,vp, ang = 0.;
Standard_Integer dimension = 3 * NbCoeff[1];
TColStd_Array1OfReal Patch(1, NbCoeff[0] * dimension);
TColStd_Array1OfReal Curve(1, 2*dimension);
TColStd_Array1OfReal Point(1, 3);
Standard_Real * Coeffs = (Standard_Real *) &Patch.ChangeValue(1);
#ifdef DEB
Standard_Real * Result = (Standard_Real *) &Curve.ChangeValue(1);
#else
Curve.ChangeValue(1);
#endif
Standard_Real * Digit = (Standard_Real *) &Point.ChangeValue(1);
Standard_Integer k1, k2, pos, ll=1;
for (k1 = 1; k1 <= NbCoeff[0]; k1++) {
// JAG 99.04.29 pos = 3*(MaxNbCoeff[0])*(k1-1);
pos = 3*(MaxNbCoeff[1])*(k1-1);
for (k2 = 1; k2 <= NbCoeff[1]; k2++, pos+=3 ) {
Patch(ll) = adrCoeff[pos];
Patch(ll+1) = adrCoeff[pos+1];
Patch(ll+2) = adrCoeff[pos+2];
ll += 3;
}
}
Standard_Integer i, NbCtr = myData.Length();
for(i=1; i<=NbCtr; i++) {
gp_Vec v1s,v2s,v3s;
gp_Vec v3h(myXYZ.Value(i).X(),myXYZ.Value(i).Y(),myXYZ.Value(i).Z());
gp_XY P2d = myData.Value(i);
if ( UInt[0]<P2d.X() && P2d.X()<UInt[1]
&& VInt[0]<P2d.Y() && P2d.Y()<VInt[1] ) {
// u,v recadres sur (-1,1)
up = (2*P2d.X()-UInt[0]-UInt[1])
/ (UInt[1]-UInt[0]) ;
vp = (2*P2d.Y()-VInt[0]-VInt[1])
/ (VInt[1]-VInt[0]) ;
PLib::EvalPoly2Var(up,vp,
1,0,
NbCoeff[0]-1,NbCoeff[1]-1,3,
Coeffs[0],
Digit[0]);
v1s.SetCoord(1,Digit[0]);
v1s.SetCoord(2,Digit[1]);
v1s.SetCoord(3,Digit[2]);
PLib::EvalPoly2Var(up,vp,
0,1,
NbCoeff[0]-1,NbCoeff[1]-1,3,
Coeffs[0],
Digit[0]);
v2s.SetCoord(1,Digit[0]);
v2s.SetCoord(2,Digit[1]);
v2s.SetCoord(3,Digit[2]);
v3s=v1s^v2s;
if( v3s.Angle(v3h)>(PI/2)) {
if ((PI-v3s.Angle(v3h))>ang) {
ang=(PI-v3s.Angle(v3h));
}
}
else {
if(v3s.Angle(v3h)>ang) {
ang=v3s.Angle(v3h);
}
}
}
}
P.SetCritValue(ang);
}
//============================================================================
//function : IsSatisfied
//purpose :
//============================================================================
Standard_Boolean GeomPlate_PlateG1Criterion::IsSatisfied(const AdvApp2Var_Patch& P) const
{
return (P.CritValue() < myMaxValue);
}

View File

@@ -0,0 +1,163 @@
-- File: GeomPlate_PointConstraint.cdl
-- Created: Mon May 5 13:32:19 1997
-- Author: Jerome LEMONIER
-- <jlr@sgi64>
---Copyright: Matra Datavision 1997
class PointConstraint from GeomPlate inherits TShared from MMgt
---Purpose:
-- Defines points as constraints to be used to deform a surface.
uses
Pnt from gp,
Pnt2d from gp,
Surface from Geom,
Vec from gp,
SLProps from GeomLProp
raises
ConstructionError from Standard
is
Create (Pt : Pnt from gp;
Order: Integer from Standard ;
TolDist : Real from Standard = 0.0001)
returns PointConstraint from GeomPlate
raises ConstructionError from Standard;
---Purpose: Constructs a point constraint object defined by Pt, a 3D point
-- Order gives the order of constraint, one of:
-- - -1 i.e. none, or 0 i.e.G0 when assigned to Pt
-- - -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when
-- assigned to U, V and Surf.
-- In this constructor, only TolDist is given.
-- Distance tolerance represents the greatest distance
-- allowed between the constraint and the target surface.
-- Angular tolerance represents the largest angle allowed
-- between the constraint and the target surface. Curvature
-- tolerance represents the greatest difference in curvature
-- allowed between the constraint and the target surface.
-- Raises ConstructionError if Order is not 0 or -1
Create (U,V : Real from Standard;
Surf : Surface from Geom;
Order: Integer from Standard;
TolDist : Real from Standard=0.0001;
TolAng : Real from Standard=0.01;
TolCurv: Real from Standard=0.1)
returns PointConstraint from GeomPlate;
---Purpose: Constructs a point constraint object defined by
-- the intersection point of U and V on the surface Surf.
-- Order gives the order of constraint, one of:
-- - -1 i.e. none, or 0 i.e.G0 when assigned to Pt
-- - -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when
-- assigned to U, V and Surf.
-- In this constructor the surface to be generated must
-- respect several tolerance values only:
-- - the distance tolerance TolDist
-- - the angular tolerance TolAng
-- - the curvature tolerance, TolCurv.
-- Distance tolerance represents the greatest distance
-- allowed between the constraint and the target surface.
-- Angular tolerance represents the largest angle allowed
-- between the constraint and the target surface. Curvature
-- tolerance represents the greatest difference in curvature
-- allowed between the constraint and the target surface.Creates a punctual constraint.
SetOrder(me : mutable ; Order: Integer from Standard);
Order(me) returns Integer from Standard;
---Purpose:
-- Returns the order of constraint: G0, G1, and G2,
-- controlled respectively by G0Criterion G1Criterion and G2Criterion.
SetG0Criterion(me : mutable; TolDist : Real from Standard) ;
--- Purpose:
-- Allows you to set the G0 criterion. This is the law
-- defining the greatest distance allowed between the
-- constraint and the target surface. If this criterion is not
-- set, {TolDist, the distance tolerance from the constructor, is used
SetG1Criterion(me : mutable; TolAng : Real from Standard)
raises ConstructionError from Standard;
---Purpose:
-- Allows you to set the G1 criterion. This is the law
-- defining the greatest angle allowed between the
-- constraint and the target surface. If this criterion is not
-- set, TolAng, the angular tolerance from the constructor, is used.
-- Raises ConstructionError if the point is not on the surface
SetG2Criterion(me : mutable; TolCurv : Real from Standard)
raises ConstructionError from Standard;
---Purpose:
-- Allows you to set the G2 criterion. This is the law
-- defining the greatest difference in curvature allowed
-- between the constraint and the target surface. If this
-- criterion is not set, TolCurv, the curvature tolerance from
-- the constructor, is used.
-- Raises ConstructionError if the point is not on the surface
G0Criterion(me) returns Real from Standard ;
---Purpose:
-- Returns the G0 criterion. This is the greatest distance
-- allowed between the constraint and the target surface.
G1Criterion(me) returns Real from Standard
raises ConstructionError from Standard;
---Purpose:
-- Returns the G1 criterion. This is the greatest angle
-- allowed between the constraint and the target surface.
-- Raises ConstructionError if the point is not on the surface.
G2Criterion(me) returns Real from Standard
raises ConstructionError from Standard;
---Purpose:
-- Returns the G2 criterion. This is the greatest difference
-- in curvature allowed between the constraint and the target surface.
-- Raises ConstructionError if the point is not on the surface
D0(me ;P : out Pnt) ;
D1(me ;P : out Pnt; V1, V2 : out Vec )
raises ConstructionError from Standard;
--if the point is not on the surface
D2(me ;P : out Pnt; V1, V2 , V3, V4, V5 : out Vec)
raises ConstructionError from Standard;
--if the point is not on the surface
HasPnt2dOnSurf(me) returns Boolean;
SetPnt2dOnSurf(me : mutable; Pnt :Pnt2d from gp);
Pnt2dOnSurf (me) returns Pnt2d from gp;
LPropSurf (me : mutable)
---C++: return &
returns SLProps from GeomLProp
raises ConstructionError;
--if the curve is not on a surface
fields
myLProp : SLProps from GeomLProp;
myPoint : Pnt from gp;
myPt2d : Pnt2d from gp;
mySurf : Surface from Geom;
myD11 : Vec from gp;
myD12 : Vec from gp;
myD21 : Vec from gp;
myD22 : Vec from gp;
myD23 : Vec from gp;
myU : Real from Standard;
myV : Real from Standard;
myTolDist : Real from Standard;
myTolAng : Real from Standard;
myTolCurv : Real from Standard;
myOrder : Integer from Standard is protected;
hasPnt2dOnSurf : Boolean;
end;

View File

@@ -0,0 +1,183 @@
// File: GeomPlate_PointConstraint.cxx
// Created: Mon May 5 16:01:43 1997
// Author: Jerome LEMONIER
// <jlr@sgi64>
#include <GeomPlate_PointConstraint.ixx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <gp_Ax3.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <gp_Trsf.hxx>
#include <Geom_Plane.hxx>
#include <Extrema_POnSurf.hxx>
#include <Extrema_ExtPS.hxx>
#include <GeomAdaptor_Surface.hxx>
//---------------------------------------------------------
// Constructeurs avec un point
//---------------------------------------------------------
GeomPlate_PointConstraint::GeomPlate_PointConstraint(const gp_Pnt& Pt,
const Standard_Integer Order,
const Standard_Real TolDist)
:
myOrder(Order),
myLProp(2,TolDist),
myPoint(Pt),
myTolDist(TolDist),
hasPnt2dOnSurf(Standard_False)
{ if ((myOrder>1)||(myOrder<-1))
Standard_Failure::Raise("GeomPlate_PointConstraint : the constraint must 0 or -1 with a point");
}
//---------------------------------------------------------
// Constructeurs avec un point sur surface
//---------------------------------------------------------
GeomPlate_PointConstraint::GeomPlate_PointConstraint
(const Standard_Real U,
const Standard_Real V,
const Handle(Geom_Surface)& Surf,
const Standard_Integer Order,
const Standard_Real TolDist,
const Standard_Real TolAng,
const Standard_Real TolCurv)
:myOrder(Order),
myLProp(2,TolDist),
mySurf(Surf),
myU(U),
myV(V),
myTolDist(TolDist),
myTolAng(TolAng),
myTolCurv(TolCurv),
hasPnt2dOnSurf(Standard_False)
{
Surf->D2(myU,myV,myPoint,myD11,myD12,myD21,myD22,myD23);
myLProp.SetSurface(Surf);
}
//---------------------------------------------------------
// Fonction : D0
//---------------------------------------------------------
void GeomPlate_PointConstraint::D0(gp_Pnt& P) const
{ P=myPoint;
}
//---------------------------------------------------------
// Fonction : D1
//---------------------------------------------------------
void GeomPlate_PointConstraint::D1(gp_Pnt& P,gp_Vec& V1,gp_Vec& V2) const
{ P=myPoint;
V1=myD11;
V2=myD12;
}
//---------------------------------------------------------
// Fonction : D2
//---------------------------------------------------------
void GeomPlate_PointConstraint::D2(gp_Pnt& P,gp_Vec& V1,gp_Vec& V2,gp_Vec& V3,gp_Vec& V4,gp_Vec& V5) const
{ P=myPoint;
V1=myD11;
V2=myD12;
V3=myD21;
V4=myD22;
V5=myD23;
}
//---------------------------------------------------------
// Fonction : SetG0Criterion
//---------------------------------------------------------
void GeomPlate_PointConstraint :: SetG0Criterion( const Standard_Real TolDist )
{
myTolDist = TolDist;
}
//---------------------------------------------------------
// Fonction : SetG1Criterion
//---------------------------------------------------------
void GeomPlate_PointConstraint :: SetG1Criterion( const Standard_Real TolAng )
{
myTolAng = TolAng;
}
//---------------------------------------------------------
// Fonction : SetG2Criterion
//---------------------------------------------------------
void GeomPlate_PointConstraint :: SetG2Criterion( const Standard_Real TolCurv )
{
myTolCurv = TolCurv;
}
//---------------------------------------------------------
// Fonction : G0Criterion
//---------------------------------------------------------
Standard_Real GeomPlate_PointConstraint::G0Criterion() const
{ return myTolDist;
}
//---------------------------------------------------------
// Fonction : G1Criterion
//---------------------------------------------------------
Standard_Real GeomPlate_PointConstraint::G1Criterion() const
{ return myTolAng;
}
//---------------------------------------------------------
// Fonction : G2Criterion
//---------------------------------------------------------
Standard_Real GeomPlate_PointConstraint::G2Criterion() const
{ return myTolCurv;
}
//---------------------------------------------------------
// Fonction : Surface
//---------------------------------------------------------
//Handle(Geom_Surface) GeomPlate_PointConstraint::Surface() const
//{ Standard_Failure::Raise("GeomPlate_PointConstraint.cxx : The surface does not exist");
//}
//------------------------------------------------------------
//Fonction : LPropSurf
//------------------------------------------------------------
GeomLProp_SLProps &GeomPlate_PointConstraint::LPropSurf()
{ // if (myFrontiere.IsNull())
// Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
// gp_Pnt2d P2d= myFrontiere->ChangeCurve().GetCurve()->Value(U);
myLProp.SetParameters(myU,myV);
return myLProp;
}
//------------------------------------------------------------
//Fonction : Order
//------------------------------------------------------------
Standard_Integer GeomPlate_PointConstraint::Order() const
{
return myOrder;
}
//------------------------------------------------------------
//Fonction : SetOrder
//------------------------------------------------------------
void GeomPlate_PointConstraint::SetOrder(const Standard_Integer Order)
{ myOrder=Order;
}
//------------------------------------------------------------
//Fonction : HasPnt2dOnSurf
//------------------------------------------------------------
Standard_Boolean GeomPlate_PointConstraint::HasPnt2dOnSurf() const
{
return hasPnt2dOnSurf;
}
//------------------------------------------------------------
//Fonction : SetPnt2dOnSurf
//------------------------------------------------------------
void GeomPlate_PointConstraint::SetPnt2dOnSurf(const gp_Pnt2d& Pnt2d)
{
myPt2d=Pnt2d;
hasPnt2dOnSurf = Standard_True;
}
//------------------------------------------------------------
//Fonction : Pnt2dOnSurf
//------------------------------------------------------------
gp_Pnt2d GeomPlate_PointConstraint::Pnt2dOnSurf() const
{ return myPt2d;
}

View File

@@ -0,0 +1,301 @@
-- File: GeomPlate_Surface.cdl
-- Created: Thu Nov 21 13:47:59 1996
-- Author: Joelle CHAUVET
-- <jct@sgi38>
-- Modified: Wed Mar 5 09:45:42 1997
-- by: Joelle CHAUVET
-- G1134 : new methods RealBounds and Constraints
---Copyright: Matra Datavision 1996
class Surface from GeomPlate inherits Surface from Geom
---Purpose:
-- Describes the characteristics of plate surface objects
-- returned by BuildPlateSurface::Surface. These can be
-- used to verify the quality of the resulting surface before
-- approximating it to a Geom_BSpline surface generated
-- by MakeApprox. This proves necessary in cases where
-- you want to use the resulting surface as the support for
-- a shape. The algorithmically generated surface cannot
-- fill this function as is, and as a result must be converted first.
uses Pnt from gp,
Vec from gp,
Trsf from gp,
GTrsf2d from gp,
Shape from GeomAbs,
Curve from Geom,
Surface from Geom,
Plate from Plate,
Array2OfPnt2d from TColgp,
Array2OfPnt from TColgp,
SequenceOfXY from TColgp
raises RangeError from Standard,
NoSuchObject from Standard,
UndefinedDerivative from Geom,
UndefinedValue from Geom
is
Create ( Surfinit : Surface from Geom; Surfinter : Plate from Plate)
returns mutable Surface from GeomPlate ;
UReverse (me : mutable)
---Purpose :
-- Reverses the U direction of parametrization of <me>.
-- The bounds of the surface are not modified.
;
UReversedParameter (me; U : Real) returns Real
---Purpose: Return the parameter on the Ureversed surface for
-- the point of parameter U on <me>.
--
-- me->UReversed()->Value(me->UReversedParameter(U),V)
--
-- is the same point as
--
-- me->Value(U,V)
;
VReverse (me : mutable)
---Purpose :
-- Reverses the V direction of parametrization of <me>.
-- The bounds of the surface are not modified.
;
VReversedParameter (me; V : Real) returns Real
---Purpose: Return the parameter on the Vreversed surface for
-- the point of parameter V on <me>.
--
-- me->VReversed()->Value(U,me->VReversedParameter(V))
--
-- is the same point as
--
-- me->Value(U,V)
;
TransformParameters(me; U,V : in out Real; T : Trsf from gp)
---Purpose: Computes the parameters on the transformed surface for
-- the transform of the point of parameters U,V on <me>.
--
-- me->Transformed(T)->Value(U',V')
--
-- is the same point as
--
-- me->Value(U,V).Transformed(T)
--
-- Where U',V' are the new values of U,V after calling
--
-- me->TranformParameters(U,V,T)
--
-- This methods does not change <U> and <V>
--
-- It can be redefined. For example on the Plane,
-- Cylinder, Cone, Revolved and Extruded surfaces.
is redefined;
ParametricTransformation(me; T : Trsf from gp) returns GTrsf2d from gp
---Purpose: Returns a 2d transformation used to find the new
-- parameters of a point on the transformed surface.
--
-- me->Transformed(T)->Value(U',V')
--
-- is the same point as
--
-- me->Value(U,V).Transformed(T)
--
-- Where U',V' are obtained by transforming U,V with
-- th 2d transformation returned by
--
-- me->ParametricTransformation(T)
--
-- This methods returns an identity transformation
--
-- It can be redefined. For example on the Plane,
-- Cylinder, Cone, Revolved and Extruded surfaces.
--
is redefined;
Bounds(me; U1, U2, V1, V2 : out Real)
-- To get the parametric bounds of the surface.
-- Returned values can be RealFirst or RealLast if the surface is
-- infinite.
;
IsUClosed (me) returns Boolean
---Purpose :
-- Is the surface closed in the parametric direction U ?
-- Returns True if for each parameter V the distance
-- between the point P (UFirst, V) and P (ULast, V) is
-- lower or equal to Resolution from gp. UFirst and ULast
-- are the parametric bounds in the U direction.
;
IsVClosed (me) returns Boolean
---Purpose :
-- Is the surface closed in the parametric direction V ?
-- Returns True if for each parameter U the distance
-- between the point P (U, VFirst) and P (U, VLast) is
-- lower or equal to Resolution from gp. VFirst and VLast
-- are the parametric bounds in the V direction.
;
IsUPeriodic (me) returns Boolean
---Purpose :
-- Is the parametrization of a surface periodic in the
-- direction U ?
-- It is possible only if the surface is closed in this
-- parametric direction and if the following relation is
-- satisfied :
-- for each parameter V the distance between the point
-- P (U, V) and the point P (U + T, V) is lower or equal
-- to Resolution from package gp. T is the parametric period
-- and must be a constant.
;
UPeriod (me) returns Real from Standard
---Purpose: returns the Uperiod.
raises
NoSuchObject from Standard
---Purpose: raises if the surface is not uperiodic.
is redefined;
IsVPeriodic (me) returns Boolean
---Purpose :
-- Is the parametrization of a surface periodic in the
-- direction U ?
-- It is possible only if the surface is closed in this
-- parametric direction and if the following relation is
-- satisfied :
-- for each parameter V the distance between the point
-- P (U, V) and the point P (U + T, V) is lower or equal
-- to Resolution from package gp. T is the parametric period
-- and must be a constant.
;
VPeriod (me) returns Real from Standard
---Purpose: returns the Vperiod.
raises
NoSuchObject from Standard
---Purpose: raises if the surface is not vperiodic.
is redefined;
UIso (me; U : Real) returns mutable Curve
---Purpose : Computes the U isoparametric curve.
;
VIso (me; V : Real) returns mutable Curve
---Purpose : Computes the V isoparametric curve.
;
Continuity (me) returns Shape from GeomAbs
---Purpose :
-- Global Continuity of the surface in direction U and V :
-- C0 : only geometric continuity,
-- C1 : continuity of the first derivative all along the surface,
-- C2 : continuity of the second derivative all along the surface,
-- C3 : continuity of the third derivative all along the surface,
-- G1 : tangency continuity all along the surface,
-- G2 : curvature continuity all along the surface,
-- CN : the order of continuity is infinite.
--- Example :
-- If the surface is C1 in the V parametric direction and C2
-- in the U parametric direction Shape = C1.
;
IsCNu (me; N : Integer) returns Boolean
---Purpose :
--- Returns the order of continuity of the surface in the
-- U parametric direction.
raises RangeError
---Purpose : Raised if N < 0.
;
IsCNv (me; N : Integer) returns Boolean
---Purpose :
--- Returns the order of continuity of the surface in the
-- V parametric direction.
raises RangeError
---Purpose : Raised if N < 0.
;
D0 (me; U, V : Real; P : out Pnt)
---Purpose :
-- Computes the point of parameter U,V on the surface.
raises UndefinedValue
---Purpose :
-- Raised only for an "OffsetSurface" if it is not possible to
-- compute the current point.
;
D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec)
---Purpose :
-- Computes the point P and the first derivatives in the
-- directions U and V at this point.
raises UndefinedDerivative
---Purpose : Raised if the continuity of the surface is not C1.
;
D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec)
---Purpose :
-- Computes the point P, the first and the second derivatives in
-- the directions U and V at this point.
raises UndefinedDerivative
---Purpose : Raised if the continuity of the surface is not C2.
;
D3 (me; U, V : Real; P : out Pnt;
D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV :out Vec)
---Purpose :
-- Computes the point P, the first,the second and the third
-- derivatives in the directions U and V at this point.
raises UndefinedDerivative
---Purpose : Raised if the continuity of the surface is not C2.
;
DN (me; U, V : Real; Nu, Nv : Integer) returns Vec
---Purpose ;
-- Computes the derivative of order Nu in the direction U and Nv
-- in the direction V at the point P(U, V).
raises UndefinedDerivative,
---Purpose :
-- Raised if the continuity of the surface is not CNu in the U
-- direction or not CNv in the V direction.
RangeError
---Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
;
Copy (me) returns mutable like me;
Transform (me : mutable; T : Trsf) ;
---Purpose :
-- Transformation of a geometric object. This tansformation
-- can be a translation, a rotation, a symmetry, a scaling
-- or a complex transformation obtained by combination of
-- the previous elementaries transformations.
-- (see class Transformation of the package Geom).
CallSurfinit (me) returns Surface from Geom;
SetBounds (me : mutable ; Umin,Umax,Vmin,Vmax : in Real from Standard );
RealBounds(me; U1, U2, V1, V2 : out Real);
-- To get the real parametric bounds of the surface.
Constraints(me; Seq : out SequenceOfXY);
-- To get the 2d constraints used by Plate
fields
mySurfinter : Plate from Plate;
mySurfinit : Surface from Geom;
myUmin,myUmax,myVmin,myVmax : Real from Standard;
end;

View File

@@ -0,0 +1,393 @@
// File: GeomPlate_Surface.cxx
// Created: Thu Nov 21 13:47:59 1996
// Author: Joelle CHAUVET
// <jct@sgi38>
// Modified: Wed Mar 5 09:45:42 1997
// by: Joelle CHAUVET
// G1134 : new methods RealBounds and Constraints
// Modified: Mon Jun 16 15:22:41 1997
// by: Jerome LEMONIER
// Correction de la methode D2 (faute de frappe dans le code)
// Correction de la methode D1 (D0 inutile)
#include <GeomPlate_Surface.ixx>
#include <gp_XY.hxx>
//=======================================================================
//function : GeomPlate_Surface
//purpose :
//=======================================================================
GeomPlate_Surface::GeomPlate_Surface(const Handle(Geom_Surface)& Surfinit,const Plate_Plate& Surfinter) : mySurfinter(Surfinter),mySurfinit(Surfinit)
{
}
//=======================================================================
//function : UReverse
//purpose :
//=======================================================================
void GeomPlate_Surface::UReverse()
{
//Standard_Failure::Raise("UReverse");
}
//=======================================================================
//function : UReversedParameter
//purpose :
//=======================================================================
Standard_Real GeomPlate_Surface::UReversedParameter(const Standard_Real U) const
{ //Standard_Failure::Raise("UReversedParameter");
return (-U);
}
//=======================================================================
//function : VReverse
//purpose :
//=======================================================================
void GeomPlate_Surface::VReverse()
{ //Standard_Failure::Raise("VReverse");
}
//=======================================================================
//function : VReversedParameter
//purpose :
//=======================================================================
Standard_Real GeomPlate_Surface::VReversedParameter(const Standard_Real V) const
{ //Standard_Failure::Raise("VReversedParameter");
return (-V);
}
//=======================================================================
//function : TransformParameters
//purpose :
//=======================================================================
//void GeomPlate_Surface::TransformParameters(Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const
void GeomPlate_Surface::TransformParameters(Standard_Real& , Standard_Real& , const gp_Trsf& ) const
{//Standard_Failure::Raise("TransformParameters");
}
//=======================================================================
//function : ParametricTransformation
//purpose :
//=======================================================================
//gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& T) const
gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& ) const
{//Standard_Failure::Raise("ParametricTransformation");
return gp_GTrsf2d();
}
//=======================================================================
//function : Bounds
//purpose :
//=======================================================================
void GeomPlate_Surface::Bounds(Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const
{
if (mySurfinit->DynamicType() == STANDARD_TYPE(GeomPlate_Surface))
mySurfinit->Bounds(U1,U2,V1,V2);
else
{U1=myUmin;U2=myUmax;V1=myVmin;V2=myVmax;}
}
//=======================================================================
//function : IsUClosed
//purpose :
//=======================================================================
Standard_Boolean GeomPlate_Surface::IsUClosed() const
{ //Standard_Failure::Raise("IsUClosed(");
//return 1;
return 0;
}
//=======================================================================
//function : IsVClosed
//purpose :
//=======================================================================
Standard_Boolean GeomPlate_Surface::IsVClosed() const
{ //Standard_Failure::Raise("IsVClosed(");
//return 1;
return 0;
}
//=======================================================================
//function : IsUPeriodic
//purpose :
//=======================================================================
Standard_Boolean GeomPlate_Surface::IsUPeriodic() const
{
return Standard_False;
}
//=======================================================================
//function : UPeriod
//purpose :
//=======================================================================
Standard_Real GeomPlate_Surface::UPeriod() const
{
return Standard_False;
}
//=======================================================================
//function : IsVPeriodic
//purpose :
//=======================================================================
Standard_Boolean GeomPlate_Surface::IsVPeriodic() const
{
return Standard_False;
}
//=======================================================================
//function : VPeriod
//purpose :
//=======================================================================
Standard_Real GeomPlate_Surface::VPeriod() const
{
return Standard_False;
}
//=======================================================================
//function : UIso
//purpose :
//=======================================================================
//Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real U) const
Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real ) const
{ //Standard_Failure::Raise("UIso");
return Handle(Geom_Curve)();
}
//=======================================================================
//function : VIso
//purpose :
//=======================================================================
//Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real V) const
Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real ) const
{ //Standard_Failure::Raise("VIso");
return Handle(Geom_Curve)();
}
//=======================================================================
//function : Continuity
//purpose :
//=======================================================================
GeomAbs_Shape GeomPlate_Surface::Continuity() const
{ //Standard_Failure::Raise("Continuity()");
return GeomAbs_Shape();
}
//=======================================================================
//function : IsCNu
//purpose :
//=======================================================================
//Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer N) const
Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer ) const
{ Standard_Failure::Raise("IsCNu");
return 1;
}
//=======================================================================
//function : IsCNv
//purpose :
//=======================================================================
//Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer N) const
Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer ) const
{ Standard_Failure::Raise("IsCNv");
return 1;
}
//=======================================================================
//function : D0
//purpose :
//=======================================================================
void GeomPlate_Surface::D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const
{
gp_XY P1(U,V);
gp_Pnt P2;
mySurfinit->D0(U,V,P2);
gp_XYZ P3;//=mySurfinter.Evaluate(P1);
P3=mySurfinter.Evaluate(P1);
for (Standard_Integer i=1; i<=3; i++)
{
P.SetCoord(i,P3.Coord(i)+P2.Coord(i));
}
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
void GeomPlate_Surface::D1(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const
{
gp_XY P1(U,V);
gp_Pnt P2;
D0(U,V,P);
gp_Vec V1U,V1V;
mySurfinit->D1(U,V,P2,V1U,V1V);
gp_XYZ V2U=mySurfinter.EvaluateDerivative(P1,1,0);
gp_XYZ V2V=mySurfinter.EvaluateDerivative(P1,0,1);
for (Standard_Integer i=1; i<=3; i++)
{
D1U.SetCoord(i,V1U.Coord(i)+V2U.Coord(i));
D1V.SetCoord(i,V1V.Coord(i)+V2V.Coord(i));
}
}
//=======================================================================
//function : D2
//purpose :
//=======================================================================
void GeomPlate_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
{
gp_XY P1(U,V);
gp_Pnt P2;
gp_Vec V1U,V1V,V1UV,vv,v;
D1(U,V,P,D1U,D1V);
mySurfinit->D2(U,V,P2,vv,v,V1U,V1V,V1UV);
gp_XYZ V2U=mySurfinter.EvaluateDerivative(P1,2,0);
gp_XYZ V2V=mySurfinter.EvaluateDerivative(P1,0,2);
gp_XYZ V2UV=mySurfinter.EvaluateDerivative(P1,1,1);
for (Standard_Integer i=1; i<=3; i++)
{
D2U.SetCoord(i,V1U.Coord(i)+V2U.Coord(i));
D2V.SetCoord(i,V1V.Coord(i)+V2V.Coord(i));
D2UV.SetCoord(i,V1UV.Coord(i)+V2UV.Coord(i));
}
}
//=======================================================================
//function : D3
//purpose :
//=======================================================================
//void GeomPlate_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 GeomPlate_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_Failure::Raise("D3");
}
//=======================================================================
//function : DN
//purpose :
//=======================================================================
//gp_Vec GeomPlate_Surface::DN(const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const
gp_Vec GeomPlate_Surface::DN(const Standard_Real , const Standard_Real , const Standard_Integer , const Standard_Integer ) const
{ Standard_Failure::Raise("DN");
return gp_Vec();
}
//=======================================================================
//function : Copy
//purpose :
//=======================================================================
Handle(Geom_Geometry) GeomPlate_Surface::Copy() const
{
Handle(GeomPlate_Surface) GPS
= new GeomPlate_Surface(mySurfinit,mySurfinter);
return GPS;
}
//=======================================================================
//function : Transform
//purpose :
//=======================================================================
//void GeomPlate_Surface::Transform(const gp_Trsf& T)
void GeomPlate_Surface::Transform(const gp_Trsf& )
{ //Standard_Failure::Raise("Transform");
}
//=======================================================================
//function : CallSurfinit
//purpose :
//=======================================================================
Handle(Geom_Surface) GeomPlate_Surface::CallSurfinit() const
{
return mySurfinit;
}
//=======================================================================
//function : SetBounds
//purpose :
//=======================================================================
void GeomPlate_Surface::SetBounds(const Standard_Real Umin, const Standard_Real Umax, const Standard_Real Vmin, const Standard_Real Vmax)
{
if ((Umin>Umax) || (Vmin>Vmax)) Standard_Failure::Raise("Bounds haven't the good sense");
else
myUmin=Umin;myUmax=Umax;myVmin=Vmin;myVmax=Vmax;
if ((Umin==Umax) || (Vmin==Vmax)) Standard_Failure::Raise("Bounds are equal");
}
//=======================================================================
//function : RealBounds
//purpose :
//=======================================================================
void GeomPlate_Surface::RealBounds(Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const
{
mySurfinter.UVBox(U1,U2,V1,V2);
}
//=======================================================================
//function : Constraints
//purpose :
//=======================================================================
void GeomPlate_Surface::Constraints(TColgp_SequenceOfXY& Seq) const
{
mySurfinter.UVConstraints(Seq);
}