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

Integration of OCCT 6.5.0 from SVN

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

79
src/IntSurf/IntSurf.cdl Executable file
View File

@@ -0,0 +1,79 @@
-- File: IntSurf.cdl
-- Created: Mon Aug 24 18:47:01 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun2>
---Copyright: Matra Datavision 1992
package IntSurf
---Purpose: This package provides resources for
-- all the packages concerning the intersection
-- between surfaces.
---Level: Internal
--
-- All the methods of all the classes of this package are Internal.
--
uses Standard, MMgt, StdFail, GeomAbs, TCollection, gp, TColgp
is
class PntOn2S;
class SequenceOfPntOn2S instantiates Sequence from TCollection
(PntOn2S from IntSurf);
class Couple;
class SequenceOfCouple instantiates Sequence from TCollection
(Couple from IntSurf);
class LineOn2S;
class Quadric;
class QuadricTool;
class PathPoint;
class SequenceOfPathPoint instantiates Sequence from TCollection
(PathPoint from IntSurf);
class PathPointTool;
class InteriorPoint;
class SequenceOfInteriorPoint instantiates Sequence from TCollection
(InteriorPoint from IntSurf);
class InteriorPointTool;
class Transition;
--amv
class ListOfPntOn2S instantiates List from TCollection
(PntOn2S from IntSurf);
enumeration TypeTrans is In, Out, Touch, Undecided;
enumeration Situation is Inside, Outside, Unknown;
MakeTransition(TgFirst,TgSecond: Vec from gp; Normal: Dir from gp;
TFirst,TSecond: out Transition from IntSurf);
---Purpose: Computes the transition of the intersection point
-- between the two lines.
-- TgFirst is the tangent vector of the first line.
-- TgSecond is the tangent vector of the second line.
-- Normal is the direction used to orientate the cross
-- product TgFirst^TgSecond.
-- TFirst is the transition of the point on the first line.
-- TSecond is the transition of the point on the second line.
end IntSurf;

94
src/IntSurf/IntSurf.cxx Executable file
View File

@@ -0,0 +1,94 @@
#include <IntSurf.ixx>
#include <Precision.hxx>
#include <gp.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <IntSurf_Transition.hxx>
//--------------------------------------------------------------
//-- IntSurf::MakeTransition(Vtgint,Vtgrst,Normale,Transline,Transarc);
//--
//-- tgFirst = Tangente Ligne Intersection
//-- tgSecond = Tangenet Restriction
//-- Normale = Normale a la surface
void IntSurf::MakeTransition (const gp_Vec& TgFirst,
const gp_Vec& TgSecond,
const gp_Dir& Normale,
IntSurf_Transition& TFirst,
IntSurf_Transition& TSecond)
{
// Effectuer le produit mixte normale, tangente 1, tangente 2
// pour avoir le type de la transition.
gp_Vec pvect(TgSecond.Crossed(TgFirst));
Standard_Real NTgSecond = TgSecond.Magnitude();
Standard_Real NTgFirst = TgFirst.Magnitude();
Standard_Real NTgSecondNTgFirstAngular = NTgSecond*NTgFirst*Precision::Angular();
if(NTgFirst <= Precision::Confusion()) {
TFirst.SetValue(Standard_True,IntSurf_Undecided);
TSecond.SetValue(Standard_True,IntSurf_Undecided);
}
else if ( (NTgSecond <= Precision::Confusion())
|| (pvect.Magnitude()<= NTgSecondNTgFirstAngular)) {
TFirst.SetValue(Standard_True,IntSurf_Unknown,TgFirst.Dot(TgSecond)<0.0);
TSecond.SetValue(Standard_True,IntSurf_Unknown,TgFirst.Dot(TgSecond)<0.0);
}
else {
Standard_Real yu = pvect.Dot(Normale);
yu/=NTgSecond*NTgFirst;
if (yu>0.0001) {
TFirst.SetValue(Standard_False,IntSurf_In);
TSecond.SetValue(Standard_False,IntSurf_Out);
}
else if(yu<-0.0001) {
TFirst.SetValue(Standard_False,IntSurf_Out);
TSecond.SetValue(Standard_False,IntSurf_In);
}
else {
#if 0
//-- MODIF XAB
gp_Vec V1(TgSecond.X() / NTgSecond,TgSecond.Y() / NTgSecond, TgSecond.Z() / NTgSecond);
gp_Vec V2(TgFirst.X() / NTgFirst,TgFirst.Y() / NTgFirst, TgFirst.Z() / NTgFirst);
pvect = V1.Crossed(V2);
yu = pvect.Dot(Normale);
if (yu>0.0000001) {
TFirst.SetValue(Standard_False,IntSurf_In);
TSecond.SetValue(Standard_False,IntSurf_Out);
}
else if(yu<-0.0000001) {
TFirst.SetValue(Standard_False,IntSurf_Out);
TSecond.SetValue(Standard_False,IntSurf_In);
}
else {
TFirst.SetValue(Standard_True,IntSurf_Undecided);
TSecond.SetValue(Standard_True,IntSurf_Undecided);
}
#else
TFirst.SetValue(Standard_True,IntSurf_Undecided);
TSecond.SetValue(Standard_True,IntSurf_Undecided);
#endif
}
}
}

41
src/IntSurf/IntSurf_Couple.cdl Executable file
View File

@@ -0,0 +1,41 @@
-- File: Couple.cdl
-- Created: Wed Mar 25 15:16:53 1992
-- Author: Isabelle GRIGNON
-- <isg@sdsun4>
---Copyright: Matra Datavision 1992
class Couple from IntSurf
---Purpose: creation d 'un couple de 2 entiers
is
Create
returns Couple from IntSurf;
---C++: inline
Create(Index1, Index2 : Integer from Standard)
---C++: inline
returns Couple from IntSurf;
First(me) returns Integer from Standard
---Purpose: returns the first element
---C++: inline
is static;
Second (me) returns Integer from Standard
---Purpose: returns the Second element
---C++: inline
is static;
fields
firstInteger : Integer from Standard;
secondInteger : Integer from Standard;
end Couple;

1
src/IntSurf/IntSurf_Couple.cxx Executable file
View File

@@ -0,0 +1 @@
#include <IntSurf_Couple.ixx>

22
src/IntSurf/IntSurf_Couple.lxx Executable file
View File

@@ -0,0 +1,22 @@
inline IntSurf_Couple::IntSurf_Couple() :
firstInteger(0),secondInteger(0)
{}
inline IntSurf_Couple::IntSurf_Couple(const Standard_Integer Index1,
const Standard_Integer Index2):
firstInteger(Index1),secondInteger(Index2)
{}
inline Standard_Integer IntSurf_Couple::First() const
{
return firstInteger;
}
inline Standard_Integer IntSurf_Couple::Second() const {
return secondInteger;
}

View File

