mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
129
src/ChFiDS/ChFiDS.cdl
Executable file
129
src/ChFiDS/ChFiDS.cdl
Executable file
@@ -0,0 +1,129 @@
|
||||
-- File: ChFiDS.cdl
|
||||
-- Created: Wed Nov 17 10:29:41 1993
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
package ChFiDS
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses BRepAdaptor,GeomAdaptor,Geom,Geom2d,TopExp,TopoDS,TopAbs,TopTools,Law,
|
||||
Adaptor3d,GCPnts,MMgt,TColgp,gp,GeomAbs,TColStd,TCollection,Standard
|
||||
|
||||
is
|
||||
|
||||
|
||||
enumeration State from ChFiDS is OnSame, OnDiff, AllSame, BreakPoint,
|
||||
FreeBoundary, Closed, Tangent
|
||||
end State from ChFiDS;
|
||||
---Purpose: This enum describe the different kinds of extremities
|
||||
-- of a fillet. OnSame, Ondiff and AllSame are
|
||||
-- particular cases of BreakPoint for a corner with 3
|
||||
-- edges and three faces :
|
||||
-- - AllSame means that the three concavities are on the
|
||||
-- same side of the Shape,
|
||||
-- - OnDiff means that the edge of the fillet has a
|
||||
-- concave side different than the two other edges,
|
||||
-- - OnSame means that the edge of the fillet has a
|
||||
-- concave side different than one of the two other edges
|
||||
-- and identical to the third edge.
|
||||
|
||||
enumeration ChamfMethod from ChFiDS is
|
||||
Sym,
|
||||
TwoDist,
|
||||
DistAngle
|
||||
end ChamfMethod from ChFiDS;
|
||||
|
||||
enumeration ErrorStatus from ChFiDS is Ok,Error,WalkingFailure,
|
||||
StartsolFailure, TwistedSurface
|
||||
end ErrorStatus from ChFiDS;
|
||||
--- Purpose statuts concernant la cause de l'erreur
|
||||
|
||||
|
||||
class Regul;
|
||||
---Purpose: Grouping of indices of a curve and of faces/surfaces
|
||||
-- that it relies on coding of regularities.
|
||||
|
||||
class Regularities instantiates List from TCollection
|
||||
(Regul from ChFiDS);
|
||||
|
||||
class CircSection;
|
||||
|
||||
class StripeArray1 instantiates Array1 from TCollection
|
||||
(Stripe from ChFiDS);
|
||||
|
||||
class SecArray1 instantiates Array1 from TCollection
|
||||
(CircSection from ChFiDS);
|
||||
|
||||
class SecHArray1 instantiates HArray1 from TCollection
|
||||
(CircSection from ChFiDS,SecArray1 from ChFiDS);
|
||||
|
||||
class Map;
|
||||
---Purpose: encapsulation of IndexedDataMapOfShapeListOfShape
|
||||
|
||||
|
||||
class CommonPoint;
|
||||
---Purpose: point start/end of fillet common to 2 adjacent filets
|
||||
-- and to an edge on one of 2 faces participating
|
||||
-- in the construction of the fillet
|
||||
|
||||
class FaceInterference;
|
||||
---Purpose: interference face/fillet
|
||||
|
||||
class SurfData;
|
||||
---Purpose: data structure for all information related to the
|
||||
-- fillet and to 2 faces vis a vis
|
||||
|
||||
class SequenceOfSurfData instantiates Sequence from TCollection
|
||||
(SurfData from ChFiDS);
|
||||
|
||||
class HData instantiates HSequence from TCollection
|
||||
(SurfData from ChFiDS,
|
||||
SequenceOfSurfData from ChFiDS);
|
||||
|
||||
class Stripe;
|
||||
---Purpose: Data caracterising a band of fillet.
|
||||
|
||||
class ListOfStripe instantiates List from TCollection
|
||||
(Stripe from ChFiDS);
|
||||
|
||||
class IndexedDataMapOfVertexListOfStripe instantiates
|
||||
IndexedDataMap from TCollection ( Vertex from TopoDS,
|
||||
ListOfStripe from ChFiDS,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class StripeMap;
|
||||
---Purpose: encapsulation of IndexedDataMapOfVertexListOfStripe
|
||||
|
||||
class ElSpine;
|
||||
---Purpose: Spin elementary calculated approximation d un
|
||||
-- troncon de spine.
|
||||
|
||||
class HElSpine instantiates GenHCurve from Adaptor3d (ElSpine from ChFiDS);
|
||||
|
||||
class ListOfHElSpine instantiates List from TCollection
|
||||
(HElSpine from ChFiDS);
|
||||
|
||||
class Spine;
|
||||
---Purpose: list of edges allowing the construction of fillet
|
||||
-- or chamfer. Such edges are mutually tangent
|
||||
-- and cross tangent faces.
|
||||
|
||||
|
||||
class FilSpine; --- inherits Sp
|
||||
---Purpose: Contains more information relative to the vector.
|
||||
|
||||
|
||||
class ChamfSpine; --- inherits Sp
|
||||
---Purpose: Contains characteristics of the chamfer.
|
||||
-- pour tous les chanfreins
|
||||
|
||||
class SequenceOfSpine instantiates
|
||||
Sequence from TCollection(Spine from ChFiDS);
|
||||
|
||||
|
||||
|
||||
end ChFiDS;
|
||||
|
49
src/ChFiDS/ChFiDS_ChamfSpine.cdl
Executable file
49
src/ChFiDS/ChFiDS_ChamfSpine.cdl
Executable file
@@ -0,0 +1,49 @@
|
||||
-- File: ChFiDS_ChamfSpine.cdl
|
||||
-- Created: Mon Apr 24 16:57:39 1995
|
||||
-- Author: Modelistation
|
||||
-- <model@phylox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
class ChamfSpine from ChFiDS inherits Spine from ChFiDS
|
||||
|
||||
---Purpose: Provides data specific to chamfers
|
||||
-- distances on each of faces.
|
||||
uses
|
||||
ChamfMethod from ChFiDS
|
||||
|
||||
is
|
||||
Create returns mutable ChamfSpine from ChFiDS;
|
||||
Create (Tol : Real from Standard) returns mutable ChamfSpine from ChFiDS;
|
||||
|
||||
SetDist (me : mutable; Dis : Real from Standard) is static;
|
||||
|
||||
GetDist (me; Dis : in out Real from Standard) is static;
|
||||
|
||||
SetDists (me : mutable; Dis1, Dis2 : Real from Standard) is static;
|
||||
|
||||
Dists (me; Dis1, Dis2 : in out Real from Standard) is static;
|
||||
|
||||
GetDistAngle (me;
|
||||
Dis, Angle : in out Real from Standard;
|
||||
DisOnF1 : in out Boolean from Standard) is static;
|
||||
|
||||
SetDistAngle(me : mutable;
|
||||
Dis, Angle : Real from Standard;
|
||||
DisOnF1 : Boolean from Standard) is static;
|
||||
|
||||
|
||||
IsChamfer(me) returns ChamfMethod from ChFiDS is static;
|
||||
---Purpose: Return the method of chamfers used
|
||||
|
||||
|
||||
fields
|
||||
d1 : Real from Standard;
|
||||
d2 : Real from Standard;
|
||||
dison1 : Boolean from Standard;
|
||||
angle : Real from Standard;
|
||||
mChamf : ChamfMethod from ChFiDS;
|
||||
end ChamfSpine;
|
||||
|
||||
|
||||
|
120
src/ChFiDS/ChFiDS_ChamfSpine.cxx
Executable file
120
src/ChFiDS/ChFiDS_ChamfSpine.cxx
Executable file
@@ -0,0 +1,120 @@
|
||||
// File: ChFiDS_ChamfSpine.cxx
|
||||
// Created: Mon Apr 24 17:14:07 1995
|
||||
// Author: Modelistation
|
||||
// <model@phylox>
|
||||
|
||||
|
||||
#include <ChFiDS_ChamfSpine.ixx>
|
||||
#include <TColStd_HArray1OfBoolean.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_ChamfSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_ChamfSpine::ChFiDS_ChamfSpine(){}
|
||||
|
||||
ChFiDS_ChamfSpine::ChFiDS_ChamfSpine(const Standard_Real Tol):
|
||||
ChFiDS_Spine(Tol)
|
||||
{}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDist
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::GetDist(Standard_Real& Dis) const
|
||||
{
|
||||
if (mChamf != ChFiDS_Sym) Standard_Failure::Raise("Chamfer is not symetric");
|
||||
Dis = d1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDist
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::SetDist(const Standard_Real Dis)
|
||||
{
|
||||
//isconstant->Init(Standard_True);
|
||||
mChamf = ChFiDS_Sym;
|
||||
d1 = Dis;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Dists
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::Dists(Standard_Real& Dis1,
|
||||
Standard_Real& Dis2)const
|
||||
{
|
||||
if (mChamf != ChFiDS_TwoDist) Standard_Failure::Raise("Chamfer is not a Two Dists Chamfer");
|
||||
Dis1 = d1;
|
||||
Dis2 = d2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDists
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::SetDists(const Standard_Real Dis1,
|
||||
const Standard_Real Dis2)
|
||||
{
|
||||
//isconstant->Init(Standard_True);
|
||||
mChamf = ChFiDS_TwoDist;
|
||||
d1 = Dis1;
|
||||
d2 = Dis2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDistAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::GetDistAngle(Standard_Real& Dis,
|
||||
Standard_Real& Angle,
|
||||
Standard_Boolean& DisOnF1)const
|
||||
{
|
||||
if (mChamf != ChFiDS_DistAngle) Standard_Failure::Raise("Chamfer is not a Two Dists Chamfer");
|
||||
Dis = d1;
|
||||
Angle = angle;
|
||||
DisOnF1 = dison1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDistAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ChamfSpine::SetDistAngle(const Standard_Real Dis,
|
||||
const Standard_Real Angle,
|
||||
const Standard_Boolean DisOnF1)
|
||||
{
|
||||
//isconstant->Init(Standard_True);
|
||||
mChamf = ChFiDS_DistAngle;
|
||||
d1 = Dis;
|
||||
angle = Angle;
|
||||
dison1 = DisOnF1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsChamfer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_ChamfMethod ChFiDS_ChamfSpine::IsChamfer() const
|
||||
{
|
||||
|
||||
return mChamf;
|
||||
}
|
||||
|
||||
|
||||
|
43
src/ChFiDS/ChFiDS_CircSection.cdl
Executable file
43
src/ChFiDS/ChFiDS_CircSection.cdl
Executable file
@@ -0,0 +1,43 @@
|
||||
-- File: ChFiDS_CircSection.cdl
|
||||
-- Created: Wed Mar 6 15:47:44 1996
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@phylox>
|
||||
---Copyright: Matra Datavision 1996
|
||||
|
||||
|
||||
class CircSection from ChFiDS
|
||||
|
||||
---Purpose: A Section of fillet.
|
||||
|
||||
uses
|
||||
Circ from gp,
|
||||
Lin from gp
|
||||
is
|
||||
Create;
|
||||
|
||||
Set(me : in out;
|
||||
C : Circ from gp;
|
||||
F,L : Real from Standard)
|
||||
is static;
|
||||
|
||||
Set(me : in out;
|
||||
C : Lin from gp;
|
||||
F,L : Real from Standard)
|
||||
is static;
|
||||
|
||||
Get(me;
|
||||
C : out Circ from gp;
|
||||
F,L : out Real from Standard)
|
||||
is static;
|
||||
|
||||
Get(me;
|
||||
C : out Lin from gp;
|
||||
F,L : out Real from Standard)
|
||||
is static;
|
||||
|
||||
fields
|
||||
myCirc : Circ from gp;
|
||||
myLin : Lin from gp;
|
||||
myF : Real from Standard;
|
||||
myL : Real from Standard;
|
||||
end CircSection;
|
72
src/ChFiDS/ChFiDS_CircSection.cxx
Executable file
72
src/ChFiDS/ChFiDS_CircSection.cxx
Executable file
@@ -0,0 +1,72 @@
|
||||
// File: ChFiDS_CircSection.cxx
|
||||
// Created: Wed Mar 6 15:54:42 1996
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@phylox>
|
||||
|
||||
|
||||
#include <ChFiDS_CircSection.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_CircSection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_CircSection::ChFiDS_CircSection(){}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_CircSection::Set(const gp_Circ& C,
|
||||
const Standard_Real F,
|
||||
const Standard_Real L)
|
||||
{
|
||||
myCirc = C;
|
||||
myF = F;
|
||||
myL = L;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_CircSection::Set(const gp_Lin& C,
|
||||
const Standard_Real F,
|
||||
const Standard_Real L)
|
||||
{
|
||||
myLin = C;
|
||||
myF = F;
|
||||
myL = L;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Get
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_CircSection::Get(gp_Circ& C,
|
||||
Standard_Real& F,
|
||||
Standard_Real& L) const
|
||||
{
|
||||
C = myCirc;
|
||||
F = myF;
|
||||
L = myL;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Get
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_CircSection::Get(gp_Lin& C,
|
||||
Standard_Real& F,
|
||||
Standard_Real& L) const
|
||||
{
|
||||
C = myLin;
|
||||
F = myF;
|
||||
L = myL;
|
||||
}
|
219
src/ChFiDS/ChFiDS_CommonPoint.cdl
Executable file
219
src/ChFiDS/ChFiDS_CommonPoint.cdl
Executable file
@@ -0,0 +1,219 @@
|
||||
-- File: ChFiDS_CommonPoint.cdl
|
||||
-- Created: Mon Nov 29 11:14:27 1993
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class CommonPoint from ChFiDS
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses Orientation from TopAbs,
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Pnt from gp,
|
||||
Vec from gp
|
||||
|
||||
raises
|
||||
DomainError from Standard,
|
||||
TypeMismatch from Standard
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create returns CommonPoint from ChFiDS;
|
||||
|
||||
---Purpose: Empty constructor.
|
||||
|
||||
Reset( me : in out) is static;
|
||||
---Purpose: default value for all fields
|
||||
|
||||
SetVertex(me: in out; V: Vertex from TopoDS)
|
||||
|
||||
---Purpose: Sets the values of a point which is a vertex on
|
||||
-- the initial facet of restriction of one
|
||||
-- of the surface.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetArc(me: in out; Tol: Real from Standard;
|
||||
A: Edge from TopoDS;
|
||||
Param: Real from Standard;
|
||||
TArc: Orientation from TopAbs)
|
||||
|
||||
---Purpose: Sets the values of a point which is on the arc
|
||||
-- A, at parameter Param.
|
||||
|
||||
|
||||
is static;
|
||||
|
||||
SetParameter(me: in out; Param: Real from Standard)
|
||||
---Purpose: Sets the value of the parameter on the spine
|
||||
is static;
|
||||
|
||||
|
||||
SetPoint(me :in out; Point : Pnt from gp)
|
||||
|
||||
---Purpose: Set the 3d point for a commonpoint that is not
|
||||
-- a vertex or on an arc.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
SetVector(me :in out; Vector : Vec from gp)
|
||||
|
||||
---Purpose: Set the output 3d vector
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
SetTolerance(me : in out; Tol : Real from Standard)
|
||||
|
||||
---Purpose: This method set the fuzziness on the point.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
Tolerance(me)
|
||||
|
||||
---Purpose: This method returns the fuzziness on the point.
|
||||
|
||||
returns Real from Standard
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
IsVertex(me)
|
||||
|
||||
---Purpose: Returns TRUE if the point is a vertex on the initial
|
||||
-- restriction facet of the surface.
|
||||
|
||||
returns Boolean from Standard
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Vertex(me)
|
||||
|
||||
---Purpose: Returns the information about the point when it is
|
||||
-- on the domain of the first patch, i-e when the function
|
||||
-- IsVertex returns True.
|
||||
-- Otherwise, an exception is raised.
|
||||
|
||||
returns Vertex from TopoDS
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
|
||||
raises DomainError from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
IsOnArc(me)
|
||||
|
||||
---Purpose: Returns TRUE if the point is a on an edge of the initial
|
||||
-- restriction facet of the surface.
|
||||
|
||||
returns Boolean from Standard
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Arc(me)
|
||||
|
||||
---Purpose: Returns the arc of restriction containing the
|
||||
-- vertex.
|
||||
|
||||
returns Edge from TopoDS
|
||||
---C++: return const&
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
TransitionOnArc(me)
|
||||
|
||||
---Purpose: Returns the transition of the point on the arc
|
||||
-- returned by Arc().
|
||||
|
||||
returns Orientation from TopAbs
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
ParameterOnArc(me)
|
||||
|
||||
---Purpose: Returns the parameter of the point on the
|
||||
-- arc returned by the method Arc().
|
||||
|
||||
returns Real from Standard
|
||||
|
||||
is static;
|
||||
|
||||
Parameter(me)
|
||||
|
||||
---Purpose: Returns the parameter the paramter on the spine
|
||||
returns Real from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Point(me)
|
||||
|
||||
---Purpose: Returns the 3d point
|
||||
|
||||
returns Pnt from gp
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
HasVector(me)
|
||||
|
||||
---Purpose: Returns TRUE if the output vector is stored.
|
||||
|
||||
returns Boolean from Standard
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
Vector(me)
|
||||
---Purpose: Returns the output 3d vector
|
||||
|
||||
returns Vec from gp
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
raises DomainError from Standard -- if HasVector() return False;
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
arc : Edge from TopoDS;
|
||||
vtx : Vertex from TopoDS;
|
||||
|
||||
point : Pnt from gp;
|
||||
vector : Vec from gp;
|
||||
|
||||
tol : Real from Standard;
|
||||
prmarc : Real from Standard;
|
||||
prmtg : Real from Standard;
|
||||
|
||||
isonarc : Boolean from Standard;
|
||||
traarc : Orientation from TopAbs;
|
||||
isvtx : Boolean from Standard;
|
||||
hasvector : Boolean from Standard;
|
||||
|
||||
|
||||
end CommonPoint;
|
116
src/ChFiDS/ChFiDS_CommonPoint.cxx
Executable file
116
src/ChFiDS/ChFiDS_CommonPoint.cxx
Executable file
@@ -0,0 +1,116 @@
|
||||
// File: ChFiDS_CommonPoint.cxx
|
||||
// Created: Tue Nov 30 17:48:00 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
#include <ChFiDS_CommonPoint.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_CommonPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_CommonPoint::ChFiDS_CommonPoint() :
|
||||
tol(0.),
|
||||
isonarc(Standard_False),
|
||||
isvtx(Standard_False),
|
||||
hasvector(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_CommonPoint::Reset()
|
||||
{
|
||||
tol = 0.;
|
||||
isvtx = Standard_False;
|
||||
isonarc = Standard_False;
|
||||
hasvector = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetArc
|
||||
//purpose :
|
||||
// 30/09/1997 : PMN On n'ecrabouille plus la tolerance
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_CommonPoint::SetArc(const Standard_Real Tol,
|
||||
const TopoDS_Edge& A,
|
||||
const Standard_Real Param,
|
||||
const TopAbs_Orientation TArc)
|
||||
{
|
||||
isonarc = Standard_True;
|
||||
if (Tol > tol) tol = Tol;
|
||||
arc = A;
|
||||
prmarc = Param;
|
||||
traarc = TArc;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_CommonPoint::SetParameter(const Standard_Real Param)
|
||||
{
|
||||
prmtg = Param;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Arc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TopoDS_Edge& ChFiDS_CommonPoint::Arc()const
|
||||
{
|
||||
if (!isonarc){
|
||||
Standard_DomainError::Raise("CommonPoint not on Arc");
|
||||
}
|
||||
return arc;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : TransitionOnArc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation ChFiDS_CommonPoint::TransitionOnArc()const
|
||||
{
|
||||
if (!isonarc){
|
||||
Standard_DomainError::Raise("CommonPoint not on Arc");
|
||||
}
|
||||
return traarc;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ParameterOnArc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_CommonPoint::ParameterOnArc()const
|
||||
{
|
||||
if (!isonarc){
|
||||
Standard_DomainError::Raise("CommonPoint not on Arc");
|
||||
}
|
||||
return prmarc;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_CommonPoint::Parameter()const
|
||||
{
|
||||
return prmtg;
|
||||
}
|
||||
|
||||
|
130
src/ChFiDS/ChFiDS_CommonPoint.lxx
Executable file
130
src/ChFiDS/ChFiDS_CommonPoint.lxx
Executable file
@@ -0,0 +1,130 @@
|
||||
// File: ChFiDS_CommonPoint.lxx
|
||||
// Created: Tue Nov 30 17:49:11 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_CommonPoint::SetVertex(const TopoDS_Vertex& V)
|
||||
{
|
||||
isvtx = Standard_True;
|
||||
vtx = V;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_CommonPoint::SetPoint(const gp_Pnt& Point)
|
||||
{
|
||||
point = Point;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetVector
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_CommonPoint::SetVector(const gp_Vec& Vector)
|
||||
{
|
||||
hasvector = Standard_True;
|
||||
vector = Vector;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTolerance
|
||||
//purpose :
|
||||
// PMN : 30/09/1997 : On se contente d'updater la tolerance.
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_CommonPoint::SetTolerance(const Standard_Real Tol)
|
||||
{
|
||||
if (Tol>tol) tol = Tol;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Tolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real ChFiDS_CommonPoint::Tolerance()const
|
||||
{
|
||||
return tol;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean ChFiDS_CommonPoint::IsVertex()const
|
||||
{
|
||||
return isvtx;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Vertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const TopoDS_Vertex& ChFiDS_CommonPoint::Vertex()const
|
||||
{
|
||||
if (!isvtx) {Standard_DomainError::Raise();}
|
||||
return vtx;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Point
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const gp_Pnt& ChFiDS_CommonPoint::Point()const
|
||||
{
|
||||
return point;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasVector
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean ChFiDS_CommonPoint::HasVector()const
|
||||
{
|
||||
return hasvector;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Vector
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const gp_Vec& ChFiDS_CommonPoint::Vector()const
|
||||
{
|
||||
if (!hasvector) {
|
||||
Standard_DomainError::Raise("ChFiDS_CommonPoint::Vector");
|
||||
}
|
||||
return vector;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsOnArc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean ChFiDS_CommonPoint::IsOnArc()const
|
||||
{
|
||||
return isonarc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
183
src/ChFiDS/ChFiDS_ElSpine.cdl
Executable file
183
src/ChFiDS/ChFiDS_ElSpine.cdl
Executable file
@@ -0,0 +1,183 @@
|
||||
-- File: ChFiDS_ElSpine.cdl
|
||||
-- Created: Thu May 4 10:35:45 1995
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@phylox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
class ElSpine from ChFiDS inherits Curve from Adaptor3d
|
||||
|
||||
---Purpose: Elementary Spine for cheminements and approximations.
|
||||
|
||||
uses
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
Lin from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Hypr from gp,
|
||||
Parab from gp,
|
||||
BezierCurve from Geom,
|
||||
BSplineCurve from Geom,
|
||||
Array1OfReal from TColStd,
|
||||
SurfData from ChFiDS,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
HCurve from Adaptor3d,
|
||||
Curve from Geom,
|
||||
Curve from GeomAdaptor
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
is
|
||||
|
||||
Create returns ElSpine from ChFiDS;
|
||||
|
||||
FirstParameter(me) returns Real from Standard
|
||||
is redefined;
|
||||
|
||||
LastParameter(me) returns Real from Standard
|
||||
is redefined;
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
NbIntervals(me: in out; S : Shape from GeomAbs)
|
||||
returns Integer is redefined static;
|
||||
|
||||
Intervals(me: in out;
|
||||
T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
is redefined static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
is redefined;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
is redefined;
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs
|
||||
is redefined;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is redefined;
|
||||
|
||||
SetPeriodic(me : in out ; I : Boolean from Standard) is static;
|
||||
|
||||
Period(me) returns Real
|
||||
is redefined;
|
||||
|
||||
Value(me ; AbsC : Real ) returns Pnt from gp
|
||||
is redefined;
|
||||
|
||||
D0(me ; AbsC : Real ; P : out Pnt from gp)
|
||||
is redefined;
|
||||
|
||||
D1(me ; AbsC : Real ; P : out Pnt from gp; V1 : out Vec from gp)
|
||||
is redefined;
|
||||
|
||||
D2(me ; AbsC : Real ; P : out Pnt from gp;
|
||||
V1,V2 : out Vec from gp)
|
||||
is redefined;
|
||||
|
||||
D3(me ; AbsC : Real ; P : out Pnt from gp;
|
||||
V1,V2, V3 : out Vec from gp)
|
||||
is redefined;
|
||||
|
||||
FirstParameter(me : in out; P : Real from Standard);
|
||||
|
||||
LastParameter(me : in out; P : Real from Standard);
|
||||
|
||||
SetOrigin(me : in out; O : Real from Standard);
|
||||
|
||||
FirstPointAndTgt(me; P : out Pnt from gp; T : out Vec from gp);
|
||||
|
||||
LastPointAndTgt(me; P : out Pnt from gp; T : out Vec from gp);
|
||||
|
||||
SetFirstPointAndTgt(me : in out; P : Pnt from gp; T : Vec from gp);
|
||||
|
||||
SetLastPointAndTgt(me : in out; P : Pnt from gp; T : Vec from gp);
|
||||
|
||||
SetCurve(me : in out; C : Curve from Geom);
|
||||
|
||||
Previous(me) returns mutable SurfData from ChFiDS;
|
||||
---C++: return const &
|
||||
|
||||
ChangePrevious(me : in out) returns any SurfData from ChFiDS;
|
||||
---C++: return &
|
||||
|
||||
Next(me) returns mutable SurfData from ChFiDS;
|
||||
---C++: return const &
|
||||
|
||||
ChangeNext(me : in out) returns any SurfData from ChFiDS;
|
||||
---C++: return &
|
||||
|
||||
Line(me) returns Lin from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Circle(me) returns Circ from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Ellipse(me) returns Elips from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Hyperbola(me) returns Hypr from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Parabola(me) returns Parab from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
--Purpose: Warning : This will NOT make a copy of the
|
||||
-- Bezier Curve : If you want to modify
|
||||
-- the Curve please make a copy yourself
|
||||
-- Also it will NOT trim the surface to
|
||||
-- myFirst/Last.
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
-- Purpose : Warning : This will NOT make a copy of the
|
||||
-- BSpline Curve : If you want to modify
|
||||
-- the Curve please make a copy yourself
|
||||
-- Also it will NOT trim the surface to
|
||||
-- myFirst/Last.
|
||||
fields
|
||||
|
||||
curve : Curve from GeomAdaptor;
|
||||
|
||||
ptfirst : Pnt from gp;
|
||||
ptlast : Pnt from gp;
|
||||
tgfirst : Vec from gp;
|
||||
tglast : Vec from gp;
|
||||
|
||||
previous : SurfData from ChFiDS;
|
||||
next : SurfData from ChFiDS;
|
||||
|
||||
pfirst : Real from Standard;
|
||||
plast : Real from Standard;
|
||||
period : Real from Standard;
|
||||
periodic : Boolean from Standard;
|
||||
|
||||
|
||||
end ElSpine;
|
411
src/ChFiDS/ChFiDS_ElSpine.cxx
Executable file
411
src/ChFiDS/ChFiDS_ElSpine.cxx
Executable file
@@ -0,0 +1,411 @@
|
||||
// File: ChFiDS_ElSpine.cxx
|
||||
// Created: Thu May 4 13:58:23 1995
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@phylox>
|
||||
|
||||
|
||||
#include <ChFiDS_ElSpine.ixx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_ElSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_ElSpine::ChFiDS_ElSpine():periodic(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_ElSpine::FirstParameter() const
|
||||
{
|
||||
return pfirst;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_ElSpine::LastParameter() const
|
||||
{
|
||||
return plast;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape ChFiDS_ElSpine::Continuity() const
|
||||
{
|
||||
return curve.Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_ElSpine::NbIntervals(const GeomAbs_Shape S)
|
||||
{
|
||||
return curve.NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Intervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S)
|
||||
{
|
||||
curve.Intervals(T,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) ChFiDS_ElSpine::Trim(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
return curve.Trim(First,Last,Tol);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_ElSpine::Resolution(const Standard_Real R3d) const
|
||||
{
|
||||
return curve.Resolution(R3d);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_CurveType ChFiDS_ElSpine::GetType() const
|
||||
{
|
||||
return curve.GetType();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_ElSpine::IsPeriodic() const
|
||||
{
|
||||
return periodic;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::SetPeriodic(const Standard_Boolean I)
|
||||
{
|
||||
periodic = I;
|
||||
period = plast - pfirst;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_ElSpine::Period() const
|
||||
{
|
||||
if(!periodic) Standard_Failure::Raise("ElSpine non periodique");
|
||||
return period;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt ChFiDS_ElSpine::Value(const Standard_Real AbsC) const
|
||||
{
|
||||
return curve.Value(AbsC);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::D0(const Standard_Real AbsC, gp_Pnt& P) const
|
||||
{
|
||||
curve.D0(AbsC,P);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::D1(const Standard_Real AbsC, gp_Pnt& P, gp_Vec& V1)
|
||||
const
|
||||
{
|
||||
curve.D1(AbsC,P,V1);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::D2(const Standard_Real AbsC,
|
||||
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
|
||||
{
|
||||
curve.D2(AbsC,P,V1,V2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::D3(const Standard_Real AbsC,
|
||||
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
|
||||
{
|
||||
curve.D3(AbsC,P,V1,V2,V3);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::FirstParameter(const Standard_Real P)
|
||||
{
|
||||
pfirst = P;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::LastParameter(const Standard_Real P)
|
||||
{
|
||||
plast = P;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetOrigin
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::SetOrigin(const Standard_Real O)
|
||||
{
|
||||
if(!periodic) Standard_Failure::Raise("Elspine non periodique");
|
||||
Handle(Geom_BSplineCurve) bs = Handle(Geom_BSplineCurve)::DownCast(curve.Curve());
|
||||
if(!bs.IsNull()) {
|
||||
bs->SetOrigin(O,Precision::PConfusion());
|
||||
curve.Load(bs);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFirstPointAndTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::SetFirstPointAndTgt(const gp_Pnt& P,
|
||||
const gp_Vec& T)
|
||||
{
|
||||
ptfirst = P;
|
||||
tgfirst = T;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLastPointAndTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::SetLastPointAndTgt(const gp_Pnt& P,
|
||||
const gp_Vec& T)
|
||||
{
|
||||
ptlast = P;
|
||||
tglast = T;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstPointAndTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::FirstPointAndTgt(gp_Pnt& P,
|
||||
gp_Vec& T) const
|
||||
{
|
||||
P = ptfirst;
|
||||
T = tgfirst;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastPointAndTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::LastPointAndTgt(gp_Pnt& P,
|
||||
gp_Vec& T) const
|
||||
{
|
||||
P = ptlast;
|
||||
T = tglast;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_ElSpine::SetCurve(const Handle(Geom_Curve)& C)
|
||||
{
|
||||
curve.Load(C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Previous
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(ChFiDS_SurfData)& ChFiDS_ElSpine::Previous() const
|
||||
{
|
||||
return previous;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangePrevious
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(ChFiDS_SurfData)& ChFiDS_ElSpine::ChangePrevious()
|
||||
{
|
||||
return previous;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Next
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(ChFiDS_SurfData)& ChFiDS_ElSpine::Next() const
|
||||
{
|
||||
return next;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeNext
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(ChFiDS_SurfData)& ChFiDS_ElSpine::ChangeNext()
|
||||
{
|
||||
return next;
|
||||
}
|
||||
|
||||
// --
|
||||
// -- The following methods must be called when GetType returned
|
||||
// -- the corresponding type.
|
||||
// --
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Lin ChFiDS_ElSpine::Line() const
|
||||
{
|
||||
return curve.Line();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Circ ChFiDS_ElSpine::Circle() const
|
||||
{
|
||||
return curve.Circle();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Ellipse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Elips ChFiDS_ElSpine::Ellipse() const
|
||||
{
|
||||
return curve.Ellipse();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Hyperbola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Hypr ChFiDS_ElSpine::Hyperbola() const
|
||||
{
|
||||
return curve.Hyperbola();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parabola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Parab ChFiDS_ElSpine::Parabola() const
|
||||
{
|
||||
return curve.Parabola();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BezierCurve) ChFiDS_ElSpine::Bezier() const
|
||||
{
|
||||
return curve.Bezier();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineCurve) ChFiDS_ElSpine::BSpline() const
|
||||
{
|
||||
return curve.BSpline();
|
||||
}
|
80
src/ChFiDS/ChFiDS_FaceInterference.cdl
Executable file
80
src/ChFiDS/ChFiDS_FaceInterference.cdl
Executable file
@@ -0,0 +1,80 @@
|
||||
-- File: ChFiDS_FaceInterference.cdl
|
||||
-- Created: Tue Nov 16 11:45:22 1993
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class FaceInterference from ChFiDS
|
||||
|
||||
---Purpose: interference face/fillet
|
||||
|
||||
uses Curve from Geom2d,
|
||||
Orientation from TopAbs
|
||||
|
||||
is
|
||||
Create returns FaceInterference from ChFiDS;
|
||||
|
||||
SetInterference(me : in out;
|
||||
LineIndex : Integer from Standard;
|
||||
Trans : Orientation from TopAbs;
|
||||
PCurv1 ,PCurv2 : Curve from Geom2d )is static;
|
||||
---C++: inline
|
||||
|
||||
SetTransition(me : in out; Trans : Orientation from TopAbs) is static;
|
||||
|
||||
SetFirstParameter(me : in out; U1 : Real) is static;
|
||||
---C++: inline
|
||||
|
||||
SetLastParameter(me : in out; U1 : Real) is static;
|
||||
---C++: inline
|
||||
|
||||
SetParameter(me : in out;
|
||||
U1 : Real from Standard;
|
||||
IsFirst : Boolean from Standard)
|
||||
is static;
|
||||
|
||||
LineIndex(me) returns Integer from Standard;
|
||||
---C++: inline
|
||||
|
||||
SetLineIndex(me : in out; I : Integer from Standard);
|
||||
---C++: inline
|
||||
|
||||
Transition(me) returns Orientation from TopAbs is static;
|
||||
---C++: inline
|
||||
|
||||
PCurveOnFace(me) returns Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
PCurveOnSurf(me) returns Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
ChangePCurveOnFace(me : in out) returns Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangePCurveOnSurf(me : in out) returns Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
FirstParameter(me) returns Real from Standard is static ;
|
||||
---C++: inline
|
||||
|
||||
LastParameter(me) returns Real from Standard is static;
|
||||
---C++: inline
|
||||
|
||||
Parameter(me; IsFirst : Boolean from Standard)
|
||||
returns Real from Standard is static;
|
||||
|
||||
fields
|
||||
|
||||
firstParam : Real from Standard;
|
||||
lastParam : Real from Standard;
|
||||
pCurveOnFace : Curve from Geom2d;
|
||||
pCurveOnSurf : Curve from Geom2d;
|
||||
lineindex : Integer from Standard;
|
||||
LineTransition : Orientation from TopAbs;
|
||||
end FaceInterference;
|
35
src/ChFiDS/ChFiDS_FaceInterference.cxx
Executable file
35
src/ChFiDS/ChFiDS_FaceInterference.cxx
Executable file
@@ -0,0 +1,35 @@
|
||||
// File: ChFiDS_FaceInterference.cxx
|
||||
// Created: Thu Nov 18 12:07:12 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
#include <ChFiDS_FaceInterference.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_FaceInterference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_FaceInterference::ChFiDS_FaceInterference()
|
||||
{
|
||||
}
|
||||
|
||||
void ChFiDS_FaceInterference::SetParameter(const Standard_Real U1,
|
||||
const Standard_Boolean IsFirst)
|
||||
{
|
||||
if(IsFirst) SetFirstParameter(U1);
|
||||
else SetLastParameter(U1);
|
||||
}
|
||||
|
||||
void ChFiDS_FaceInterference::SetTransition(const TopAbs_Orientation Trans)
|
||||
{
|
||||
LineTransition = Trans;
|
||||
}
|
||||
|
||||
Standard_Real ChFiDS_FaceInterference::Parameter
|
||||
(const Standard_Boolean IsFirst)const
|
||||
{
|
||||
if(IsFirst) return FirstParameter();
|
||||
else return LastParameter();
|
||||
}
|
147
src/ChFiDS/ChFiDS_FaceInterference.lxx
Executable file
147
src/ChFiDS/ChFiDS_FaceInterference.lxx
Executable file
@@ -0,0 +1,147 @@
|
||||
// File: ChFiDS_FaceInterference.lxx
|
||||
// Created: Thu Nov 18 12:07:39 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
//=======================================================================
|
||||
//function : SetInterference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_FaceInterference:: SetInterference
|
||||
(const Standard_Integer LineIndex,
|
||||
const TopAbs_Orientation Trans,
|
||||
const Handle(Geom2d_Curve)& PCurv1,
|
||||
const Handle(Geom2d_Curve)& PCurv2)
|
||||
{
|
||||
lineindex = LineIndex;
|
||||
LineTransition = Trans;
|
||||
pCurveOnFace = PCurv1;
|
||||
pCurveOnSurf = PCurv2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLineIndex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_FaceInterference::SetLineIndex
|
||||
(const Standard_Integer I)
|
||||
{
|
||||
lineindex = I;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_FaceInterference::SetFirstParameter(
|
||||
const Standard_Real U1)
|
||||
{
|
||||
firstParam = U1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_FaceInterference::SetLastParameter(
|
||||
const Standard_Real U1)
|
||||
{
|
||||
lastParam = U1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LineIndex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_FaceInterference::LineIndex()const
|
||||
{
|
||||
return lineindex;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Transition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopAbs_Orientation ChFiDS_FaceInterference::Transition()const
|
||||
{
|
||||
return LineTransition;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PCurveOnFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Geom2d_Curve)&
|
||||
ChFiDS_FaceInterference::PCurveOnFace()const
|
||||
{
|
||||
return pCurveOnFace;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PCurveOnSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Geom2d_Curve)& ChFiDS_FaceInterference::PCurveOnSurf()const
|
||||
{
|
||||
return pCurveOnSurf;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangePCurveOnFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom2d_Curve)&
|
||||
ChFiDS_FaceInterference::ChangePCurveOnFace()
|
||||
{
|
||||
return pCurveOnFace;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangePCurveOnSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom2d_Curve)&
|
||||
ChFiDS_FaceInterference::ChangePCurveOnSurf()
|
||||
{
|
||||
return pCurveOnSurf;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real ChFiDS_FaceInterference:: FirstParameter()const
|
||||
{
|
||||
return firstParam;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real ChFiDS_FaceInterference:: LastParameter()const
|
||||
{
|
||||
return lastParam;
|
||||
}
|
||||
|
||||
|
133
src/ChFiDS/ChFiDS_FilSpine.cdl
Executable file
133
src/ChFiDS/ChFiDS_FilSpine.cdl
Executable file
@@ -0,0 +1,133 @@
|
||||
-- File: ChFiDS_FilSpine.cdl
|
||||
-- Created: Mon Apr 24 16:48:31 1995
|
||||
-- Author: Modelistation
|
||||
-- <model@phylox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
class FilSpine from ChFiDS inherits Spine from ChFiDS
|
||||
|
||||
---Purpose: Provides data specific to the fillets -
|
||||
-- vector or rule of evolution (C2).
|
||||
--
|
||||
|
||||
|
||||
uses
|
||||
HArray1OfReal from TColStd,
|
||||
HElSpine from ChFiDS,
|
||||
Function from Law,
|
||||
Laws from Law,
|
||||
Composite from Law,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
SequenceOfXY from TColgp,
|
||||
XY from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable FilSpine from ChFiDS;
|
||||
|
||||
Create(Tol : Real from Standard) returns mutable FilSpine from ChFiDS;
|
||||
|
||||
Reset(me : mutable; AllData : Boolean from Standard = Standard_False)
|
||||
is redefined;
|
||||
|
||||
------------------------------------------------
|
||||
-- Update selectif du rayon par edges ou vertex.
|
||||
------------------------------------------------
|
||||
|
||||
SetRadius(me : mutable;
|
||||
Radius : Real from Standard;
|
||||
E : Edge from TopoDS)
|
||||
---Purpose: initializes the constant vector on edge E.
|
||||
is static;
|
||||
|
||||
UnSetRadius(me : mutable;
|
||||
E : Edge from TopoDS)
|
||||
---Purpose: resets the constant vector on edge E.
|
||||
is static;
|
||||
|
||||
SetRadius(me : mutable;
|
||||
Radius : Real from Standard;
|
||||
V : Vertex from TopoDS)
|
||||
---Purpose: initializes the vector on Vertex V.
|
||||
is static;
|
||||
|
||||
UnSetRadius(me : mutable;
|
||||
V : Vertex from TopoDS)
|
||||
---Purpose: resets the vector on Vertex V.
|
||||
is static;
|
||||
|
||||
SetRadius(me : mutable;
|
||||
UandR : XY from gp;
|
||||
IinC : Integer from Standard)
|
||||
---Purpose: initializes the vector on the point of parameter W.
|
||||
is static;
|
||||
|
||||
SetRadius(me : mutable;Radius : Real from Standard)
|
||||
---Purpose: initializes the constant vector on all spine.
|
||||
is static;
|
||||
|
||||
SetRadius(me : mutable;
|
||||
C : Function from Law;
|
||||
IinC : Integer from Standard)
|
||||
---Purpose: initializes the rule of evolution on all spine.
|
||||
is static;
|
||||
|
||||
IsConstant(me)
|
||||
returns Boolean from Standard
|
||||
---Purpose: returns true if the radius is constant
|
||||
-- all along the spine.
|
||||
is static;
|
||||
|
||||
IsConstant(me; IE : Integer from Standard)
|
||||
returns Boolean from Standard
|
||||
---Purpose: returns true if the radius is constant
|
||||
-- all along the edge E.
|
||||
is static;
|
||||
|
||||
Radius(me) returns Real from Standard;
|
||||
---Purpose: returns the radius if the fillet is constant
|
||||
-- all along the spine.
|
||||
|
||||
Radius(me; IE : Integer from Standard)
|
||||
returns Real from Standard;
|
||||
---Purpose: returns the radius if the fillet is constant
|
||||
-- all along the edge E.
|
||||
|
||||
Radius(me; E : Edge from TopoDS)
|
||||
returns Real from Standard;
|
||||
---Purpose: returns the radius if the fillet is constant
|
||||
-- all along the edge E.
|
||||
|
||||
ComputeLaw(me : mutable; Els : HElSpine from ChFiDS)
|
||||
returns mutable Composite from Law
|
||||
is private;
|
||||
|
||||
AppendElSpine(me : mutable; Els : HElSpine from ChFiDS)
|
||||
is redefined;
|
||||
|
||||
AppendLaw(me : mutable; Els : HElSpine from ChFiDS)
|
||||
is private;
|
||||
|
||||
Law(me; Els : HElSpine from ChFiDS)
|
||||
returns mutable Composite from Law
|
||||
is static;
|
||||
|
||||
ChangeLaw(me : mutable; E : Edge from TopoDS)
|
||||
---C++: return &
|
||||
returns mutable Function from Law
|
||||
---Purpose: returns the elementary law
|
||||
is static;
|
||||
|
||||
MaxRadFromSeqAndLaws(me) returns Real from Standard;
|
||||
---Purpose: returns the maximum radius if the fillet is non-constant
|
||||
|
||||
fields
|
||||
|
||||
--radius : HArray1OfReal from TColStd;
|
||||
parandrad : SequenceOfXY from TColgp;
|
||||
laws : Laws from Law;
|
||||
|
||||
end FilSpine;
|
||||
|
||||
|
768
src/ChFiDS/ChFiDS_FilSpine.cxx
Executable file
768
src/ChFiDS/ChFiDS_FilSpine.cxx
Executable file
@@ -0,0 +1,768 @@
|
||||
// File: ChFiDS_FilSpine.cxx
|
||||
// Created: Mon Apr 24 17:04:22 1995
|
||||
// Author: Modelistation
|
||||
// <model@phylox>
|
||||
|
||||
|
||||
#include <ChFiDS_FilSpine.ixx>
|
||||
#include <ChFiDS_ListIteratorOfListOfHElSpine.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColStd_HArray1OfBoolean.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <gp_XY.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Law_ListIteratorOfLaws.hxx>
|
||||
#include <Law_Constant.hxx>
|
||||
#include <Law_S.hxx>
|
||||
#include <Law_Interpol.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_FilSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_FilSpine::ChFiDS_FilSpine() {}
|
||||
|
||||
ChFiDS_FilSpine::ChFiDS_FilSpine(const Standard_Real Tol) :
|
||||
ChFiDS_Spine(Tol)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::Reset(const Standard_Boolean AllData)
|
||||
{
|
||||
ChFiDS_Spine::Reset(AllData);
|
||||
laws.Clear();
|
||||
if(AllData)
|
||||
parandrad.Clear();
|
||||
else //Complete parandrad
|
||||
{
|
||||
Standard_Real spinedeb = FirstParameter();
|
||||
Standard_Real spinefin = LastParameter();
|
||||
|
||||
gp_XY FirstUandR = parandrad.First();
|
||||
gp_XY LastUandR = parandrad.Last();
|
||||
if (Abs( spinedeb - FirstUandR.X() ) > gp::Resolution())
|
||||
{
|
||||
FirstUandR.SetX( spinedeb );
|
||||
parandrad.Prepend( FirstUandR );
|
||||
}
|
||||
if (Abs( spinefin - LastUandR.X() ) > gp::Resolution())
|
||||
{
|
||||
LastUandR.SetX( spinefin );
|
||||
parandrad.Append( LastUandR );
|
||||
}
|
||||
|
||||
if (IsPeriodic())
|
||||
parandrad(parandrad.Length()).SetY( parandrad(1).Y() );
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRadius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::SetRadius(const Standard_Real Radius,
|
||||
const TopoDS_Edge& E)
|
||||
{
|
||||
splitdone = Standard_False;
|
||||
Standard_Integer IE = Index(E);
|
||||
gp_XY FirstUandR( 0., Radius ), LastUandR( 1., Radius );
|
||||
SetRadius( FirstUandR, IE );
|
||||
SetRadius( LastUandR, IE );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnSetRadius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::UnSetRadius(const TopoDS_Edge& E)
|
||||
{
|
||||
splitdone = Standard_False;
|
||||
Standard_Integer IE = Index(E);
|
||||
|
||||
Standard_Real Uf = FirstParameter(IE);
|
||||
Standard_Real Ul = LastParameter(IE);
|
||||
Standard_Integer ifirst = 0, ilast = 0;
|
||||
for (Standard_Integer i = 1; i <= parandrad.Length(); i++)
|
||||
{
|
||||
if (Abs(parandrad(i).X()-Uf) <= gp::Resolution())
|
||||
ifirst = i;
|
||||
if (Abs(parandrad(i).X()-Ul) <= gp::Resolution())
|
||||
ilast = i;
|
||||
}
|
||||
if (ifirst != 0 && ilast != 0)
|
||||
parandrad.Remove( ifirst, ilast );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRadius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::SetRadius(const Standard_Real Radius,
|
||||
const TopoDS_Vertex& V)
|
||||
{
|
||||
Standard_Real npar = Absc(V);
|
||||
gp_XY UandR( npar, Radius );
|
||||
SetRadius( UandR, 0 );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRadius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::SetRadius(const Standard_Real Radius)
|
||||
{
|
||||
parandrad.Clear();
|
||||
gp_XY FirstUandR( FirstParameter(), Radius );
|
||||
gp_XY LastUandR( LastParameter(), Radius );
|
||||
SetRadius( FirstUandR, 0 );
|
||||
SetRadius( LastUandR, 0 );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRadius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::SetRadius(const gp_XY& UandR,
|
||||
const Standard_Integer IinC)
|
||||
{
|
||||
Standard_Real W;
|
||||
if (IinC == 0)
|
||||
W = UandR.X();
|
||||
else
|
||||
{
|
||||
Standard_Real Uf = FirstParameter(IinC);
|
||||
Standard_Real Ul = LastParameter(IinC);
|
||||
W = Uf + UandR.X()*( Ul - Uf );
|
||||
}
|
||||
|
||||
gp_XY pr( W, UandR.Y() );
|
||||
Standard_Integer i;
|
||||
for(i = 1; i <= parandrad.Length(); i++){
|
||||
if(parandrad.Value(i).X() == W) {
|
||||
parandrad.ChangeValue(i).SetY( UandR.Y() );
|
||||
if (!splitdone) return;
|
||||
else break;
|
||||
}
|
||||
else if(parandrad.Value(i).X() > W) {
|
||||
parandrad.InsertBefore(i,pr);
|
||||
if (!splitdone) return;
|
||||
else break;
|
||||
}
|
||||
}
|
||||
if (i == parandrad.Length()+1) parandrad.Append(pr);
|
||||
|
||||
//si le split est done il faut rejouer la law
|
||||
//correspondant au parametre W
|
||||
if (splitdone) {
|
||||
ChFiDS_ListIteratorOfListOfHElSpine It(elspines);
|
||||
Law_ListIteratorOfLaws Itl(laws);
|
||||
Handle(ChFiDS_HElSpine) Els = It.Value();
|
||||
if (Els->IsPeriodic()) Itl.Value() = ComputeLaw(Els);
|
||||
else{
|
||||
Standard_Real nW = W;
|
||||
if(IsPeriodic())
|
||||
nW = ElCLib::InPeriod(W,FirstParameter(),LastParameter());
|
||||
for (; It.More(); It.Next(), Itl.Next()) {
|
||||
Els = It.Value();
|
||||
Standard_Real uf = Els->FirstParameter();
|
||||
Standard_Real ul = Els->LastParameter();
|
||||
if(uf <= W && W <= ul) {
|
||||
Itl.Value() = ComputeLaw(Els);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnSetRadius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::UnSetRadius(const TopoDS_Vertex& V)
|
||||
{
|
||||
Standard_Real npar = Absc(V);
|
||||
for(Standard_Integer i = 1; i <= parandrad.Length(); i++){
|
||||
if(parandrad.Value(i).X() == npar) {
|
||||
parandrad.Remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRadius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::SetRadius(const Handle(Law_Function)& C,
|
||||
const Standard_Integer IinC)
|
||||
{
|
||||
splitdone = Standard_False;
|
||||
Handle(Law_Composite) prout = new Law_Composite();
|
||||
Law_Laws& lst = prout->ChangeLaws();
|
||||
lst.Append(C);
|
||||
parandrad.Clear();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsConstant
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_FilSpine::IsConstant()const
|
||||
{
|
||||
if (parandrad.IsEmpty())
|
||||
return Standard_False;
|
||||
|
||||
Standard_Boolean isconst = Standard_True;
|
||||
Standard_Real Radius = parandrad(1).Y();
|
||||
for (Standard_Integer i = 2; i <= parandrad.Length(); i++)
|
||||
if (Abs( Radius - parandrad(i).Y() ) > Precision::Confusion())
|
||||
{
|
||||
isconst = Standard_False;
|
||||
break;
|
||||
}
|
||||
return isconst;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsConstant
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_FilSpine::IsConstant(const Standard_Integer IE)const
|
||||
{
|
||||
Standard_Real Uf = FirstParameter(IE);
|
||||
Standard_Real Ul = LastParameter(IE);
|
||||
|
||||
Standard_Real StartRad, par, rad;
|
||||
Standard_Integer i;
|
||||
for (i = 1; i < parandrad.Length(); i++)
|
||||
{
|
||||
par = parandrad(i).X();
|
||||
rad = parandrad(i).Y();
|
||||
Standard_Real nextpar = parandrad(i+1).X();
|
||||
if (Abs( Uf-par ) <= gp::Resolution() ||
|
||||
par < Uf && Uf < nextpar && nextpar-Uf > gp::Resolution())
|
||||
{
|
||||
StartRad = rad;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i++; i <= parandrad.Length(); i++)
|
||||
{
|
||||
par = parandrad(i).X();
|
||||
rad = parandrad(i).Y();
|
||||
if (Abs( rad-StartRad ) > Precision::Confusion())
|
||||
return Standard_False;
|
||||
if (Abs( Ul-par ) <= gp::Resolution())
|
||||
return Standard_True;
|
||||
if (par > Ul)
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Radius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_FilSpine::Radius(const TopoDS_Edge& E)const
|
||||
{
|
||||
Standard_Integer IE = Index(E);
|
||||
return Radius(IE);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Radius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_FilSpine::Radius(const Standard_Integer IE)const
|
||||
{
|
||||
Standard_Real Uf = FirstParameter(IE);
|
||||
Standard_Real Ul = LastParameter(IE);
|
||||
|
||||
Standard_Real StartRad, par, rad;
|
||||
Standard_Integer i;
|
||||
for (i = 1; i < parandrad.Length(); i++)
|
||||
{
|
||||
par = parandrad(i).X();
|
||||
rad = parandrad(i).Y();
|
||||
Standard_Real nextpar = parandrad(i+1).X();
|
||||
if (Abs( Uf-par ) <= gp::Resolution() ||
|
||||
par < Uf && Uf < nextpar && nextpar-Uf > gp::Resolution())
|
||||
{
|
||||
StartRad = rad;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i++; i <= parandrad.Length(); i++)
|
||||
{
|
||||
par = parandrad(i).X();
|
||||
rad = parandrad(i).Y();
|
||||
if (Abs( rad-StartRad ) > Precision::Confusion())
|
||||
Standard_DomainError::Raise("Arete non constante");
|
||||
if (Abs( Ul-par ) <= gp::Resolution())
|
||||
return StartRad;
|
||||
if (par > Ul)
|
||||
return StartRad;
|
||||
}
|
||||
return StartRad;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Radius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_FilSpine::Radius()const
|
||||
{
|
||||
if (!IsConstant()) Standard_DomainError::Raise("Spine non constante");
|
||||
return parandrad(1).Y();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AppendElSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::AppendElSpine(const Handle(ChFiDS_HElSpine)& Els)
|
||||
{
|
||||
ChFiDS_Spine::AppendElSpine(Els);
|
||||
AppendLaw(Els);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AppendLaw
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_FilSpine::AppendLaw(const Handle(ChFiDS_HElSpine)& Els)
|
||||
{
|
||||
Handle(Law_Composite) l = ComputeLaw(Els);
|
||||
laws.Append(l);
|
||||
}
|
||||
|
||||
static void mklaw(Law_Laws& res,
|
||||
const TColgp_SequenceOfXY& pr,
|
||||
const Standard_Real curdeb,
|
||||
const Standard_Real curfin,
|
||||
const Standard_Real Rdeb,
|
||||
const Standard_Real Rfin,
|
||||
const Standard_Boolean recadre,
|
||||
const Standard_Real deb,
|
||||
const Standard_Real fin,
|
||||
const Standard_Real tol3d)
|
||||
{
|
||||
TColgp_SequenceOfXY npr;
|
||||
Standard_Real rad = Rdeb, raf = Rfin;
|
||||
Standard_Boolean yaunpointsurledeb = Standard_False;
|
||||
Standard_Boolean yaunpointsurlefin = Standard_False;
|
||||
if(!pr.IsEmpty()){
|
||||
for (Standard_Integer i = 1; i <= pr.Length(); i++){
|
||||
const gp_XY& cur = pr.Value(i);
|
||||
Standard_Real wcur = cur.X();
|
||||
if(recadre) wcur = ElCLib::InPeriod(wcur,deb,fin);
|
||||
if( curdeb - tol3d <= wcur && wcur <= curfin + tol3d) {
|
||||
if(wcur - curdeb < tol3d) {
|
||||
yaunpointsurledeb = Standard_True;
|
||||
gp_XY ncur = cur;
|
||||
if(Rdeb < 0.) rad = cur.Y();
|
||||
ncur.SetCoord(curdeb,rad);
|
||||
npr.Append(ncur);
|
||||
}
|
||||
else if(curfin - wcur < tol3d) {
|
||||
yaunpointsurlefin = Standard_True;
|
||||
gp_XY ncur = cur;
|
||||
if(Rfin < 0.) raf = cur.Y();
|
||||
ncur.SetCoord(curfin,raf);
|
||||
npr.Append(ncur);
|
||||
}
|
||||
else npr.Append(gp_XY(wcur,cur.Y()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(npr.IsEmpty()){
|
||||
if( Rdeb < 0. && Rfin <0. )
|
||||
Standard_DomainError::Raise("construction de la loi impossible");
|
||||
else if(Rdeb < 0. || Rfin <0.){
|
||||
Standard_Real r = (Rfin<0.)? Rdeb : Rfin;
|
||||
Handle(Law_Constant) loi = new Law_Constant();
|
||||
loi->Set(r,curdeb,curfin);
|
||||
res.Append(loi);
|
||||
}
|
||||
else{
|
||||
Handle(Law_S) loi = new Law_S();
|
||||
loi->Set(curdeb,Rdeb,curfin,Rfin);
|
||||
res.Append(loi);
|
||||
}
|
||||
}
|
||||
else{
|
||||
//tri bourrin!!
|
||||
if(!yaunpointsurledeb && Rdeb >= 0.) npr.Append(gp_XY(curdeb,Rdeb));
|
||||
if(!yaunpointsurlefin && Rfin >= 0.) npr.Append(gp_XY(curfin,Rfin));
|
||||
Standard_Integer nbp = npr.Length();
|
||||
// for(Standard_Integer i = 1; i < nbp; i++){
|
||||
Standard_Integer i;
|
||||
for(i = 1; i < nbp; i++){
|
||||
for(Standard_Integer j = i + 1; j <= nbp; j++){
|
||||
if(npr.Value(i).X() > npr.Value(j).X()){
|
||||
gp_XY temp = npr.Value(i);
|
||||
npr.ChangeValue(i) = npr.Value(j);
|
||||
npr.ChangeValue(j) = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
//On vire les doublons.
|
||||
Standard_Boolean fini = (nbp <= 1);
|
||||
i = 1;
|
||||
while (!fini) {
|
||||
if(fabs(npr.Value(i).X() - npr.Value(i+1).X()) < tol3d) {
|
||||
npr.Remove(i);
|
||||
nbp--;
|
||||
}
|
||||
else i++;
|
||||
fini = (i >= nbp);
|
||||
}
|
||||
|
||||
if(rad < 0.) {
|
||||
Handle(Law_Constant) loi = new Law_Constant();
|
||||
loi->Set(npr.First().Y(),curdeb,npr.First().X());
|
||||
res.Append(loi);
|
||||
}
|
||||
if(nbp > 1){
|
||||
TColgp_Array1OfPnt2d tpr(1,nbp);
|
||||
for (Standard_Integer l = 1; l <= nbp; l++) {
|
||||
tpr(l).SetXY(npr.Value(l));
|
||||
}
|
||||
Handle(Law_Interpol) curloi = new Law_Interpol();
|
||||
curloi->Set(tpr,0.,0.,Standard_False);
|
||||
res.Append(curloi);
|
||||
}
|
||||
if(raf < 0.) {
|
||||
Handle(Law_Constant) loi = new Law_Constant();
|
||||
loi->Set(npr.Last().Y(),npr.Last().X(),curfin);
|
||||
res.Append(loi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeLaw
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Law_Composite) ChFiDS_FilSpine::ComputeLaw
|
||||
(const Handle(ChFiDS_HElSpine)& Els)
|
||||
{
|
||||
Standard_Real tol3d = Precision::Confusion();
|
||||
Standard_Real deb,fin,curdeb,curfin;
|
||||
curdeb = deb = Els->FirstParameter();
|
||||
curfin = fin = Els->LastParameter();
|
||||
Standard_Integer ideb = Index(deb,Standard_True);
|
||||
Standard_Integer ifin = Index(fin,Standard_False);
|
||||
Standard_Integer len = NbEdges();
|
||||
// si la spine est periodique attention aux index et aux parametres!!!
|
||||
Standard_Real spinedeb = FirstParameter();
|
||||
Standard_Real spinefin = LastParameter();
|
||||
|
||||
Standard_Integer nbed = ifin - ideb + 1;
|
||||
Standard_Integer biddeb = ideb, bidfin = ifin;
|
||||
|
||||
Handle(Law_Composite) loi = new Law_Composite();
|
||||
Law_Laws& list = loi->ChangeLaws();
|
||||
#ifndef DEB
|
||||
Standard_Real Rdeb = 0., Rfin = 0., Rcur;
|
||||
#else
|
||||
Standard_Real Rdeb, Rfin, Rcur;
|
||||
#endif
|
||||
Standard_Integer icur = 1;
|
||||
Handle(Law_S) sl;
|
||||
Handle(Law_Constant) lastloi;
|
||||
Standard_Boolean lawencours = Standard_False;
|
||||
|
||||
|
||||
if(IsPeriodic()){
|
||||
if(deb < 0 && ideb > ifin) bidfin += len;
|
||||
else if(fin > LastParameter(len) && ideb > ifin) bidfin += len;
|
||||
nbed = bidfin - biddeb + 1;
|
||||
}
|
||||
TColStd_Array1OfInteger ind(1,nbed);
|
||||
Standard_Integer j = 1;
|
||||
for(Standard_Integer i = biddeb; i <= bidfin; i++){
|
||||
ind(j++) = ((i - 1)%len) + 1;
|
||||
}
|
||||
|
||||
if(Els->IsPeriodic()){
|
||||
//On cree une composite periodique de range eventuellement
|
||||
//decale par rapport a l elspine, pour ne pas faire de l
|
||||
//origine un point singulier.
|
||||
loi->SetPeriodic();
|
||||
//Y a t il une arete constante?
|
||||
// for(Standard_Integer k = 1; k <= len; k++){
|
||||
Standard_Integer k;
|
||||
for( k = 1; k <= len; k++){
|
||||
if (IsConstant(k)){ // oui !
|
||||
spinedeb = deb = curdeb = FirstParameter(k);
|
||||
spinefin = fin = deb + Period();
|
||||
for(Standard_Integer l = 1; l <= len; l++){
|
||||
ind(l) = ((k + l -2)%len) + 1;
|
||||
}
|
||||
Rdeb = Rfin = Radius(k);
|
||||
icur++;
|
||||
if(len == 1) curfin = LastParameter(k);//car le InPeriod va rendre 0.!!!
|
||||
else curfin = ElCLib::InPeriod(LastParameter(k),spinedeb,spinefin);
|
||||
Handle(Law_Constant) curloi = new Law_Constant();
|
||||
curloi->Set(Rdeb,curdeb,curfin);
|
||||
list.Append(curloi);
|
||||
curdeb = curfin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(k > len){ // non !
|
||||
if(parandrad.IsEmpty())
|
||||
Standard_DomainError::Raise("Rayon non defini");
|
||||
Standard_Integer nbp = parandrad.Length();
|
||||
if(nbp > 1){
|
||||
deb = parandrad.First().X();
|
||||
fin = deb + Period();
|
||||
if(parandrad.Last().X() - fin < - tol3d) nbp++;
|
||||
}
|
||||
else nbp++;
|
||||
TColgp_Array1OfPnt2d pr(1,nbp);
|
||||
for (Standard_Integer l = 1; l < nbp; l++) {
|
||||
pr(l).SetXY(parandrad(l));
|
||||
}
|
||||
pr(nbp).SetCoord(fin,pr(1).Y());
|
||||
Handle(Law_Interpol) curloi = new Law_Interpol();
|
||||
curloi->Set(pr,Standard_True);
|
||||
list.Append(curloi);
|
||||
return loi;
|
||||
}
|
||||
}
|
||||
else if(IsPeriodic()){
|
||||
// le rayon au debut.
|
||||
if (IsConstant(ind(1))) {
|
||||
Rdeb = Radius(ind(1));
|
||||
curfin = LastParameter(ind(1));
|
||||
curfin = ElCLib::InPeriod(curfin,spinedeb + tol3d, spinefin + tol3d);
|
||||
curfin = Min(fin,curfin);
|
||||
Handle(Law_Constant) curloi = new Law_Constant();
|
||||
curloi->Set(Rdeb,curdeb,curfin);
|
||||
list.Append(curloi);
|
||||
curdeb = curfin;
|
||||
icur++;
|
||||
}
|
||||
else{
|
||||
// Il y a forcement un kpart juste avant!
|
||||
Standard_Integer iprec = (ind(1) - 1);
|
||||
if(iprec == 0) iprec = len;
|
||||
if (IsConstant(iprec)){
|
||||
Rdeb = Radius(iprec);
|
||||
}
|
||||
else Standard_DomainError::Raise("AppendLaw : pas de precedant constant bizarre!!");
|
||||
lawencours = Standard_True;
|
||||
}
|
||||
// le rayon a la fin.
|
||||
if (IsConstant(ind(nbed))) Rfin = Radius(ind(nbed));
|
||||
else{
|
||||
// Il y a forcement un kpart juste apres!
|
||||
Standard_Integer isuiv = (ind(nbed) + 1);
|
||||
if(isuiv == len + 1) isuiv = 1;
|
||||
if (IsConstant(isuiv)) {
|
||||
Rfin = Radius(isuiv);
|
||||
}
|
||||
else Standard_DomainError::Raise("AppendLaw : pas de suivant constant bizarre!!");
|
||||
}
|
||||
}
|
||||
else{
|
||||
// le rayon au debut.
|
||||
if (IsConstant(ind(1))) {
|
||||
Rdeb = Radius(ind(1));
|
||||
curfin = Min(fin,LastParameter(ind(1)));
|
||||
Handle(Law_Constant) curloi = new Law_Constant();
|
||||
curloi->Set(Rdeb,curdeb,curfin);
|
||||
list.Append(curloi);
|
||||
curdeb = curfin;
|
||||
icur++;
|
||||
}
|
||||
else{
|
||||
if(ind(1) > 1){
|
||||
if (IsConstant(ind(1) - 1)){
|
||||
Rdeb = Radius(ind(1) - 1);
|
||||
}
|
||||
else Standard_DomainError::Raise("AppendLaw : pas de precedant constant");
|
||||
}
|
||||
else if(parandrad.IsEmpty()){
|
||||
Standard_DomainError::Raise("AppendLaw : pas rayon sur vertex");
|
||||
}
|
||||
else Rdeb = -1.;
|
||||
lawencours = Standard_True;
|
||||
}
|
||||
// le rayon a la fin.
|
||||
if (IsConstant(ind(nbed))) Rfin = Radius(ind(nbed));
|
||||
else{
|
||||
if(ind(nbed) < len){
|
||||
if (IsConstant(ind(nbed) + 1)) Rfin = Radius(ind(nbed) + 1);
|
||||
else Standard_DomainError::Raise("AppendLaw : pas de suivant constant");
|
||||
}
|
||||
else if(parandrad.IsEmpty()){
|
||||
Standard_DomainError::Raise("AppendLaw : pas rayon sur vertex");
|
||||
}
|
||||
else Rfin = -1.;
|
||||
}
|
||||
}
|
||||
|
||||
// On a les infos sur les extremites de l elspine,
|
||||
// on parcourt toutes les aretes
|
||||
for(; icur <= nbed; icur++){
|
||||
if (IsConstant(ind(icur))) {
|
||||
Rcur = Radius(ind(icur));
|
||||
if(lawencours){
|
||||
Law_Laws temp;
|
||||
mklaw(temp,parandrad,curdeb,curfin,Rdeb,Rcur,
|
||||
IsPeriodic(),spinedeb,spinefin,tol3d);
|
||||
list.Append(temp);
|
||||
lawencours = Standard_False;
|
||||
curdeb = curfin;
|
||||
}
|
||||
curfin = LastParameter(ind(icur));
|
||||
if(IsPeriodic()){
|
||||
curfin = ElCLib::InPeriod(curfin,spinedeb + tol3d, spinefin + tol3d);
|
||||
if(ind(icur) == ind(nbed)){
|
||||
// Attention le curfin peut etre faut si le dernier edge passe par
|
||||
// dessus l origine de la spine periodique.
|
||||
Standard_Real biddeb = FirstParameter(ind(icur));
|
||||
biddeb = ElCLib::InPeriod(biddeb,spinedeb + tol3d, spinefin + tol3d);
|
||||
if(biddeb >= curfin) curfin = fin;
|
||||
else curfin = Min(fin,curfin);
|
||||
}
|
||||
else curfin = Min(fin,curfin);
|
||||
}
|
||||
if((curfin - curdeb) > tol3d){
|
||||
Rdeb = Rcur;
|
||||
Handle(Law_Constant) curloi = new Law_Constant();
|
||||
curloi->Set(Rdeb,curdeb,curfin);
|
||||
list.Append(curloi);
|
||||
curdeb = curfin;
|
||||
}
|
||||
}
|
||||
else {
|
||||
curfin = LastParameter(ind(icur));
|
||||
if(IsPeriodic())
|
||||
curfin = ElCLib::InPeriod(curfin,spinedeb + tol3d, spinefin + tol3d);
|
||||
curfin = Min(fin,curfin);
|
||||
lawencours = Standard_True;
|
||||
if(ind(icur) == ind(nbed)){
|
||||
// Attention le curfin peut etre faut si le dernier edge passe par
|
||||
// dessus l origine de la spine periodique.
|
||||
if(IsPeriodic()) {
|
||||
Standard_Real biddeb = FirstParameter(ind(icur));
|
||||
curfin = LastParameter(ind(icur));
|
||||
biddeb = ElCLib::InPeriod(biddeb,spinedeb + tol3d, spinefin + tol3d);
|
||||
curfin = ElCLib::InPeriod(curfin,spinedeb + tol3d, spinefin + tol3d);
|
||||
if(biddeb >= curfin) curfin = fin;
|
||||
else curfin = Min(fin,curfin);
|
||||
}
|
||||
// ou si on est en fin de spine avec prolongement.
|
||||
else if(ind(icur) == len) curfin = fin;
|
||||
Law_Laws temp;
|
||||
mklaw(temp,parandrad,curdeb,curfin,Rdeb,Rfin,
|
||||
IsPeriodic(),spinedeb,spinefin,tol3d);
|
||||
list.Append(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!lastloi.IsNull()) list.Append(lastloi);
|
||||
return loi;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Law
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Law_Composite) ChFiDS_FilSpine::Law(const Handle(ChFiDS_HElSpine)& Els) const
|
||||
{
|
||||
ChFiDS_ListIteratorOfListOfHElSpine Itsp(elspines);
|
||||
Law_ListIteratorOfLaws Itl(laws);
|
||||
for(; Itsp.More(); Itsp.Next(), Itl.Next()){
|
||||
if(Els == Itsp.Value()){
|
||||
return Handle(Law_Composite)::DownCast(Itl.Value());
|
||||
}
|
||||
}
|
||||
return Handle(Law_Composite)();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Law
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Law_Function)& ChFiDS_FilSpine::ChangeLaw(const TopoDS_Edge& E)
|
||||
{
|
||||
if(!SplitDone()) {
|
||||
Standard_DomainError::Raise("ChFiDS_FilSpine::ChangeLaw : les bornes ne sont pas a jour");
|
||||
}
|
||||
Standard_Integer IE = Index(E);
|
||||
if (IsConstant(IE)) {
|
||||
Standard_DomainError::Raise("ChFiDS_FilSpine::ChangeLaw : pas de loi sur les aretes constantes");
|
||||
}
|
||||
Handle(ChFiDS_HElSpine) hsp = ElSpine(IE);
|
||||
Standard_Real w = 0.5*(FirstParameter(IE) + LastParameter(IE));
|
||||
Handle(Law_Composite) lc = Law(hsp);
|
||||
return lc->ChangeElementaryLaw(w);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Radius
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_FilSpine::MaxRadFromSeqAndLaws()const
|
||||
{
|
||||
Standard_Real MaxRad = 0.;
|
||||
|
||||
for (Standard_Integer i = 1; i <= parandrad.Length(); i++)
|
||||
if (parandrad(i).Y() > MaxRad)
|
||||
MaxRad = parandrad(i).Y();
|
||||
|
||||
Law_ListIteratorOfLaws itl( laws );
|
||||
for (; itl.More(); itl.Next())
|
||||
{
|
||||
Handle(Law_Function) law = itl.Value();
|
||||
Standard_Real fpar, lpar, par, delta, rad;
|
||||
law->Bounds( fpar, lpar );
|
||||
delta = (lpar - fpar)*0.2;
|
||||
for (Standard_Integer i = 0; i <= 4; i++)
|
||||
{
|
||||
par = fpar + i*delta;
|
||||
rad = law->Value(par);
|
||||
if (rad > MaxRad)
|
||||
MaxRad = rad;
|
||||
}
|
||||
rad = law->Value(lpar);
|
||||
if (rad > MaxRad)
|
||||
MaxRad = rad;
|
||||
}
|
||||
|
||||
return MaxRad;
|
||||
}
|
48
src/ChFiDS/ChFiDS_Map.cdl
Executable file
48
src/ChFiDS/ChFiDS_Map.cdl
Executable file
@@ -0,0 +1,48 @@
|
||||
-- File: ChFiDS_Map.cdl
|
||||
-- Created: Fri Oct 22 16:23:11 1993
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class Map from ChFiDS
|
||||
|
||||
---Purpose: Encapsulation of IndexedDataMapOfShapeListOfShape.
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
ShapeEnum from TopAbs,
|
||||
ListOfShape from TopTools,
|
||||
IndexedDataMapOfShapeListOfShape from TopTools
|
||||
|
||||
is
|
||||
Create returns Map from ChFiDS;
|
||||
---Purpose: Create an empty Map
|
||||
|
||||
Fill (me : in out; S : Shape from TopoDS; T1,T2 : ShapeEnum from TopAbs)
|
||||
---Purpose: Fills the map with the subshapes of type T1 as keys
|
||||
-- and the list of ancestors of type T2 as items.
|
||||
is static;
|
||||
|
||||
Contains(me; S : Shape from TopoDS)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
FindFromKey(me; S : Shape from TopoDS)
|
||||
returns ListOfShape from TopTools
|
||||
---C++: alias operator()
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
FindFromIndex(me; I : Integer from Standard)
|
||||
returns ListOfShape from TopTools
|
||||
---C++: alias operator()
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
myMap : IndexedDataMapOfShapeListOfShape from TopTools;
|
||||
|
||||
end Map;
|
67
src/ChFiDS/ChFiDS_Map.cxx
Executable file
67
src/ChFiDS/ChFiDS_Map.cxx
Executable file
@@ -0,0 +1,67 @@
|
||||
// File: ChFiDS_Map.cxx
|
||||
// Created: Fri Oct 22 17:25:12 1993
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@phylox>
|
||||
|
||||
|
||||
#include <ChFiDS_Map.ixx>
|
||||
#include <TopExp.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_Map
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_Map::ChFiDS_Map()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Fill
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Map::Fill(const TopoDS_Shape& S,
|
||||
const TopAbs_ShapeEnum T1,
|
||||
const TopAbs_ShapeEnum T2)
|
||||
{
|
||||
TopExp::MapShapesAndAncestors(S,T1,T2,myMap);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Contains
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Map::Contains(const TopoDS_Shape& S)const
|
||||
{
|
||||
return myMap.Contains(S);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FindFromKey
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TopTools_ListOfShape& ChFiDS_Map::FindFromKey
|
||||
(const TopoDS_Shape& S)const
|
||||
{
|
||||
return myMap.FindFromKey(S);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FindFromIndex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TopTools_ListOfShape&
|
||||
ChFiDS_Map::FindFromIndex(const Standard_Integer I)const
|
||||
{
|
||||
return myMap.FindFromIndex(I);
|
||||
}
|
||||
|
||||
|
45
src/ChFiDS/ChFiDS_Regul.cdl
Executable file
45
src/ChFiDS/ChFiDS_Regul.cdl
Executable file
@@ -0,0 +1,45 @@
|
||||
-- File: ChFiDS_Regul.cdl
|
||||
-- Created: Tue Mar 21 10:47:55 1995
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@phylox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
class Regul from ChFiDS
|
||||
|
||||
---Purpose: Storage of a curve and its 2 faces or surfaces of support.
|
||||
|
||||
is
|
||||
|
||||
Create returns Regul from ChFiDS;
|
||||
|
||||
SetCurve(me : in out; IC : Integer from Standard)
|
||||
is static;
|
||||
|
||||
SetS1(me : in out;
|
||||
IS1 : Integer from Standard;
|
||||
IsFace : Boolean from Standard = Standard_True)
|
||||
is static;
|
||||
|
||||
SetS2(me : in out;
|
||||
IS2 : Integer from Standard;
|
||||
IsFace : Boolean from Standard = Standard_True)
|
||||
is static;
|
||||
|
||||
IsSurface1(me) returns Boolean from Standard is static;
|
||||
|
||||
IsSurface2(me) returns Boolean from Standard is static;
|
||||
|
||||
Curve(me) returns Integer from Standard is static;
|
||||
|
||||
S1(me) returns Integer from Standard is static;
|
||||
|
||||
S2(me) returns Integer from Standard is static;
|
||||
|
||||
fields
|
||||
|
||||
icurv : Integer from Standard;
|
||||
is1 : Integer from Standard;
|
||||
is2 : Integer from Standard;
|
||||
|
||||
end Regul;
|
110
src/ChFiDS/ChFiDS_Regul.cxx
Executable file
110
src/ChFiDS/ChFiDS_Regul.cxx
Executable file
@@ -0,0 +1,110 @@
|
||||
// File: ChFiDS_Regul.cxx
|
||||
// Created: Tue Mar 21 11:15:18 1995
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@phylox>
|
||||
|
||||
|
||||
#include <ChFiDS_Regul.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_Regul
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_Regul::ChFiDS_Regul()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Regul::SetCurve(const Standard_Integer IC)
|
||||
{
|
||||
icurv = Abs(IC);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Regul::SetS1(const Standard_Integer IS1,
|
||||
const Standard_Boolean IsFace)
|
||||
{
|
||||
if(IsFace) is1 = Abs(IS1);
|
||||
else is1 = -Abs(IS1);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Regul::SetS2(const Standard_Integer IS2,
|
||||
const Standard_Boolean IsFace)
|
||||
{
|
||||
if(IsFace) is2 = Abs(IS2);
|
||||
else is2 = -Abs(IS2);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsSurface1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Regul::IsSurface1() const
|
||||
{
|
||||
return (is1<0);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsSurface2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Regul::IsSurface2() const
|
||||
{
|
||||
return (is2<0);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Regul::Curve() const
|
||||
{
|
||||
return icurv;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : S1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Regul::S1() const
|
||||
{
|
||||
return Abs(is1);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : S2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Regul::S2() const
|
||||
{
|
||||
return Abs(is2);
|
||||
}
|
||||
|
||||
|
359
src/ChFiDS/ChFiDS_Spine.cdl
Executable file
359
src/ChFiDS/ChFiDS_Spine.cdl
Executable file
@@ -0,0 +1,359 @@
|
||||
-- File: ChFiDS_Spine.cdl
|
||||
-- Created: Tue Nov 9 16:23:29 1993
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
|
||||
class Spine from ChFiDS inherits TShared from MMgt
|
||||
|
||||
---Purpose: Contient les informations necessaires a la
|
||||
-- construction d un conge volumique :
|
||||
--
|
||||
--
|
||||
-- - ligne guide composee d'edges du solide, tangents
|
||||
-- entre eux, et bordes par des faces tangentes entre
|
||||
-- elles.
|
||||
--
|
||||
-- Les outils de construction du Sp
|
||||
-- par propagation a partir d un edge du solide sont
|
||||
-- fournis dans le Builder de Fil3d.
|
||||
--
|
||||
-- Le Spine contient par aileurs des
|
||||
-- informations concernant la nature des extremites
|
||||
-- du conge ( sur bord libre, sur cassure ou ferme ).
|
||||
--
|
||||
-- REMARQUE IMPORTANTE : la ligne guide ainsi
|
||||
-- representee n est pas C2, alors que le cheminement
|
||||
-- le reclame. Un certain nombre d amenagements
|
||||
-- paliatifs (voir les methodes en fin) sont prevus,
|
||||
-- s ils sont insuffisants il faudra changer notre
|
||||
-- fusil d epaule et doubler le Spine d
|
||||
-- une ligne C2 avec les consequences que l on sait
|
||||
-- pour gerer les va et vient entre KPart Blend dans
|
||||
-- Fil3d.
|
||||
|
||||
|
||||
|
||||
uses
|
||||
|
||||
HArray1OfReal from TColStd,
|
||||
HArray1OfBoolean from TColStd,
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
Lin from gp,
|
||||
Circ from gp,
|
||||
CurveType from GeomAbs,
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
SequenceOfShape from TopTools,
|
||||
Curve from BRepAdaptor,
|
||||
SurfData from ChFiDS,
|
||||
State from ChFiDS,
|
||||
HElSpine from ChFiDS,
|
||||
ListOfHElSpine from ChFiDS,
|
||||
ErrorStatus from ChFiDS
|
||||
is
|
||||
|
||||
----------------------------
|
||||
-- methodes de construction.
|
||||
----------------------------
|
||||
|
||||
Create returns mutable Spine from ChFiDS;
|
||||
|
||||
Create(Tol : Real from Standard) returns mutable Spine from ChFiDS;
|
||||
|
||||
SetEdges(me : mutable; E : Edge from TopoDS) is static;
|
||||
---Purpose: stocker les edges qui vont composer la ligne guide
|
||||
---C++: inline
|
||||
|
||||
PutInFirst(me : mutable; E : Edge from TopoDS) is static;
|
||||
---Purpose:stocker l edge en premiere position avant tous les autres
|
||||
---C++: inline
|
||||
|
||||
NbEdges(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
|
||||
Edges(me; I : Integer) returns Edge from TopoDS is static;
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
|
||||
|
||||
SetFirstStatus(me : mutable; S : State from ChFiDS) is static;
|
||||
---Purpose: stocker si le debut de l ensemble des edges demarre
|
||||
-- sur une cassure un bord libre ou forme un contour ferme
|
||||
---C++: inline
|
||||
|
||||
|
||||
SetLastStatus(me : mutable; S : State from ChFiDS) is static;
|
||||
---Purpose: stocker si la fin de l ensemble des edges demarre
|
||||
-- sur une cassure un bord libre ou forme un contour ferme
|
||||
---C++: inline
|
||||
|
||||
AppendElSpine(me : mutable; Els : HElSpine from ChFiDS)
|
||||
is virtual;
|
||||
|
||||
ElSpine(me; IE : Integer from Standard)
|
||||
returns mutable HElSpine from ChFiDS
|
||||
is static;
|
||||
|
||||
ElSpine(me; E : Edge from TopoDS)
|
||||
returns mutable HElSpine from ChFiDS
|
||||
is static;
|
||||
|
||||
ElSpine(me; W : Real from Standard)
|
||||
returns mutable HElSpine from ChFiDS
|
||||
is static;
|
||||
|
||||
ChangeElSpines(me : mutable)
|
||||
---C++: return &
|
||||
returns ListOfHElSpine from ChFiDS
|
||||
is static;
|
||||
|
||||
Reset(me : mutable; AllData : Boolean from Standard = Standard_False)
|
||||
is virtual;
|
||||
|
||||
SplitDone(me) returns Boolean from Standard is static;
|
||||
SplitDone(me : mutable; B : Boolean from Standard) is static;
|
||||
|
||||
----------------------
|
||||
-- methodes de calcul.
|
||||
----------------------
|
||||
|
||||
Load(me : mutable) is static;
|
||||
---Purpose: preparer la ligne guide en fonction des edges qui
|
||||
-- sont des arcs elementaires (prendre un parametrage
|
||||
-- unique abscisse curviligne );pour pouvoir appeller
|
||||
-- les methodes sur la geometrie (first,last,value,d1,d2)
|
||||
-- il faut d abord preparer sinon une exception sera levee
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
is static;
|
||||
|
||||
IsClosed(me) returns Boolean
|
||||
is static;
|
||||
|
||||
FirstParameter(me) returns Real
|
||||
is static;
|
||||
|
||||
LastParameter(me) returns Real
|
||||
is static;
|
||||
|
||||
SetFirstParameter(me : mutable; Par : Real from Standard)
|
||||
is static;
|
||||
|
||||
SetLastParameter(me : mutable; Par : Real from Standard)
|
||||
is static;
|
||||
|
||||
FirstParameter(me; IndexSpine : Integer ) returns Real
|
||||
---Purpose: donne la longueur cumulee de tous les arcs avant le
|
||||
-- numero IndexSp
|
||||
is static;
|
||||
|
||||
LastParameter(me; IndexSpine : Integer ) returns Real
|
||||
---Purpose: donne la longueur cumulee jusqu a l arc de numero
|
||||
-- IndexSpine (inclus)
|
||||
is static;
|
||||
|
||||
Length(me;IndexSpine : Integer ) returns Real
|
||||
---Purpose: donne la longueur de l arc de numero IndexSp
|
||||
is static;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is static;
|
||||
|
||||
Period(me) returns Real
|
||||
is static;
|
||||
|
||||
Absc(me :mutable; U : Real) returns Real from Standard
|
||||
is static;
|
||||
|
||||
Absc(me :mutable; U : Real; I : Integer from Standard)
|
||||
returns Real from Standard
|
||||
is static;
|
||||
|
||||
Parameter(me :mutable;
|
||||
AbsC : Real;
|
||||
U : out Real;
|
||||
Oriented : Boolean from Standard = Standard_True)
|
||||
is static;
|
||||
|
||||
Parameter(me :mutable;
|
||||
Index : Integer;
|
||||
AbsC : Real;
|
||||
U : out Real;
|
||||
Oriented : Boolean from Standard = Standard_True)
|
||||
is static;
|
||||
|
||||
Prepare(me;
|
||||
L : in out Real from Standard;
|
||||
Index : in out Integer from Standard )
|
||||
is static private;
|
||||
|
||||
Value(me :mutable; AbsC : Real ) returns Pnt from gp
|
||||
is static;
|
||||
|
||||
D0(me :mutable; AbsC : Real ; P : out Pnt from gp)
|
||||
is static;
|
||||
|
||||
D1(me :mutable; AbsC : Real ; P : out Pnt from gp; V1 : out Vec from gp)
|
||||
is static;
|
||||
|
||||
D2(me :mutable; AbsC : Real ; P : out Pnt from gp;
|
||||
V1,V2 : out Vec from gp)
|
||||
is static;
|
||||
|
||||
SetCurrent (me : mutable; Index : Integer )
|
||||
is static;
|
||||
|
||||
CurrentElementarySpine (me : mutable; Index : Integer )
|
||||
---Purpose: set la courbe courante et la renvoie
|
||||
returns Curve from BRepAdaptor is static;
|
||||
---C++: return const &
|
||||
|
||||
CurrentIndexOfElementarySpine(me) returns Integer from Standard
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs
|
||||
is static;
|
||||
|
||||
Line(me) returns Lin from gp
|
||||
is static;
|
||||
|
||||
Circle(me) returns Circ from gp
|
||||
is static;
|
||||
|
||||
FirstStatus(me) returns State from ChFiDS is static;
|
||||
---Purpose: returns if the set of edges starts on a free boundary
|
||||
-- or if the first vertex is a breakpoint or if the set is
|
||||
-- closed
|
||||
---C++: inline
|
||||
|
||||
LastStatus(me) returns State from ChFiDS is static;
|
||||
---Purpose: returns the state at the end of the set
|
||||
---C++: inline
|
||||
|
||||
|
||||
Status(me; IsFirst : Boolean from Standard)
|
||||
returns State from ChFiDS is static;
|
||||
---C++: inline
|
||||
|
||||
|
||||
SetStatus(me : mutable;
|
||||
S : State from ChFiDS;
|
||||
IsFirst : Boolean from Standard) is static;
|
||||
---C++: inline
|
||||
|
||||
IsTangencyExtremity(me; IsFirst : Boolean from Standard)
|
||||
returns Boolean is static;
|
||||
---Purpose: returns if the set of edges starts (or end) on
|
||||
-- Tangency point.
|
||||
---C++: inline
|
||||
|
||||
|
||||
SetTangencyExtremity(me : mutable;
|
||||
IsTangency : Boolean from Standard;
|
||||
IsFirst : Boolean from Standard) is static;
|
||||
---C++: inline
|
||||
-----------------------------------------------------------
|
||||
-- Methodes d acces aux vertex et a leurs parametres
|
||||
-----------------------------------------------------------
|
||||
|
||||
Absc(me ; V : Vertex from TopoDS) returns Real from Standard
|
||||
is static;
|
||||
FirstVertex(me) returns Vertex from TopoDS;
|
||||
LastVertex(me) returns Vertex from TopoDS;
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Methodes de controle des prolongements aux extremites :
|
||||
-- - prolongement par parmetrage etendu,
|
||||
-- - prolongement par la tangente.
|
||||
-----------------------------------------------------------
|
||||
|
||||
SetFirstTgt(me : mutable; W : Real from Standard) is static;
|
||||
|
||||
SetLastTgt(me : mutable; W : Real from Standard) is static;
|
||||
|
||||
HasFirstTgt(me) returns Boolean from Standard is static;
|
||||
|
||||
HasLastTgt(me) returns Boolean from Standard is static;
|
||||
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Methodes d implementation permettant de positionner un flag pour
|
||||
-- le calcul de D2 aux points singuliers de la ligne guide.
|
||||
---------------------------------------------------------------------
|
||||
|
||||
SetReference(me : mutable; W : Real from Standard) is static;
|
||||
---Purpose: set a parameter reference for the approx.
|
||||
|
||||
SetReference(me : mutable; I : Integer from Standard) is static;
|
||||
---Purpose: set a parameter reference for the approx, at the
|
||||
-- middle of edge I.
|
||||
|
||||
Index(me;
|
||||
W : Real from Standard;
|
||||
Forward : Boolean from Standard = Standard_True)
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
Index(me; E : Edge from TopoDS)
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
UnsetReference(me : mutable) is static;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- methodes concernant le statut d'erreur
|
||||
-----------------------------------------------------------------------
|
||||
SetErrorStatus(me : mutable; state : ErrorStatus from ChFiDS) is static;
|
||||
|
||||
ErrorStatus(me) returns ErrorStatus from ChFiDS is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
-- donnees generales.
|
||||
|
||||
myCurve : Curve from BRepAdaptor;
|
||||
indexofcurve : Integer from Standard;
|
||||
firstState : State from ChFiDS;
|
||||
lastState : State from ChFiDS;
|
||||
spine : SequenceOfShape from TopTools;
|
||||
abscissa : HArray1OfReal from TColStd;
|
||||
--isconstant : HArray1OfBoolean from TColStd is protected;
|
||||
splitdone : Boolean from Standard is protected;
|
||||
elspines : ListOfHElSpine from ChFiDS is protected;
|
||||
tolesp : Real from Standard;
|
||||
|
||||
-- donnees caraterisant les extremites.
|
||||
|
||||
firstparam : Real from Standard;
|
||||
lastparam : Real from Standard;
|
||||
firstprolon : Boolean from Standard;
|
||||
lastprolon : Boolean from Standard;
|
||||
firstistgt : Boolean from Standard;
|
||||
lastistgt : Boolean from Standard;
|
||||
|
||||
firsttgtpar : Real from Standard;
|
||||
lasttgtpar : Real from Standard;
|
||||
hasfirsttgt : Boolean from Standard;
|
||||
haslasttgt : Boolean from Standard;
|
||||
firstori : Pnt from gp;
|
||||
lastori : Pnt from gp;
|
||||
firsttgt : Vec from gp;
|
||||
lasttgt : Vec from gp;
|
||||
|
||||
-- detrompeurs de calcul.
|
||||
|
||||
valref : Real from Standard;
|
||||
hasref : Boolean from Standard;
|
||||
|
||||
-- statut d'erreur
|
||||
errorstate : ErrorStatus from ChFiDS;
|
||||
|
||||
end Spine;
|
885
src/ChFiDS/ChFiDS_Spine.cxx
Executable file
885
src/ChFiDS/ChFiDS_Spine.cxx
Executable file
@@ -0,0 +1,885 @@
|
||||
// File: ChFiDS_Spine.cxx
|
||||
// Created: Thu Nov 18 12:36:53 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
// Modified by isg, Thu Mar 17 09:21:31 1994
|
||||
|
||||
|
||||
#include <ChFiDS_Spine.ixx>
|
||||
#include <ChFiDS_HElSpine.hxx>
|
||||
#include <ChFiDS_ErrorStatus.hxx>
|
||||
#include <ChFiDS_ListIteratorOfListOfHElSpine.hxx>
|
||||
#include <GCPnts_AbscissaPoint.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_Spine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_Spine::ChFiDS_Spine():
|
||||
splitdone(Standard_False),
|
||||
tolesp(Precision::Confusion()),
|
||||
firstprolon(Standard_False),
|
||||
lastprolon(Standard_False),
|
||||
firstistgt(Standard_False),
|
||||
lastistgt(Standard_False),
|
||||
hasfirsttgt(Standard_False),
|
||||
haslasttgt(Standard_False),
|
||||
hasref(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
ChFiDS_Spine::ChFiDS_Spine(const Standard_Real Tol):
|
||||
splitdone(Standard_False),
|
||||
tolesp(Tol),
|
||||
firstprolon(Standard_False),
|
||||
lastprolon(Standard_False),
|
||||
firstistgt(Standard_False),
|
||||
lastistgt(Standard_False),
|
||||
hasfirsttgt(Standard_False),
|
||||
haslasttgt(Standard_False),
|
||||
hasref(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AppendElSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::AppendElSpine(const Handle(ChFiDS_HElSpine)& Els)
|
||||
{
|
||||
elspines.Append(Els);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ElSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(ChFiDS_HElSpine) ChFiDS_Spine::ElSpine(const TopoDS_Edge& E) const
|
||||
{
|
||||
return ElSpine(Index(E));
|
||||
}
|
||||
|
||||
Handle(ChFiDS_HElSpine) ChFiDS_Spine::ElSpine(const Standard_Integer IE) const
|
||||
{
|
||||
Standard_Real wmil = 0.5 * (FirstParameter(IE) + LastParameter(IE));
|
||||
if(IsPeriodic()) wmil = ElCLib::InPeriod(wmil,FirstParameter(),LastParameter());
|
||||
return ElSpine(wmil);
|
||||
}
|
||||
|
||||
Handle(ChFiDS_HElSpine) ChFiDS_Spine::ElSpine(const Standard_Real W) const
|
||||
{
|
||||
ChFiDS_ListIteratorOfListOfHElSpine It(elspines);
|
||||
for (; It.More(); It.Next()) {
|
||||
Handle(ChFiDS_HElSpine) cur = It.Value();
|
||||
Standard_Real uf = cur->FirstParameter();
|
||||
Standard_Real ul = cur->LastParameter();
|
||||
if(uf <= W && W <= ul) return cur;
|
||||
}
|
||||
return Handle(ChFiDS_HElSpine)();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeElSpines
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_ListOfHElSpine& ChFiDS_Spine::ChangeElSpines()
|
||||
{
|
||||
return elspines;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SplitDone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SplitDone(const Standard_Boolean B)
|
||||
{
|
||||
splitdone = B;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SplitDone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Spine::SplitDone() const
|
||||
{
|
||||
return splitdone;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::Reset(const Standard_Boolean AllData)
|
||||
{
|
||||
splitdone = Standard_False;
|
||||
//if(AllData && !isconstant.IsNull()) isconstant->ChangeArray1().Init(0);
|
||||
elspines.Clear();
|
||||
if(AllData){
|
||||
firstparam = 0.;
|
||||
lastparam = abscissa->Value(abscissa->Upper());
|
||||
firstprolon = lastprolon = Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::FirstParameter() const
|
||||
{
|
||||
if(firstprolon) return firstparam;
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::LastParameter() const
|
||||
{
|
||||
if(lastprolon) return lastparam;
|
||||
return abscissa->Value(abscissa->Upper());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SetFirstParameter(const Standard_Real Par)
|
||||
{
|
||||
#ifdef DEB
|
||||
if(Par >= Precision::Confusion())
|
||||
cout<<"Prolongement interieur en debut de ligne guide"<<endl;
|
||||
if(IsPeriodic())
|
||||
cout<<"WARNING!!! Prolongement sur ligne guide periodique."<<endl;
|
||||
#endif
|
||||
firstprolon = Standard_True;
|
||||
firstparam = Par;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SetLastParameter(const Standard_Real Par)
|
||||
{
|
||||
#ifdef DEB
|
||||
Standard_Real lll = abscissa->Value(abscissa->Upper());
|
||||
if((Par - lll) <= -Precision::Confusion())
|
||||
cout<<"Prolongement interieur en fin de ligne guide"<<endl;
|
||||
if(IsPeriodic())
|
||||
cout<<"WARNING!!! Prolongement sur ligne guide periodique."<<endl;
|
||||
#endif
|
||||
lastprolon = Standard_True;
|
||||
lastparam = Par;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::FirstParameter
|
||||
(const Standard_Integer IndexSpine) const
|
||||
{
|
||||
if (IndexSpine==1) return 0.;
|
||||
return abscissa->Value(IndexSpine-1);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::LastParameter
|
||||
(const Standard_Integer IndexSpine) const
|
||||
{
|
||||
return abscissa->Value(IndexSpine);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Length
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::Length
|
||||
(const Standard_Integer IndexSpine) const
|
||||
{
|
||||
if (IndexSpine==1) return abscissa->Value(IndexSpine);
|
||||
return abscissa->Value(IndexSpine) - abscissa->Value(IndexSpine-1);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Spine::IsPeriodic() const
|
||||
{
|
||||
return (firstState == ChFiDS_Closed);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Spine::IsClosed() const
|
||||
{
|
||||
return (FirstVertex().IsSame(LastVertex()));
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Vertex ChFiDS_Spine::FirstVertex() const
|
||||
{
|
||||
TopoDS_Edge E = TopoDS::Edge(spine.First());
|
||||
if(E.Orientation() == TopAbs_FORWARD) return TopExp::FirstVertex(E);
|
||||
return TopExp::LastVertex(E);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Vertex ChFiDS_Spine::LastVertex() const
|
||||
{
|
||||
TopoDS_Edge E = TopoDS::Edge(spine.Last());
|
||||
if(E.Orientation() == TopAbs_FORWARD) return TopExp::LastVertex(E);
|
||||
return TopExp::FirstVertex(E);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Absc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::Absc(const TopoDS_Vertex& V) const
|
||||
{
|
||||
TopoDS_Vertex d,f;
|
||||
TopoDS_Edge E;
|
||||
for(Standard_Integer i = 1; i<=spine.Length(); i++){
|
||||
E = TopoDS::Edge(spine.Value(i));
|
||||
TopExp::Vertices(E,d,f);
|
||||
if(d.IsSame(V) && E.Orientation() == TopAbs_FORWARD){
|
||||
return FirstParameter(i);
|
||||
}
|
||||
if(d.IsSame(V) && E.Orientation() == TopAbs_REVERSED){
|
||||
return LastParameter(i);
|
||||
}
|
||||
if(f.IsSame(V) && E.Orientation() == TopAbs_FORWARD){
|
||||
return LastParameter(i);
|
||||
}
|
||||
if(f.IsSame(V) && E.Orientation() == TopAbs_REVERSED){
|
||||
return FirstParameter(i);
|
||||
}
|
||||
}
|
||||
return -1.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::Period() const
|
||||
{
|
||||
if(!IsPeriodic()) Standard_Failure::Raise("Spine non periodique");
|
||||
return abscissa->Value(abscissa->Upper());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::Resolution(const Standard_Real R3d) const
|
||||
{
|
||||
return R3d;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFirstTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SetFirstTgt(const Standard_Real W)
|
||||
{
|
||||
if(IsPeriodic()) Standard_Failure::Raise
|
||||
("Pas de prolongement par tangente sur les contours periodiques");
|
||||
#ifdef DEB
|
||||
if(W >= Precision::Confusion())
|
||||
cout<<"Prolongement interieur en debut de ligne guide"<<endl;
|
||||
#endif
|
||||
//On vire le flag au cas ou il serait deja positionne pour
|
||||
//ne pas planter le d1
|
||||
hasfirsttgt = Standard_False;
|
||||
D1(W,firstori,firsttgt);
|
||||
//et on le remet.
|
||||
hasfirsttgt = Standard_True;
|
||||
firsttgtpar = W;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLastTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SetLastTgt(const Standard_Real W)
|
||||
{
|
||||
if(IsPeriodic()) Standard_Failure::Raise
|
||||
("Pas de prologement par tangente sur les contours periodiques");
|
||||
|
||||
#ifdef DEB
|
||||
Standard_Real L = W - abscissa->Value(abscissa->Upper());
|
||||
if(L <= -Precision::Confusion())
|
||||
cout<<"Prolongement interieur en fin de ligne guide"<<endl;
|
||||
#endif
|
||||
//On vire le flag au cas ou il serait deja positionne pour
|
||||
//ne pas planter le d1
|
||||
haslasttgt = Standard_False;
|
||||
D1(W,lastori,lasttgt);
|
||||
//et on le remet.
|
||||
haslasttgt = Standard_True;
|
||||
lasttgtpar = W;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : HasFirstTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Spine::HasFirstTgt()const
|
||||
{
|
||||
return hasfirsttgt;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasLastTgt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFiDS_Spine::HasLastTgt()const
|
||||
{
|
||||
return haslasttgt;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetReference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SetReference(const Standard_Real W)
|
||||
{
|
||||
hasref = Standard_True;
|
||||
Standard_Real lll = abscissa->Value(abscissa->Upper());
|
||||
if(IsPeriodic()) valref = ElCLib::InPeriod(W,0.,lll);
|
||||
else valref = W;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetReference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SetReference(const Standard_Integer I)
|
||||
{
|
||||
hasref = Standard_True;
|
||||
if(I == 1) valref = abscissa->Value(1)*0.5;
|
||||
else valref = (abscissa->Value(I) + abscissa->Value(I-1))*0.5;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Index
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Spine::Index(const Standard_Real W,
|
||||
const Standard_Boolean Forward) const
|
||||
{
|
||||
Standard_Integer ind, len = abscissa->Length();
|
||||
Standard_Real par = W,last = abscissa->Value(abscissa->Upper());
|
||||
Standard_Real f = 0., l = 0., t = Max(tolesp,Precision::Confusion());
|
||||
|
||||
if(IsPeriodic() && Abs(par) >= t && Abs(par-last) >= t)
|
||||
par = ElCLib::InPeriod(par,0.,last);
|
||||
|
||||
for (ind=1; ind <= len; ind++) {
|
||||
f = l;
|
||||
l = abscissa->Value(ind);
|
||||
if (par<l || ind==len) break;
|
||||
}
|
||||
if (Forward && ind<len && Abs(par-l) < t) ind++;
|
||||
else if (!Forward && ind > 1 && Abs(par-f) < t) ind--;
|
||||
else if (Forward && IsPeriodic() && ind == len && Abs(par-l) < t) ind = 1;
|
||||
else if (!Forward && IsPeriodic() && ind == 1 && Abs(par-f) < t) ind = len;
|
||||
return ind;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Index
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Spine::Index (const TopoDS_Edge& E) const
|
||||
{
|
||||
for(Standard_Integer IE = 1; IE <= spine.Length(); IE++){
|
||||
if(E.IsSame(spine.Value(IE))) return IE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetReference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::UnsetReference()
|
||||
{
|
||||
hasref = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::Load()
|
||||
{
|
||||
if(!abscissa.IsNull()){
|
||||
#ifdef DEB
|
||||
cout<<"nouveau load du CE"<<endl;
|
||||
#endif
|
||||
}
|
||||
Standard_Integer len = spine.Length();
|
||||
abscissa = new TColStd_HArray1OfReal(1,len);
|
||||
Standard_Real a1 = 0.;
|
||||
for (Standard_Integer i = 1; i <= len; i++){
|
||||
myCurve.Initialize(TopoDS::Edge(spine.Value(i)));
|
||||
a1 += GCPnts_AbscissaPoint::Length(myCurve);
|
||||
abscissa->SetValue(i,a1);
|
||||
}
|
||||
indexofcurve =1;
|
||||
myCurve.Initialize(TopoDS::Edge(spine.Value(1)));
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Absc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::Absc(const Standard_Real U)
|
||||
{
|
||||
return Absc(U,indexofcurve);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Absc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_Spine::Absc(const Standard_Real U,
|
||||
const Standard_Integer I)
|
||||
{
|
||||
|
||||
|
||||
if(indexofcurve != I){
|
||||
void* p = (void*)this;
|
||||
((ChFiDS_Spine*)p)->indexofcurve = I;
|
||||
((ChFiDS_Spine*)p)->myCurve.Initialize(TopoDS::Edge(spine.Value(I)));
|
||||
}
|
||||
Standard_Real L = FirstParameter(I);
|
||||
if (spine.Value(I).Orientation() == TopAbs_REVERSED) {
|
||||
L += GCPnts_AbscissaPoint::Length(myCurve,U,myCurve.LastParameter());
|
||||
}
|
||||
else{
|
||||
L += GCPnts_AbscissaPoint::Length(myCurve,myCurve.FirstParameter(),U);
|
||||
}
|
||||
return L;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::Parameter(const Standard_Real AbsC,
|
||||
Standard_Real& U,
|
||||
const Standard_Boolean Oriented)
|
||||
{
|
||||
Standard_Integer Index;
|
||||
for (Index=1;Index<abscissa->Length();Index++) {
|
||||
if (AbsC<abscissa->Value(Index)) break;
|
||||
}
|
||||
Parameter(Index,AbsC,U,Oriented);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Parameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::Parameter(const Standard_Integer Index,
|
||||
const Standard_Real AbsC,
|
||||
Standard_Real& U,
|
||||
const Standard_Boolean Oriented)
|
||||
{
|
||||
|
||||
if (Index != indexofcurve) {
|
||||
void* p = (void*)this;
|
||||
((ChFiDS_Spine*)p)->indexofcurve = Index;
|
||||
((ChFiDS_Spine*)p)->myCurve.Initialize(TopoDS::Edge(spine.Value(Index)));
|
||||
}
|
||||
Standard_Real L;
|
||||
TopAbs_Orientation Or = spine.Value(Index).Orientation();
|
||||
if (Or == TopAbs_REVERSED) {
|
||||
L = abscissa->Value(indexofcurve)-AbsC;
|
||||
}
|
||||
else if (indexofcurve==1) {
|
||||
L = AbsC;
|
||||
}
|
||||
else {
|
||||
L = AbsC - abscissa->Value(indexofcurve-1);
|
||||
}
|
||||
Standard_Real t = L/Length(Index);
|
||||
Standard_Real uapp = (1. - t) * myCurve.FirstParameter() + t * myCurve.LastParameter();
|
||||
// GCPnts_AbscissaPoint GCP;
|
||||
// GCP.Perform(myCurve,L,myCurve.FirstParameter(),uapp,BRep_Tool::Tolerance(myCurve.Edge()));
|
||||
GCPnts_AbscissaPoint GCP(myCurve,L,myCurve.FirstParameter(),uapp);
|
||||
U = GCP.Parameter();
|
||||
if (Or == TopAbs_REVERSED && Oriented) {
|
||||
U = (myCurve.LastParameter()+myCurve.FirstParameter()) - U;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Prepare
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::Prepare(Standard_Real& L,
|
||||
Standard_Integer& Ind) const
|
||||
{
|
||||
Standard_Real tol = Max(tolesp,Precision::Confusion());
|
||||
Standard_Real last = abscissa->Value(abscissa->Upper());
|
||||
Standard_Integer len = abscissa->Length();
|
||||
if(IsPeriodic() && Abs(L) >= tol && Abs(L-last) >= tol)
|
||||
L = ElCLib::InPeriod(L,0.,last);
|
||||
|
||||
if(hasfirsttgt && (L <= firsttgtpar)){
|
||||
if(hasref && valref >= L && Abs(L-firsttgtpar) <= tol){
|
||||
Ind = Index(L);
|
||||
}
|
||||
else{Ind = -1; L -= firsttgtpar;}
|
||||
}
|
||||
else if(L <= 0.){Ind = 1;}
|
||||
else if(haslasttgt && (L >= lasttgtpar)){
|
||||
if(hasref && valref <= L && Abs(L-lasttgtpar) <= tol){
|
||||
Ind = Index(L);
|
||||
}
|
||||
else{Ind = len + 1; L -= lasttgtpar;}
|
||||
}
|
||||
else if(L >= last){Ind = len;}
|
||||
else{
|
||||
for (Ind=1;Ind < len;Ind++) {
|
||||
if (L<abscissa->Value(Ind)) break;
|
||||
}
|
||||
if(hasref){
|
||||
if (L >= valref && Ind != 1){
|
||||
if(Abs(L-abscissa->Value(Ind-1)) <= Precision::Confusion()) Ind--;
|
||||
}
|
||||
else if (L <= valref && Ind != len){
|
||||
if(Abs(L-abscissa->Value(Ind)) <= Precision::Confusion()) Ind++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(Ind >= 1 && Ind <= len){
|
||||
if (spine.Value(Ind).Orientation() == TopAbs_REVERSED){
|
||||
L = abscissa->Value(Ind) - L;
|
||||
}
|
||||
else if (Ind!=1){
|
||||
L -= abscissa->Value(Ind - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt ChFiDS_Spine::Value(const Standard_Real AbsC)
|
||||
{
|
||||
|
||||
Standard_Integer Index;
|
||||
Standard_Real L = AbsC;
|
||||
|
||||
Prepare(L,Index);
|
||||
|
||||
if (Index == -1) {
|
||||
gp_Pnt Pp = firstori;
|
||||
gp_Vec Vp = firsttgt;
|
||||
Vp.Multiply(L);
|
||||
Pp.Translate(Vp);
|
||||
return Pp;
|
||||
}
|
||||
else if (Index == (abscissa->Length() + 1)) {
|
||||
gp_Pnt Pp = lastori;
|
||||
gp_Vec Vp = lasttgt;
|
||||
Vp.Multiply(L);
|
||||
Pp.Translate(Vp);
|
||||
return Pp;
|
||||
}
|
||||
if (Index != indexofcurve) {
|
||||
void* p = (void*)this;
|
||||
((ChFiDS_Spine*)p)->indexofcurve = Index;
|
||||
((ChFiDS_Spine*)p)->myCurve.Initialize(TopoDS::Edge(spine.Value(Index)));
|
||||
}
|
||||
Standard_Real t = L/Length(Index);
|
||||
Standard_Real uapp = (1. - t) * myCurve.FirstParameter() + t * myCurve.LastParameter();
|
||||
// GCPnts_AbscissaPoint GCP;
|
||||
// GCP.Perform(myCurve,L,myCurve.FirstParameter(),uapp,BRep_Tool::Tolerance(myCurve.Edge()));
|
||||
GCPnts_AbscissaPoint GCP(myCurve,L,myCurve.FirstParameter(),uapp);
|
||||
return myCurve.Value(GCP.Parameter());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::D0(const Standard_Real AbsC, gp_Pnt& P)
|
||||
{
|
||||
P = Value(AbsC);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::D1(const Standard_Real AbsC,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V1)
|
||||
{
|
||||
Standard_Integer Index;
|
||||
Standard_Real L = AbsC;
|
||||
|
||||
Prepare(L,Index);
|
||||
|
||||
if (Index == -1) {
|
||||
P = firstori;
|
||||
V1 = firsttgt;
|
||||
gp_Vec Vp = firsttgt;
|
||||
Vp.Multiply(L);
|
||||
P.Translate(Vp);
|
||||
}
|
||||
else if (Index == (abscissa->Length() + 1)) {
|
||||
P = lastori;
|
||||
V1 = lasttgt;
|
||||
gp_Vec Vp = lasttgt;
|
||||
Vp.Multiply(L);
|
||||
P.Translate(Vp);
|
||||
}
|
||||
else {
|
||||
if (Index != indexofcurve) {
|
||||
void* p = (void*)this;
|
||||
((ChFiDS_Spine*)p)->indexofcurve = Index;
|
||||
((ChFiDS_Spine*)p)->myCurve.Initialize(TopoDS::Edge(spine.Value(Index)));
|
||||
}
|
||||
Standard_Real t = L/Length(Index);
|
||||
Standard_Real uapp = (1. - t) * myCurve.FirstParameter() + t * myCurve.LastParameter();
|
||||
// GCPnts_AbscissaPoint GCP;
|
||||
// GCP.Perform(myCurve,L,myCurve.FirstParameter(),uapp,BRep_Tool::Tolerance(myCurve.Edge()));
|
||||
GCPnts_AbscissaPoint GCP(myCurve,L,myCurve.FirstParameter(),uapp);
|
||||
myCurve.D1(GCP.Parameter(),P,V1);
|
||||
Standard_Real D1 = 1./V1.Magnitude();
|
||||
if (spine.Value(Index).Orientation() == TopAbs_REVERSED) D1 = -D1;
|
||||
V1.Multiply(D1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::D2(const Standard_Real AbsC,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V1,
|
||||
gp_Vec& V2)
|
||||
{
|
||||
|
||||
Standard_Integer Index;
|
||||
Standard_Real L = AbsC;
|
||||
|
||||
Prepare(L,Index);
|
||||
|
||||
if (Index == -1) {
|
||||
P = firstori;
|
||||
V1 = firsttgt;
|
||||
V2.SetCoord(0.,0.,0.);
|
||||
gp_Vec Vp = firsttgt;
|
||||
Vp.Multiply(L);
|
||||
P.Translate(Vp);
|
||||
}
|
||||
else if (Index == (abscissa->Length() + 1)) {
|
||||
P = lastori;
|
||||
V1 = lasttgt;
|
||||
V2.SetCoord(0.,0.,0.);
|
||||
gp_Vec Vp = lasttgt;
|
||||
Vp.Multiply(L);
|
||||
P.Translate(Vp);
|
||||
}
|
||||
else {
|
||||
if (Index != indexofcurve) {
|
||||
void* p = (void*)this;
|
||||
((ChFiDS_Spine*)p)->indexofcurve = Index;
|
||||
((ChFiDS_Spine*)p)->myCurve.Initialize(TopoDS::Edge(spine.Value(Index)));
|
||||
}
|
||||
Standard_Real t = L/Length(Index);
|
||||
Standard_Real uapp = (1. - t) * myCurve.FirstParameter() + t * myCurve.LastParameter();
|
||||
// GCPnts_AbscissaPoint GCP;
|
||||
// GCP.Perform(myCurve,L,myCurve.FirstParameter(),uapp,BRep_Tool::Tolerance(myCurve.Edge()));
|
||||
GCPnts_AbscissaPoint GCP(myCurve,L,myCurve.FirstParameter(),uapp);
|
||||
myCurve.D2(GCP.Parameter(),P,V1,V2);
|
||||
Standard_Real N1 = V1.SquareMagnitude();
|
||||
Standard_Real D2 = -(V1.Dot(V2))*(1./N1)*(1./N1);
|
||||
V2.Multiply(1./N1);
|
||||
N1 = Sqrt(N1);
|
||||
gp_Vec Va = V1.Multiplied(D2);
|
||||
V2.Add(Va);
|
||||
Standard_Real D1 = 1./N1;
|
||||
if (spine.Value(Index).Orientation() == TopAbs_REVERSED) D1 = -D1;
|
||||
V1.Multiply(D1);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCurrent
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Spine::SetCurrent(const Standard_Integer Index)
|
||||
{
|
||||
if (Index != indexofcurve) {
|
||||
indexofcurve = Index;
|
||||
myCurve.Initialize(TopoDS::Edge(spine.Value(indexofcurve)));
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CurrentElementarySpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const BRepAdaptor_Curve& ChFiDS_Spine::CurrentElementarySpine
|
||||
(const Standard_Integer Index)
|
||||
{
|
||||
if (Index != indexofcurve) {
|
||||
indexofcurve = Index;
|
||||
myCurve.Initialize(TopoDS::Edge(spine.Value(indexofcurve)));
|
||||
}
|
||||
return myCurve;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_CurveType ChFiDS_Spine::GetType() const
|
||||
{
|
||||
return myCurve.GetType();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Lin ChFiDS_Spine::Line() const
|
||||
{
|
||||
gp_Lin LL(myCurve.Line());
|
||||
if (spine.Value(indexofcurve).Orientation() == TopAbs_REVERSED) {
|
||||
LL.Reverse();
|
||||
LL.SetLocation(myCurve.Value(myCurve.LastParameter()));
|
||||
}
|
||||
else {
|
||||
LL.SetLocation(myCurve.Value(myCurve.FirstParameter()));
|
||||
}
|
||||
return LL;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Circ ChFiDS_Spine::Circle() const
|
||||
{
|
||||
gp_Ax2 Ac = myCurve.Circle().Position();
|
||||
gp_Dir Dc(gp_Vec(Ac.Location(),myCurve.Value(myCurve.FirstParameter())));
|
||||
gp_Dir ZZ(Ac.Direction());
|
||||
|
||||
if (spine.Value(indexofcurve).Orientation() == TopAbs_REVERSED) {
|
||||
Dc = gp_Dir(gp_Vec(Ac.Location(),myCurve.Value(myCurve.LastParameter())));
|
||||
ZZ.Reverse();
|
||||
}
|
||||
gp_Ax2 A(Ac.Location(),ZZ,Dc);
|
||||
return gp_Circ(A,myCurve.Circle().Radius());
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetErrorStatus
|
||||
//purpose : met a jour le statut d'erreur
|
||||
//=======================================================================
|
||||
void ChFiDS_Spine::SetErrorStatus(const ChFiDS_ErrorStatus state)
|
||||
{
|
||||
errorstate=state;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ErrorStatus
|
||||
//purpose : renvoie le statut d'erreur concernant la spine
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_ErrorStatus ChFiDS_Spine::ErrorStatus()const
|
||||
{
|
||||
return errorstate;
|
||||
}
|
143
src/ChFiDS/ChFiDS_Spine.lxx
Executable file
143
src/ChFiDS/ChFiDS_Spine.lxx
Executable file
@@ -0,0 +1,143 @@
|
||||
// File: ChFiDS_Spine.lxx
|
||||
// Created: Thu Nov 18 12:44:20 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFirstStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::SetFirstStatus(const ChFiDS_State S)
|
||||
{
|
||||
firstState = S;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLastStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::SetLastStatus(const ChFiDS_State S)
|
||||
{
|
||||
lastState = S;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : FirstStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_State ChFiDS_Spine::FirstStatus()const
|
||||
{
|
||||
return firstState;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_State ChFiDS_Spine::LastStatus()const
|
||||
{
|
||||
return lastState;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::SetStatus(const ChFiDS_State S,
|
||||
const Standard_Boolean IsFirst)
|
||||
{
|
||||
if(IsFirst) firstState = S;
|
||||
else lastState = S;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Status
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_State ChFiDS_Spine::Status(const Standard_Boolean IsFirst)const
|
||||
{
|
||||
if (IsFirst) return firstState;
|
||||
else return lastState;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTangencyExtremity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::SetTangencyExtremity(const Standard_Boolean IsTangency,
|
||||
const Standard_Boolean IsFirst)
|
||||
{
|
||||
if(IsFirst) firstistgt = IsTangency ;
|
||||
else lastistgt = IsTangency;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsTangencyExtremity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean
|
||||
ChFiDS_Spine::IsTangencyExtremity(const Standard_Boolean IsFirst)const
|
||||
{
|
||||
if (IsFirst) return firstistgt;
|
||||
else return lastistgt;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Spine::NbEdges() const
|
||||
{
|
||||
return spine.Length();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Edges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const TopoDS_Edge& ChFiDS_Spine::Edges(const Standard_Integer I) const
|
||||
{
|
||||
return TopoDS::Edge(spine.Value(I));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::SetEdges(const TopoDS_Edge& E)
|
||||
{
|
||||
spine.Append(E);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PutInFirst
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Spine::PutInFirst(const TopoDS_Edge& E)
|
||||
{
|
||||
spine.InsertBefore(1,E);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CurrentIndexOfElementarySpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer ChFiDS_Spine::CurrentIndexOfElementarySpine() const
|
||||
{
|
||||
return indexofcurve;
|
||||
}
|
264
src/ChFiDS/ChFiDS_Stripe.cdl
Executable file
264
src/ChFiDS/ChFiDS_Stripe.cdl
Executable file
@@ -0,0 +1,264 @@
|
||||
-- File: ChFiDS_Stripe.cdl
|
||||
-- Created: Wed Mar 9 16:52:35 1994
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@zerox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
class Stripe from ChFiDS inherits TShared
|
||||
|
||||
---Purpose: data structure associe au coin
|
||||
|
||||
uses HData from ChFiDS,
|
||||
Spine from ChFiDS,
|
||||
Orientation from TopAbs,
|
||||
Curve from Geom2d
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Stripe from ChFiDS;
|
||||
|
||||
|
||||
Reset(me : mutable) is static;
|
||||
---Purpose: Reset everything except Spine.
|
||||
|
||||
SetOfSurfData(me) returns any HData from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Spine(me) returns any Spine from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
OrientationOnFace1(me) returns Orientation from TopAbs is static;
|
||||
---C++: inline
|
||||
|
||||
OrientationOnFace2(me) returns Orientation from TopAbs is static;
|
||||
---C++: inline
|
||||
|
||||
Choix(me)
|
||||
returns Integer from Standard is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeSetOfSurfData(me: mutable) returns any HData from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeSpine(me : mutable) returns any Spine from ChFiDS
|
||||
is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
OrientationOnFace1(me : mutable; Or1 : Orientation from TopAbs)
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
OrientationOnFace2(me : mutable; Or2 : Orientation from TopAbs )
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
Choix(me : mutable; C : Integer from Standard)
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
FirstParameters(me; Pdeb,Pfin : out Real from Standard) is static;
|
||||
---C++: inline
|
||||
|
||||
LastParameters(me; Pdeb,Pfin : out Real from Standard) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeFirstParameters(me : mutable ; Pdeb,Pfin : Real from Standard)
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
ChangeLastParameters(me : mutable ; Pdeb,Pfin : Real from Standard)
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
FirstCurve(me) returns Integer from Standard is static;
|
||||
---C++: inline
|
||||
|
||||
LastCurve(me) returns Integer from Standard is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeFirstCurve(me : mutable;Index : Integer) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeLastCurve(me : mutable;Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
FirstPCurve(me) returns any Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
LastPCurve(me) returns any Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
ChangeFirstPCurve(me : mutable) returns any Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeLastPCurve(me : mutable) returns any Curve from Geom2d is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
FirstPCurveOrientation(me) returns Orientation from TopAbs is static;
|
||||
---C++: inline
|
||||
|
||||
LastPCurveOrientation(me) returns Orientation from TopAbs is static;
|
||||
---C++: inline
|
||||
|
||||
FirstPCurveOrientation(me : mutable; O : Orientation from TopAbs)
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
LastPCurveOrientation(me : mutable; O : Orientation from TopAbs)
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
IndexFirstPointOnS1(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
IndexFirstPointOnS2(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
IndexLastPointOnS1(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
IndexLastPointOnS2(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeIndexFirstPointOnS1(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeIndexFirstPointOnS2(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeIndexLastPointOnS1(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeIndexLastPointOnS2(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
---------------------------------------------------------------
|
||||
-- syntaxes utiles pour faire la meme chose que ci dessus --
|
||||
---------------------------------------------------------------
|
||||
|
||||
Parameters(me;
|
||||
First : Boolean from Standard;
|
||||
Pdeb,Pfin : out Real from Standard) is static;
|
||||
|
||||
|
||||
SetParameters(me : mutable;
|
||||
First : Boolean from Standard;
|
||||
Pdeb,Pfin : Real from Standard) is static;
|
||||
|
||||
|
||||
Curve(me; First : Boolean from Standard)
|
||||
returns Integer from Standard is static;
|
||||
|
||||
SetCurve(me : mutable;
|
||||
Index : Integer;
|
||||
First : Boolean from Standard) is static;
|
||||
|
||||
PCurve(me; First : Boolean from Standard)
|
||||
returns any Curve from Geom2d is static;
|
||||
---C++: return const &
|
||||
|
||||
ChangePCurve(me : mutable;
|
||||
First : Boolean from Standard)
|
||||
returns any Curve from Geom2d is static;
|
||||
---C++: return &
|
||||
|
||||
Orientation(me; OnS : Integer from Standard)
|
||||
returns Orientation from TopAbs
|
||||
is static;
|
||||
|
||||
SetOrientation(me : mutable;
|
||||
Or : Orientation from TopAbs;
|
||||
OnS : Integer from Standard)
|
||||
is static;
|
||||
|
||||
Orientation(me; First : Boolean from Standard)
|
||||
returns Orientation from TopAbs
|
||||
is static;
|
||||
|
||||
SetOrientation(me : mutable;
|
||||
Or : Orientation from TopAbs;
|
||||
First : Boolean from Standard)
|
||||
is static;
|
||||
|
||||
IndexPoint(me;
|
||||
First : Boolean from Standard;
|
||||
OnS : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
SetIndexPoint(me : mutable;
|
||||
Index : Integer from Standard;
|
||||
First : Boolean from Standard;
|
||||
OnS : Integer from Standard)
|
||||
is static;
|
||||
|
||||
|
||||
SolidIndex(me)
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
SetSolidIndex(me : mutable;
|
||||
Index : Integer from Standard)
|
||||
is static;
|
||||
|
||||
|
||||
InDS(me : mutable;
|
||||
First : Boolean from Standard;
|
||||
Nb : Integer from Standard = 1) -- eap, Apr 29 2002, occ293
|
||||
is static;
|
||||
---Purpose: Set nb of SurfData's at end put in DS
|
||||
|
||||
IsInDS(me;
|
||||
First : Boolean from Standard)
|
||||
-- returns Boolean from Standard
|
||||
returns Integer from Standard -- eap, Apr 29 2002, occ293
|
||||
is static;
|
||||
---Purpose: Returns nb of SurfData's at end being in DS
|
||||
|
||||
fields
|
||||
|
||||
|
||||
--- donnees caracterisant les extremites.
|
||||
-----------------------------------------
|
||||
pardeb1 : Real from Standard;
|
||||
parfin1 : Real from Standard;
|
||||
pardeb2 : Real from Standard;
|
||||
parfin2 : Real from Standard;
|
||||
|
||||
--- donnees globales a la bande de conges.
|
||||
------------------------------------------
|
||||
mySpine : Spine from ChFiDS;
|
||||
myHdata : HData from ChFiDS;
|
||||
pcrv1 : Curve from Geom2d;
|
||||
pcrv2 : Curve from Geom2d;
|
||||
|
||||
myChoix : Integer from Standard;
|
||||
indexOfSolid : Integer from Standard;
|
||||
indexOfcurve1 : Integer from Standard;
|
||||
indexOfcurve2 : Integer from Standard;
|
||||
--- donnees caracterisant les extremites.
|
||||
indexfirstPOnS1 : Integer from Standard;
|
||||
indexlastPOnS1 : Integer from Standard;
|
||||
indexfirstPOnS2 : Integer from Standard;
|
||||
indexlastPOnS2 : Integer from Standard;
|
||||
|
||||
-- eap, Apr 29 2002, occ293
|
||||
begfilled : Integer from Standard;
|
||||
endfilled : Integer from Standard;
|
||||
--begfilled : Boolean from Standard;
|
||||
--endfilled : Boolean from Standard;
|
||||
|
||||
myOr1 : Orientation from TopAbs;-- donnees globales a la bande de conges.
|
||||
myOr2 : Orientation from TopAbs;-- donnees globales a la bande de conges.
|
||||
orcurv1 : Orientation from TopAbs;
|
||||
orcurv2 : Orientation from TopAbs;
|
||||
end Stripe;
|
231
src/ChFiDS/ChFiDS_Stripe.cxx
Executable file
231
src/ChFiDS/ChFiDS_Stripe.cxx
Executable file
@@ -0,0 +1,231 @@
|
||||
// File: ChFiDS_Stripe.cxx
|
||||
// Created: Wed Mar 9 17:25:21 1994
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
#include <ChFiDS_Stripe.ixx>
|
||||
|
||||
ChFiDS_Stripe::ChFiDS_Stripe ():
|
||||
begfilled(/*Standard_False*/0), // eap, Apr 29 2002, occ293
|
||||
endfilled(/*Standard_False*/0),
|
||||
orcurv1(TopAbs_FORWARD),
|
||||
orcurv2(TopAbs_FORWARD)
|
||||
{}
|
||||
|
||||
void ChFiDS_Stripe::Reset()
|
||||
{
|
||||
myHdata.Nullify();
|
||||
orcurv1 = orcurv2 = TopAbs_FORWARD;
|
||||
pcrv1.Nullify();
|
||||
pcrv1.Nullify();
|
||||
mySpine->Reset();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Stripe::Parameters(const Standard_Boolean First,
|
||||
Standard_Real& Pdeb,
|
||||
Standard_Real& Pfin) const
|
||||
{
|
||||
if(First) {Pdeb = pardeb1; Pfin = parfin1;}
|
||||
else {Pdeb = pardeb2; Pfin = parfin2;}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Stripe::SetParameters(const Standard_Boolean First,
|
||||
const Standard_Real Pdeb,
|
||||
const Standard_Real Pfin)
|
||||
{
|
||||
if(First) {pardeb1 = Pdeb; parfin1 = Pfin;}
|
||||
else {pardeb2 = Pdeb; parfin2 = Pfin;}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Stripe::Curve(const Standard_Boolean First) const
|
||||
{
|
||||
if(First) return indexOfcurve1;
|
||||
else return indexOfcurve2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Stripe::SetCurve(const Standard_Integer Index,
|
||||
const Standard_Boolean First)
|
||||
{
|
||||
if(First) indexOfcurve1 = Index;
|
||||
else indexOfcurve2 = Index;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Handle_Geom2d_Curve&
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(Geom2d_Curve)& ChFiDS_Stripe::PCurve
|
||||
(const Standard_Boolean First) const
|
||||
{
|
||||
if(First) return pcrv1;
|
||||
else return pcrv2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangePCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_Curve)& ChFiDS_Stripe::ChangePCurve
|
||||
(const Standard_Boolean First)
|
||||
{
|
||||
if(First) return pcrv1;
|
||||
else return pcrv2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Orientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation ChFiDS_Stripe::Orientation
|
||||
(const Standard_Integer OnS) const
|
||||
{
|
||||
if(OnS == 1) return myOr1;
|
||||
else return myOr2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Orientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
|
||||
const Standard_Integer OnS)
|
||||
{
|
||||
if(OnS == 1) myOr1 = Or;
|
||||
else myOr2 = Or;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Orientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation ChFiDS_Stripe::Orientation
|
||||
(const Standard_Boolean First) const
|
||||
{
|
||||
if(First) return orcurv1;
|
||||
else return orcurv2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Orientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
|
||||
const Standard_Boolean First)
|
||||
{
|
||||
if(First) orcurv1 = Or;
|
||||
else orcurv2 = Or;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Stripe::IndexPoint
|
||||
(const Standard_Boolean First, const Standard_Integer OnS) const
|
||||
{
|
||||
if(First){
|
||||
if (OnS == 1) return indexfirstPOnS1;
|
||||
else return indexfirstPOnS2;
|
||||
}
|
||||
else{
|
||||
if (OnS == 1) return indexlastPOnS1;
|
||||
else return indexlastPOnS2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetIndexPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Stripe::SetIndexPoint(const Standard_Integer Index,
|
||||
const Standard_Boolean First,
|
||||
const Standard_Integer OnS)
|
||||
{
|
||||
if(First){
|
||||
if (OnS == 1) indexfirstPOnS1 = Index;
|
||||
else indexfirstPOnS2 = Index;
|
||||
}
|
||||
else{
|
||||
if (OnS == 1) indexlastPOnS1 = Index;
|
||||
else indexlastPOnS2 = Index;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer ChFiDS_Stripe::SolidIndex()const
|
||||
{
|
||||
return indexOfSolid;
|
||||
}
|
||||
|
||||
void ChFiDS_Stripe::SetSolidIndex(const Standard_Integer Index)
|
||||
{
|
||||
indexOfSolid = Index;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : InDS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_Stripe::InDS(const Standard_Boolean First,
|
||||
const Standard_Integer Nb) // eap, Apr 29 2002, occ293
|
||||
{
|
||||
if(First){
|
||||
begfilled = /*Standard_True*/ Nb;
|
||||
}
|
||||
else{
|
||||
endfilled = /*Standard_True*/ Nb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsInDS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_Stripe::IsInDS(const Standard_Boolean First)const
|
||||
{
|
||||
if(First) return begfilled;
|
||||
else return endfilled;
|
||||
}
|
367
src/ChFiDS/ChFiDS_Stripe.lxx
Executable file
367
src/ChFiDS/ChFiDS_Stripe.lxx
Executable file
@@ -0,0 +1,367 @@
|
||||
// File: ChFiDS_Stripe.lxx
|
||||
// Created: Wed Mar 9 17:13:42 1994
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetOfSurfData
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(ChFiDS_HData)& ChFiDS_Stripe::SetOfSurfData() const
|
||||
{
|
||||
return myHdata;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Spine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(ChFiDS_Spine)& ChFiDS_Stripe::Spine() const
|
||||
{
|
||||
return mySpine;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OrientationOnFace1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopAbs_Orientation ChFiDS_Stripe::OrientationOnFace1() const
|
||||
{
|
||||
return myOr1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OrientationOnFace2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopAbs_Orientation ChFiDS_Stripe::OrientationOnFace2() const
|
||||
{
|
||||
return myOr2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Choix
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Stripe::Choix() const
|
||||
{
|
||||
return myChoix;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeSetOfSurfData
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(ChFiDS_HData)& ChFiDS_Stripe::ChangeSetOfSurfData()
|
||||
{
|
||||
return myHdata;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeSpine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(ChFiDS_Spine)& ChFiDS_Stripe::ChangeSpine()
|
||||
{
|
||||
return mySpine;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OrientationOnFace1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::OrientationOnFace1(const TopAbs_Orientation Or1)
|
||||
{
|
||||
myOr1 = Or1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OrientationOnFace2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::OrientationOnFace2(const TopAbs_Orientation Or2)
|
||||
{
|
||||
myOr2 = Or2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Choix
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::Choix(const Standard_Integer C)
|
||||
{
|
||||
myChoix = C;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::FirstParameters(Standard_Real& Pdeb,
|
||||
Standard_Real& Pfin) const
|
||||
{
|
||||
Pdeb = pardeb1;
|
||||
Pfin = parfin1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : lastParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::LastParameters(Standard_Real& Pdeb,
|
||||
Standard_Real& Pfin) const
|
||||
{
|
||||
Pdeb = pardeb2;
|
||||
Pfin = parfin2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeFirstParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeFirstParameters(const Standard_Real Pdeb,
|
||||
const Standard_Real Pfin)
|
||||
{
|
||||
pardeb1 = Pdeb;
|
||||
parfin1 = Pfin;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeLastParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeLastParameters(const Standard_Real Pdeb,
|
||||
const Standard_Real Pfin)
|
||||
{
|
||||
pardeb2 = Pdeb;
|
||||
parfin2 = Pfin;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Stripe::FirstCurve()const
|
||||
{
|
||||
return indexOfcurve1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Stripe::LastCurve()const
|
||||
{
|
||||
return indexOfcurve2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeFirstCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeFirstCurve(const Standard_Integer Index)
|
||||
{
|
||||
indexOfcurve1 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeLastCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeLastCurve(const Standard_Integer Index)
|
||||
{
|
||||
indexOfcurve2 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstPCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Geom2d_Curve)& ChFiDS_Stripe::FirstPCurve()const
|
||||
{
|
||||
return pcrv1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastPCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Geom2d_Curve)& ChFiDS_Stripe::LastPCurve()const
|
||||
{
|
||||
return pcrv2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeFirstPCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom2d_Curve)& ChFiDS_Stripe::ChangeFirstPCurve()
|
||||
{
|
||||
return pcrv1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeLastPCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom2d_Curve)& ChFiDS_Stripe::ChangeLastPCurve()
|
||||
{
|
||||
return pcrv2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexFirstPointOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Stripe::IndexFirstPointOnS1() const
|
||||
{
|
||||
return indexfirstPOnS1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexLastPointOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Stripe::IndexLastPointOnS1() const
|
||||
{
|
||||
return indexlastPOnS1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexFirstPointOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Stripe::IndexFirstPointOnS2() const
|
||||
{
|
||||
return indexfirstPOnS2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexLastPointOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_Stripe::IndexLastPointOnS2() const
|
||||
{
|
||||
return indexlastPOnS2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeIndexFirstPointOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeIndexFirstPointOnS1
|
||||
(const Standard_Integer Index)
|
||||
{
|
||||
indexfirstPOnS1 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeIndexLastPointOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeIndexLastPointOnS1
|
||||
(const Standard_Integer Index)
|
||||
{
|
||||
indexlastPOnS1 = Index;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeIndexFirstPointOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeIndexFirstPointOnS2
|
||||
(const Standard_Integer Index)
|
||||
{
|
||||
indexfirstPOnS2 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeIndexLastPointOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::ChangeIndexLastPointOnS2
|
||||
(const Standard_Integer Index)
|
||||
{
|
||||
indexlastPOnS2 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstPCurveOrientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopAbs_Orientation ChFiDS_Stripe::FirstPCurveOrientation()const
|
||||
{
|
||||
return orcurv1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastPCurveOrientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopAbs_Orientation ChFiDS_Stripe::LastPCurveOrientation()const
|
||||
{
|
||||
return orcurv2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstPCurveOrientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::FirstPCurveOrientation
|
||||
(const TopAbs_Orientation O)
|
||||
{
|
||||
orcurv1 = O;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastPCurveOrientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_Stripe::LastPCurveOrientation
|
||||
(const TopAbs_Orientation O)
|
||||
{
|
||||
orcurv2 = O;
|
||||
}
|
||||
|
||||
|
56
src/ChFiDS/ChFiDS_StripeMap.cdl
Executable file
56
src/ChFiDS/ChFiDS_StripeMap.cdl
Executable file
@@ -0,0 +1,56 @@
|
||||
-- File: ChFiDS_StripeMap.cdl
|
||||
-- Created: Wed Nov 10 16:59:25 1993
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class StripeMap from ChFiDS
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
IndexedDataMapOfVertexListOfStripe from ChFiDS,
|
||||
Vertex from TopoDS,
|
||||
ListOfStripe from ChFiDS,
|
||||
Stripe from ChFiDS
|
||||
is
|
||||
|
||||
Create returns StripeMap from ChFiDS;
|
||||
|
||||
Add(me : in out; V : Vertex from TopoDS; F : Stripe from ChFiDS)
|
||||
is static;
|
||||
|
||||
|
||||
Extent(me) returns Integer
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
FindFromKey(me; V: Vertex from TopoDS)
|
||||
returns ListOfStripe from ChFiDS
|
||||
---C++: alias operator()
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
FindFromIndex(me; I : Integer from Standard)
|
||||
returns ListOfStripe from ChFiDS
|
||||
---C++: alias operator()
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
|
||||
FindKey(me; I : Integer from Standard) returns Vertex from TopoDS
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
|
||||
Clear(me : in out) is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
mymap : IndexedDataMapOfVertexListOfStripe from ChFiDS;
|
||||
|
||||
end StripeMap;
|
65
src/ChFiDS/ChFiDS_StripeMap.cxx
Executable file
65
src/ChFiDS/ChFiDS_StripeMap.cxx
Executable file
@@ -0,0 +1,65 @@
|
||||
// File: ChFiDS_StripeMap.cxx
|
||||
// Created: Thu Nov 18 11:51:01 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
#include <ChFiDS_StripeMap.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ChFiDS_StripeMap
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_StripeMap::ChFiDS_StripeMap()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_StripeMap::Add(const TopoDS_Vertex& V,
|
||||
const Handle(ChFiDS_Stripe)& F)
|
||||
{
|
||||
Standard_Integer Index = mymap.FindIndex(V);
|
||||
if (Index==0) {
|
||||
ChFiDS_ListOfStripe Empty;
|
||||
Index = mymap.Add(V,Empty);
|
||||
}
|
||||
mymap(Index).Append(F);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FindFromKey
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const ChFiDS_ListOfStripe& ChFiDS_StripeMap::FindFromKey(
|
||||
const TopoDS_Vertex& V)const
|
||||
{
|
||||
return mymap.FindFromKey(V);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FindFromIndex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const ChFiDS_ListOfStripe& ChFiDS_StripeMap::
|
||||
FindFromIndex(const Standard_Integer I)const
|
||||
{
|
||||
return mymap.FindFromIndex(I);
|
||||
}
|
||||
|
||||
void ChFiDS_StripeMap::Clear()
|
||||
{
|
||||
mymap.Clear();
|
||||
}
|
26
src/ChFiDS/ChFiDS_StripeMap.lxx
Executable file
26
src/ChFiDS/ChFiDS_StripeMap.lxx
Executable file
@@ -0,0 +1,26 @@
|
||||
// File: ChFiDS_StripeMap.lxx
|
||||
// Created: Tue Jan 18 14:00:47 1994
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@nonox>
|
||||
|
||||
//=======================================================================
|
||||
//function : Extent
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
inline Standard_Integer ChFiDS_StripeMap::Extent() const {
|
||||
return mymap.Extent();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FindKey
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
inline const TopoDS_Vertex& ChFiDS_StripeMap::FindKey
|
||||
(const Standard_Integer I) const {
|
||||
return mymap.FindKey(I);
|
||||
}
|
||||
|
223
src/ChFiDS/ChFiDS_SurfData.cdl
Executable file
223
src/ChFiDS/ChFiDS_SurfData.cdl
Executable file
@@ -0,0 +1,223 @@
|
||||
-- File: ChFiDS_SurfData.cdl
|
||||
-- Created: Fri Nov 26 16:43:33 1993
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class SurfData from ChFiDS inherits TShared from MMgt
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Pnt2d from gp,
|
||||
Surface from Geom,
|
||||
Orientation from TopAbs,
|
||||
FaceInterference from ChFiDS,
|
||||
CommonPoint from ChFiDS
|
||||
|
||||
is
|
||||
Create returns mutable SurfData;
|
||||
|
||||
Copy(me: mutable; Other : SurfData from ChFiDS);
|
||||
|
||||
IndexOfS1(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
IndexOfS2(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
IsOnCurve1(me) returns Boolean is static;
|
||||
---C++: inline
|
||||
|
||||
IsOnCurve2(me) returns Boolean is static;
|
||||
---C++: inline
|
||||
|
||||
IndexOfC1(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
IndexOfC2(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
Surf(me) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
Orientation(me) returns Orientation from TopAbs is static;
|
||||
---C++: inline
|
||||
|
||||
InterferenceOnS1(me) returns FaceInterference from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
InterferenceOnS2(me) returns FaceInterference from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
VertexFirstOnS1(me) returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
VertexFirstOnS2(me) returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
VertexLastOnS1(me) returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
VertexLastOnS2(me) returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
ChangeIndexOfS1(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeIndexOfS2(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeSurf(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
SetIndexOfC1(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
SetIndexOfC2(me : mutable; Index : Integer ) is static;
|
||||
---C++: inline
|
||||
|
||||
ChangeOrientation(me : mutable) returns Orientation from TopAbs is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeInterferenceOnS1(me : mutable)
|
||||
returns FaceInterference from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeInterferenceOnS2(me : mutable)
|
||||
returns FaceInterference from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeVertexFirstOnS1(me : mutable)
|
||||
returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeVertexFirstOnS2(me : mutable)
|
||||
returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeVertexLastOnS1(me : mutable)
|
||||
returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
ChangeVertexLastOnS2(me : mutable)
|
||||
returns CommonPoint from ChFiDS is static;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
Interference(me; OnS : Integer from Standard)
|
||||
returns FaceInterference from ChFiDS is static;
|
||||
---C++: return const &
|
||||
|
||||
ChangeInterference(me : mutable; OnS : Integer from Standard)
|
||||
returns FaceInterference from ChFiDS is static;
|
||||
---C++: return &
|
||||
|
||||
Index(me; OfS : Integer from Standard)
|
||||
returns Integer from Standard is static;
|
||||
|
||||
|
||||
Vertex(me;
|
||||
First : Boolean from Standard;
|
||||
OnS : Integer from Standard)
|
||||
returns CommonPoint from ChFiDS is static;
|
||||
---C++: return const &
|
||||
---Purpose: returns one of the four vertices wether First is true
|
||||
-- or wrong and OnS equals 1 or 2.
|
||||
|
||||
ChangeVertex(me : mutable;
|
||||
First : Boolean from Standard;
|
||||
OnS : Integer from Standard)
|
||||
returns CommonPoint from ChFiDS is static;
|
||||
---C++: return &
|
||||
---Purpose: returns one of the four vertices wether First is true
|
||||
-- or wrong and OnS equals 1 or 2.
|
||||
|
||||
IsOnCurve(me; OnS : Integer from Standard) returns Boolean is static;
|
||||
---C++: inline
|
||||
|
||||
IndexOfC(me; OnS : Integer from Standard) returns Integer is static;
|
||||
---C++: inline
|
||||
|
||||
FirstSpineParam(me) returns Real from Standard is static;
|
||||
LastSpineParam(me) returns Real from Standard is static;
|
||||
FirstSpineParam(me : mutable; Par :Real from Standard) is static;
|
||||
LastSpineParam(me : mutable; Par :Real from Standard) is static;
|
||||
|
||||
FirstExtensionValue(me) returns Real from Standard is static;
|
||||
LastExtensionValue(me) returns Real from Standard is static;
|
||||
FirstExtensionValue(me:mutable;Extend:Real from Standard) is static;
|
||||
LastExtensionValue(me:mutable;Extend:Real from Standard) is static;
|
||||
|
||||
Simul(me) returns mutable TShared from MMgt;
|
||||
SetSimul(me : mutable; S : TShared from MMgt);
|
||||
ResetSimul(me : mutable);
|
||||
|
||||
Get2dPoints(me; First : Boolean from Standard; OnS : Integer from Standard)
|
||||
returns Pnt2d from gp;
|
||||
Get2dPoints(me; P2df1,P2dl1,P2df2,P2dl2 : out Pnt2d from gp);
|
||||
Set2dPoints(me : mutable; P2df1,P2dl1,P2df2,P2dl2 : Pnt2d from gp);
|
||||
|
||||
TwistOnS1(me) returns Boolean is static;
|
||||
---C++: inline
|
||||
|
||||
TwistOnS2(me) returns Boolean is static;
|
||||
---C++: inline
|
||||
|
||||
TwistOnS1(me : mutable; T : Boolean from Standard);
|
||||
---C++: inline
|
||||
|
||||
TwistOnS2(me : mutable; T : Boolean from Standard);
|
||||
---C++: inline
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
pfirstOnS1 : CommonPoint from ChFiDS;
|
||||
plastOnS1 : CommonPoint from ChFiDS;
|
||||
pfirstOnS2 : CommonPoint from ChFiDS;
|
||||
plastOnS2 : CommonPoint from ChFiDS;
|
||||
|
||||
intf1 : FaceInterference from ChFiDS;
|
||||
intf2 : FaceInterference from ChFiDS;
|
||||
|
||||
p2df1 : Pnt2d from gp; -- 2d points to be used as start point for simulation.
|
||||
p2dl1 : Pnt2d from gp;
|
||||
p2df2 : Pnt2d from gp;
|
||||
p2dl2 : Pnt2d from gp;
|
||||
|
||||
ufspine : Real from Standard; -- may be uninitialized
|
||||
ulspine : Real from Standard; -- may be uninitialized
|
||||
myfirstextend : Real from Standard;
|
||||
mylastextend : Real from Standard;
|
||||
|
||||
simul : TShared from MMgt; -- free space to store simulating sections.
|
||||
|
||||
indexOfS1 : Integer from Standard;
|
||||
indexOfC1 : Integer from Standard;
|
||||
indexOfS2 : Integer from Standard;
|
||||
indexOfC2 : Integer from Standard;
|
||||
indexOfConge : Integer from Standard;
|
||||
|
||||
isoncurv1 : Boolean from Standard;
|
||||
isoncurv2 : Boolean from Standard;
|
||||
twistons1 : Boolean from Standard;
|
||||
twistons2 : Boolean from Standard;
|
||||
orientation : Orientation from TopAbs;
|
||||
|
||||
end SurfData;
|
||||
|
274
src/ChFiDS/ChFiDS_SurfData.cxx
Executable file
274
src/ChFiDS/ChFiDS_SurfData.cxx
Executable file
@@ -0,0 +1,274 @@
|
||||
// File: ChFiDS_SurfData.cxx
|
||||
// Created: Mon Nov 29 11:12:59 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
#include <ChFiDS_SurfData.ixx>
|
||||
|
||||
ChFiDS_SurfData::ChFiDS_SurfData () :
|
||||
indexOfS1(0),indexOfS2(0),indexOfConge(0),
|
||||
isoncurv1(0),isoncurv2(0),twistons1(0),twistons2(0)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::Copy(const Handle(ChFiDS_SurfData)& Other)
|
||||
{
|
||||
indexOfS1 = Other->indexOfS1;
|
||||
indexOfS2 = Other->indexOfS2;
|
||||
indexOfConge = Other->indexOfConge;
|
||||
orientation = Other->orientation;
|
||||
intf1 = Other->intf1;
|
||||
intf2 = Other->intf2;
|
||||
|
||||
pfirstOnS1 = Other->pfirstOnS1;
|
||||
plastOnS1 = Other->plastOnS1;
|
||||
pfirstOnS2 = Other->pfirstOnS2;
|
||||
plastOnS2 = Other->plastOnS2;
|
||||
|
||||
ufspine = Other->ufspine;
|
||||
ulspine = Other->ulspine;
|
||||
|
||||
simul = Other->simul;
|
||||
p2df1 = Other->p2df1;
|
||||
p2dl1 = Other->p2dl1;
|
||||
p2df2 = Other->p2df2;
|
||||
p2dl2 = Other->p2dl2;
|
||||
|
||||
myfirstextend = Other->myfirstextend;
|
||||
mylastextend = Other->mylastextend;
|
||||
|
||||
twistons1 = Other->twistons1;
|
||||
twistons2 = Other->twistons2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Index
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFiDS_SurfData::Index(const Standard_Integer OfS) const
|
||||
{
|
||||
if(OfS == 1) return indexOfS1;
|
||||
else return indexOfS2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Interference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const ChFiDS_FaceInterference& ChFiDS_SurfData::Interference
|
||||
(const Standard_Integer OnS) const
|
||||
{
|
||||
if(OnS == 1) return intf1;
|
||||
else return intf2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Interference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_FaceInterference& ChFiDS_SurfData::ChangeInterference
|
||||
(const Standard_Integer OnS)
|
||||
{
|
||||
if(OnS == 1) return intf1;
|
||||
else return intf2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Vertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const ChFiDS_CommonPoint& ChFiDS_SurfData::Vertex
|
||||
(const Standard_Boolean First,const Standard_Integer OnS) const
|
||||
{
|
||||
if(First && OnS == 1) return pfirstOnS1;
|
||||
else if(First && OnS == 2) return pfirstOnS2;
|
||||
else if(!First && OnS == 1) return plastOnS1;
|
||||
else return plastOnS2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ChFiDS_CommonPoint& ChFiDS_SurfData::ChangeVertex
|
||||
(const Standard_Boolean First,const Standard_Integer OnS)
|
||||
{
|
||||
if(First && OnS == 1) return pfirstOnS1;
|
||||
else if(First && OnS == 2) return pfirstOnS2;
|
||||
else if(!First && OnS == 1) return plastOnS1;
|
||||
else return plastOnS2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstSpineParam
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_SurfData::FirstSpineParam()const
|
||||
{
|
||||
return ufspine;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastSpineParam
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_SurfData::LastSpineParam()const
|
||||
{
|
||||
return ulspine;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstSpineParam
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::FirstSpineParam(const Standard_Real Par)
|
||||
{
|
||||
ufspine = Par;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastSpineParam
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::LastSpineParam(const Standard_Real Par)
|
||||
{
|
||||
ulspine = Par;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstExtensionValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_SurfData::FirstExtensionValue()const
|
||||
{
|
||||
return myfirstextend;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastExtensionValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ChFiDS_SurfData::LastExtensionValue()const
|
||||
{
|
||||
return mylastextend;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstExtensionValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::FirstExtensionValue(const Standard_Real Extend)
|
||||
{
|
||||
myfirstextend=Extend;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastExtensionValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::LastExtensionValue(const Standard_Real Extend)
|
||||
{
|
||||
mylastextend=Extend;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Simul
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(MMgt_TShared) ChFiDS_SurfData::Simul() const
|
||||
{
|
||||
return simul;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSimul
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::SetSimul(const Handle(MMgt_TShared)& S)
|
||||
{
|
||||
simul = S;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ResetSimul
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::ResetSimul()
|
||||
{
|
||||
simul.Nullify();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Get2dPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::Get2dPoints(gp_Pnt2d& P2df1,
|
||||
gp_Pnt2d& P2dl1,
|
||||
gp_Pnt2d& P2df2,
|
||||
gp_Pnt2d& P2dl2) const
|
||||
{
|
||||
P2df1 = p2df1;
|
||||
P2dl1 = p2dl1;
|
||||
P2df2 = p2df2;
|
||||
P2dl2 = p2dl2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Get2dPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt2d ChFiDS_SurfData::Get2dPoints(const Standard_Boolean First,
|
||||
const Standard_Integer OnS) const
|
||||
|
||||
{
|
||||
if(First && OnS == 1) return p2df1;
|
||||
else if(!First && OnS == 1) return p2dl1;
|
||||
else if(First && OnS == 2) return p2df2;
|
||||
return p2dl2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Set2dPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFiDS_SurfData::Set2dPoints(const gp_Pnt2d& P2df1,
|
||||
const gp_Pnt2d& P2dl1,
|
||||
const gp_Pnt2d& P2df2,
|
||||
const gp_Pnt2d& P2dl2)
|
||||
{
|
||||
p2df1 = P2df1;
|
||||
p2dl1 = P2dl1;
|
||||
p2df2 = P2df2;
|
||||
p2dl2 = P2dl2;
|
||||
}
|
||||
|
322
src/ChFiDS/ChFiDS_SurfData.lxx
Executable file
322
src/ChFiDS/ChFiDS_SurfData.lxx
Executable file
@@ -0,0 +1,322 @@
|
||||
// File: ChFiDS_SurfData.lxx
|
||||
// Created: Fri Nov 26 17:25:21 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOfS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_SurfData::IndexOfS1() const
|
||||
{
|
||||
return indexOfS1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsOnCurve1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean ChFiDS_SurfData::IsOnCurve1() const
|
||||
{
|
||||
return isoncurv1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOfC1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_SurfData::IndexOfC1() const
|
||||
{
|
||||
if(!isoncurv1) Standard_Failure::Raise("Interference pas sur courbe");
|
||||
return indexOfC1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetIndexOfC1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_SurfData::SetIndexOfC1(const Standard_Integer Index)
|
||||
{
|
||||
indexOfC1 = isoncurv1 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOfS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_SurfData::IndexOfS2() const
|
||||
{
|
||||
return indexOfS2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsOnCurve2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean ChFiDS_SurfData::IsOnCurve2() const
|
||||
{
|
||||
return isoncurv2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOfC2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_SurfData::IndexOfC2() const
|
||||
{
|
||||
if(!isoncurv2) Standard_Failure::Raise("Interference pas sur courbe");
|
||||
return indexOfC2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetIndexOfC2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_SurfData::SetIndexOfC2(const Standard_Integer Index)
|
||||
{
|
||||
indexOfC2 = isoncurv2 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Surf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_SurfData::Surf()const
|
||||
{
|
||||
return indexOfConge;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Orientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopAbs_Orientation ChFiDS_SurfData::Orientation()const
|
||||
{
|
||||
return orientation;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InterferenceOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const ChFiDS_FaceInterference& ChFiDS_SurfData::InterferenceOnS1()const
|
||||
{
|
||||
return intf1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : InterferenceOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const ChFiDS_FaceInterference& ChFiDS_SurfData::InterferenceOnS2()const
|
||||
{
|
||||
return intf2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VertexFirstOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const ChFiDS_CommonPoint& ChFiDS_SurfData::VertexFirstOnS1() const
|
||||
{
|
||||
return pfirstOnS1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VertexLastOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const ChFiDS_CommonPoint& ChFiDS_SurfData::VertexLastOnS1() const
|
||||
{
|
||||
return plastOnS1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VertexFirstOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const ChFiDS_CommonPoint& ChFiDS_SurfData::VertexFirstOnS2() const
|
||||
{
|
||||
return pfirstOnS2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VertexLastOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const ChFiDS_CommonPoint& ChFiDS_SurfData::VertexLastOnS2() const
|
||||
{
|
||||
return plastOnS2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeIndexOfS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_SurfData::ChangeIndexOfS1(const Standard_Integer Index)
|
||||
{
|
||||
indexOfS1 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeIndexOfS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_SurfData::ChangeIndexOfS2(const Standard_Integer Index)
|
||||
{
|
||||
indexOfS2 = Index;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void ChFiDS_SurfData::ChangeSurf(const Standard_Integer Index)
|
||||
{
|
||||
indexOfConge = Index;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeOrientation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopAbs_Orientation& ChFiDS_SurfData::ChangeOrientation()
|
||||
{
|
||||
return orientation;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeInterferenceOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_FaceInterference& ChFiDS_SurfData::ChangeInterferenceOnS1()
|
||||
{
|
||||
return intf1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeInterferenceOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_FaceInterference& ChFiDS_SurfData::ChangeInterferenceOnS2()
|
||||
{
|
||||
return intf2;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeVertexFirstOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_CommonPoint& ChFiDS_SurfData::ChangeVertexFirstOnS1()
|
||||
{
|
||||
return pfirstOnS1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeVertexLastOnS1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_CommonPoint& ChFiDS_SurfData::ChangeVertexLastOnS1()
|
||||
{
|
||||
return plastOnS1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeVertexFirstOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_CommonPoint& ChFiDS_SurfData::ChangeVertexFirstOnS2()
|
||||
{
|
||||
return pfirstOnS2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChangeVertexLastOnS2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline ChFiDS_CommonPoint& ChFiDS_SurfData::ChangeVertexLastOnS2()
|
||||
{
|
||||
return plastOnS2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsOnCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean ChFiDS_SurfData::IsOnCurve(const Standard_Integer OnS) const
|
||||
{
|
||||
if(OnS == 1) return isoncurv1;
|
||||
return isoncurv2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOfC
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer ChFiDS_SurfData::IndexOfC(const Standard_Integer OnS) const
|
||||
{
|
||||
if(OnS == 1) {
|
||||
if(!isoncurv1) Standard_Failure::Raise("Interference pas sur courbe");
|
||||
return indexOfC1;
|
||||
}
|
||||
if(!isoncurv2) Standard_Failure::Raise("Interference pas sur courbe");
|
||||
return indexOfC2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Twist
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean ChFiDS_SurfData::TwistOnS1() const
|
||||
{
|
||||
return twistons1;
|
||||
}
|
||||
inline Standard_Boolean ChFiDS_SurfData::TwistOnS2() const
|
||||
{
|
||||
return twistons2;
|
||||
}
|
||||
inline void ChFiDS_SurfData::TwistOnS1(const Standard_Boolean T)
|
||||
{
|
||||
twistons1 = T;
|
||||
}
|
||||
inline void ChFiDS_SurfData::TwistOnS2(const Standard_Boolean T)
|
||||
{
|
||||
twistons2 = T;
|
||||
}
|
||||
|
Reference in New Issue
Block a user