@@ -0,0 +1,115 @@
-- File: InteriorPoint.cdl
-- Created: Fri May 15 14:50:17 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun1>
---Copyright: Matra Datavision 1992
class InteriorPoint from IntSurf
---Purpose: Definition of a point solution of the
-- intersection between an implicit an a
-- parametrised surface. These points are
-- passing points on the intersection lines,
-- or starting points for the closed lines
-- on the parametrised surface.
uses Pnt from gp,
Vec from gp,
Vec2d from gp
is
Create
returns InteriorPoint from IntSurf;
Create(P: Pnt from gp; U,V: Real from Standard;
Direc: Vec from gp; Direc2d: Vec2d from gp)
returns InteriorPoint from IntSurf;
SetValue(me: in out; P: Pnt from gp; U,V: Real from Standard;
Direc: Vec from gp; Direc2d: Vec2d from gp)
is static;
Value(me)
---Purpose: Returns the 3d coordinates of the interior point.
returns Pnt from gp
---C++: return const&
---C++: inline
is static;
Parameters(me; U,V: out Real from Standard)
---Purpose: Returns the parameters of the interior point on the
-- parametric surface.
---C++: inline
is static;
UParameter(me)
---Purpose: Returns the first parameter of the interior point on the
-- parametric surface.
returns Real from Standard
---C++: inline
is static;
VParameter(me)
---Purpose: Returns the second parameter of the interior point on the
-- parametric surface.
returns Real from Standard
---C++: inline
is static;
Direction(me)
---Purpose: Returns the tangent at the intersection in 3d space
-- associated to the interior point.
returns Vec from gp
---C++: return const&
---C++: inline
is static;
Direction2d(me)
---Purpose: Returns the tangent at the intersection in the parametric
-- space of the parametric surface.
returns Vec2d from gp
---C++: return const&
---C++: inline
is static;
fields
point : Pnt from gp;
paramu : Real from Standard;
paramv : Real from Standard;
direc : Vec from gp;
direc2d : Vec2d from gp;
end InteriorPoint;

View File

@@ -0,0 +1,30 @@
#include <IntSurf_InteriorPoint.ixx>
IntSurf_InteriorPoint::IntSurf_InteriorPoint () {}
IntSurf_InteriorPoint::IntSurf_InteriorPoint (const gp_Pnt& P,
const Standard_Real U,
const Standard_Real V,
const gp_Vec& Direc,
const gp_Vec2d& Direc2d):
point(P),paramu(U),paramv(V),direc(Direc),direc2d(Direc2d)
{}
void IntSurf_InteriorPoint::SetValue (const gp_Pnt& P,
const Standard_Real U,
const Standard_Real V,
const gp_Vec& Direc,
const gp_Vec2d& Direc2d) {
point = P;
paramu = U;
paramv = V;
direc = Direc;
direc2d = Direc2d;
}

View File

@@ -0,0 +1,36 @@
inline const gp_Pnt& IntSurf_InteriorPoint::Value () const {
return point;
}
inline void IntSurf_InteriorPoint::Parameters (Standard_Real& U,
Standard_Real& V) const {
U = paramu;
V = paramv;
}
inline Standard_Real IntSurf_InteriorPoint::UParameter () const {
return paramu;
}
inline Standard_Real IntSurf_InteriorPoint::VParameter () const {
return paramv;
}
inline const gp_Vec& IntSurf_InteriorPoint::Direction () const {
return direc;
}
inline const gp_Vec2d& IntSurf_InteriorPoint::Direction2d () const {
return direc2d;
}

View File

@@ -0,0 +1,63 @@
-- File: InteriorPointTool.cdl
-- Created: Thu Oct 1 12:05:40 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun2>
---Copyright: Matra Datavision 1992
class InteriorPointTool from IntSurf
---Purpose: This class provides a tool on the "interior point"
-- that can be used to instantiates the Walking
-- algorithmes (see package IntWalk).
uses Pnt from gp,
Vec from gp,
Dir2d from gp,
InteriorPoint from IntSurf
is
Value3d(myclass; PStart: InteriorPoint from IntSurf)
---Purpose: Returns the 3d coordinates of the starting point.
returns Pnt from gp;
---C++: inline
Value2d(myclass; PStart: InteriorPoint from IntSurf;
U, V: out Real from Standard);
---Purpose: Returns the <U,V> parameters which are associated
-- with <P>
-- it's the parameters which start the marching algorithm
---C++: inline
Direction3d(myclass; PStart: InteriorPoint from IntSurf)
---Purpose: returns the tangent at the intersectin in 3d space
-- associated to <P>
returns Vec from gp;
---C++: inline
Direction2d(myclass; PStart: InteriorPoint from IntSurf)
---Purpose: returns the tangent at the intersectin in the
-- parametric space of the parametrized surface.This tangent
-- is associated to the value2d
returns Dir2d from gp;
---C++: inline
end InteriorPointTool;

View File

@@ -0,0 +1,2 @@
#include <IntSurf_InteriorPointTool.ixx>

View File

@@ -0,0 +1,32 @@
#include <IntSurf_InteriorPoint.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir2d.hxx>
inline gp_Pnt IntSurf_InteriorPointTool::Value3d
(const IntSurf_InteriorPoint& PStart)
{
return PStart.Value();
}
inline void IntSurf_InteriorPointTool::Value2d
(const IntSurf_InteriorPoint& PStart,
Standard_Real& U,
Standard_Real& V)
{
PStart.Parameters(U,V);
}
inline gp_Vec IntSurf_InteriorPointTool::Direction3d
(const IntSurf_InteriorPoint& PStart) {
return PStart.Direction();
}
inline gp_Dir2d IntSurf_InteriorPointTool::Direction2d
(const IntSurf_InteriorPoint& PStart) {
return PStart.Direction2d();
}

134
src/IntSurf/IntSurf_LineOn2S.cdl Executable file
View File

@@ -0,0 +1,134 @@
-- File: IntSurf_LineOn2S.cdl
-- Created: Mon Feb 22 12:45:55 1993
-- Author: Jacques GOUSSARD
-- <jag@form4>
---Copyright: Matra Datavision 1993
class LineOn2S from IntSurf
---Purpose:
inherits TShared from MMgt
uses PntOn2S from IntSurf,
SequenceOfPntOn2S from IntSurf
raises OutOfRange from Standard
is
Create
returns mutable LineOn2S from IntSurf;
Add(me: mutable; P: PntOn2S from IntSurf)
---Purpose: Adds a point in the line.
---C++: inline
is static;
NbPoints(me)
---Purpose: Returns the number of points in the line.
returns Integer from Standard
---C++: inline
is static;
Value(me; Index: Integer from Standard)
---Purpose: Returns the point of range Index in the line.
returns PntOn2S from IntSurf
---C++: inline
---C++: return const&
raises OutOfRange from Standard
--- The exception OutOfRange is raised when Index <= 0 or
-- Index > NbPoints.
is static;
Reverse(me: mutable)
---Purpose: Reverses the order of points of the line.
---C++: inline
is static;
Split(me: mutable;Index: Integer from Standard)
---Purpose: Keeps in <me> the points 1 to Index-1, and returns
-- the items Index to the end.
returns mutable LineOn2S from IntSurf
raises OutOfRange from Standard
--- The exception OutOfRange is raised when Index <= 0 or
-- Index > NbPoints.
is static;
Value(me: mutable; Index: Integer from Standard; P: PntOn2S from IntSurf)
---Purpose: Replaces the point of range Index in the line.
raises OutOfRange from Standard
--- The exception OutOfRange is raised when Index <= 0 or
-- Index > NbPoints.
---C++: inline
is static;
SetUV(me: mutable; Index: Integer from Standard;
OnFirst: Boolean from Standard;
U,V: Real from Standard)
---Purpose: Sets the parametric coordinates on one of the surfaces
-- of the point of range Index in the line.
---C++: inline
raises OutOfRange from Standard
--- The exception OutOfRange is raised when Index <= 0 or
-- Index > NbPoints.
is static;
Clear(me: mutable)
---C++: inline
is static;
InsertBefore(me:mutable; I: Integer from Standard; P: PntOn2S from IntSurf)
is static;
RemovePoint(me:mutable; I: Integer from Standard)
is static;
fields
mySeq: SequenceOfPntOn2S from IntSurf;
end LineOn2S;

View File

@@ -0,0 +1,33 @@
#include <IntSurf_LineOn2S.ixx>
IntSurf_LineOn2S::IntSurf_LineOn2S ()
{}
Handle(IntSurf_LineOn2S) IntSurf_LineOn2S::Split (const Standard_Integer Index)
{
IntSurf_SequenceOfPntOn2S SS;
mySeq.Split(Index,SS);
Handle(IntSurf_LineOn2S) NS = new IntSurf_LineOn2S ();
Standard_Integer i;
Standard_Integer leng = SS.Length();
for (i=1; i<=leng; i++) {
NS->Add(SS(i));
}
return NS;
}
void IntSurf_LineOn2S::InsertBefore(const Standard_Integer index, const IntSurf_PntOn2S& P) {
if(index>mySeq.Length()) {
mySeq.Append(P);
}
else {
mySeq.InsertBefore(index,P);
}
}
void IntSurf_LineOn2S::RemovePoint(const Standard_Integer index) {
mySeq.Remove(index);
}

View File

@@ -0,0 +1,48 @@
#include <IntSurf_PntOn2S.hxx>
inline void IntSurf_LineOn2S::Add(const IntSurf_PntOn2S& P) {
mySeq.Append(P);
}
inline Standard_Integer IntSurf_LineOn2S::NbPoints() const {
return mySeq.Length();
}
inline void IntSurf_LineOn2S::Reverse () {
mySeq.Reverse();
}
inline const IntSurf_PntOn2S& IntSurf_LineOn2S::
Value(const Standard_Integer Index) const
{
return mySeq(Index);
}
inline void IntSurf_LineOn2S::Value(const Standard_Integer Index,
const IntSurf_PntOn2S& P)
{
mySeq(Index) = P;
}
inline void IntSurf_LineOn2S::SetUV(const Standard_Integer Index,
const Standard_Boolean OnFirst,
const Standard_Real U,
const Standard_Real V)
{
mySeq(Index).SetValue(OnFirst,U,V);
}
inline void IntSurf_LineOn2S::Clear ()
{
mySeq.Clear();
}

143
src/IntSurf/IntSurf_PathPoint.cdl Executable file
View File

@@ -0,0 +1,143 @@
-- File: PathPoint.cdl
-- Created: Tue Nov 10 11:12:59 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun1>
---Copyright: Matra Datavision 1992
class PathPoint from IntSurf
---Purpose:
uses Pnt from gp,
Vec from gp,
Dir2d from gp,
HSequenceOfXY from TColgp
raises UndefinedDerivative from StdFail,
OutOfRange from Standard
is
Create
returns PathPoint from IntSurf;
Create (P: Pnt from gp; U,V: Real from Standard)
returns PathPoint from IntSurf;
SetValue (me: in out; P: Pnt from gp; U,V: Real from Standard)
is static;
AddUV(me: in out; U,V : Real from Standard)
---C++: inline
is static;
SetDirections(me: in out; V: Vec from gp; D: Dir2d from gp)
---C++: inline
is static;
SetTangency(me: in out; Tang: Boolean from Standard)
---C++: inline
is static;
SetPassing(me: in out; Pass: Boolean from Standard)
---C++: inline
is static;
Value(me)
returns Pnt from gp
---C++: return const &
---C++: inline
is static;
Value2d(me; U,V: out Real from Standard)
---C++: inline
is static;
IsPassingPnt(me)
returns Boolean from Standard
---C++: inline
is static;
IsTangent(me)
returns Boolean from Standard
---C++: inline
is static;
Direction3d(me)
returns Vec from gp
---C++: return const &
---C++: inline
raises UndefinedDerivative from StdFail
is static;
Direction2d(me)
returns Dir2d from gp
---C++: return const &
---C++: inline
raises UndefinedDerivative from StdFail
is static;
Multiplicity(me)
returns Integer from Standard
---C++: inline
is static;
Parameters(me; Index: Integer from Standard;
U,V: out Real from Standard)
---C++: inline
raises OutOfRange from Standard
is static;
fields
pt : Pnt from gp;
ispass : Boolean from Standard;
istgt : Boolean from Standard;
vectg : Vec from gp;
dirtg : Dir2d from gp;
sequv : HSequenceOfXY from TColgp;
end PathPoint;

View File

@@ -0,0 +1,28 @@
#include <IntSurf_PathPoint.ixx>
IntSurf_PathPoint::IntSurf_PathPoint ():
ispass(Standard_True), istgt(Standard_True)
{
}
IntSurf_PathPoint::IntSurf_PathPoint (const gp_Pnt& P,
const Standard_Real U,
const Standard_Real V):
pt(P),ispass(Standard_True),istgt(Standard_True)
{
sequv = new TColgp_HSequenceOfXY ();
sequv->Append(gp_XY(U,V));
}
void IntSurf_PathPoint::SetValue (const gp_Pnt& P,
const Standard_Real U,
const Standard_Real V)
{
pt = P;
sequv = new TColgp_HSequenceOfXY ();
sequv->Append(gp_XY(U,V));
}

View File

@@ -0,0 +1,75 @@
#include <StdFail_UndefinedDerivative.hxx>
#include <TColgp_HSequenceOfXY.hxx>
inline void IntSurf_PathPoint::AddUV(const Standard_Real U,
const Standard_Real V) {
sequv->Append(gp_XY(U,V));
}
inline void IntSurf_PathPoint::SetDirections (const gp_Vec& V,
const gp_Dir2d& D) {
istgt = Standard_False;
vectg = V;
dirtg = D;
}
inline void IntSurf_PathPoint::SetTangency (const Standard_Boolean Tang) {
istgt = Tang;
}
inline void IntSurf_PathPoint::SetPassing (const Standard_Boolean Pass) {
ispass = Pass;
}
inline const gp_Pnt& IntSurf_PathPoint::Value () const
{
return pt;
}
inline void IntSurf_PathPoint::Value2d (Standard_Real& U,
Standard_Real& V) const
{
gp_XY uv(sequv->Sequence().First());
U = uv.X();
V = uv.Y();
}
inline Standard_Boolean IntSurf_PathPoint::IsPassingPnt () const {
return ispass;
}
inline Standard_Boolean IntSurf_PathPoint::IsTangent () const {
return istgt;
}
inline const gp_Vec& IntSurf_PathPoint::Direction3d () const {
if (istgt) {StdFail_UndefinedDerivative::Raise();}
return vectg;
}
inline const gp_Dir2d& IntSurf_PathPoint::Direction2d () const {
if (istgt) {StdFail_UndefinedDerivative::Raise();}
return dirtg;
}
inline Standard_Integer IntSurf_PathPoint::Multiplicity () const {
return (sequv->Length()-1);
}
inline void IntSurf_PathPoint::Parameters (const Standard_Integer Index,
Standard_Real& U,
Standard_Real& V) const
{
gp_XY uv(sequv->Value(Index+1));
U = uv.X();
V = uv.Y();
}

View File

@@ -0,0 +1,118 @@
-- File: PathPointTool.cdl
-- Created: Fri Sep 25 16:41:41 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun2>
---Copyright: Matra Datavision 1992
class PathPointTool from IntSurf
uses Pnt from gp,
Vec from gp,
Dir2d from gp,
PathPoint from IntSurf
raises OutOfRange from Standard,
UndefinedDerivative from StdFail
is
Value3d(myclass; PStart: PathPoint from IntSurf)
---Purpose: Returns the 3d coordinates of the starting point.
returns Pnt from gp;
---C++: inline
Value2d(myclass; PStart: PathPoint from IntSurf;
U, V: out Real from Standard);
---Purpose: Returns the <U, V> parameters which are associated
-- with <P>
-- it's the parameters which start the marching algorithm
---C++: inline
IsPassingPnt(myclass; PStart: PathPoint from IntSurf)
---Purpose: Returns True if the point is a point on a non-oriented
-- arc, which means that the intersection line does not
-- stop at such a point but just go through such a point.
-- IsPassingPnt is True when IsOnArc is True
returns Boolean from Standard;
---C++: inline
IsTangent(myclass; PStart: PathPoint from IntSurf )
---Purpose: Returns True if the surfaces are tangent at this point.
-- IsTangent can be True when IsOnArc is True
-- if IsPassingPnt is True and IsTangent is True,this point
-- is a stopped point.
returns Boolean from Standard;
---C++: inline
Direction3d(myclass; PStart: PathPoint from IntSurf)
---Purpose: returns the tangent at the intersection in 3d space
-- associated to <P>
-- an exception is raised if IsTangent is true.
returns Vec from gp
---C++: inline
raises UndefinedDerivative from StdFail;
Direction2d(myclass; PStart: PathPoint from IntSurf)
---Purpose: returns the tangent at the intersection in the
-- parametric space of the parametrized surface.This tangent
-- is associated to the value2d
-- la tangente a un sens signifiant (indique le sens de chemin
-- ement)
-- an exception is raised if IsTangent is true.
returns Dir2d from gp
---C++: inline
raises UndefinedDerivative from StdFail;
Multiplicity(myclass; PStart: PathPoint from IntSurf)
---Purpose: Returns the multiplicity of the point i-e
-- the number of auxillar parameters associated to the
-- point which the principal parameters are given by Value2d
returns Integer from Standard;
---C++: inline
Parameters(myclass; PStart: PathPoint from IntSurf;
Mult: Integer from Standard;
U, V: out Real from Standard)
---Purpose: Parametric coordinates associated to the multiplicity.
-- An exception is raised if Mult<=0 or Mult>multiplicity.
---C++: inline
raises OutOfRange from Standard;
end PathPointTool;

View File

@@ -0,0 +1,3 @@
#include <IntSurf_PathPointTool.ixx>

View File

@@ -0,0 +1,60 @@
#include <IntSurf_PathPoint.hxx>
#include <gp_Vec.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir2d.hxx>
inline gp_Pnt IntSurf_PathPointTool::Value3d (const IntSurf_PathPoint& PStart)
{
return PStart.Value();
}
inline void IntSurf_PathPointTool::Value2d (const IntSurf_PathPoint& PStart,
Standard_Real& U,
Standard_Real& V) {
PStart.Value2d(U,V);
}
inline Standard_Boolean IntSurf_PathPointTool::IsPassingPnt
(const IntSurf_PathPoint& PStart) {
return PStart.IsPassingPnt();
}
inline Standard_Boolean IntSurf_PathPointTool::IsTangent
(const IntSurf_PathPoint& PStart)
{
return PStart.IsTangent();
}
inline gp_Vec IntSurf_PathPointTool::Direction3d
(const IntSurf_PathPoint& PStart)
{
return PStart.Direction3d();
}
inline gp_Dir2d IntSurf_PathPointTool::Direction2d
(const IntSurf_PathPoint& PStart)
{
return PStart.Direction2d();
}
inline Standard_Integer IntSurf_PathPointTool::Multiplicity
(const IntSurf_PathPoint& PStart)
{
return PStart.Multiplicity();
}
inline void IntSurf_PathPointTool::Parameters (const IntSurf_PathPoint& PStart,
const Standard_Integer Mult,
Standard_Real& U,
Standard_Real& V)
{
PStart.Parameters(Mult,U,V);
}

122
src/IntSurf/IntSurf_PntOn2S.cdl Executable file
View File

@@ -0,0 +1,122 @@
-- File: PntOn2S.cdl
-- Created: Wed May 6 14:08:15 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun1>
---Copyright: Matra Datavision 1992
class PntOn2S from IntSurf
---Purpose: This class defines the geometric informations
-- for an intersection point between 2 surfaces :
-- The coordinates ( Pnt from gp ), and two
-- parametric coordinates.
uses Pnt from gp
is
Create
---Purpose: Empty constructor.
returns PntOn2S from IntSurf;
SetValue(me: in out; Pt: Pnt from gp)
---Purpose: Sets the value of the point in 3d space.
---C++: inline
is static;
SetValue(me: in out; Pt: Pnt from gp; OnFirst: Boolean from Standard;
U,V: Real from Standard)
---Purpose: Sets the values of the point in 3d space, and
-- in the parametric space of one of the surface.
is static;
SetValue(me: in out; Pt: Pnt from gp; U1,V1,U2,V2: Real from Standard)
---Purpose: Sets the values of the point in 3d space, and
-- in the parametric space of each surface.
---C++: inline
is static;
SetValue(me: in out; OnFirst: Boolean from Standard;
U,V: Real from Standard)
---Purpose: Set the values of the point in the parametric
-- space of one of the surface.
is static;
SetValue(me: in out; U1,V1, U2, V2: Real from Standard)
---Purpose: Set the values of the point in the parametric
-- space of one of the surface.
---C++: inline
is static;
Value(me)
---Purpose: Returns the point in 3d space.
returns Pnt from gp
---C++: return const&
---C++: inline
is static;
ParametersOnS1(me; U1,V1: out Real from Standard)
---Purpose: Returns the parameters of the point on the first surface.
---C++: inline
is static;
ParametersOnS2(me; U2,V2: out Real from Standard)
---Purpose: Returns the parameters of the point on the second surface.
---C++: inline
is static;
Parameters(me; U1,V1,U2,V2: out Real from Standard)
---Purpose: Returns the parameters of the point on both surfaces.
---C++: inline
is static;
fields
pt : Pnt from gp;
u1 : Real from Standard;
v1 : Real from Standard;
u2 : Real from Standard;
v2 : Real from Standard;
end PntOn2S;

38
src/IntSurf/IntSurf_PntOn2S.cxx Executable file
View File

@@ -0,0 +1,38 @@
#include <IntSurf_PntOn2S.ixx>
IntSurf_PntOn2S::IntSurf_PntOn2S () : pt(0,0,0),u1(0),v1(0),u2(0),v2(0) {};
void IntSurf_PntOn2S::SetValue (const gp_Pnt& Pt,
const Standard_Boolean OnFirst,
const Standard_Real U,
const Standard_Real V) {
pt = Pt;
if (OnFirst) {
u1 = U;
v1 = V;
}
else {
u2 = U;
v2 = V;
}
}
void IntSurf_PntOn2S::SetValue (const Standard_Boolean OnFirst,
const Standard_Real U,
const Standard_Real V) {
if (OnFirst) {
u1 = U;
v1 = V;
}
else {
u2 = U;
v2 = V;
}
}

64
src/IntSurf/IntSurf_PntOn2S.lxx Executable file
View File

@@ -0,0 +1,64 @@
inline void IntSurf_PntOn2S::SetValue (const gp_Pnt& Pt ) {
pt = Pt;
}
inline void IntSurf_PntOn2S::SetValue (const gp_Pnt& Pt,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2) {
pt = Pt;
u1 = U1;
v1 = V1;
u2 = U2;
v2 = V2;
}
inline void IntSurf_PntOn2S::SetValue (const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2) {
u1 = U1;
v1 = V1;
u2 = U2;
v2 = V2;
}
inline const gp_Pnt& IntSurf_PntOn2S::Value () const {
return pt;
}
inline void IntSurf_PntOn2S::ParametersOnS1 (Standard_Real& U1,
Standard_Real& V1) const
{
U1 = u1;
V1 = v1;
}
inline void IntSurf_PntOn2S::ParametersOnS2 (Standard_Real& U2,
Standard_Real& V2) const
{
U2 = u2;
V2 = v2;
}
inline void IntSurf_PntOn2S::Parameters (Standard_Real& U1,
Standard_Real& V1,
Standard_Real& U2,
Standard_Real& V2) const
{
U1 = u1;
V1 = v1;
U2 = u2;
V2 = v2;
}

181
src/IntSurf/IntSurf_Quadric.cdl Executable file
View File

@@ -0,0 +1,181 @@
-- File: Quadric.cdl
-- Created: Mon Apr 13 17:38:01 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun1>
---Copyright: Matra Datavision 1992
class Quadric from IntSurf
---Purpose:
uses Ax3 from gp,
Pnt from gp,
Vec from gp,
Dir from gp,
Lin from gp,
Pln from gp,
Cylinder from gp,
Sphere from gp,
Cone from gp,
SurfaceType from GeomAbs
is
Create
returns Quadric from IntSurf;
Create(P: Pln from gp)
returns Quadric from IntSurf;
Create(C: Cylinder from gp)
returns Quadric from IntSurf;
Create(S: Sphere from gp)
returns Quadric from IntSurf;
Create(C: Cone from gp)
returns Quadric from IntSurf;
SetValue(me: in out; P: Pln from gp)
is static;
SetValue(me: in out; C: Cylinder from gp)
is static;
SetValue(me: in out; S: Sphere from gp)
is static;
SetValue(me: in out; C: Cone from gp)
is static;
Distance(me; P: Pnt from gp)
returns Real from Standard
is static;
Gradient(me; P: Pnt from gp)
returns Vec from gp
is static;
ValAndGrad(me; P: Pnt from gp; Dist: out Real from Standard;
Grad: out Vec from gp)
is static;
TypeQuadric(me)
returns SurfaceType from GeomAbs
---C++: inline
is static;
Plane(me)
returns Pln from gp
---C++: inline
is static;
Sphere(me)
returns Sphere from gp
---C++: inline
is static;
Cylinder(me)
returns Cylinder from gp
---C++: inline
is static;
Cone(me)
returns Cone from gp
---C++: inline
is static;
Value(me; U,V: Real)
returns Pnt from gp
is static;
D1(me; U,V: Real; P: out Pnt; D1U,D1V: out Vec from gp)
is static;
DN(me; U,V: Real; Nu,Nv: Integer)
returns Vec from gp
is static;
Normale(me; U,V: Real)
returns Vec from gp
is static;
Parameters(me; P: Pnt from gp; U,V: out Real)
is static;
Normale(me; P: Pnt from gp)
returns Vec from gp
is static;
fields
ax3 : Ax3 from gp;
lin : Lin from gp;
prm1 : Real from Standard;
prm2 : Real from Standard;
prm3 : Real from Standard;
prm4 : Real from Standard;
ax3direc : Boolean from Standard;
typ : SurfaceType from GeomAbs;
end Quadric;

414
src/IntSurf/IntSurf_Quadric.cxx Executable file
View File

@@ -0,0 +1,414 @@
#include <IntSurf_Quadric.ixx>
#include <StdFail_NotDone.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <gp.hxx>
// ============================================================
IntSurf_Quadric::IntSurf_Quadric ():typ(GeomAbs_OtherSurface),
prm1(0.), prm2(0.), prm3(0.), prm4(0.)
{}
// ============================================================
IntSurf_Quadric::IntSurf_Quadric (const gp_Pln& P):
ax3(P.Position()),typ(GeomAbs_Plane)
{
ax3direc = ax3.Direct();
P.Coefficients(prm1,prm2,prm3,prm4);
}
// ============================================================
IntSurf_Quadric::IntSurf_Quadric (const gp_Cylinder& C):
ax3(C.Position()),lin(ax3.Axis()),typ(GeomAbs_Cylinder)
{
prm2=prm3=prm4=0.0;
ax3direc=ax3.Direct();
prm1=C.Radius();
}
// ============================================================
IntSurf_Quadric::IntSurf_Quadric (const gp_Sphere& S):
ax3(S.Position()),lin(ax3.Axis()),typ(GeomAbs_Sphere)
{
prm2=prm3=prm4=0.0;
ax3direc = ax3.Direct();
prm1=S.Radius();
}
// ============================================================
IntSurf_Quadric::IntSurf_Quadric (const gp_Cone& C):
ax3(C.Position()),typ(GeomAbs_Cone)
{
ax3direc = ax3.Direct();
lin.SetPosition(ax3.Axis());
prm1 = C.RefRadius();
prm2 = C.SemiAngle();
prm3 = Cos(prm2);
prm4 = 0.0;
}
// ============================================================
void IntSurf_Quadric::SetValue (const gp_Pln& P)
{
typ = GeomAbs_Plane;
ax3 = P.Position();
ax3direc = ax3.Direct();
P.Coefficients(prm1,prm2,prm3,prm4);
}
// ============================================================
void IntSurf_Quadric::SetValue (const gp_Cylinder& C)
{
typ = GeomAbs_Cylinder;
ax3 = C.Position();
ax3direc = ax3.Direct();
lin.SetPosition(ax3.Axis());
prm1 = C.Radius();
prm2=prm3=prm4=0.0;
}
// ============================================================
void IntSurf_Quadric::SetValue (const gp_Sphere& S)
{
typ = GeomAbs_Sphere;
ax3 = S.Position();
ax3direc = ax3.Direct();
lin.SetPosition(ax3.Axis());
prm1 = S.Radius();
prm2=prm3=prm4=0.0;
}
// ============================================================
void IntSurf_Quadric::SetValue (const gp_Cone& C)
{
typ = GeomAbs_Cone;
ax3 = C.Position();
ax3direc = ax3.Direct();
lin.SetPosition(ax3.Axis());
prm1 = C.RefRadius();
prm2 = C.SemiAngle();
prm3 = Cos(prm2);
prm4 = 0.0;
}
// ============================================================
Standard_Real IntSurf_Quadric::Distance (const gp_Pnt& P) const {
switch (typ) {
case GeomAbs_Plane: // plan
return prm1*P.X() + prm2*P.Y() + prm3*P.Z() + prm4;
case GeomAbs_Cylinder: // cylindre
return (lin.Distance(P) - prm1);
case GeomAbs_Sphere: // sphere
return (lin.Location().Distance(P) - prm1);
case GeomAbs_Cone: // cone
{
Standard_Real dist = lin.Distance(P);
Standard_Real U,V;
ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V);
gp_Pnt Pp = ElSLib::ConeValue(U,V,ax3,prm1,prm2);
Standard_Real distp = lin.Distance(Pp);
dist = (dist-distp)/prm3;
return(dist);
}
default:
{
}
break;
}
return(0.0);
}
// ============================================================
gp_Vec IntSurf_Quadric::Gradient (const gp_Pnt& P) const {
gp_Vec grad;
switch (typ) {
case GeomAbs_Plane: // plan
grad.SetCoord(prm1,prm2,prm3);
break;
case GeomAbs_Cylinder: // cylindre
{
gp_XYZ PP(lin.Location().XYZ());
PP.Add(ElCLib::Parameter(lin,P)*lin.Direction().XYZ());
grad.SetXYZ(P.XYZ()-PP);
Standard_Real N = grad.Magnitude();
if(N>1e-14) { grad.Divide(N); }
else { grad.SetCoord(0.0,0.0,0.0); }
}
break;
case GeomAbs_Sphere: // sphere
{
gp_XYZ PP(P.XYZ());
grad.SetXYZ((PP-lin.Location().XYZ()));
Standard_Real N = grad.Magnitude();
if(N>1e-14) { grad.Divide(N); }
else { grad.SetCoord(0.0,0.0,0.0); }
}
break;
case GeomAbs_Cone: // cone
{
Standard_Real U,V;
ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V);
gp_Pnt Pp = ElSLib::ConeValue(U,V,ax3,prm1,prm2);
gp_Vec D1u,D1v;
ElSLib::ConeD1(U,V,ax3,prm1,prm2,Pp,D1u,D1v);
grad=D1u.Crossed(D1v);
if(ax3direc==Standard_False) {
grad.Reverse();
}
grad.Normalize();
}
break;
default:
{}
break;
}
return grad;
}
// ============================================================
void IntSurf_Quadric::ValAndGrad (const gp_Pnt& P,
Standard_Real& Dist,
gp_Vec& Grad) const
{
switch (typ) {
case GeomAbs_Plane:
{
Dist = prm1*P.X() + prm2*P.Y() + prm3*P.Z() + prm4;
Grad.SetCoord(prm1,prm2,prm3);
}
break;
case GeomAbs_Cylinder:
{
Dist = lin.Distance(P) - prm1;
gp_XYZ PP(lin.Location().XYZ());
PP.Add(ElCLib::Parameter(lin,P)*lin.Direction().XYZ());
Grad.SetXYZ((P.XYZ()-PP));
Standard_Real N = Grad.Magnitude();
if(N>1e-14) { Grad.Divide(N); }
else { Grad.SetCoord(0.0,0.0,0.0); }
}
break;
case GeomAbs_Sphere:
{
Dist = lin.Location().Distance(P) - prm1;
gp_XYZ PP(P.XYZ());
Grad.SetXYZ((PP-lin.Location().XYZ()));
Standard_Real N = Grad.Magnitude();
if(N>1e-14) { Grad.Divide(N); }
else { Grad.SetCoord(0.0,0.0,0.0); }
}
break;
case GeomAbs_Cone:
{
Standard_Real dist = lin.Distance(P);
Standard_Real U,V;
gp_Vec D1u,D1v;
gp_Pnt Pp;
ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V);
ElSLib::ConeD1(U,V,ax3,prm1,prm2,Pp,D1u,D1v);
Standard_Real distp = lin.Distance(Pp);
dist = (dist-distp)/prm3;
Dist = dist;
Grad=D1u.Crossed(D1v);
if(ax3direc==Standard_False) {
Grad.Reverse();
}
//-- lbr le 7 mars 96
//-- Si le gardient est nul, on est sur l axe
//-- et dans ce cas dist vaut 0
//-- On peut donc renvoyer une valeur quelconque.
if( Grad.X() > 1e-13
|| Grad.Y() > 1e-13
|| Grad.Z() > 1e-13) {
Grad.Normalize();
}
}
break;
default:
{}
break;
}
}
// ============================================================
gp_Pnt IntSurf_Quadric::Value(const Standard_Real U,
const Standard_Real V) const
{
switch (typ) {
case GeomAbs_Plane:
return ElSLib::PlaneValue(U,V,ax3);
case GeomAbs_Cylinder:
return ElSLib::CylinderValue(U,V,ax3,prm1);
case GeomAbs_Sphere:
return ElSLib::SphereValue(U,V,ax3,prm1);
case GeomAbs_Cone:
return ElSLib::ConeValue(U,V,ax3,prm1,prm2);
default:
{
gp_Pnt p(0,0,0);
return(p);
}
break;
}
// pop : pour NT
return gp_Pnt(0,0,0);
}
// ============================================================
void IntSurf_Quadric::D1(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V) const
{
switch (typ) {
case GeomAbs_Plane:
ElSLib::PlaneD1(U,V,ax3,P,D1U,D1V);
break;
case GeomAbs_Cylinder:
ElSLib::CylinderD1(U,V,ax3,prm1,P,D1U,D1V);
break;
case GeomAbs_Sphere:
ElSLib::SphereD1(U,V,ax3,prm1,P,D1U,D1V);
break;
case GeomAbs_Cone:
ElSLib::ConeD1(U,V,ax3,prm1,prm2,P,D1U,D1V);
break;
default:
{
}
break;
}
}
// ============================================================
gp_Vec IntSurf_Quadric::DN(const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv) const
{
switch (typ) {
case GeomAbs_Plane:
return ElSLib::PlaneDN(U,V,ax3,Nu,Nv);
case GeomAbs_Cylinder:
return ElSLib::CylinderDN(U,V,ax3,prm1,Nu,Nv);
case GeomAbs_Sphere:
return ElSLib::SphereDN(U,V,ax3,prm1,Nu,Nv);
case GeomAbs_Cone:
return ElSLib::ConeDN(U,V,ax3,prm1,prm2,Nu,Nv);
default:
{
gp_Vec v(0,0,0);
return(v);
}
break;
}
// pop : pour NT
return gp_Vec(0,0,0);
}
// ============================================================
gp_Vec IntSurf_Quadric::Normale(const Standard_Real U,
const Standard_Real V) const
{
switch (typ) {
case GeomAbs_Plane:
if(ax3direc)
return ax3.Direction();
else
return ax3.Direction().Reversed();
case GeomAbs_Cylinder:
return Normale(Value(U,V));
case GeomAbs_Sphere:
return Normale(Value(U,V));
case GeomAbs_Cone:
{
gp_Pnt P;
gp_Vec D1u,D1v;
ElSLib::ConeD1(U,V,ax3,prm1,prm2,P,D1u,D1v);
if(D1u.Magnitude()<0.0000001) {
gp_Vec Vn(0.0,0.0,0.0);
return(Vn);
}
return(D1u.Crossed(D1v));
}
default:
{
gp_Vec v(0,0,0);
return(v);
}
break;
}
// pop : pour NT
return gp_Vec(0,0,0);
}
// ============================================================
gp_Vec IntSurf_Quadric::Normale (const gp_Pnt& P) const
{
switch (typ) {
case GeomAbs_Plane:
if(ax3direc)
return ax3.Direction();
else
return ax3.Direction().Reversed();
case GeomAbs_Cylinder:
{
if(ax3direc) {
return lin.Normal(P).Direction();
}
else {
gp_Dir D(lin.Normal(P).Direction());
D.Reverse();
return(D);
}
}
case GeomAbs_Sphere:
{
if(ax3direc) {
gp_Vec ax3P(ax3.Location(),P);
return gp_Dir(ax3P);
}
else {
gp_Vec Pax3(P,ax3.Location());
return gp_Dir(Pax3);
}
}
case GeomAbs_Cone:
{
Standard_Real U,V;
ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V);
return Normale(U,V);;
}
default:
{
gp_Vec v(0,0,0);
return(v);
} break;
}
// pop : pour NT
return gp_Vec(0,0,0);
}
// ============================================================
void IntSurf_Quadric::Parameters (const gp_Pnt& P,
Standard_Real& U,
Standard_Real& V) const
{
switch (typ) {
case GeomAbs_Plane:
ElSLib::PlaneParameters(ax3,P,U,V);
break;
case GeomAbs_Cylinder:
ElSLib::CylinderParameters(ax3,prm1,P,U,V);
break;
case GeomAbs_Sphere:
ElSLib::SphereParameters(ax3,prm1,P,U,V);
break;
case GeomAbs_Cone:
{
ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V);
}
break;
default:
{}
break;
}
}
// ============================================================

47
src/IntSurf/IntSurf_Quadric.lxx Executable file
View File

@@ -0,0 +1,47 @@
#ifndef gp_Pln_HeaderFile
#include <gp_Pln.hxx>
#endif
#ifndef gp_Sphere_HeaderFile
#include <gp_Sphere.hxx>
#endif
#ifndef gp_Cylinder_HeaderFile
#include <gp_Cylinder.hxx>
#endif
#ifndef gp_Cone_HeaderFile
#include <gp_Cone.hxx>
#endif
#ifndef GeomAbs_SurfaceType_HeaderFile
#include <GeomAbs_SurfaceType.hxx>
#endif
inline GeomAbs_SurfaceType IntSurf_Quadric::TypeQuadric () const {
return typ;
}
inline gp_Pln IntSurf_Quadric::Plane () const {
return gp_Pln(ax3);
}
inline gp_Sphere IntSurf_Quadric::Sphere () const {
return gp_Sphere(ax3,prm1);
}
inline gp_Cylinder IntSurf_Quadric::Cylinder () const {
return gp_Cylinder(ax3,prm1);
}
inline gp_Cone IntSurf_Quadric::Cone () const {
return gp_Cone(ax3,prm2,prm1);
}

View File

@@ -0,0 +1,57 @@
-- File: QuadricTool.cdl
-- Created: Wed Sep 30 12:42:33 1992
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1992
class QuadricTool from IntSurf
---Purpose: This class provides a tool on a quadric that can be
-- used to instantiates the Walking algorithmes (see
-- package IntWalk) with a Quadric from IntSurf
-- as implicit surface.
uses Quadric from IntSurf,
Vec from gp
is
Value(myclass; Quad: Quadric from IntSurf;
X, Y, Z: Real from Standard)
---Purpose: Returns the value of the function.
returns Real from Standard;
---C++: inline
Gradient(myclass; Quad: Quadric from IntSurf;
X, Y, Z: Real from Standard ; V : out Vec from gp);
---Purpose: Returns the gradient of the function.
---C++: inline
ValueAndGradient(myclass; Quad: Quadric from IntSurf;
X, Y, Z: Real from Standard;
Val: out Real from Standard; Grad: out Vec from gp);
---Purpose: Returns the value and the gradient.
---C++: inline
Tolerance(myclass; Quad: Quadric from IntSurf )
---Purpose: returns the tolerance of the zero of the implicit function
returns Real from Standard;
end QuadricTool;

View File

@@ -0,0 +1,17 @@
#include <IntSurf_QuadricTool.ixx>
#include <gp_Sphere.hxx>
#include <gp_Cylinder.hxx>
Standard_Real IntSurf_QuadricTool::Tolerance (const IntSurf_Quadric& Q) {
switch (Q.TypeQuadric()) {
case GeomAbs_Sphere:
return 2.e-6*Q.Sphere().Radius();
case GeomAbs_Cylinder:
return 2.e-6*Q.Cylinder().Radius();
default:
break;
}
return(1e-6);
}

View File

@@ -0,0 +1,31 @@
#include <IntSurf_Quadric.hxx>
#include <gp_Vec.hxx>
inline Standard_Real IntSurf_QuadricTool::Value (const IntSurf_Quadric& Quad,
const Standard_Real X,
const Standard_Real Y,
const Standard_Real Z) {
return Quad.Distance(gp_Pnt(X,Y,Z));
}
inline void IntSurf_QuadricTool::Gradient (const IntSurf_Quadric& Quad,
const Standard_Real X,
const Standard_Real Y,
const Standard_Real Z,
gp_Vec& V) {
V = Quad.Gradient(gp_Pnt(X,Y,Z));
}
inline void IntSurf_QuadricTool::ValueAndGradient (const IntSurf_Quadric& Quad,
const Standard_Real X,
const Standard_Real Y,
const Standard_Real Z,
Standard_Real& Val,
gp_Vec& V) {
Quad.ValAndGrad(gp_Pnt(X,Y,Z),Val,V);
}

View File

@@ -0,0 +1,145 @@
-- File: Transition.cdl
-- Created: Wed May 6 14:09:43 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun1>
---Copyright: Matra Datavision 1992
class Transition from IntSurf
---Purpose: Definition of the transition at the intersection
-- between an intersection line and a restriction curve
-- on a surface.
uses TypeTrans from IntSurf,
Situation from IntSurf
raises DomainError from Standard
is
Create
---Purpose: Empty constructor. Creates an UNDECIDED transition.
returns Transition from IntSurf;
Create(Tangent: Boolean from Standard; Type: TypeTrans from IntSurf)
---Purpose: Create a IN or OUT transition
returns Transition from IntSurf;
Create(Tangent: Boolean from Standard;
Situ: Situation from IntSurf; Oppos: Boolean from Standard)
---Purpose: Create a TOUCH transition.
returns Transition from IntSurf;
SetValue(me: in out; Tangent: Boolean from Standard;
Type: TypeTrans from IntSurf)
---Purpose: Set the values of an IN or OUT transition.
---C++: inline
is static;
SetValue(me: in out; Tangent: Boolean from Standard;
Situ: Situation from IntSurf; Oppos: Boolean from Standard)
---Purpose: Set the values of a TOUCH transition.
---C++: inline
is static;
SetValue(me: in out)
---Purpose: Set the values of an UNDECIDED transition.
---C++: inline
is static;
TransitionType(me)
---Purpose: Returns the type of Transition (in/out/touch/undecided)
-- for the arc given by value. This the transition of
-- the intersection line compared to the Arc of restriction,
-- i-e when the function returns INSIDE for example, it
-- means that the intersection line goes inside the
-- part of plane limited by the arc of restriction.
returns TypeTrans from IntSurf
---C++: inline
is static;
IsTangent(me)
---Purpose: Returns TRUE if the point is tangent to the arc
-- given by Value.
-- An exception is raised if TransitionType returns UNDECIDED.
returns Boolean from Standard
---C++: inline
raises DomainError from Standard
is static;
Situation(me)
---Purpose: Returns a significant value if TransitionType returns
-- TOUCH. In this case, the function returns :
-- INSIDE when the intersection line remains inside the Arc,
-- OUTSIDE when it remains outside the Arc,
-- UNKNOWN when the calsulus cannot give results.
-- If TransitionType returns IN, or OUT, or UNDECIDED, a
-- exception is raised.
returns Situation from IntSurf
---C++: inline
raises DomainError from Standard
is static;
IsOpposite(me)
---Purpose: returns a significant value if TransitionType returns
-- TOUCH.
-- In this case, the function returns true when
-- the 2 curves locally define two different parts of the
-- space.
-- If TransitionType returns IN or OUT or UNDECIDED, an
-- exception is raised.
returns Boolean from Standard
---C++: inline
raises DomainError from Standard
is static;
fields
tangent : Boolean from Standard;
typetra : TypeTrans from IntSurf;
situat : Situation from IntSurf;
oppos : Boolean from Standard;
end Transition;

View File

@@ -0,0 +1,29 @@
#include <IntSurf_Transition.ixx>
IntSurf_Transition::IntSurf_Transition (const Standard_Boolean Tangent,
const IntSurf_TypeTrans Type):
tangent(Tangent),
typetra(Type),
situat(IntSurf_Unknown),
oppos(Standard_False)
{}
IntSurf_Transition::IntSurf_Transition (const Standard_Boolean Tangent,
const IntSurf_Situation Situ,
const Standard_Boolean Oppos):
tangent(Tangent),
typetra(IntSurf_Touch),
situat(Situ),
oppos(Oppos)
{}
IntSurf_Transition::IntSurf_Transition ():
tangent(Standard_False),
typetra(IntSurf_Undecided),
situat(IntSurf_Unknown),
oppos(Standard_False)
{}

View File

@@ -0,0 +1,55 @@
#include <Standard_DomainError.hxx>
inline void IntSurf_Transition::SetValue (const Standard_Boolean Tangent,
const IntSurf_TypeTrans Type) {
tangent = Tangent;
typetra = Type;
}
inline void IntSurf_Transition::SetValue (const Standard_Boolean Tangent,
const IntSurf_Situation Situ,
const Standard_Boolean Oppos) {
tangent = Tangent;
typetra = IntSurf_Touch;
situat = Situ;
oppos = Oppos;
}
inline void IntSurf_Transition::SetValue () {
typetra = IntSurf_Undecided;
}
inline IntSurf_TypeTrans IntSurf_Transition::TransitionType () const {
return typetra;
}
inline Standard_Boolean IntSurf_Transition::IsTangent () const {
if (typetra == IntSurf_Undecided) {Standard_DomainError::Raise();}
return tangent;
}
inline IntSurf_Situation IntSurf_Transition::Situation () const {
if (typetra != IntSurf_Touch) {Standard_DomainError::Raise();}
return situat;
}
inline Standard_Boolean IntSurf_Transition::IsOpposite () const {
if (typetra != IntSurf_Touch) {Standard_DomainError::Raise();}
return oppos;
}