1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
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

176
src/IGESGeom/IGESGeom.cdl Executable file
View File

@@ -0,0 +1,176 @@
--
-- File : IGESGeom.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
package IGESGeom
---Purpose : This package consists of B-Rep and CSG Solid entities
uses
Standard,
TCollection,
TColgp,
TColStd,
gp,
Message,
Interface,
IGESBasic,
IGESData
is
class CircularArc;
-- Type 100, Form 0
---Purpose : Defines IGES CircularArc
class CompositeCurve;
-- Type 102, Form 0
---Purpose : Defines IGES CompositeCurve
class ConicArc;
-- Type 104, Form 0-3
---Purpose : Defines a ConicArc
class CopiousData;
-- Type 106, Form 1-3,11-13,63
---Purpose : Defines a CopiousData
class Plane;
-- Type 108, Form -1,0,1
---Purpose : Defines IGES Plane
class Line;
-- Type 110, Form 0
---Purpose : Defines IGES Line
class SplineCurve;
-- Type 112, Form 0
---Purpose : Defines IGES SplineCurve
class SplineSurface;
-- Type 114, Form 0
-- Purpose : Defines IGES SplineSurface
class Point;
-- Type 116, Form 0
---Purpose : Defines IGES Point
class RuledSurface;
-- Type 118, Form 0,1
---Purpose : Defines IGES RuledSurface
class SurfaceOfRevolution;
-- Type 120, Form 0
---Purpose : Defines IGES SurfaceOfRevolution
class TabulatedCylinder;
-- Type 122, Form 0
---Purpose : Defines IGES TabulatedCylinder
class Direction;
-- Type 123, Form 0
---Purpose : Defines IGES Direction
class TransformationMatrix;
-- Type 124, Form 0
---Purpose : Defines IGES TransformationMatrix
class Flash;
-- Type 125, Form 0-4
---Purpose : Defines IGES Flash
class BSplineCurve;
-- Type 126, Form 0-5
---Purpose : Defines IGES BSplineCurve
class BSplineSurface;
-- Type 128, Form 0-9
---Purpose : Defines IGES BSplineSurface
class OffsetCurve;
-- Type 130, Form 0
---Purpose : Defines IGES OffsetCurve
class OffsetSurface;
-- Type 140, Form 0
---Purpose : Defines IGES OffsetSurface
class Boundary;
-- Type 141, Form 0
---Purpose : Defines IGES Boundary
class CurveOnSurface;
-- Type 142, Form 0
---Purpose : Defines IGES CurveOnSurface
class BoundedSurface;
-- Type 143, Form 0
---Purpose : Defines IGES BoundedSurface
class TrimmedSurface;
-- Type 144, Form 0
---Purpose : Defines IGES TrimmedSurface
-- Tools for Entities --
class ToolCircularArc;
class ToolCompositeCurve;
class ToolConicArc;
class ToolCopiousData;
class ToolPlane;
class ToolLine;
class ToolSplineCurve;
class ToolSplineSurface;
class ToolPoint;
class ToolRuledSurface;
class ToolSurfaceOfRevolution;
class ToolTabulatedCylinder;
class ToolDirection;
class ToolTransformationMatrix;
class ToolFlash;
class ToolBSplineCurve;
class ToolBSplineSurface;
class ToolOffsetCurve;
class ToolOffsetSurface;
class ToolBoundary;
class ToolCurveOnSurface;
class ToolBoundedSurface;
class ToolTrimmedSurface;
-- Definition and Exploitation of Entities defined in this Package
class Protocol;
class ReadWriteModule;
class GeneralModule;
class SpecificModule;
-- Instantiations :
class Array1OfBoundary instantiates Array1 from TCollection (Boundary);
class Array1OfCurveOnSurface instantiates
Array1 from TCollection (CurveOnSurface);
class Array1OfTransformationMatrix instantiates
Array1 from TCollection (TransformationMatrix);
class HArray1OfBoundary instantiates HArray1 from TCollection
(Boundary,Array1OfBoundary);
class HArray1OfCurveOnSurface instantiates HArray1 from TCollection
(CurveOnSurface,Array1OfCurveOnSurface);
class HArray1OfTransformationMatrix instantiates HArray1 from TCollection
(TransformationMatrix,Array1OfTransformationMatrix);
-- Package Methods
Init;
---Purpose : Prepares dymanic data (Protocol, Modules) for this package
Protocol returns Protocol from IGESGeom;
---Purpose : Returns the Protocol for this Package
end IGESGeom;

33
src/IGESGeom/IGESGeom.cxx Executable file
View File

@@ -0,0 +1,33 @@
#include <IGESGeom.ixx>
#include <IGESGeom_Protocol.hxx>
#include <IGESGeom_GeneralModule.hxx>
#include <IGESGeom_ReadWriteModule.hxx>
#include <IGESGeom_SpecificModule.hxx>
#include <Interface_GeneralLib.hxx>
#include <Interface_ReaderLib.hxx>
#include <IGESData_WriterLib.hxx>
#include <IGESData_SpecificLib.hxx>
#include <IGESBasic.hxx>
// Ancillary data to work on a Package of IGES Entities with a Protocol
// (Modules are created and loaded in appropriate libraries, once by Init)
static Handle(IGESGeom_Protocol) protocol;
void IGESGeom::Init ()
{
IGESBasic::Init();
if (protocol.IsNull()) {
protocol = new IGESGeom_Protocol;
Interface_GeneralLib::SetGlobal (new IGESGeom_GeneralModule, protocol);
Interface_ReaderLib::SetGlobal (new IGESGeom_ReadWriteModule,protocol);
IGESData_WriterLib::SetGlobal (new IGESGeom_ReadWriteModule,protocol);
IGESData_SpecificLib::SetGlobal (new IGESGeom_SpecificModule, protocol);
}
}
Handle(IGESGeom_Protocol) IGESGeom::Protocol ()
{
return protocol;
}

View File

@@ -0,0 +1,151 @@
--
-- File : BSplineCurve.cdl
-- Created : Sat 9 Jan 1993
-- Author : Kiran
--
---Copyright : MATRA-DATAVISION 1993
--
class BSplineCurve from IGESGeom inherits IGESEntity
---Purpose : defines IGESBSplineCurve, Type <126> Form <0-5>
-- in package IGESGeom
-- A parametric equation obtained by dividing two summations
-- involving weights (which are real numbers), the control
-- points, and B-Spline basis functions
uses
Pnt from gp,
XYZ from gp,
HArray1OfReal from TColStd,
HArray1OfXYZ from TColgp
raises DimensionMismatch, OutOfRange
is
Create returns mutable BSplineCurve;
-- Specific Methods pertaining to the class
Init (me : mutable;
anIndex : Integer;
aDegree : Integer;
aPlanar : Boolean;
aClosed : Boolean;
aPolynom : Boolean;
aPeriodic : Boolean;
allKnots : HArray1OfReal;
allWeights : HArray1OfReal;
allPoles : HArray1OfXYZ;
aUmin, aUmax : Real;
aNorm : XYZ)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- BSplineCurve. Beware about indexation of arrays
-- - anIndex : Upper index of the sum
-- - aDegree : Degree of basis functions
-- - aPlanar : 0 = nonplanar curve, 1 = planar curve
-- - aClosed : 0 = open curve, 1 = closed curve
-- - aPolynom : 0 = rational, 1 = polynomial
-- - aPeriodic : 0 = nonperiodic, 1 = periodic
-- - allKnots : Knot sequence values [-Degree,Index+1]
-- - allWeights : Array of weights [0,Index]
-- - allPoles : X, Y, Z coordinates of all control points
-- [0,Index]
-- - aUmin, aUmax : Starting and ending parameter values
-- - aNorm : Unit normal (if the curve is planar)
-- raises exception if allWeights & allPoles are not of same size.
SetFormNumber (me : mutable; form : Integer) raises OutOfRange;
---Purpose : Changes FormNumber (indicates the Shape of the Curve)
-- Error if not in range [0-5]
UpperIndex(me) returns Integer;
---Purpose : returns the upper index of the sum (see Knots,Poles)
Degree(me) returns Integer;
---Purpose : returns the degree of basis functions
IsPlanar(me) returns Boolean;
---Purpose : returns True if the curve is Planar, False if non-planar
IsClosed(me) returns Boolean;
---Purpose : returns True if the curve is closed, False if open
IsPolynomial(me; flag : Boolean = Standard_False) returns Boolean;
---Purpose : returns True if the curve is polynomial, False if rational
-- <flag> False (D) : computed from the list of weights
-- (all must be equal)
-- <flag> True : as recorded
IsPeriodic(me) returns Boolean;
---Purpose : returns True if the curve is periodic, False otherwise
NbKnots(me) returns Integer;
---Purpose : returns the number of knots (i.e. Degree + UpperIndex + 2)
Knot(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns the knot referred to by anIndex,
-- inside the range [-Degree,UpperIndex+1]
-- raises exception if
-- anIndex < -Degree() or anIndex > (NbKnots() - Degree())
-- Note : Knots are numbered from -Degree (not from 1)
NbPoles(me) returns Integer;
---Purpose : returns number of poles (i.e. UpperIndex + 1)
Weight(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns the weight referred to by anIndex, in [0,UpperIndex]
-- raises exception if anIndex < 0 or anIndex > UpperIndex()
Pole(me; anIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the pole referred to by anIndex, in [0,UpperIndex]
-- raises exception if anIndex < 0 or anIndex > UpperIndex()
TransformedPole(me; anIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the anIndex'th pole after applying Transf. Matrix
-- raises exception if an Index < 0 or an Index > UpperIndex()
UMin(me) returns Real;
---Purpose : returns starting parameter value
UMax(me) returns Real;
---Purpose : returns ending parameter value
Normal(me) returns XYZ;
---Purpose : if the curve is nonplanar then (0, 0, 0) is returned
fields
--
-- Class : IGESGeom_BSplineCurve
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class BSplineCurve.
--
-- Reminder : A BSplineCurve instance is defined by :
-- A parametric equation obtained by dividing two summations
-- involving weights (which are real numbers), the control
-- points, and B-Spline basis functions
theIndex : Integer; -- Upper index of the sum
theDegree : Integer;
isPlanar : Boolean;
isClosed : Boolean;
isPolynomial : Boolean;
isPeriodic : Boolean;
theKnots : HArray1OfReal;
theWeights : HArray1OfReal;
thePoles : HArray1OfXYZ;
theUmin : Real; -- Starting parameter value
theUmax : Real; -- Ending parameter value
theNorm : XYZ;
end BSplineCurve;

View File

@@ -0,0 +1,148 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_BSplineCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_BSplineCurve.ixx>
#include <Standard_OutOfRange.hxx>
#include <gp_GTrsf.hxx>
IGESGeom_BSplineCurve::IGESGeom_BSplineCurve () { }
void IGESGeom_BSplineCurve::Init
(const Standard_Integer anIndex,
const Standard_Integer aDegree, const Standard_Boolean aPlanar,
const Standard_Boolean aClosed, const Standard_Boolean aPolynom,
const Standard_Boolean aPeriodic,
const Handle(TColStd_HArray1OfReal)& allKnots,
const Handle(TColStd_HArray1OfReal)& allWeights,
const Handle(TColgp_HArray1OfXYZ)& allPoles,
const Standard_Real aUmin, const Standard_Real aUmax,
const gp_XYZ& aNorm)
{
if (!allPoles.IsNull()) {
if (allPoles->Length() != allWeights->Length())
Standard_DimensionMismatch::Raise("IGESGeom_BSplineCurve : Init");
if (allKnots->Lower() != -aDegree || allKnots->Upper() != anIndex+1 ||
allWeights->Upper() != anIndex ||
allWeights->Lower() != 0 || allPoles->Lower() != 0)
Standard_DimensionMismatch::Raise("IGESGeom_BSplineCurve : Init");
}
theIndex = anIndex;
theDegree = aDegree;
isPlanar = aPlanar;
isClosed = aClosed;
isPolynomial = aPolynom;
isPeriodic = aPeriodic;
theKnots = allKnots;
theWeights = allWeights;
thePoles = allPoles;
theUmin = aUmin;
theUmax = aUmax;
theNorm = aNorm;
InitTypeAndForm(126,FormNumber());
// FormNumber precises the shape 0-5
}
void IGESGeom_BSplineCurve::SetFormNumber (const Standard_Integer form)
{
if (form < 0 || form > 5) Standard_OutOfRange::Raise
("IGESGeom_BSplineCurve : SetFormNumber");
InitTypeAndForm(126,form);
}
Standard_Integer IGESGeom_BSplineCurve::UpperIndex () const
{
return theIndex;
}
Standard_Integer IGESGeom_BSplineCurve::Degree () const
{
return theDegree;
}
Standard_Boolean IGESGeom_BSplineCurve::IsPlanar () const
{
return isPlanar;
}
Standard_Boolean IGESGeom_BSplineCurve::IsClosed () const
{
return isClosed;
}
Standard_Boolean IGESGeom_BSplineCurve::IsPolynomial
(const Standard_Boolean flag) const
{
if (flag || theWeights.IsNull()) return isPolynomial;
Standard_Integer i, i1 = theWeights->Lower(), i2 = theWeights->Upper();
Standard_Real w0 = theWeights->Value(i1);
for (i = i1+1; i <= i2; i ++)
if (Abs (theWeights->Value(i) - w0) > 1.e-10) return Standard_False;
return Standard_True;
}
Standard_Boolean IGESGeom_BSplineCurve::IsPeriodic () const
{
return isPeriodic;
}
Standard_Integer IGESGeom_BSplineCurve::NbKnots () const
{
return (theKnots.IsNull() ? 0 : theKnots->Length());
}
Standard_Real IGESGeom_BSplineCurve::Knot
(const Standard_Integer anIndex) const
{
return theKnots->Value(anIndex);
}
Standard_Integer IGESGeom_BSplineCurve::NbPoles () const
{
return (thePoles.IsNull() ? 0 : thePoles->Length());
}
Standard_Real IGESGeom_BSplineCurve::Weight
(const Standard_Integer anIndex) const
{
return theWeights->Value(anIndex);
}
gp_Pnt IGESGeom_BSplineCurve::Pole (const Standard_Integer anIndex) const
{
gp_XYZ tempXYZ = thePoles->Value(anIndex);
gp_Pnt Pole(tempXYZ);
return Pole;
}
gp_Pnt IGESGeom_BSplineCurve::TransformedPole
(const Standard_Integer anIndex) const
{
gp_XYZ tempXYZ = thePoles->Value(anIndex);
if (HasTransf()) Location().Transforms(tempXYZ);
gp_Pnt Pole(tempXYZ);
return Pole;
}
Standard_Real IGESGeom_BSplineCurve::UMin () const
{
return theUmin;
}
Standard_Real IGESGeom_BSplineCurve::UMax () const
{
return theUmax;
}
gp_XYZ IGESGeom_BSplineCurve::Normal () const
{
return theNorm;
}

View File

@@ -0,0 +1,184 @@
--
-- File : BSplineSurface.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class BSplineSurface from IGESGeom inherits IGESEntity
---Purpose: defines IGESBSplineSurface, Type <128> Form <0-9>
-- in package IGESGeom
-- A parametric equation obtained by dividing two summations
-- involving weights (which are real numbers), the control
-- points, and B-Spline basis functions
uses
Pnt from gp,
HArray1OfReal from TColStd,
HArray2OfReal from TColStd,
HArray2OfXYZ from TColgp
raises DimensionMismatch, OutOfRange
is
Create returns mutable BSplineSurface;
-- Specific Methods pertaining to the class
Init (me : mutable;
anIndexU, anIndexV : Integer;
aDegU, aDegV : Integer;
aCloseU, aCloseV : Boolean;
aPolynom, aPeriodU, aPeriodV : Boolean;
allKnotsU, allKnotsV : HArray1OfReal;
allWeights : HArray2OfReal;
allPoles : HArray2OfXYZ;
aUmin, aUmax, aVmin, aVmax : Real)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- BSplineSurface
-- - anIndexU : Upper index of first sum
-- - anIndexV : Upper index of second sum
-- - aDegU, aDegV : Degrees of first and second sets
-- of basis functions
-- - aCloseU, aCloseV : 1 = Closed in U, V directions
-- 0 = open in U, V directions
-- - aPolynom : 0 = Rational, 1 = polynomial
-- - aPeriodU, aPeriodV : 0 = Non periodic in U or V direction
-- 1 = Periodic in U or V direction
-- - allKnotsU, allKnotsV : Knots in U and V directions
-- - allWeights : Array of weights
-- - allPoles : XYZ coordinates of all control points
-- - aUmin : Starting value of U direction
-- - aUmax : Ending value of U direction
-- - aVmin : Starting value of V direction
-- - aVmax : Ending value of V direction
-- raises exception if allWeights & allPoles are not of same size.
SetFormNumber (me : mutable; form : Integer) raises OutOfRange;
---Purpose : Changes FormNumber (indicates the Shape of the Surface)
-- Error if not in range [0-9]
UpperIndexU(me) returns Integer;
---Purpose : returns the upper index of the first sum (U)
UpperIndexV(me) returns Integer;
---Purpose : returns the upper index of the second sum (V)
DegreeU(me) returns Integer;
---Purpose : returns degree of first set of basis functions
DegreeV(me) returns Integer;
---Purpose : returns degree of second set of basis functions
IsClosedU(me) returns Boolean;
---Purpose : True if closed in U direction else False
IsClosedV(me) returns Boolean;
---Purpose : True if closed in V direction else False
IsPolynomial(me; flag : Boolean = Standard_False) returns Boolean;
---Purpose : True if polynomial, False if rational
-- <flag> False (D) : computed from Weights
-- <flag> True : recorded
IsPeriodicU(me) returns Boolean;
---Purpose : True if periodic in U direction else False
IsPeriodicV(me) returns Boolean;
---Purpose : True if periodic in V direction else False
NbKnotsU(me) returns Integer;
---Purpose : returns number of knots in U direction
-- KnotsU are numbered from -DegreeU
NbKnotsV(me) returns Integer;
---Purpose : returns number of knots in V direction
-- KnotsV are numbered from -DegreeV
KnotU(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns the value of knot referred to by anIndex in U direction
-- raises exception if
-- anIndex < -DegreeU() or anIndex > (NbKnotsU() - DegreeU())
KnotV(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns the value of knot referred to by anIndex in V direction
-- raises exception if
-- anIndex < -DegreeV() or anIndex > (NbKnotsV() - DegreeV())
NbPolesU(me) returns Integer;
---Purpose : returns number of poles in U direction
NbPolesV(me) returns Integer;
---Purpose : returns number of poles in V direction
Weight(me; anIndex1, anIndex2 : Integer) returns Real
raises OutOfRange;
---Purpose : returns the weight referred to by anIndex1, anIndex2
-- raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU()
-- or if anIndex2 <= 0 or anIndex2 > NbPolesV()
Pole(me; anIndex1, anIndex2 : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the control point referenced by anIndex1, anIndex2
-- raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU()
-- or if anIndex2 <= 0 or anIndex2 > NbPolesV()
TransformedPole(me; anIndex1, anIndex2 : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the control point referenced by anIndex1, anIndex2
-- after applying the Transf.Matrix
-- raises exception if anIndex1 <= 0 or anIndex1 > NbPolesU()
-- or if anIndex2 <= 0 or anIndex2 > NbPolesV()
UMin(me) returns Real;
---Purpose : returns starting value in the U direction
UMax(me) returns Real;
---Purpose : returns ending value in the U direction
VMin(me) returns Real;
---Purpose : returns starting value in the V direction
VMax(me) returns Real;
---Purpose : returns ending value in the V direction
fields
--
-- Class : IGESGeom_BSplineSurface
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class BSplineSurface.
--
-- Reminder : A BSplineSurface instance is defined by :
-- A parametric equation obtained by dividing two summations
-- involving weights (which are real numbers), the control
-- points, and B-Spline basis functions
theIndexU : Integer;
theIndexV : Integer;
theDegreeU : Integer;
theDegreeV : Integer;
isClosedU : Boolean;
isClosedV : Boolean;
isPolynomial : Boolean;
isPeriodicU : Boolean;
isPeriodicV : Boolean;
theKnotsU : HArray1OfReal;
theKnotsV : HArray1OfReal;
theWeights : HArray2OfReal;
thePoles : HArray2OfXYZ;
theUmin : Real; -- Starting value for 1st parameter direction
theUmax : Real; -- Ending value for 1st parameter direction
theVmin : Real; -- Starting value for 2nd parameter direction
theVmax : Real; -- Ending value for 2nd parameter direction
end BSplineSurface;

View File

@@ -0,0 +1,198 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_BSplineSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_BSplineSurface.ixx>
#include <Standard_OutOfRange.hxx>
#include <gp_GTrsf.hxx>
IGESGeom_BSplineSurface::IGESGeom_BSplineSurface () { }
void IGESGeom_BSplineSurface::Init
(const Standard_Integer anIndexU,
const Standard_Integer anIndexV, const Standard_Integer aDegU,
const Standard_Integer aDegV, const Standard_Boolean aCloseU,
const Standard_Boolean aCloseV, const Standard_Boolean aPolynom,
const Standard_Boolean aPeriodU, const Standard_Boolean aPeriodV,
const Handle(TColStd_HArray1OfReal)& allKnotsU,
const Handle(TColStd_HArray1OfReal)& allKnotsV,
const Handle(TColStd_HArray2OfReal)& allWeights,
const Handle(TColgp_HArray2OfXYZ)& allPoles,
const Standard_Real aUmin, const Standard_Real aUmax,
const Standard_Real aVmin, const Standard_Real aVmax)
{
if (allWeights->RowLength() != allPoles->RowLength() ||
allWeights->ColLength() != allPoles->ColLength())
Standard_DimensionMismatch::Raise("IGESGeom_BSplineSurface : Init");
if (allKnotsU->Lower() != -aDegU || allKnotsV->Lower() != -aDegV ||
allKnotsU->Upper() != anIndexU+1 || allKnotsV->Upper() != anIndexV+1 ||
allWeights->LowerRow() != 0 || allWeights->LowerCol() != 0 ||
allPoles->LowerRow() != 0 || allPoles->LowerCol() != 0 ||
allPoles->UpperRow() != anIndexU || allPoles->UpperCol() != anIndexV)
Standard_DimensionMismatch::Raise("IGESGeom_BSplineSurface : Init");
theIndexU = anIndexU;
theIndexV = anIndexV;
theDegreeU = aDegU;
theDegreeV = aDegV;
isClosedU = aCloseU;
isClosedV = aCloseV;
isPolynomial = aPolynom;
isPeriodicU = aPeriodU;
isPeriodicV = aPeriodV;
theKnotsU = allKnotsU;
theKnotsV = allKnotsV;
theWeights = allWeights;
thePoles = allPoles;
theUmin = aUmin;
theUmax = aUmax;
theVmin = aVmin;
theVmax = aVmax;
InitTypeAndForm(128,FormNumber());
// FormNumber precises the shape 0-9
}
void IGESGeom_BSplineSurface::SetFormNumber (const Standard_Integer form)
{
if (form < 0 || form > 9) Standard_OutOfRange::Raise
("IGESGeom_BSplineSurface : SetFormNumber");
InitTypeAndForm(128,form);
}
Standard_Integer IGESGeom_BSplineSurface::UpperIndexU () const
{
return theIndexU;
}
Standard_Integer IGESGeom_BSplineSurface::UpperIndexV () const
{
return theIndexV;
}
Standard_Integer IGESGeom_BSplineSurface::DegreeU () const
{
return theDegreeU;
}
Standard_Integer IGESGeom_BSplineSurface::DegreeV () const
{
return theDegreeV;
}
Standard_Boolean IGESGeom_BSplineSurface::IsClosedU () const
{
return isClosedU;
}
Standard_Boolean IGESGeom_BSplineSurface::IsClosedV () const
{
return isClosedV;
}
Standard_Boolean IGESGeom_BSplineSurface::IsPolynomial
(const Standard_Boolean flag) const
{
if (flag) return isPolynomial;
Standard_Integer i,j;
Standard_Real w0 = theWeights->Value(0,0);
for ( j = 0; j < theIndexV; j ++)
for (i = 0; i < theIndexU; i ++)
if (Abs(theWeights->Value(i,j) - w0) > 1.e-10) return Standard_False;
return Standard_True;
}
Standard_Boolean IGESGeom_BSplineSurface::IsPeriodicU () const
{
return isPeriodicU;
}
Standard_Boolean IGESGeom_BSplineSurface::IsPeriodicV () const
{
return isPeriodicV;
}
Standard_Integer IGESGeom_BSplineSurface::NbKnotsU () const
{
return theKnotsU->Length();
}
Standard_Integer IGESGeom_BSplineSurface::NbKnotsV () const
{
return theKnotsV->Length();
}
Standard_Real IGESGeom_BSplineSurface::KnotU
(const Standard_Integer anIndex) const
{
return theKnotsU->Value(anIndex);
}
Standard_Real IGESGeom_BSplineSurface::KnotV
(const Standard_Integer anIndex) const
{
return theKnotsV->Value(anIndex);
}
Standard_Integer IGESGeom_BSplineSurface::NbPolesU () const
{
return theIndexU+1;
}
Standard_Integer IGESGeom_BSplineSurface::NbPolesV () const
{
return theIndexV+1;
}
Standard_Real IGESGeom_BSplineSurface::Weight
(const Standard_Integer anIndex1, const Standard_Integer anIndex2) const
{
return theWeights->Value(anIndex1, anIndex2);
}
gp_Pnt IGESGeom_BSplineSurface::Pole
(const Standard_Integer anIndex1, const Standard_Integer anIndex2) const
{
gp_XYZ tempXYZ = thePoles->Value(anIndex1,anIndex2);
// Reversal of the order of indices since the poles are
// stored in the array like that. See ReadOwnParams()
gp_Pnt Pole(tempXYZ);
return Pole;
}
gp_Pnt IGESGeom_BSplineSurface::TransformedPole
(const Standard_Integer anIndex1, const Standard_Integer anIndex2) const
{
gp_XYZ tempXYZ = thePoles->Value(anIndex1, anIndex2);
// Reversal of the order of indices since the poles are
// stored in the array like that. See ReadOwnParams()
if (HasTransf()) Location().Transforms(tempXYZ);
gp_Pnt Pole(tempXYZ);
return Pole;
}
Standard_Real IGESGeom_BSplineSurface::UMin () const
{
return theUmin;
}
Standard_Real IGESGeom_BSplineSurface::UMax () const
{
return theUmax;
}
Standard_Real IGESGeom_BSplineSurface::VMin () const
{
return theVmin;
}
Standard_Real IGESGeom_BSplineSurface::VMax () const
{
return theVmax;
}

View File

@@ -0,0 +1,120 @@
--
-- File : Boundary.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen (Kiran)
--
---Copyright : MATRA-DATAVISION 1993
--
class Boundary from IGESGeom inherits IGESEntity
---Purpose: defines IGESBoundary, Type <141> Form <0>
-- in package IGESGeom
-- A boundary entity identifies a surface boundary consisting
-- of a set of curves lying on the surface
uses
HArray1OfInteger from TColStd,
HArray1OfIGESEntity from IGESData,
HArray1OfHArray1OfIGESEntity from IGESBasic
raises DimensionMismatch, OutOfRange
is
Create returns mutable Boundary;
-- Specific Methods pertaining to the class
Init (me : mutable;
aType : Integer;
aPreference : Integer;
aSurface : IGESEntity;
allModelCurves : HArray1OfIGESEntity;
allSenses : HArray1OfInteger;
allParameterCurves : HArray1OfHArray1OfIGESEntity)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- Boundary
-- - aType : Type of bounded surface representation
-- - aPreference : Preferred representation of
-- Trimming Curve
-- - aSurface : Untrimmed surface to be bounded
-- - allModelCurves : Model Space Curves
-- - allSenses : Orientation flags of all Model Space
-- Curves
-- - allParameterCurves : Parameter Space Curves
-- raises exception if allSenses, allModelCurves and
-- allParameterCurves do not have same dimensions
BoundaryType (me) returns Integer;
---Purpose : returns type of bounded surface representation
-- 0 = Boundary entities may only reference model space trimming
-- curves. Associated surface representation may be parametric
-- 1 = Boundary entities must reference model space curves and
-- associated parameter space curve collections. Associated
-- surface must be a parametric representation
PreferenceType (me) returns Integer;
---Purpose : returns preferred representation of trimming curves
-- 0 = Unspecified
-- 1 = Model space
-- 2 = Parameter space
-- 3 = Representations are of equal preference
Surface (me) returns IGESEntity;
---Purpose : returns the surface to be bounded
NbModelSpaceCurves (me) returns Integer;
---Purpose : returns the number of model space curves
ModelSpaceCurve (me; Index : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns Model Space Curve
-- raises exception if Index <= 0 or Index > NbModelSpaceCurves()
Sense(me; Index: Integer) returns Integer
raises OutOfRange;
---Purpose : returns the sense of a particular model space curve
-- 1 = model curve direction does not need reversal
-- 2 = model curve direction needs to be reversed
-- raises exception if Index <= 0 or Index > NbModelSpaceCurves()
NbParameterCurves (me; Index : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the number of parameter curves associated with one
-- model space curve referred to by Index
-- raises exception if Index <= 0 or Index > NbModelSpaceCurves()
ParameterCurves (me; Index : Integer) returns HArray1OfIGESEntity
raises OutOfRange;
---Purpose : returns an array of parameter space curves associated with
-- a model space curve referred to by the Index
-- raises exception if Index <= 0 or Index > NbModelSpaceCurves()
ParameterCurve (me; Index, Num: Integer) returns mutable IGESEntity
raises OutOfRange;
---Purpose : returns an individual parameter curve
-- raises exception if Index or Num is out of range
fields
--
-- Class : IGESGeom_Boundary
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class Boundary.
--
-- Reminder : A Boundary instance is defined by :
-- A surface boundary consisting of a set of curves lying
-- on the surface
theType : Integer;
thePreference : Integer;
theSurface : IGESEntity;
theModelCurves : HArray1OfIGESEntity;
theSenses : HArray1OfInteger;
theParameterCurves : HArray1OfHArray1OfIGESEntity;
end Boundary;

View File

@@ -0,0 +1,88 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Boundary.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_Boundary.ixx>
IGESGeom_Boundary::IGESGeom_Boundary () { }
void IGESGeom_Boundary::Init
(const Standard_Integer aType,
const Standard_Integer aPreference,
const Handle(IGESData_IGESEntity)& aSurface,
const Handle(IGESData_HArray1OfIGESEntity)& allModelCurves,
const Handle(TColStd_HArray1OfInteger)& allSenses,
const Handle(IGESBasic_HArray1OfHArray1OfIGESEntity)& allParameterCurves)
{
Standard_Integer num1 = allSenses->Length();
if ( allSenses->Lower() != 1 ||
(allModelCurves->Lower() != 1 || allModelCurves->Length() != num1) ||
(allParameterCurves->Lower() != 1 || allParameterCurves->Length() != num1))
Standard_DimensionMismatch::Raise("IGESGeom_Boundary: Init");
theType = aType;
thePreference = aPreference;
theSurface = aSurface;
theModelCurves = allModelCurves;
theSenses = allSenses;
theParameterCurves = allParameterCurves;
InitTypeAndForm(141,0);
}
Standard_Integer IGESGeom_Boundary::BoundaryType () const
{
return theType;
}
Standard_Integer IGESGeom_Boundary::PreferenceType () const
{
return thePreference;
}
Handle(IGESData_IGESEntity) IGESGeom_Boundary::Surface () const
{
return theSurface;
}
Standard_Integer IGESGeom_Boundary::NbModelSpaceCurves () const
{
return theModelCurves->Length();
}
Standard_Integer IGESGeom_Boundary::Sense (const Standard_Integer Index) const
{
return theSenses->Value(Index);
}
Handle(IGESData_IGESEntity) IGESGeom_Boundary::ModelSpaceCurve
(const Standard_Integer Index) const
{
return theModelCurves->Value(Index);
}
Standard_Integer IGESGeom_Boundary::NbParameterCurves
(const Standard_Integer Index) const
{
if (theParameterCurves->Value(Index).IsNull()) return 0;
return theParameterCurves->Value(Index)->Length();
}
Handle(IGESData_HArray1OfIGESEntity) IGESGeom_Boundary::ParameterCurves
(const Standard_Integer Index) const
{
return theParameterCurves->Value(Index);
}
Handle(IGESData_IGESEntity) IGESGeom_Boundary::ParameterCurve
(const Standard_Integer Index, const Standard_Integer Num) const
{
return theParameterCurves->Value(Index)->Value(Num);
}

View File

@@ -0,0 +1,73 @@
--
-- File : BoundedSurface.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen (Kiran)
--
---Copyright : MATRA-DATAVISION 1993
--
class BoundedSurface from IGESGeom inherits IGESEntity
---Purpose: defines BoundedSurface, Type <143> Form <0>
-- in package IGESGeom
-- A bounded surface is used to communicate trimmed
-- surfaces. The surface and trimming curves are assumed
-- to be represented parametrically.
uses
Boundary from IGESGeom,
HArray1OfBoundary from IGESGeom
raises OutOfRange
is
Create returns mutable BoundedSurface;
-- Specific Methods pertaining to the class
Init (me : mutable;
aType : Integer;
aSurface : IGESEntity;
allBounds : HArray1OfBoundary);
---Purpose : This method is used to set the fields of the class
-- BoundedSurface
-- - aType : Type of bounded surface representation
-- - aSurface : Surface entity to be bounded
-- - allBounds : Array of boundary entities
RepresentationType (me) returns Integer;
---Purpose : returns the type of Bounded surface representation
-- 0 = The boundary entities may only reference model space curves
-- 1 = The boundary entities may reference both model space curves
-- and associated parameter space curve representations
Surface (me) returns IGESEntity;
---Purpose : returns the bounded surface
NbBoundaries (me) returns Integer;
---Purpose : returns the number of boundaries
Boundary (me; Index : Integer) returns Boundary
raises OutOfRange;
---Purpose : returns boundary entity
-- raises exception if Index <= 0 or Index > NbBoundaries()
fields
--
-- Class : IGESGeom_BoundedSurface
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class BoundedSurface.
--
-- Reminder : A BoundedSurface instance is defined by :
-- The type of bounded surface representation, the surface
-- entity bounded and a collection of boundary entities
theType : Integer;
theSurface : IGESEntity;
theBoundaries : HArray1OfBoundary;
end BoundedSurface;

View File

@@ -0,0 +1,49 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_BoundedSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_BoundedSurface.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESGeom_BoundedSurface::IGESGeom_BoundedSurface () { }
void IGESGeom_BoundedSurface::Init
(const Standard_Integer aType,
const Handle(IGESData_IGESEntity)& aSurface,
const Handle(IGESGeom_HArray1OfBoundary)& aBoundary)
{
if (aBoundary->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESGeom_BoundedSurface : Init");
theType = aType;
theSurface = aSurface;
theBoundaries = aBoundary;
InitTypeAndForm(143,0);
}
Standard_Integer IGESGeom_BoundedSurface::RepresentationType () const
{
return theType;
}
Handle(IGESData_IGESEntity) IGESGeom_BoundedSurface::Surface () const
{
return theSurface;
}
Standard_Integer IGESGeom_BoundedSurface::NbBoundaries () const
{
return theBoundaries->Length();
}
Handle(IGESGeom_Boundary) IGESGeom_BoundedSurface::Boundary
(const Standard_Integer Index) const
{
return theBoundaries->Value(Index);
}

View File

@@ -0,0 +1,97 @@
--
-- File : CircularArc.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class CircularArc from IGESGeom inherits IGESEntity
---Purpose: defines IGESCircularArc, Type <100> Form <0>
-- in package IGESGeom
-- A circular arc is a connected portion of a parent circle
-- which consists of more than one point. The definition space
-- coordinate system is always chosen so that the circular arc
-- remains in a plane either coincident with or parallel to
-- the XT, YT plane.
uses
XY from gp,
Dir2d from gp,
Dir from gp,
Pnt from gp,
Pnt2d from gp
is
Create returns mutable CircularArc;
-- Specific Methods pertaining to the class
Init (me : mutable; aZT : Real; aCenter, aStart, anEnd : XY);
---Purpose : This method is used to set the fields of the class
-- CircularArc
-- - aZT : Shift above the Z plane
-- - aCenter : Center of the circle of which the arc forms a part
-- - aStart : Starting point of the circular arc
-- - anEnd : Ending point of the circular arc
Center(me) returns Pnt2d;
---Purpose : returns the center of the circle of which arc forms a part
TransformedCenter(me) returns Pnt;
---Purpose : returns the center of the circle of which arc forms a part
-- after applying Transf. Matrix
StartPoint(me) returns Pnt2d;
---Purpose : returns the start point of the arc
TransformedStartPoint(me) returns Pnt;
---Purpose : returns the start point of the arc after applying Transf. Matrix
ZPlane(me) returns Real;
---Purpose : returns the parallel displacement of the plane containing the
-- arc from the XT, YT plane
EndPoint(me) returns Pnt2d;
---Purpose : returns the end point of the arc
TransformedEndPoint(me) returns Pnt;
---Purpose : returns the end point of the arc after applying Transf. Matrix
Radius(me) returns Real;
---Purpose : returns the radius of the circle of which arc forms a part
Angle(me) returns Real;
---Purpose : returns the angle subtended by the arc at the center in radians
Axis(me) returns Dir;
---Purpose : Z-Axis of circle (i.e. [0,0,1])
TransformedAxis (me) returns Dir;
---Purpose : Z-Axis after applying Trans. Matrix
IsClosed(me) returns Boolean;
---Purpose : True if StartPoint = EndPoint
fields
--
-- Class : IGESGeom_CircularArc
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class CircularArc.
--
-- Reminder : A CircularArc instance is defined by :
-- The center of a circle of which it forms a part
-- the plane in which it lies, the starting point
-- and ending point coordinates
theZT : Real;
theCenter : XY;
theStart : XY;
theEnd : XY;
end CircularArc;

View File

@@ -0,0 +1,124 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CircularArc.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_CircularArc.ixx>
#include <gp_Dir2d.hxx>
#include <gp_GTrsf.hxx>
IGESGeom_CircularArc::IGESGeom_CircularArc () { }
void IGESGeom_CircularArc::Init
(const Standard_Real aZT, const gp_XY& aCenter,
const gp_XY& aStart, const gp_XY& anEnd)
{
theZT = aZT;
theCenter = aCenter;
theStart = aStart;
theEnd = anEnd;
InitTypeAndForm(100,0);
}
gp_Pnt2d IGESGeom_CircularArc::Center () const
{
gp_Pnt2d Center(theCenter);
return Center;
}
gp_Pnt IGESGeom_CircularArc::TransformedCenter () const
{
gp_XYZ Center(theCenter.X(), theCenter.Y(), theZT);
if (HasTransf()) Location().Transforms(Center);
gp_Pnt transCenter(Center);
return transCenter;
}
gp_Pnt2d IGESGeom_CircularArc::StartPoint () const
{
gp_Pnt2d Start(theStart);
return Start;
}
gp_Pnt IGESGeom_CircularArc::TransformedStartPoint () const
{
gp_XYZ Start(theStart.X(), theStart.Y(), theZT);
if (HasTransf()) Location().Transforms(Start);
gp_Pnt transStart(Start);
return transStart;
}
Standard_Real IGESGeom_CircularArc::ZPlane () const
{
return theZT;
}
gp_Pnt2d IGESGeom_CircularArc::EndPoint () const
{
gp_Pnt2d End(theEnd);
return End;
}
gp_Pnt IGESGeom_CircularArc::TransformedEndPoint () const
{
gp_XYZ End(theEnd.X(), theEnd.Y(), theZT);
if (HasTransf()) Location().Transforms(End);
gp_Pnt transEnd(End);
return transEnd;
}
Standard_Real IGESGeom_CircularArc::Radius () const
{
Standard_Real x1, y1, x2, y2;
x1 = theStart.X();
y1 = theStart.Y();
x2 = theCenter.X();
y2 = theCenter.Y();
Standard_Real radius = Sqrt(Square(x2 - x1) + Square(y2 - y1));
return radius;
}
Standard_Real IGESGeom_CircularArc::Angle () const
{
Standard_Real x1, y1, x2, y2, xc, yc;
xc = theCenter.X();
yc = theCenter.Y();
x1 = theStart.X();
y1 = theStart.Y();
x2 = theEnd.X();
y2 = theEnd.Y();
gp_Dir2d dir1(x1-xc, y1-yc); // After shifting the centre of
// arc to the origin
gp_Dir2d dir2(x2-xc, y2-yc); // After shifting the centre of
// arc to the origin
Standard_Real t = dir1.Angle(dir2);
return t + (t > 0 ? 0 : 2*PI);
}
gp_Dir IGESGeom_CircularArc::Axis () const
{
gp_Dir axis(0.0 , 0.0, 1.0);
return axis;
}
gp_Dir IGESGeom_CircularArc::TransformedAxis () const
{
gp_XYZ axis(0.0 , 0.0, 1.0);
if (!HasTransf()) return gp_Dir(axis);
gp_GTrsf loc = Location();
loc.SetTranslationPart (gp_XYZ(0.,0.,0.));
loc.Transforms(axis);
return gp_Dir(axis);
}
Standard_Boolean IGESGeom_CircularArc::IsClosed () const
{
return ((theStart.X() == theEnd.X()) && (theStart.Y() == theEnd.Y()));
}

View File

@@ -0,0 +1,58 @@
--
-- File : CompositeCurve.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen (Kiran)
--
---Copyright : MATRA-DATAVISION 1993
--
class CompositeCurve from IGESGeom inherits IGESEntity
---Purpose: defines IGESCompositeCurve, Type <102> Form <0>
-- in package IGESGeom
-- A composite curve is defined as an ordered list of entities
-- consisting of a point, connect point and parametrised curve
-- entities (excluding the CompositeCurve entity).
uses
HArray1OfIGESEntity from IGESData
raises OutOfRange
is
Create returns mutable CompositeCurve;
-- Specific Methods pertaining to the class
Init (me : mutable;
allEntities : HArray1OfIGESEntity);
---Purpose : This method is used to set the fields of the class
-- CompositeCurve
-- - allEntities : Constituent Entities of the composite curve
NbCurves (me) returns Integer;
---Purpose : returns the number of curves contained in the CompositeCurve
Curve (me; Index : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns Component of the CompositeCurve (a curve or a point)
-- raises exception if Index <= 0 or Index > NbCurves()
fields
--
-- Class : IGESGeom_CompositeCurve
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class CompositeCurve.
--
-- Reminder : A CompositeCurve instance is defined by :
-- The collection of constituent curves which could
-- be of type point, connect point or parametric curve
-- entities
theEntities : HArray1OfIGESEntity;
end CompositeCurve;

View File

@@ -0,0 +1,35 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CompositeCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_CompositeCurve.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESGeom_CompositeCurve::IGESGeom_CompositeCurve () { }
void IGESGeom_CompositeCurve::Init
(const Handle(IGESData_HArray1OfIGESEntity)& allEntities)
{
if (!allEntities.IsNull() && allEntities->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESGeom_CompositeCurve : Init");
theEntities = allEntities;
InitTypeAndForm(102,0);
}
Standard_Integer IGESGeom_CompositeCurve::NbCurves () const
{
return (theEntities.IsNull() ? 0 : theEntities->Length());
}
Handle(IGESData_IGESEntity) IGESGeom_CompositeCurve::Curve
(const Standard_Integer Index) const
{
return theEntities->Value(Index);
}

View File

@@ -0,0 +1,144 @@
--
-- File : ConicArc.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen (Kiran)
--
---Copyright : MATRA-DATAVISION 1993
--
class ConicArc from IGESGeom inherits IGESEntity
---Purpose: defines IGESConicArc, Type <104> Form <0-3> in package IGESGeom
-- A conic arc is a bounded connected portion of a parent
-- conic curve which consists of more than one point. The
-- parent conic curve is either an ellipse, a parabola, or
-- a hyperbola. The definition space coordinate system is
-- always chosen so that the conic arc lies in a plane either
-- coincident with or parallel to XT, YT plane. Within such
-- a plane a conic is defined by the six coefficients in the
-- following equation.
-- A*XT^2 + B*XT*YT + C*YT^2 + D*XT + E*YT + F = 0
uses
Pnt from gp,
Pnt2d from gp,
Dir from gp,
XY from gp
is
Create returns mutable ConicArc;
-- Specific Methods pertaining to the class
Init (me : mutable;
A, B, C, D, E, F, ZT : Real;
aStart, anEnd : XY);
---Purpose : This method is used to set the fields of the class
-- ConicalArc
-- - A, B, C, D, E, F : Coefficients of the equation
-- defining conic arc
-- - ZT : Parallel ZT displacement of the arc
-- from XT, YT plane.
-- - aStart : Starting point of the conic arc
-- - anEnd : End point of the conic arc
OwnCorrect (me : mutable) returns Boolean;
---Purpose : sets the Form Number equal to ComputedFormNumber,
-- returns True if changed
ComputedFormNumber (me) returns Integer;
---Purpose : Computes the Form Number according to the equation
-- 1 for Ellipse, 2 for Hyperbola, 3 for Parabola
Equation (me; A, B, C, D, E, F : out Real);
-- returns the basic equation defining the arc
-- A, B, C, D, E, F are the coefficients of the equation
ZPlane (me) returns Real;
---Purpose : returns the Z displacement of the arc from XT, YT plane
StartPoint (me) returns Pnt2d;
---Purpose : returns the starting point of the arc
TransformedStartPoint (me) returns Pnt;
---Purpose : returns the starting point of the arc after applying
-- Transf. Matrix
EndPoint (me) returns Pnt2d;
---Purpose : returns the end point of the arc
TransformedEndPoint (me) returns Pnt;
---Purpose : returns the end point of the arc after applying
-- Transf. Matrix
IsFromEllipse (me) returns Boolean;
---Purpose : returns True if parent conic curve is an ellipse
IsFromParabola (me) returns Boolean;
---Purpose : returns True if parent conic curve is a parabola
IsFromHyperbola (me) returns Boolean;
---Purpose : returns True if parent conic curve is a hyperbola
IsClosed (me) returns Boolean;
---Purpose : returns True if StartPoint = EndPoint
Axis(me) returns Dir;
---Purpose : Z-Axis of conic (i.e. [0,0,1])
TransformedAxis (me) returns Dir;
---Purpose : Z-Axis after applying Trans. Matrix
Definition (me; Center : out Pnt; MainAxis : out Dir;
rmin, rmax : out Real);
---Purpose : Returns a Definition computed from equation, easier to use
-- <Center> : the center of the the conic (meaningless for
-- a parabola) (defined with Z displacement)
-- <MainAxis> : the Main Axis of the conic (for a Circle,
-- arbitrary the X Axis)
-- <Rmin,Rmax> : Minor and Major Radii of the conic
-- For a Circle, Rmin = Rmax,
-- For a Parabola, Rmin = Rmax = the Focal
-- Warning : the basic definition (by equation) is not very stable,
-- limit cases may be approximative
TransformedDefinition (me; Center : out Pnt; MainAxis : out Dir;
rmin, rmax : out Real);
---Purpose : Same as Definition, but the Location is applied on the
-- Center and the MainAxis
ComputedDefinition (me; Xcen,Ycen, Xax, Yax, Rmin,Rmax : out Real);
---Purpose : Computes and returns the coordinates of the definition of
-- a comic from its equation. Used by Definition &
-- TransformedDefinition, or may be called directly if needed
fields
--
-- Class : IGESGeom_ConicArc
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class ConicArc.
--
-- Reminder : A ConicArc instance is defined by :
-- The six coefficients in the following equation.
-- A*XT^2 + B*XT*YT + C*YT^2 + D*XT + E*YT + F = 0
-- The parent curve could be a parabola or a hyperbola
-- or an ellipse. The arc has one start and one end point.
theA : Real;
theB : Real;
theC : Real;
theD : Real;
theE : Real;
theF : Real;
-- Conic coefficients
theZT : Real;
theStart : XY;
theEnd : XY;
end ConicArc;

View File

@@ -0,0 +1,292 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_ConicArc.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
//#59 rln 29.12.98 PRO17015
#include <IGESGeom_ConicArc.ixx>
#include <gp_Dir2d.hxx>
#include <gp_GTrsf.hxx>
IGESGeom_ConicArc::IGESGeom_ConicArc () { }
void IGESGeom_ConicArc::Init
(const Standard_Real A, const Standard_Real B,
const Standard_Real C, const Standard_Real D, const Standard_Real E,
const Standard_Real F, const Standard_Real ZT, const gp_XY& aStart,
const gp_XY& anEnd)
{
theA = A;
theB = B;
theC = C;
theD = D;
theE = E;
theF = F;
theZT = ZT;
theStart = aStart;
theEnd = anEnd;
Standard_Integer fn = FormNumber();
if (fn == 0) fn = ComputedFormNumber();
InitTypeAndForm(104,fn);
}
Standard_Boolean IGESGeom_ConicArc::OwnCorrect ()
{
Standard_Integer cfn = ComputedFormNumber();
if (FormNumber() == cfn) return Standard_False;
InitTypeAndForm(104,cfn);
return Standard_True;
}
void IGESGeom_ConicArc::Equation
(Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D,
Standard_Real& E, Standard_Real& F) const
{
A = theA;
B = theB;
C = theC;
D = theD;
E = theE;
F = theF;
}
Standard_Real IGESGeom_ConicArc::ZPlane () const
{
return theZT;
}
gp_Pnt2d IGESGeom_ConicArc::StartPoint () const
{
gp_Pnt2d start(theStart.X(), theStart.Y());
return start;
}
gp_Pnt IGESGeom_ConicArc::TransformedStartPoint () const
{
gp_XYZ start(theStart.X(), theStart.Y(), theZT);
if (HasTransf()) Location().Transforms(start);
gp_Pnt transStart(start);
return transStart;
}
gp_Pnt2d IGESGeom_ConicArc::EndPoint () const
{
gp_Pnt2d end(theEnd.X(), theEnd.Y());
return end;
}
gp_Pnt IGESGeom_ConicArc::TransformedEndPoint () const
{
gp_XYZ end(theEnd.X(), theEnd.Y(), theZT);
if (HasTransf()) Location().Transforms(end);
gp_Pnt transEnd(end);
return transEnd;
}
Standard_Integer IGESGeom_ConicArc::ComputedFormNumber () const
{
Standard_Real eps,eps2,eps4;
eps = 1.E-08; eps2 = eps*eps; eps4 = eps2*eps2;//#59 rln
Standard_Real Q1 = theA * (theC*theF - theE*theE/4.)
+ theB/2. * (theE*theD/4. - theB*theF/2.)
+ theD/2. * (theB*theE/4. - theC*theD/2.);
Standard_Real Q2 = theA*theC - theB*theB/4;
Standard_Real Q3 = theA + theC;
// Resultats
//#59 rln 29.12.98 PRO17015 face#67, ellipse
//each Qi has its own dimension:
//[Q1] = L^-4, [Q2]=L^-4, [Q3]=L^-2
if (Q2 > eps4 && Q1*Q3 < 0 ) return 1; // Ellipse
if (Q2 < -eps4 && Abs (Q1) > eps4) return 2; // Hyperbola
if (Abs (Q2) <= eps4 && Abs (Q1) > eps4) return 3; // Parabola
return 0;
}
Standard_Boolean IGESGeom_ConicArc::IsFromParabola () const
{
Standard_Integer fn = FormNumber();
if (fn == 0) fn = ComputedFormNumber();
return (fn == 3);
}
Standard_Boolean IGESGeom_ConicArc::IsFromEllipse () const
{
Standard_Integer fn = FormNumber();
if (fn == 0) fn = ComputedFormNumber();
return (fn == 1);
}
Standard_Boolean IGESGeom_ConicArc::IsFromHyperbola () const
{
Standard_Integer fn = FormNumber();
if (fn == 0) fn = ComputedFormNumber();
return (fn == 2);
}
Standard_Boolean IGESGeom_ConicArc::IsClosed () const
{
return ((theStart.X() == theEnd.X()) && (theStart.Y() == theEnd.Y()));
}
gp_Dir IGESGeom_ConicArc::Axis () const
{
gp_Dir axis(0.0 , 0.0, 1.0);
return axis;
}
// Valeurs calculees
gp_Dir IGESGeom_ConicArc::TransformedAxis () const
{
gp_XYZ axis(0.0 , 0.0, 1.0);
if (!HasTransf()) return gp_Dir(axis);
gp_GTrsf loc = Location();
loc.SetTranslationPart (gp_XYZ(0.,0.,0.));
loc.Transforms(axis);
return gp_Dir(axis);
}
void IGESGeom_ConicArc::Definition
(gp_Pnt& Center, gp_Dir& MainAxis,
Standard_Real& Rmin, Standard_Real& Rmax) const
{
Standard_Real Xcen,Ycen, Xax,Yax;
ComputedDefinition (Xcen,Ycen, Xax,Yax, Rmin,Rmax);
Center.SetCoord (Xcen,Ycen,theZT);
MainAxis.SetCoord (Xax,Yax,0.);
}
void IGESGeom_ConicArc::TransformedDefinition
(gp_Pnt& Center, gp_Dir& MainAxis,
Standard_Real& Rmin, Standard_Real& Rmax) const
{
if (!HasTransf()) {
Definition (Center,MainAxis,Rmin,Rmax);
return;
}
Standard_Real Xcen,Ycen, Xax,Yax;
ComputedDefinition (Xcen,Ycen, Xax,Yax, Rmin,Rmax);
gp_GTrsf loc = Location();
gp_XYZ cen (Xcen,Ycen,theZT);
gp_XYZ axis (Xax, Yax, 0.);
loc.Transforms (cen);
loc.SetTranslationPart (gp_XYZ(0.,0.,0.));
loc.Transforms (axis);
Center.SetCoord (cen.X(), cen.Y(), cen.Z() );
MainAxis.SetCoord (axis.X(),axis.Y(),axis.Z());
}
void IGESGeom_ConicArc::ComputedDefinition
(Standard_Real& Xcen, Standard_Real& Ycen,
Standard_Real& Xax, Standard_Real& Yax,
Standard_Real& Rmin, Standard_Real& Rmax) const
{
Standard_Real a,b,c,d,e,f;
// conic : a*x2 + 2*b*x*y + c*y2 + 2*d*x + 2*e*y + f = 0.
Equation (a,b,c,d,e,f);
b = b/2.; d = d/2.; e = e/2.; // chgt de variable
Standard_Real eps = 1.E-08; // ?? comme ComputedForm
if (IsFromParabola()) {
Rmin = Rmax = -1.; // rayons : yena pas
if ( (Abs(a) <= eps) && (Abs(b) <= eps)) {
Xcen = (f*c - e*e) /c /d /2.;
Ycen = e/c;
Standard_Real focal = -d/c;
Xax = (focal >= 0 ? 1. : -1.);
Yax = 0.;
Rmin = Rmax = Abs(focal);
}
else {
Standard_Real ss = a+c;
Standard_Real cc = - (a*d+b*e) / ss;
Standard_Real dd = d + (c*d - b*e) / ss;
Standard_Real fc = (a*e - b*d) / ss;
Standard_Real ee = e + fc;
Standard_Real dn = a*ee - dd*b;
Xcen = ( cc*ee + f*b) / dn;
Ycen = (-cc*dd - f*a) / dn;
Standard_Real teta = PI/2.;
if (Abs(b) > eps) teta = ATan (-a/b);
if (fc < 0) teta += PI;
Xax = Cos(teta);
Yax = Sin(teta);
Rmin = Rmax = Abs(fc)/sqrt(a*a+b*b)/2.;
}
}
else {
// -> Conique a centre, cas general
// On utilise les Determinants des matrices :
// | a b d |
// gdet (3x3) = | b c e | et pdet (2X2) = | a b |
// | d e f | | b c |
Standard_Real gdet = a*c*f + 2*b*d*e - c*d*d - a*e*e - b*b*f;
Standard_Real pdet = a*c - b*b;
Xcen = (b*e - c*d) / pdet;
Ycen = (b*d - a*e) / pdet;
Standard_Real term1 = a-c;
Standard_Real term2 = 2*b;
Standard_Real cos2t;
Standard_Real auxil;
if (Abs(term2)<= eps && Abs(term1)<= eps) {
cos2t = 1.;
auxil = 0.;
}
else {
Standard_Real t2d = term2/term1; //skl 28.12.2001
cos2t = 1./sqrt(1+t2d*t2d);
auxil = sqrt (term1*term1 + term2*term2);
}
Standard_Real cost = sqrt ( (1+cos2t)/2. );
Standard_Real sint = sqrt ( (1-cos2t)/2. );
Standard_Real aprim = (a+c+auxil)/2.;
Standard_Real cprim = (a+c-auxil)/2.;
term1 = -gdet/(aprim*pdet);
term2 = -gdet/(cprim*pdet);
if (IsFromEllipse()) {
Xax = cost;
Yax = sint;
Rmin = sqrt ( term1);
Rmax = sqrt ( term2);
if(Rmax<Rmin){ //skl 28.12.2001
Rmax = sqrt ( term1);
Rmin = sqrt ( term2);
}
}
else if (term1 <= eps){
Xax = -sint;
Yax = cost;
Rmin = sqrt (-term1);
Rmax = sqrt (term2);
}
else {
Xax = cost;
Yax = sint;
Rmin = sqrt (-term2);
Rmax = sqrt (term1);
}
}
}

View File

@@ -0,0 +1,119 @@
--
-- File : CopiousData.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class CopiousData from IGESGeom inherits IGESEntity
---Purpose: defines IGESCopiousData, Type <106> Form <1-3,11-13,63>
-- in package IGESGeom
-- This entity stores data points in the form of pairs,
-- triples, or sextuples. An interpretation flag value
-- signifies which of these forms is being used.
uses
Pnt from gp,
Vec from gp,
HArray1OfReal from TColStd
raises OutOfRange
is
Create returns mutable CopiousData;
-- Specific Methods pertaining to the class
Init (me : mutable;
aDataType : Integer;
aZPlane : Real;
allData : HArray1OfReal);
---Purpose : This method is used to set the fields of the class
-- CopiousData
-- - aDataType : Specifies whether data is a pair or a triple
-- or a sextuple.
-- - aZPlane : Common Z value for all points if datatype = 1
-- - allData : Data to be read in groups of 2, 3 or 6
SetPolyline (me : mutable; mode : Boolean);
---Purpose : Sets Copious Data to be a Polyline if <mode> is True
-- (Form = 11-12-13) or a Set of Points else (Form 1-2-3)
SetClosedPath2D (me : mutable);
---Purpose : Sets Copious Data to be a Closed Path 2D (Form 63)
-- Warning : DataType is not checked and must be set to ONE by Init
IsPointSet (me) returns Boolean;
---Purpose : Returns True if <me> is a Set of Points (Form 1-2-3)
IsPolyline (me) returns Boolean;
---Purpose : Returns True if <me> is a Polyline (Form 11-12-13)
IsClosedPath2D (me) returns Boolean;
---Purpose : Returns True if <me> is a Closed Path 2D (Form 63)
DataType(me) returns Integer;
---Purpose : returns data type
-- 1 = XY ( with common Z given by plane)
-- 2 = XYZ ( point)
-- 3 = XYZ + Vec(XYZ) (point + normal vector)
NbPoints(me) returns Integer;
---Purpose : returns the number of tuples
Data (me; NumPoint, NumData : Integer) returns Real raises OutOfRange;
---Purpose : Returns an individual Data, given the N0 of the Point
---Purpose : and the B0 of the Coordinate (according DataType)
ZPlane(me) returns Real;
---Purpose : If datatype = 1, then returns common z value for all data
-- else returns 0
Point(me; anIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the coordinates of the point specified by the anIndex
-- raises exception if anIndex <= 0 or anIndex > NbPoints()
TransformedPoint(me; anIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the coordinates of the point specified by the anIndex
-- after applying Transf. Matrix
-- raises exception if anIndex <= 0 or anIndex > NbPoints()
Vector(me; anIndex : Integer) returns Vec
raises OutOfRange;
---Purpose : returns i, j, k values if 3-tuple else returns (0, 0, 0)
-- raises exception if anIndex <= 0 or anIndex > NbPoints()
TransformedVector(me; anIndex : Integer) returns Vec
raises OutOfRange;
---Purpose : returns transformed vector if 3-tuple else returns (0, 0, 0)
-- raises exception if anIndex <= 0 or anIndex > NbPoints()
fields
--
-- Class : IGESGeom_CopiousData
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class CopiousData.
--
-- Reminder : A CopiousData instance is defined by :
-- The data type which it holds (whether it is a pair
-- or a triad or sex-tuple), and the data.
theDataType : Integer;
-- 1 for x, y pairs, common z
-- 2 for x, y, z coordinates
-- 3 for x, y, z coordinates and i, j, k vectors
theZPlane : Real;
-- The common Z displacement if the data type is a pair
theData : HArray1OfReal;
-- To be read in groups of 2 or 3 or 6 according to data type
end CopiousData;

View File

@@ -0,0 +1,163 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CopiousData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_CopiousData.ixx>
#include <Standard_DimensionMismatch.hxx>
#include <gp_XY.hxx>
#include <gp_GTrsf.hxx>
#include <Standard_NullObject.hxx>
IGESGeom_CopiousData::IGESGeom_CopiousData ()
{
theDataType = 0; // to allow Setting Form Number before Init
}
void IGESGeom_CopiousData::Init
(const Standard_Integer aDataType,
const Standard_Real aZPlane,
const Handle(TColStd_HArray1OfReal)& allData)
{
// PTV OCC386 crach application while reading So5771b.igs
if (allData.IsNull())
Standard_NullObject::Raise("IGESGeom_CopiousData : Init with null data");
if (allData->Lower() != 1) Standard_DimensionMismatch::Raise("IGESGeom_CopiousData : Init");
theDataType = aDataType;
theZPlane = aZPlane;
theData = allData;
// FormNumber = DataType + <N> N=0 -> Set of Points. N=10 : PolyLine
// or N=62 (DataType=1 only, gives FormNumber=63) : 2D closed path
InitTypeAndForm(106,FormNumber());
}
void IGESGeom_CopiousData::SetPolyline (const Standard_Boolean F)
{
Standard_Integer newfn = theDataType;
if (F) newfn += 10;
InitTypeAndForm(106,newfn);
}
void IGESGeom_CopiousData::SetClosedPath2D ()
{
InitTypeAndForm(106,63); // et verifier DataType !
}
Standard_Boolean IGESGeom_CopiousData::IsPointSet () const
{
return (FormNumber() < 10);
}
Standard_Boolean IGESGeom_CopiousData::IsPolyline () const
{
return (FormNumber()/10 == 1);
}
Standard_Boolean IGESGeom_CopiousData::IsClosedPath2D () const
{
return (FormNumber() == 63);
}
Standard_Integer IGESGeom_CopiousData::DataType () const
{
return theDataType;
}
Standard_Integer IGESGeom_CopiousData::NbPoints () const
{
Standard_Integer nbtuples;
// PTV OCC386
if (theData.IsNull())
nbtuples = 0;
else
nbtuples = theData->Length();
if (theDataType == 1) nbtuples /= 2;
else if (theDataType == 2) nbtuples /= 3;
else if (theDataType == 3) nbtuples /= 6;
return nbtuples;
}
Standard_Real IGESGeom_CopiousData::Data
(const Standard_Integer nump, const Standard_Integer numdata) const
{
Standard_Integer numd = 0;
if (theDataType == 1) numd = 2*(nump - 1) + numdata; // 1-2
else if (theDataType == 2) numd = 3*(nump - 1) + numdata; // 1-2-3
else if (theDataType == 3) numd = 6*(nump - 1) + numdata; // 1-2-3-4-5-6
return theData->Value(numd);
}
Standard_Real IGESGeom_CopiousData::ZPlane () const
{
return theZPlane;
}
gp_Pnt IGESGeom_CopiousData::Point (const Standard_Integer anIndex) const
{
Standard_Integer lower = theData->Lower();
Standard_Integer real_index;
Standard_Real X=0.,Y=0.,Z=0. ;
if (theDataType == 1) {
real_index = lower + 2 * (anIndex-1);
X = theData->Value(real_index);
Y = theData->Value(real_index+1);
Z = theZPlane;
}
if (theDataType == 2) {
real_index = lower + 3 * (anIndex-1);
X = theData->Value(real_index);
Y = theData->Value(real_index+1);
Z = theData->Value(real_index+2);
}
if (theDataType == 3) {
real_index = lower + 6 * (anIndex-1);
X = theData->Value(real_index);
Y = theData->Value(real_index+1);
Z = theData->Value(real_index+2);
}
gp_Pnt point(X,Y,Z);
return point;
}
gp_Pnt IGESGeom_CopiousData::TransformedPoint
(const Standard_Integer anIndex) const
{
if (!HasTransf()) return Point(anIndex);
gp_XYZ xyz (Point(anIndex).XYZ());
Location().Transforms(xyz);
return gp_Pnt(xyz);
}
gp_Vec IGESGeom_CopiousData::Vector (const Standard_Integer anIndex) const
{
Standard_Integer lower = theData->Lower();
Standard_Integer Real_Index;
if (theDataType != 3) return gp_Vec(0.0, 0.0, 0.0);
Real_Index = lower + 6*(anIndex-1) +3;
Standard_Real I = theData->Value(Real_Index);
Standard_Real J = theData->Value(Real_Index+1);
Standard_Real K = theData->Value(Real_Index+2);
return gp_Vec(I, J, K);
}
gp_Vec IGESGeom_CopiousData::TransformedVector
(const Standard_Integer anIndex) const
{
if (!HasTransf()) return Vector (anIndex);
gp_XYZ xyz (Vector(anIndex).XYZ());
gp_GTrsf loc = Location();
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
loc.Transforms(xyz);
return gp_Vec(xyz);
}

View File

@@ -0,0 +1,85 @@
--
-- File : CurveOnSurface.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class CurveOnSurface from IGESGeom inherits IGESEntity
---Purpose: defines IGESCurveOnSurface, Type <142> Form <0>
-- in package IGESGeom
-- A curve on a parametric surface entity associates a given
-- curve with a surface and identifies the curve as lying on
-- the surface.
uses Integer -- no one specific type
is
Create returns mutable CurveOnSurface;
-- Specific Methods pertaining to the class
Init (me : mutable;
aMode : Integer;
aSurface : IGESEntity;
aCurveUV : IGESEntity;
aCurve3D : IGESEntity;
aPreference : Integer);
---Purpose : This method is used to set the fields of the class
-- CurveOnSurface
-- - aMode : Way the curve on the surface has been created
-- - aSurface : Surface on which the curve lies
-- - aCurveUV : Curve S (UV)
-- - aCurve3D : Curve C (3D)
-- - aPreference : 0 = Unspecified
-- 1 = S o B is preferred
-- 2 = C is preferred
-- 3 = C and S o B are equally preferred
CreationMode (me) returns Integer;
---Purpose : returns the mode in which the curve is created on the surface
-- 0 = Unspecified
-- 1 = Projection of a given curve on the surface
-- 2 = Intersection of two surfaces
-- 3 = Isoparametric curve, i.e:- either a `u` parametric
-- or a `v` parametric curve
Surface (me) returns IGESEntity;
---Purpose : returns the surface on which the curve lies
CurveUV (me) returns IGESEntity;
---Purpose : returns curve S
Curve3D (me) returns IGESEntity;
---Purpose : returns curve C
PreferenceMode (me) returns Integer;
---Purpose : returns preference mode
-- 0 = Unspecified
-- 1 = S o B is preferred
-- 2 = C is preferred
-- 3 = C and S o B are equally preferred
fields
--
-- Class : IGESGeom_CurveOnSurface
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class CurveOnSurface.
--
-- Reminder : A CurveOnSurface instance is defined by :
-- The way the curve has been created, the surface on which
-- it has been created, and two other curves, curve S and
-- curve C involved in its creation
theCreationMode : Integer;
theSurface : IGESEntity;
theCurveUV : IGESEntity;
theCurve3D : IGESEntity;
thePreferenceMode : Integer;
end CurveOnSurface;

View File

@@ -0,0 +1,54 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CurveOnSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_CurveOnSurface.ixx>
IGESGeom_CurveOnSurface::IGESGeom_CurveOnSurface () { }
void IGESGeom_CurveOnSurface::Init
(const Standard_Integer aMode,
const Handle(IGESData_IGESEntity)& aSurface,
const Handle(IGESData_IGESEntity)& aCurveUV,
const Handle(IGESData_IGESEntity)& aCurve3D,
const Standard_Integer aPreference)
{
theCreationMode = aMode;
theSurface = aSurface;
theCurveUV = aCurveUV;
theCurve3D = aCurve3D;
thePreferenceMode = aPreference;
InitTypeAndForm(142,0);
}
Standard_Integer IGESGeom_CurveOnSurface::CreationMode () const
{
return theCreationMode;
}
Handle(IGESData_IGESEntity) IGESGeom_CurveOnSurface::Surface () const
{
return theSurface;
}
Handle(IGESData_IGESEntity) IGESGeom_CurveOnSurface::CurveUV () const
{
return theCurveUV;
}
Handle(IGESData_IGESEntity) IGESGeom_CurveOnSurface::Curve3D () const
{
return theCurve3D;
}
Standard_Integer IGESGeom_CurveOnSurface::PreferenceMode () const
{
return thePreferenceMode;
}

View File

@@ -0,0 +1,52 @@
--
-- File : Direction.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class Direction from IGESGeom inherits IGESEntity
---Purpose: defines IGESDirection, Type <123> Form <0>
-- in package IGESGeom
-- A direction entity is a non-zero vector in Euclidean 3-space
-- that is defined by its three components (direction ratios)
-- with respect to the coordinate axes. If x, y, z are the
-- direction ratios then (x^2 + y^2 + z^2) > 0
uses
Vec from gp,
XYZ from gp
is
Create returns mutable Direction;
-- Specific Methods pertaining to the class
Init (me : mutable; aDirection : XYZ);
---Purpose : This method is used to set the fields of the class
-- Direction
-- - aDirection : Direction ratios, Z is 0 by default
Value (me) returns Vec;
TransformedValue (me) returns Vec;
---Purpose : returns the Direction value after applying Transformation matrix
fields
--
-- Class : IGESGeom_Direction
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class Direction.
--
-- Reminder : A Direction instance is defined by :
-- The three direction ratios along the three coordinate axes
theDirection : XYZ;
end Direction;

View File

@@ -0,0 +1,38 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Direction.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_Direction.ixx>
#include <gp_GTrsf.hxx>
IGESGeom_Direction::IGESGeom_Direction () { }
void IGESGeom_Direction::Init
(const gp_XYZ& aDirection)
{
theDirection = aDirection;
InitTypeAndForm(123,0);
}
gp_Vec IGESGeom_Direction::Value () const
{
gp_Vec direction(theDirection);
return direction;
}
gp_Vec IGESGeom_Direction::TransformedValue () const
{
if (!HasTransf()) return gp_Vec(theDirection);
gp_XYZ xyz (theDirection);
gp_GTrsf loc = Location();
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
loc.Transforms(xyz);
return gp_Vec(xyz);
}

96
src/IGESGeom/IGESGeom_Flash.cdl Executable file
View File

@@ -0,0 +1,96 @@
--
-- File : Flash.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class Flash from IGESGeom inherits IGESEntity
---Purpose: defines IGESFlash, Type <125> Form <0 - 4>
-- in package IGESGeom
-- A flash entity is a point in the ZT=0 plane that locates
-- a particular closed area. That closed area can be defined
-- in one of two ways. First, it can be an arbitrary closed
-- area defined by any entity capable of defining a closed
-- area. The points of this entity must all lie in the ZT=0
-- plane. Second, it can be a member of a predefined set of
-- flash shapes.
uses
Pnt from gp,
Pnt2d from gp,
XY from gp
raises OutOfRange
is
Create returns mutable Flash;
-- Specific Methods pertaining to the class
Init (me : mutable;
aPoint : XY;
aDim : Real;
anotherDim : Real;
aRotation : Real;
aReference : IGESEntity);
---Purpose : This method is used to set the fields of the class Flash
-- - aPoint : Reference of flash
-- - aDim : First flash sizing parameter
-- - anotherDim : Second flash sizing parameter
-- - aRotation : Rotation of flash about reference point
-- in radians
-- - aReference : Pointer to the referenced entity or Null
SetFormNumber (me : mutable; form : Integer) raises OutOfRange;
---Purpose : Changes FormNumber (indicates the Nature of the Flash :
-- 0 Unspecified, then given by Reference, 1->4 various
-- Specialisations (Circle,Rectangle, etc...) )
-- Error if not in range [0-4]
ReferencePoint (me) returns Pnt2d;
---Purpose : returns the referenced point, Z = 0 always
TransformedReferencePoint (me) returns Pnt;
---Purpose : returns the referenced point after applying Transf. Matrix
Dimension1 (me) returns Real;
---Purpose : returns first flash sizing parameter
Dimension2 (me) returns Real;
---Purpose : returns second flash sizing parameter
Rotation (me) returns Real;
---Purpose : returns the angle in radians of the rotation of flash about the
-- reference point
ReferenceEntity (me) returns IGESEntity;
---Purpose : returns the referenced entity or Null handle.
HasReferenceEntity (me) returns Boolean;
---Purpose : returns True if referenced entity is present.
fields
--
-- Class : IGESGeom_Flash
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class Flash.
--
-- Reminder : A Flash instance is defined by :
-- A reference position, sizing and orientation parameters
-- and an optional referenced entity
thePoint : XY;
theDim1 : Real;
theDim2 : Real;
theRotation : Real;
theReference : IGESEntity;
end Flash;

77
src/IGESGeom/IGESGeom_Flash.cxx Executable file
View File

@@ -0,0 +1,77 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Flash.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_Flash.ixx>
#include <Standard_OutOfRange.hxx>
#include <gp_GTrsf.hxx>
IGESGeom_Flash::IGESGeom_Flash () { }
void IGESGeom_Flash::Init
(const gp_XY& aPoint,
const Standard_Real aDim1,
const Standard_Real aDim2,
const Standard_Real aRotation,
const Handle(IGESData_IGESEntity)& aReference)
{
thePoint = aPoint;
theDim1 = aDim1;
theDim2 = aDim2;
theRotation = aRotation;
theReference = aReference;
InitTypeAndForm(125,FormNumber());
// FormNumber : 0-4, Shape of the Flash
}
void IGESGeom_Flash::SetFormNumber (const Standard_Integer form)
{
if (form < 0 || form > 4) Standard_OutOfRange::Raise
("IGESGeom_Flash : SetFormNumber");
InitTypeAndForm(125,form);
}
gp_Pnt2d IGESGeom_Flash::ReferencePoint () const
{
return ( gp_Pnt2d(thePoint) );
}
gp_Pnt IGESGeom_Flash::TransformedReferencePoint () const
{
gp_XYZ Point(thePoint.X(), thePoint.Y(), 0.0);
if (HasTransf()) Location().Transforms(Point);
return gp_Pnt(Point);
}
Standard_Real IGESGeom_Flash::Dimension1 () const
{
return theDim1;
}
Standard_Real IGESGeom_Flash::Dimension2 () const
{
return theDim2;
}
Standard_Real IGESGeom_Flash::Rotation () const
{
return theRotation;
}
Standard_Boolean IGESGeom_Flash::HasReferenceEntity () const
{
return (! theReference.IsNull() );
}
Handle(IGESData_IGESEntity) IGESGeom_Flash::ReferenceEntity () const
{
return theReference;
}

View File

@@ -0,0 +1,52 @@
-- File: IGESGeom_GeneralModule.cdl
-- Created: Mon May 10 15:00:51 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class GeneralModule from IGESGeom inherits GeneralModule from IGESData
---Purpose : Definition of General Services for IGESGeom (specific part)
-- This Services comprise : Shared & Implied Lists, Copy, Check
uses OStream,
Check, ShareTool, EntityIterator, CopyTool,
IGESEntity, DirChecker
is
Create returns mutable GeneralModule from IGESGeom;
---Purpose : Creates a GeneralModule from IGESGeom and puts it into GeneralLib
OwnSharedCase (me; CN : Integer; ent : IGESEntity;
iter : in out EntityIterator);
---Purpose : Lists the Entities shared by a given IGESEntity <ent>, from
-- its specific parameters : specific for each type
DirChecker (me; CN : Integer; ent : IGESEntity) returns DirChecker;
---Purpose : Returns a DirChecker, specific for each type of Entity
-- (identified by its Case Number) : this DirChecker defines
-- constraints which must be respected by the DirectoryPart
OwnCheckCase (me; CN : Integer; ent : IGESEntity; shares : ShareTool;
ach : in out Check);
---Purpose : Performs Specific Semantic Check for each type of Entity
NewVoid (me; CN : Integer; entto : out mutable Transient)
returns Boolean;
---Purpose : Specific creation of a new void entity
OwnCopyCase (me; CN : Integer;
entfrom : IGESEntity; entto : mutable IGESEntity;
TC : in out CopyTool);
---Purpose : Copies parameters which are specific of each Type of Entity
CategoryNumber (me; CN : Integer; ent : Transient; shares : ShareTool)
returns Integer is redefined;
---Purpose : Returns a category number which characterizes an entity
-- Shape for all, but Drawing for :
-- Flash; Point with a symbol; Plane with a symbol
end GeneralModule;

View File

@@ -0,0 +1,774 @@
#include <IGESGeom_GeneralModule.ixx>
#include <Interface_Macros.hxx>
#include <Interface_Category.hxx>
#include <IGESGeom_BSplineCurve.hxx>
#include <IGESGeom_BSplineSurface.hxx>
#include <IGESGeom_Boundary.hxx>
#include <IGESGeom_BoundedSurface.hxx>
#include <IGESGeom_CircularArc.hxx>
#include <IGESGeom_CompositeCurve.hxx>
#include <IGESGeom_ConicArc.hxx>
#include <IGESGeom_CopiousData.hxx>
#include <IGESGeom_CurveOnSurface.hxx>
#include <IGESGeom_Direction.hxx>
#include <IGESGeom_Flash.hxx>
#include <IGESGeom_Line.hxx>
#include <IGESGeom_OffsetCurve.hxx>
#include <IGESGeom_OffsetSurface.hxx>
#include <IGESGeom_Plane.hxx>
#include <IGESGeom_Point.hxx>
#include <IGESGeom_RuledSurface.hxx>
#include <IGESGeom_SplineCurve.hxx>
#include <IGESGeom_SplineSurface.hxx>
#include <IGESGeom_SurfaceOfRevolution.hxx>
#include <IGESGeom_TabulatedCylinder.hxx>
#include <IGESGeom_TransformationMatrix.hxx>
#include <IGESGeom_TrimmedSurface.hxx>
#include <IGESGeom_ToolBSplineCurve.hxx>
#include <IGESGeom_ToolBSplineSurface.hxx>
#include <IGESGeom_ToolBoundary.hxx>
#include <IGESGeom_ToolBoundedSurface.hxx>
#include <IGESGeom_ToolCircularArc.hxx>
#include <IGESGeom_ToolCompositeCurve.hxx>
#include <IGESGeom_ToolConicArc.hxx>
#include <IGESGeom_ToolCopiousData.hxx>
#include <IGESGeom_ToolCurveOnSurface.hxx>
#include <IGESGeom_ToolDirection.hxx>
#include <IGESGeom_ToolFlash.hxx>
#include <IGESGeom_ToolLine.hxx>
#include <IGESGeom_ToolOffsetCurve.hxx>
#include <IGESGeom_ToolOffsetSurface.hxx>
#include <IGESGeom_ToolPlane.hxx>
#include <IGESGeom_ToolPoint.hxx>
#include <IGESGeom_ToolRuledSurface.hxx>
#include <IGESGeom_ToolSplineCurve.hxx>
#include <IGESGeom_ToolSplineSurface.hxx>
#include <IGESGeom_ToolSurfaceOfRevolution.hxx>
#include <IGESGeom_ToolTabulatedCylinder.hxx>
#include <IGESGeom_ToolTransformationMatrix.hxx>
#include <IGESGeom_ToolTrimmedSurface.hxx>
// Each Module is attached to a Protocol : it must interprete Case Numbers
// (arguments <CN> of various methods) in accordance to values returned by
// the method TypeNumber from this Protocol
IGESGeom_GeneralModule::IGESGeom_GeneralModule () { }
void IGESGeom_GeneralModule::OwnSharedCase
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
Interface_EntityIterator& iter) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGeom_BSplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineCurve tool;
tool.OwnShared(anent,iter);
}
break;
case 2 : {
DeclareAndCast(IGESGeom_BSplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineSurface tool;
tool.OwnShared(anent,iter);
}
break;
case 3 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundary tool;
tool.OwnShared(anent,iter);
}
break;
case 4 : {
DeclareAndCast(IGESGeom_BoundedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundedSurface tool;
tool.OwnShared(anent,iter);
}
break;
case 5 : {
DeclareAndCast(IGESGeom_CircularArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCircularArc tool;
tool.OwnShared(anent,iter);
}
break;
case 6 : {
DeclareAndCast(IGESGeom_CompositeCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCompositeCurve tool;
tool.OwnShared(anent,iter);
}
break;
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolConicArc tool;
tool.OwnShared(anent,iter);
}
break;
case 8 : {
DeclareAndCast(IGESGeom_CopiousData,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCopiousData tool;
tool.OwnShared(anent,iter);
}
break;
case 9 : {
DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCurveOnSurface tool;
tool.OwnShared(anent,iter);
}
break;
case 10 : {
DeclareAndCast(IGESGeom_Direction,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolDirection tool;
tool.OwnShared(anent,iter);
}
break;
case 11 : {
DeclareAndCast(IGESGeom_Flash,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolFlash tool;
tool.OwnShared(anent,iter);
}
break;
case 12 : {
DeclareAndCast(IGESGeom_Line,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolLine tool;
tool.OwnShared(anent,iter);
}
break;
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetCurve tool;
tool.OwnShared(anent,iter);
}
break;
case 14 : {
DeclareAndCast(IGESGeom_OffsetSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetSurface tool;
tool.OwnShared(anent,iter);
}
break;
case 15 : {
DeclareAndCast(IGESGeom_Plane,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPlane tool;
tool.OwnShared(anent,iter);
}
break;
case 16 : {
DeclareAndCast(IGESGeom_Point,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPoint tool;
tool.OwnShared(anent,iter);
}
break;
case 17 : {
DeclareAndCast(IGESGeom_RuledSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolRuledSurface tool;
tool.OwnShared(anent,iter);
}
break;
case 18 : {
DeclareAndCast(IGESGeom_SplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineCurve tool;
tool.OwnShared(anent,iter);
}
break;
case 19 : {
DeclareAndCast(IGESGeom_SplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineSurface tool;
tool.OwnShared(anent,iter);
}
break;
case 20 : {
DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSurfaceOfRevolution tool;
tool.OwnShared(anent,iter);
}
break;
case 21 : {
DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTabulatedCylinder tool;
tool.OwnShared(anent,iter);
}
break;
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTransformationMatrix tool;
tool.OwnShared(anent,iter);
}
break;
case 23 : {
DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTrimmedSurface tool;
tool.OwnShared(anent,iter);
}
break;
default : break;
}
}
IGESData_DirChecker IGESGeom_GeneralModule::DirChecker
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGeom_BSplineCurve,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolBSplineCurve tool;
return tool.DirChecker(anent);
}
case 2 : {
DeclareAndCast(IGESGeom_BSplineSurface,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolBSplineSurface tool;
return tool.DirChecker(anent);
}
case 3 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolBoundary tool;
return tool.DirChecker(anent);
}
case 4 : {
DeclareAndCast(IGESGeom_BoundedSurface,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolBoundedSurface tool;
return tool.DirChecker(anent);
}
case 5 : {
DeclareAndCast(IGESGeom_CircularArc,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolCircularArc tool;
return tool.DirChecker(anent);
}
case 6 : {
DeclareAndCast(IGESGeom_CompositeCurve,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolCompositeCurve tool;
return tool.DirChecker(anent);
}
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolConicArc tool;
return tool.DirChecker(anent);
}
case 8 : {
DeclareAndCast(IGESGeom_CopiousData,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolCopiousData tool;
return tool.DirChecker(anent);
}
case 9 : {
DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolCurveOnSurface tool;
return tool.DirChecker(anent);
}
case 10 : {
DeclareAndCast(IGESGeom_Direction,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolDirection tool;
return tool.DirChecker(anent);
}
case 11 : {
DeclareAndCast(IGESGeom_Flash,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolFlash tool;
return tool.DirChecker(anent);
}
case 12 : {
DeclareAndCast(IGESGeom_Line,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolLine tool;
return tool.DirChecker(anent);
}
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolOffsetCurve tool;
return tool.DirChecker(anent);
}
case 14 : {
DeclareAndCast(IGESGeom_OffsetSurface,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolOffsetSurface tool;
return tool.DirChecker(anent);
}
case 15 : {
DeclareAndCast(IGESGeom_Plane,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolPlane tool;
return tool.DirChecker(anent);
}
case 16 : {
DeclareAndCast(IGESGeom_Point,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolPoint tool;
return tool.DirChecker(anent);
}
case 17 : {
DeclareAndCast(IGESGeom_RuledSurface,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolRuledSurface tool;
return tool.DirChecker(anent);
}
case 18 : {
DeclareAndCast(IGESGeom_SplineCurve,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolSplineCurve tool;
return tool.DirChecker(anent);
}
case 19 : {
DeclareAndCast(IGESGeom_SplineSurface,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolSplineSurface tool;
return tool.DirChecker(anent);
}
case 20 : {
DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolSurfaceOfRevolution tool;
return tool.DirChecker(anent);
}
case 21 : {
DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolTabulatedCylinder tool;
return tool.DirChecker(anent);
}
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolTransformationMatrix tool;
return tool.DirChecker(anent);
}
case 23 : {
DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolTrimmedSurface tool;
return tool.DirChecker(anent);
}
default : break;
}
return IGESData_DirChecker(); // by default, no specific criterium
}
void IGESGeom_GeneralModule::OwnCheckCase
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGeom_BSplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineCurve tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 2 : {
DeclareAndCast(IGESGeom_BSplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineSurface tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 3 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundary tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 4 : {
DeclareAndCast(IGESGeom_BoundedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundedSurface tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 5 : {
DeclareAndCast(IGESGeom_CircularArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCircularArc tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 6 : {
DeclareAndCast(IGESGeom_CompositeCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCompositeCurve tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolConicArc tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 8 : {
DeclareAndCast(IGESGeom_CopiousData,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCopiousData tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 9 : {
DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCurveOnSurface tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 10 : {
DeclareAndCast(IGESGeom_Direction,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolDirection tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 11 : {
DeclareAndCast(IGESGeom_Flash,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolFlash tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 12 : {
DeclareAndCast(IGESGeom_Line,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolLine tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetCurve tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 14 : {
DeclareAndCast(IGESGeom_OffsetSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetSurface tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 15 : {
DeclareAndCast(IGESGeom_Plane,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPlane tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 16 : {
DeclareAndCast(IGESGeom_Point,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPoint tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 17 : {
DeclareAndCast(IGESGeom_RuledSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolRuledSurface tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 18 : {
DeclareAndCast(IGESGeom_SplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineCurve tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 19 : {
DeclareAndCast(IGESGeom_SplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineSurface tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 20 : {
DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSurfaceOfRevolution tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 21 : {
DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTabulatedCylinder tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTransformationMatrix tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 23 : {
DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTrimmedSurface tool;
tool.OwnCheck(anent,shares,ach);
}
break;
default : break;
}
}
Standard_Boolean IGESGeom_GeneralModule::NewVoid
(const Standard_Integer CN, Handle(Standard_Transient)& ent) const
{
switch (CN) {
case 1 : ent = new IGESGeom_BSplineCurve; break;
case 2 : ent = new IGESGeom_BSplineSurface; break;
case 3 : ent = new IGESGeom_Boundary; break;
case 4 : ent = new IGESGeom_BoundedSurface; break;
case 5 : ent = new IGESGeom_CircularArc; break;
case 6 : ent = new IGESGeom_CompositeCurve; break;
case 7 : ent = new IGESGeom_ConicArc; break;
case 8 : ent = new IGESGeom_CopiousData; break;
case 9 : ent = new IGESGeom_CurveOnSurface; break;
case 10 : ent = new IGESGeom_Direction; break;
case 11 : ent = new IGESGeom_Flash; break;
case 12 : ent = new IGESGeom_Line; break;
case 13 : ent = new IGESGeom_OffsetCurve; break;
case 14 : ent = new IGESGeom_OffsetSurface; break;
case 15 : ent = new IGESGeom_Plane; break;
case 16 : ent = new IGESGeom_Point; break;
case 17 : ent = new IGESGeom_RuledSurface; break;
case 18 : ent = new IGESGeom_SplineCurve; break;
case 19 : ent = new IGESGeom_SplineSurface; break;
case 20 : ent = new IGESGeom_SurfaceOfRevolution; break;
case 21 : ent = new IGESGeom_TabulatedCylinder; break;
case 22 : ent = new IGESGeom_TransformationMatrix; break;
case 23 : ent = new IGESGeom_TrimmedSurface; break;
default : return Standard_False; // by default, Failure on Recognize
}
return Standard_True;
}
void IGESGeom_GeneralModule::OwnCopyCase
(const Standard_Integer CN,
const Handle(IGESData_IGESEntity)& entfrom,
const Handle(IGESData_IGESEntity)& entto,
Interface_CopyTool& TC) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGeom_BSplineCurve,enfr,entfrom);
DeclareAndCast(IGESGeom_BSplineCurve,ento,entto);
IGESGeom_ToolBSplineCurve tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 2 : {
DeclareAndCast(IGESGeom_BSplineSurface,enfr,entfrom);
DeclareAndCast(IGESGeom_BSplineSurface,ento,entto);
IGESGeom_ToolBSplineSurface tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 3 : {
DeclareAndCast(IGESGeom_Boundary,enfr,entfrom);
DeclareAndCast(IGESGeom_Boundary,ento,entto);
IGESGeom_ToolBoundary tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 4 : {
DeclareAndCast(IGESGeom_BoundedSurface,enfr,entfrom);
DeclareAndCast(IGESGeom_BoundedSurface,ento,entto);
IGESGeom_ToolBoundedSurface tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 5 : {
DeclareAndCast(IGESGeom_CircularArc,enfr,entfrom);
DeclareAndCast(IGESGeom_CircularArc,ento,entto);
IGESGeom_ToolCircularArc tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 6 : {
DeclareAndCast(IGESGeom_CompositeCurve,enfr,entfrom);
DeclareAndCast(IGESGeom_CompositeCurve,ento,entto);
IGESGeom_ToolCompositeCurve tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,enfr,entfrom);
DeclareAndCast(IGESGeom_ConicArc,ento,entto);
IGESGeom_ToolConicArc tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 8 : {
DeclareAndCast(IGESGeom_CopiousData,enfr,entfrom);
DeclareAndCast(IGESGeom_CopiousData,ento,entto);
IGESGeom_ToolCopiousData tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 9 : {
DeclareAndCast(IGESGeom_CurveOnSurface,enfr,entfrom);
DeclareAndCast(IGESGeom_CurveOnSurface,ento,entto);
IGESGeom_ToolCurveOnSurface tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 10 : {
DeclareAndCast(IGESGeom_Direction,enfr,entfrom);
DeclareAndCast(IGESGeom_Direction,ento,entto);
IGESGeom_ToolDirection tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 11 : {
DeclareAndCast(IGESGeom_Flash,enfr,entfrom);
DeclareAndCast(IGESGeom_Flash,ento,entto);
IGESGeom_ToolFlash tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 12 : {
DeclareAndCast(IGESGeom_Line,enfr,entfrom);
DeclareAndCast(IGESGeom_Line,ento,entto);
IGESGeom_ToolLine tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,enfr,entfrom);
DeclareAndCast(IGESGeom_OffsetCurve,ento,entto);
IGESGeom_ToolOffsetCurve tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 14 : {
DeclareAndCast(IGESGeom_OffsetSurface,enfr,entfrom);
DeclareAndCast(IGESGeom_OffsetSurface,ento,entto);
IGESGeom_ToolOffsetSurface tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 15 : {
DeclareAndCast(IGESGeom_Plane,enfr,entfrom);
DeclareAndCast(IGESGeom_Plane,ento,entto);
IGESGeom_ToolPlane tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 16 : {
DeclareAndCast(IGESGeom_Point,enfr,entfrom);
DeclareAndCast(IGESGeom_Point,ento,entto);
IGESGeom_ToolPoint tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 17 : {
DeclareAndCast(IGESGeom_RuledSurface,enfr,entfrom);
DeclareAndCast(IGESGeom_RuledSurface,ento,entto);
IGESGeom_ToolRuledSurface tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 18 : {
DeclareAndCast(IGESGeom_SplineCurve,enfr,entfrom);
DeclareAndCast(IGESGeom_SplineCurve,ento,entto);
IGESGeom_ToolSplineCurve tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 19 : {
DeclareAndCast(IGESGeom_SplineSurface,enfr,entfrom);
DeclareAndCast(IGESGeom_SplineSurface,ento,entto);
IGESGeom_ToolSplineSurface tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 20 : {
DeclareAndCast(IGESGeom_SurfaceOfRevolution,enfr,entfrom);
DeclareAndCast(IGESGeom_SurfaceOfRevolution,ento,entto);
IGESGeom_ToolSurfaceOfRevolution tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 21 : {
DeclareAndCast(IGESGeom_TabulatedCylinder,enfr,entfrom);
DeclareAndCast(IGESGeom_TabulatedCylinder,ento,entto);
IGESGeom_ToolTabulatedCylinder tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,enfr,entfrom);
DeclareAndCast(IGESGeom_TransformationMatrix,ento,entto);
IGESGeom_ToolTransformationMatrix tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 23 : {
DeclareAndCast(IGESGeom_TrimmedSurface,enfr,entfrom);
DeclareAndCast(IGESGeom_TrimmedSurface,ento,entto);
IGESGeom_ToolTrimmedSurface tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
default : break;
}
}
Standard_Integer IGESGeom_GeneralModule::CategoryNumber
(const Standard_Integer CN, const Handle(Standard_Transient)& ent,
const Interface_ShareTool& ) const
{
if (CN == 11) return Interface_Category::Number("Drawing");
if (CN == 15) {
DeclareAndCast(IGESGeom_Plane,anent,ent);
if (anent->HasSymbolAttach()) return Interface_Category::Number("Drawing");
}
if (CN == 16) {
DeclareAndCast(IGESGeom_Point,anent,ent);
if (anent->HasDisplaySymbol()) return Interface_Category::Number("Drawing");
}
if (CN == 22) return Interface_Category::Number("Auxiliary");
return Interface_Category::Number("Shape");
}

72
src/IGESGeom/IGESGeom_Line.cdl Executable file
View File

@@ -0,0 +1,72 @@
--
-- File : Line.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class Line from IGESGeom inherits IGESEntity
---Purpose: defines IGESLine, Type <110> Form <0>
-- in package IGESGeom
-- A line is a bounded, connected portion of a parent straight
-- line which consists of more than one point. A line is
-- defined by its end points.
--
-- From IGES-5.3, two other Forms are admitted (same params) :
-- 0 remains for standard limited line (the default)
-- 1 for semi-infinite line (End is just a passing point)
-- 2 for full infinite Line (both Start and End are abitrary)
uses
Pnt from gp,
XYZ from gp
is
Create returns mutable Line;
-- Specific Methods pertaining to the class
Init (me : mutable; aStart : XYZ; anEnd : XYZ);
---Purpose : This method is used to set the fields of the class Line
-- - aStart : Start point of the line
-- - anEnd : End point of the line
Infinite (me) returns Integer;
---Purpose : Returns the Infinite status i.e. the Form Number : 0 1 2
SetInfinite (me : mutable; status : Integer);
---Purpose : Sets the Infinite status
-- Does nothing if <status> is not 0 1 or 2
StartPoint(me) returns Pnt;
---Purpose : returns the start point of the line
TransformedStartPoint(me) returns Pnt;
---Purpose : returns the start point of the line after applying Transf. Matrix
EndPoint(me) returns Pnt;
---Purpose : returns the end point of the line
TransformedEndPoint(me) returns Pnt;
---Purpose : returns the end point of the line after applying Transf. Matrix
fields
--
-- Class : IGESGeom_Line
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class Line.
--
-- Reminder : A Line instance is defined by :
-- A starting and ending point
theStart : XYZ;
theEnd : XYZ;
end Line;

58
src/IGESGeom/IGESGeom_Line.cxx Executable file
View File

@@ -0,0 +1,58 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Line.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_Line.ixx>
#include <gp_GTrsf.hxx>
IGESGeom_Line::IGESGeom_Line () { }
void IGESGeom_Line::Init
(const gp_XYZ& aStart, const gp_XYZ& anEnd)
{
theStart = aStart;
theEnd = anEnd;
InitTypeAndForm(110,0);
}
Standard_Integer IGESGeom_Line::Infinite () const
{ return FormNumber(); }
void IGESGeom_Line::SetInfinite (const Standard_Integer status)
{ if (status >= 0 && status <= 2) InitTypeAndForm(110,status); }
gp_Pnt IGESGeom_Line::StartPoint () const
{
gp_Pnt start(theStart);
return start;
}
gp_Pnt IGESGeom_Line::TransformedStartPoint () const
{
gp_XYZ Start = theStart;
if (HasTransf()) Location().Transforms(Start);
gp_Pnt transStart(Start);
return transStart;
}
gp_Pnt IGESGeom_Line::EndPoint () const
{
gp_Pnt end(theEnd);
return end;
}
gp_Pnt IGESGeom_Line::TransformedEndPoint () const
{
gp_XYZ End = theEnd;
if (HasTransf()) Location().Transforms(End);
gp_Pnt transEnd(End);
return transEnd;
}

View File

@@ -0,0 +1,160 @@
--
-- File : OffsetCurve.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class OffsetCurve from IGESGeom inherits IGESEntity
---Purpose: defines IGESOffsetCurve, Type <130> Form <0>
-- in package IGESGeom
-- An OffsetCurve entity contains the data necessary to
-- determine the offset of a given curve C. This entity
-- points to the base curve to be offset and contains
-- offset distance and other pertinent information.
uses
Vec from gp,
XYZ from gp
is
Create returns mutable OffsetCurve;
-- Specific Methods pertaining to the class
Init (me : mutable;
aBaseCurve : IGESEntity;
anOffsetType : Integer;
aFunction : IGESEntity;
aFunctionCoord : Integer;
aTaperedOffsetType : Integer;
offDistance1 : Real;
arcLength1 : Real;
offDistance2 : Real;
arcLength2 : Real;
aNormalVec : XYZ;
anOffsetParam : Real;
anotherOffsetParam : Real);
---Purpose : This method is used to set the fields of the class
-- OffsetCurve
-- - aBaseCurve : The curve entity to be offset
-- - anOffsetType : Offset distance flag
-- 1 = Single value, uniform distance
-- 2 = Varying linearly
-- 3 = As a specified function
-- - aFunction : Curve entity, one coordinate of which
-- describes offset as a function of its
-- parameter (0 unless OffsetType = 3)
-- - aFunctionCoord : Particular coordinate of curve
-- describing offset as function of its
-- parameters. (used if OffsetType = 3)
-- - aTaperedOffsetType : Tapered offset type flag
-- 1 = Function of arc length
-- 2 = Function of parameter
-- (Only used if OffsetType = 2 or 3)
-- - offDistance1 : First offset distance
-- (Only used if OffsetType = 1 or 2)
-- - arcLength1 : Arc length or parameter value of
-- first offset distance
-- (Only used if OffsetType = 2)
-- - offDistance2 : Second offset distance
-- - arcLength2 : Arc length or parameter value of
-- second offset distance
-- (Only used if OffsetType = 2)
-- - aNormalVec : Unit vector normal to plane containing
-- curve to be offset
-- - anOffsetParam : Start parameter value of offset curve
-- - anotherOffsetParam : End parameter value of offset curve
BaseCurve (me) returns IGESEntity;
---Purpose : returns the curve to be offset
OffsetType (me) returns Integer;
---Purpose : returns the offset distance flag
-- 1 = Single value offset (uniform distance)
-- 2 = Offset distance varying linearly
-- 3 = Offset distance specified as a function
Function (me) returns IGESEntity;
---Purpose : returns the function defining the offset if at all the offset
-- is described as a function or Null Handle.
HasFunction (me) returns Boolean;
---Purpose : returns True if function defining the offset is present.
FunctionParameter (me) returns Integer;
---Purpose : returns particular coordinate of the curve which describes offset
-- as a function of its parameters. (only used if OffsetType() = 3)
TaperedOffsetType (me) returns Integer;
---Purpose : returns tapered offset type flag (only used if OffsetType() = 2 or 3)
-- 1 = Function of arc length
-- 2 = Function of parameter
FirstOffsetDistance (me) returns Real;
---Purpose : returns first offset distance (only used if OffsetType() = 1 or 2)
ArcLength1 (me) returns Real;
---Purpose : returns arc length or parameter value (depending on value of
-- offset distance flag) of first offset distance
-- (only used if OffsetType() = 2)
SecondOffsetDistance (me) returns Real;
---Purpose : returns the second offset distance
ArcLength2 (me) returns Real;
---Purpose : returns arc length or parameter value (depending on value of
-- offset distance flag) of second offset distance
-- (only used if OffsetType() = 2)
NormalVector (me) returns Vec;
---Purpose : returns unit vector normal to plane containing curve to be offset
TransformedNormalVector (me) returns Vec;
---Purpose : returns unit vector normal to plane containing curve to be offset
-- after applying Transf. Matrix
Parameters (me; StartParam, EndParam : out Real);
-- returns start and end parameter values of the offset curve
StartParameter (me) returns Real;
---Purpose : returns Start Parameter value of the offset curve
EndParameter (me) returns Real;
---Purpose : returns End Parameter value of the offset curve
fields
--
-- Class : IGESGeom_OffsetCurve
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class OffsetCurve.
--
-- Reminder : A OffsetCurve instance is defined by :
-- The curve to be offset, the offset type (indicating
-- whether the offset is single valued, or varies linearly
-- or is a function), the curve representing the function
-- in case offset is specified as a function, the offset
-- distances, unit vector normal to the plane containing
-- offset curve, the starting and ending parameters of offset
-- curve
theBaseCurve : IGESEntity;
theOffsetType : Integer;
theFunction : IGESEntity;
theFunctionCoord : Integer;
theTaperedOffsetType : Integer;
theOffsetDistance1 : Real;
theArcLength1 : Real;
theOffsetDistance2 : Real;
theArcLength2 : Real;
theNormalVector : XYZ;
theOffsetParam1 : Real;
theOffsetParam2 : Real;
end OffsetCurve;

View File

@@ -0,0 +1,123 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_OffsetCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_OffsetCurve.ixx>
#include <gp_GTrsf.hxx>
IGESGeom_OffsetCurve::IGESGeom_OffsetCurve () { }
void IGESGeom_OffsetCurve::Init
(const Handle(IGESData_IGESEntity)& aBaseCurve,
const Standard_Integer anOffsetType,
const Handle(IGESData_IGESEntity)& aFunction,
const Standard_Integer aFunctionCoord,
const Standard_Integer aTaperedOffsetType,
const Standard_Real offDistance1,
const Standard_Real anArcLength1,
const Standard_Real offDistance2,
const Standard_Real anArcLength2,
const gp_XYZ& aNormalVec,
const Standard_Real anOffsetParam,
const Standard_Real anotherOffsetParam)
{
theBaseCurve = aBaseCurve;
theOffsetType = anOffsetType;
theFunction = aFunction;
theFunctionCoord = aFunctionCoord;
theTaperedOffsetType = aTaperedOffsetType;
theOffsetDistance1 = offDistance1;
theArcLength1 = anArcLength1;
theOffsetDistance2 = offDistance2;
theArcLength2 = anArcLength2;
theNormalVector = aNormalVec;
theOffsetParam1 = anOffsetParam;
theOffsetParam2 = anotherOffsetParam;
InitTypeAndForm(130,0);
}
Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::BaseCurve () const
{
return theBaseCurve;
}
Standard_Integer IGESGeom_OffsetCurve::OffsetType () const
{
return theOffsetType;
}
Handle(IGESData_IGESEntity) IGESGeom_OffsetCurve::Function () const
{
return theFunction;
}
Standard_Integer IGESGeom_OffsetCurve::FunctionParameter () const
{
return theFunctionCoord;
}
Standard_Integer IGESGeom_OffsetCurve::TaperedOffsetType () const
{
return theTaperedOffsetType;
}
Standard_Real IGESGeom_OffsetCurve::FirstOffsetDistance () const
{
return theOffsetDistance1;
}
Standard_Real IGESGeom_OffsetCurve::ArcLength1 () const
{
return theArcLength1;
}
Standard_Real IGESGeom_OffsetCurve::SecondOffsetDistance () const
{
return theOffsetDistance2;
}
Standard_Real IGESGeom_OffsetCurve::ArcLength2 () const
{
return theArcLength2;
}
gp_Vec IGESGeom_OffsetCurve::NormalVector () const
{
return ( gp_Vec(theNormalVector) );
}
gp_Vec IGESGeom_OffsetCurve::TransformedNormalVector () const
{
if (!HasTransf()) return gp_Vec(theNormalVector);
gp_XYZ tempXYZ(theNormalVector);
gp_GTrsf loc = Location();
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
loc.Transforms(tempXYZ);
return gp_Vec(tempXYZ);
}
Standard_Real IGESGeom_OffsetCurve::StartParameter () const
{ return theOffsetParam1; }
Standard_Real IGESGeom_OffsetCurve::EndParameter () const
{ return theOffsetParam2; }
void IGESGeom_OffsetCurve::Parameters
(Standard_Real& TT1, Standard_Real& TT2) const
{
TT1 = theOffsetParam1;
TT2 = theOffsetParam2;
}
Standard_Boolean IGESGeom_OffsetCurve::HasFunction () const
{
return (! theFunction.IsNull() );
}

View File

@@ -0,0 +1,71 @@
--
-- File : OffsetSurface.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class OffsetSurface from IGESGeom inherits IGESEntity
---Purpose: defines IGESOffsetSurface, Type <140> Form <0>
-- in package IGESGeom
-- An offset surface is a surface defined in terms of an
-- already existing surface.If S(u, v) is a parametrised
-- regular surface and N(u, v) is a differential field of
-- unit normal vectors defined on the whole surface, and
-- "d" a fixed non zero real number, then offset surface
-- to S is a parametrised surface S(u, v) given by
-- O(u, v) = S(u, v) + d * N(u, v);
-- u1 <= u <= u2; v1 <= v <= v2;
uses
Vec from gp,
XYZ from gp
is
Create returns mutable OffsetSurface;
-- Specific Methods pertaining to the class
Init (me : mutable;
anIndicatoR : XYZ;
aDistance : Real;
aSurface : IGESEntity);
---Purpose : This method is used to set the fields of the class
-- OffsetSurface
-- - anIndicator : Offset indicator
-- - aDistance : Offset distance
-- - aSurface : Surface that is offset
OffsetIndicator (me) returns Vec;
---Purpose : returns the offset indicator
TransformedOffsetIndicator (me) returns Vec;
---Purpose : returns the offset indicator after applying Transf. Matrix
Distance (me) returns Real;
---Purpose : returns the distance by which surface is offset
Surface (me) returns IGESEntity;
---Purpose : returns the surface that has been offset
fields
--
-- Class : IGESGeom_OffsetSurface
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class OffsetSurface.
--
-- Reminder : A OffsetSurface instance is defined by :
-- The coordinates of offset indicator, the offset distance
-- and the surface to be offset.
theIndicator : XYZ;
theDistance : Real;
theSurface : IGESEntity;
end OffsetSurface;

View File

@@ -0,0 +1,51 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_OffsetSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_OffsetSurface.ixx>
#include <gp_GTrsf.hxx>
IGESGeom_OffsetSurface::IGESGeom_OffsetSurface () { }
void IGESGeom_OffsetSurface::Init
(const gp_XYZ& anIndicator,
const Standard_Real aDistance,
const Handle(IGESData_IGESEntity)& aSurface)
{
theIndicator = anIndicator;
theDistance = aDistance;
theSurface = aSurface;
InitTypeAndForm(140,0);
}
gp_Vec IGESGeom_OffsetSurface::OffsetIndicator () const
{
return gp_Vec(theIndicator);
}
gp_Vec IGESGeom_OffsetSurface::TransformedOffsetIndicator () const
{
if (!HasTransf()) return gp_Vec(theIndicator);
gp_XYZ temp(theIndicator);
gp_GTrsf loc = Location();
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
loc.Transforms(temp);
return gp_Vec(temp);
}
Standard_Real IGESGeom_OffsetSurface::Distance () const
{
return theDistance;
}
Handle(IGESData_IGESEntity) IGESGeom_OffsetSurface::Surface () const
{
return theSurface;
}

101
src/IGESGeom/IGESGeom_Plane.cdl Executable file
View File

@@ -0,0 +1,101 @@
--
-- File : Plane.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class Plane from IGESGeom inherits IGESEntity
---Purpose: defines IGESPlane, Type <108> Form <-1,0,1>
-- in package IGESGeom
-- A plane entity can be used to represent unbounded plane,
-- as well as bounded portion of a plane. In either of the
-- above cases the plane is defined within definition space
-- by means of coefficients A, B, C, D where at least one of
-- A, B, C is non-zero and A * XT + B * YT + C * ZT = D
uses
Pnt from gp,
XYZ from gp
is
Create returns mutable Plane;
-- Specific Methods pertaining to the class
Init(me : mutable;
A, B, C, D : Real;
aCurve : IGESEntity;
attach : XYZ;
aSize : Real);
-- This method is used to set the fields of the
-- class Plane
-- - A, B, C, D : Coefficients in the planar equation
-- - aCurve : Bounding curve of the plane, if any
-- - attach : Location of the display symbol if one exists,
-- else (0, 0, 0)
-- - aSize : Size of the display symbol if one exists else 0
SetFormNumber (me : mutable; form : Integer);
---Purpose : Changes FormNumber (indicates the Type of Bound :
-- 0 no Bound, 1 (External) Bound, -1 Hole)
-- Remark that Init keeps this Value and must be consistent :
-- aCurve Null if FormNumber = 0, Non-Null else
-- Error if not in ranges [0-1] or [10-12]
Equation(me; A, B, C, D : out Real);
-- returns the basic equation describing the plane
-- A, B, C, D are the coefficients of plane.
TransformedEquation(me; A, B, C, D : out Real);
-- returns basic equation describing plane after applying Location()
HasBoundingCurve(me) returns Boolean;
---Purpose : returns True if there exists a bounding curve
HasBoundingCurveHole(me) returns Boolean;
---Purpose : returns True if bounding curve exists and bounded portion is negative
BoundingCurve(me) returns IGESEntity;
---Purpose : returns Optional Bounding Curve, can be positive (normal clipping)
-- or negative (hole) according to Form Number
HasSymbolAttach(me) returns Boolean;
---Purpose : returns True if SymbolSize() > 0, False if SymbolSize() = 0
SymbolAttach(me) returns Pnt;
---Purpose : returns (X, Y, Z) if symbol exists else returns (0, 0, 0)
TransformedSymbolAttach(me) returns Pnt;
---Purpose : returns (X, Y, Z) if symbol exists after applying Transf. Matrix
-- else returns (0, 0, 0)
SymbolSize(me) returns Real;
---Purpose : Size of optional display symbol
fields
--
-- Class : IGESGeom_Plane
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class Plane.
--
-- Reminder : A Plane instance is defined by :
-- The plane cooefficients, the bounding curve if any,
-- the size of an optional display symbol.
theA : Real;
theB : Real;
theC : Real;
theD : Real;
theCurve : IGESEntity;
theAttach : XYZ; -- The display symbol
theSize : Real;
end Plane;

155
src/IGESGeom/IGESGeom_Plane.cxx Executable file
View File

@@ -0,0 +1,155 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Plane.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_Plane.ixx>
#include <gp_GTrsf.hxx>
IGESGeom_Plane::IGESGeom_Plane () { }
void IGESGeom_Plane::Init
(const Standard_Real A, const Standard_Real B,
const Standard_Real C, const Standard_Real D,
const Handle(IGESData_IGESEntity)& aCurve,
const gp_XYZ& attach, const Standard_Real aSize)
{
theA = A;
theB = B;
theC = C;
theD = D;
theCurve = aCurve;
theAttach = attach;
theSize = aSize;
InitTypeAndForm(108,FormNumber());
// FormNumber : 0 No Curve. +1 Bound. -1 Hole
}
void IGESGeom_Plane::SetFormNumber (const Standard_Integer form)
{
Standard_Integer fn = 0;
if (form < 0) fn = -1;
if (form > 0) fn = 1;
InitTypeAndForm(108,fn);
}
void IGESGeom_Plane::Equation
(Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D) const
{
A = theA;
B = theB;
C = theC;
D = theD;
}
Standard_Boolean IGESGeom_Plane::HasBoundingCurve () const
{
return (!theCurve.IsNull());
}
Standard_Boolean IGESGeom_Plane::HasBoundingCurveHole () const
{
return ((FormNumber() == -1) && (!theCurve.IsNull()));
}
Handle(IGESData_IGESEntity) IGESGeom_Plane::BoundingCurve () const
{
return theCurve;
}
Standard_Boolean IGESGeom_Plane::HasSymbolAttach () const
{
return (theSize > 0);
}
gp_Pnt IGESGeom_Plane::SymbolAttach () const
{
gp_Pnt attach(theAttach);
return attach;
}
gp_Pnt IGESGeom_Plane::TransformedSymbolAttach () const
{
if (theSize > 0 && HasTransf())
{
gp_XYZ Symbol = theAttach;
Location().Transforms(Symbol);
return gp_Pnt(Symbol);
}
else return gp_Pnt(0, 0, 0);
}
Standard_Real IGESGeom_Plane::SymbolSize () const
{
return theSize;
}
void IGESGeom_Plane::TransformedEquation
(Standard_Real& A, Standard_Real& B, Standard_Real& C, Standard_Real& D) const
{
//eqn of plane AX + BY + CZ = D
Standard_Real x1,y1,z1,x2,y2,z2,x3,y3,z3;
//case 1 intersection of the plane with the XY plane.
x1 = 0.0;
y1 = 0.0;
z1 = theD / theC;
//case 2 intersection of the plane with the XZ plane.
x2 = 0.0;
y2 = theD / theB;
z2 = 0.0;
//case 3 intersection of the plane with the YZ plane.
x3 = theD / theA;
y3 = 0.0;
z3 = 0.0;
gp_XYZ P1(x1,y1,z1);
gp_XYZ P2(x2,y2,z2);
gp_XYZ P3(x3,y3,z3);
Location().Transforms(P1);
Location().Transforms(P2);
Location().Transforms(P3);
x1 = P1.X();
y1 = P1.Y();
z1 = P1.Z();
x2 = P2.X();
y2 = P2.Y();
z2 = P2.Z();
x3 = P3.X();
y3 = P3.Y();
z3 = P3.Z();
/*
General eqn of plane can also be written as
a(x1 -x2) + b(y1 - y2) + c(z1 - z2) = 0
a(x3 - x2) + b(y3 - y2) + c(z3 -z2) = 0
Applying Cramer's Rule :
a b c
------------- = --------------- = --------------- = k
|y3-y2 z3-z2| |z3-z2 x3-x2| |x3-x2 y3-y2|
|y1-y2 z1-z2| |z1-z2 x1-x2| |x1-x2 y1-y2|
.
. . a = c1*k , b = c2*k , c = c3*k
hence c1(x - x2) + c2(y - y2) + c3(z - z2) = 0
*/
Standard_Real c1,c2,c3;
c1 = (y1*(-z3 + z2) + y2*(-z1 + z3) + y3*(z1 - z2));
c2 = (x1*(z3 - z2) + x2*(-z3 + z1) + x3*(-z1 + z2));
c3 = (x1*(-y3 + y2) + x2*(-y1 + y3) + x3*(y1 - y2));
A = c1;
B = c2;
C = c3;
D = c1*x2 + c2*y2 + c3*z3;
}

57
src/IGESGeom/IGESGeom_Point.cdl Executable file
View File

@@ -0,0 +1,57 @@
--
-- File : Point.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class Point from IGESGeom inherits IGESEntity
---Purpose: defines IGESPoint, Type <116> Form <0>
-- in package IGESGeom
uses
SubfigureDef from IGESBasic,
Pnt from gp,
XYZ from gp
is
Create returns mutable Point;
-- Specific Methods pertaining to the class
Init (me : mutable; aPoint : XYZ; aSymbol : SubfigureDef);
---Purpose : This method is used to set the fields of the class Point
-- - aPoint : Coordinates of point
-- - aSymbol : SubfigureDefinition entity specifying the
-- display symbol if there exists one, or zero
Value (me) returns Pnt;
---Purpose : returns co-ordinates of the point
TransformedValue (me) returns Pnt;
---Purpose : returns co-ordinates of the point after applying Transf. Matrix
HasDisplaySymbol (me) returns Boolean;
---Purpose : returns True if symbol exists
DisplaySymbol (me) returns SubfigureDef;
---Purpose : returns display symbol entity if it exists
fields
--
-- Class : IGESGeom_Point
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class Point.
--
-- Reminder : A Point instance is defined by :
-- The coordinates of the point and display symbol if any
thePoint : XYZ;
theSymbol : SubfigureDef;
end Point;

47
src/IGESGeom/IGESGeom_Point.cxx Executable file
View File

@@ -0,0 +1,47 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Point.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_Point.ixx>
#include <gp_GTrsf.hxx>
IGESGeom_Point::IGESGeom_Point () { }
void IGESGeom_Point::Init
(const gp_XYZ& aPoint,
const Handle(IGESBasic_SubfigureDef)& aSymbol)
{
thePoint = aPoint;
theSymbol = aSymbol;
InitTypeAndForm(116,0);
}
gp_Pnt IGESGeom_Point::Value () const
{
return gp_Pnt(thePoint);
}
gp_Pnt IGESGeom_Point::TransformedValue () const
{
gp_XYZ Val = thePoint;
if (HasTransf()) Location().Transforms(Val);
gp_Pnt transVal(Val);
return transVal;
}
Standard_Boolean IGESGeom_Point::HasDisplaySymbol () const
{
return (!theSymbol.IsNull());
}
Handle(IGESBasic_SubfigureDef) IGESGeom_Point::DisplaySymbol () const
{
return theSymbol;
}

View File

@@ -0,0 +1,33 @@
-- File: IGESGeom_Protocol.cdl
-- Created: Wed May 5 11:30:30 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class Protocol from IGESGeom inherits Protocol from IGESData
---Purpose : Description of Protocol for IGESGeom
uses Type, Protocol from Interface
is
Create returns mutable Protocol from IGESGeom;
NbResources (me) returns Integer is redefined;
---Purpose : Gives the count of Resource Protocol. Here, one
-- (Protocol from IGESBasic)
Resource (me; num : Integer) returns Protocol from Interface is redefined;
---Purpose : Returns a Resource, given a rank.
TypeNumber (me; atype : any Type) returns Integer is redefined;
---Purpose : Returns a Case Number, specific of each recognized Type
-- This Case Number is then used in Libraries : the various
-- Modules attached to this class of Protocol must use them
-- in accordance (for a given value of TypeNumber, they must
-- consider the same Type as the Protocol defines)
end Protocol;

View File

@@ -0,0 +1,100 @@
#include <IGESGeom_Protocol.ixx>
#include <IGESGeom_BSplineCurve.hxx>
#include <IGESGeom_BSplineSurface.hxx>
#include <IGESGeom_Boundary.hxx>
#include <IGESGeom_BoundedSurface.hxx>
#include <IGESGeom_CircularArc.hxx>
#include <IGESGeom_CompositeCurve.hxx>
#include <IGESGeom_ConicArc.hxx>
#include <IGESGeom_CopiousData.hxx>
#include <IGESGeom_CurveOnSurface.hxx>
#include <IGESGeom_Direction.hxx>
#include <IGESGeom_Flash.hxx>
#include <IGESGeom_Line.hxx>
#include <IGESGeom_OffsetCurve.hxx>
#include <IGESGeom_OffsetSurface.hxx>
#include <IGESGeom_Plane.hxx>
#include <IGESGeom_Point.hxx>
#include <IGESGeom_RuledSurface.hxx>
#include <IGESGeom_SplineCurve.hxx>
#include <IGESGeom_SplineSurface.hxx>
#include <IGESGeom_SurfaceOfRevolution.hxx>
#include <IGESGeom_TabulatedCylinder.hxx>
#include <IGESGeom_TransformationMatrix.hxx>
#include <IGESGeom_TrimmedSurface.hxx>
#include <IGESBasic.hxx>
#include <IGESBasic_Protocol.hxx>
static int deja = 0;
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
atype16,atype17,atype18,atype19,atype20,atype21,atype22,atype23;
IGESGeom_Protocol::IGESGeom_Protocol ()
{
if (deja) return; deja = 1;
atype01 = STANDARD_TYPE(IGESGeom_BSplineCurve);
atype02 = STANDARD_TYPE(IGESGeom_BSplineSurface);
atype03 = STANDARD_TYPE(IGESGeom_Boundary);
atype04 = STANDARD_TYPE(IGESGeom_BoundedSurface);
atype05 = STANDARD_TYPE(IGESGeom_CircularArc);
atype06 = STANDARD_TYPE(IGESGeom_CompositeCurve);
atype07 = STANDARD_TYPE(IGESGeom_ConicArc);
atype08 = STANDARD_TYPE(IGESGeom_CopiousData);
atype09 = STANDARD_TYPE(IGESGeom_CurveOnSurface);
atype10 = STANDARD_TYPE(IGESGeom_Direction);
atype11 = STANDARD_TYPE(IGESGeom_Flash);
atype12 = STANDARD_TYPE(IGESGeom_Line);
atype13 = STANDARD_TYPE(IGESGeom_OffsetCurve);
atype14 = STANDARD_TYPE(IGESGeom_OffsetSurface);
atype15 = STANDARD_TYPE(IGESGeom_Plane);
atype16 = STANDARD_TYPE(IGESGeom_Point);
atype17 = STANDARD_TYPE(IGESGeom_RuledSurface);
atype18 = STANDARD_TYPE(IGESGeom_SplineCurve);
atype19 = STANDARD_TYPE(IGESGeom_SplineSurface);
atype20 = STANDARD_TYPE(IGESGeom_SurfaceOfRevolution);
atype21 = STANDARD_TYPE(IGESGeom_TabulatedCylinder);
atype22 = STANDARD_TYPE(IGESGeom_TransformationMatrix);
atype23 = STANDARD_TYPE(IGESGeom_TrimmedSurface);
}
Standard_Integer IGESGeom_Protocol::NbResources () const
{ return 1; }
Handle(Interface_Protocol) IGESGeom_Protocol::Resource
(const Standard_Integer num) const
{
Handle(Interface_Protocol) res = IGESBasic::Protocol();;
return res;
}
Standard_Integer IGESGeom_Protocol::TypeNumber
(const Handle(Standard_Type)& atype) const
{
if (atype == atype01) return 1;
else if (atype == atype02) return 2;
else if (atype == atype03) return 3;
else if (atype == atype04) return 4;
else if (atype == atype05) return 5;
else if (atype == atype06) return 6;
else if (atype == atype07) return 7;
else if (atype == atype08) return 8;
else if (atype == atype09) return 9;
else if (atype == atype10) return 10;
else if (atype == atype11) return 11;
else if (atype == atype12) return 12;
else if (atype == atype13) return 13;
else if (atype == atype14) return 14;
else if (atype == atype15) return 15;
else if (atype == atype16) return 16;
else if (atype == atype17) return 17;
else if (atype == atype18 ) return 18;
else if (atype == atype19) return 19;
else if (atype == atype20) return 20;
else if (atype == atype21) return 21;
else if (atype == atype22) return 22;
else if (atype == atype23) return 23;
return 0;
}

View File

@@ -0,0 +1,37 @@
-- File: IGESGeom_ReadWriteModule.cdl
-- Created: Mon Sep 6 19:22:12 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ReadWriteModule from IGESGeom inherits ReadWriteModule from IGESData
---Purpose : Defines Geom File Access Module for IGESGeom (specific parts)
-- Specific actions concern : Read and Write Own Parameters of
-- an IGESEntity.
uses Transient, FileReaderData,
IGESEntity, DirPart, IGESReaderData, ParamReader, IGESWriter
raises DomainError
is
Create returns mutable ReadWriteModule from IGESGeom;
---Purpose : Creates a ReadWriteModule & puts it into ReaderLib & WriterLib
CaseIGES (me; typenum, formnum : Integer) returns Integer;
---Purpose : Defines Case Numbers for Entities of IGESGeom
ReadOwnParams (me; CN : Integer; ent : mutable IGESEntity;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError;
---Purpose : Reads own parameters from file for an Entity of IGESGeom
WriteOwnParams (me; CN : Integer; ent : IGESEntity;
IW : in out IGESWriter);
---Purpose : Writes own parameters to IGESWriter
end ReadWriteModule;

View File

@@ -0,0 +1,435 @@
#include <IGESGeom_ReadWriteModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESGeom_BSplineCurve.hxx>
#include <IGESGeom_BSplineSurface.hxx>
#include <IGESGeom_Boundary.hxx>
#include <IGESGeom_BoundedSurface.hxx>
#include <IGESGeom_CircularArc.hxx>
#include <IGESGeom_CompositeCurve.hxx>
#include <IGESGeom_ConicArc.hxx>
#include <IGESGeom_CopiousData.hxx>
#include <IGESGeom_CurveOnSurface.hxx>
#include <IGESGeom_Direction.hxx>
#include <IGESGeom_Flash.hxx>
#include <IGESGeom_Line.hxx>
#include <IGESGeom_OffsetCurve.hxx>
#include <IGESGeom_OffsetSurface.hxx>
#include <IGESGeom_Plane.hxx>
#include <IGESGeom_Point.hxx>
#include <IGESGeom_RuledSurface.hxx>
#include <IGESGeom_SplineCurve.hxx>
#include <IGESGeom_SplineSurface.hxx>
#include <IGESGeom_SurfaceOfRevolution.hxx>
#include <IGESGeom_TabulatedCylinder.hxx>
#include <IGESGeom_TransformationMatrix.hxx>
#include <IGESGeom_TrimmedSurface.hxx>
#include <IGESGeom_ToolBSplineCurve.hxx>
#include <IGESGeom_ToolBSplineSurface.hxx>
#include <IGESGeom_ToolBoundary.hxx>
#include <IGESGeom_ToolBoundedSurface.hxx>
#include <IGESGeom_ToolCircularArc.hxx>
#include <IGESGeom_ToolCompositeCurve.hxx>
#include <IGESGeom_ToolConicArc.hxx>
#include <IGESGeom_ToolCopiousData.hxx>
#include <IGESGeom_ToolCurveOnSurface.hxx>
#include <IGESGeom_ToolDirection.hxx>
#include <IGESGeom_ToolFlash.hxx>
#include <IGESGeom_ToolLine.hxx>
#include <IGESGeom_ToolOffsetCurve.hxx>
#include <IGESGeom_ToolOffsetSurface.hxx>
#include <IGESGeom_ToolPlane.hxx>
#include <IGESGeom_ToolPoint.hxx>
#include <IGESGeom_ToolRuledSurface.hxx>
#include <IGESGeom_ToolSplineCurve.hxx>
#include <IGESGeom_ToolSplineSurface.hxx>
#include <IGESGeom_ToolSurfaceOfRevolution.hxx>
#include <IGESGeom_ToolTabulatedCylinder.hxx>
#include <IGESGeom_ToolTransformationMatrix.hxx>
#include <IGESGeom_ToolTrimmedSurface.hxx>
// Each Module is attached to a Protocol : it must interprete Case Numbers
// (arguments <CN> of various methods) in accordance to values returned by
// the method TypeNumber from this Protocol
IGESGeom_ReadWriteModule::IGESGeom_ReadWriteModule () { }
Standard_Integer IGESGeom_ReadWriteModule::CaseIGES
(const Standard_Integer typenum, const Standard_Integer formnum) const
{
switch (typenum) {
case 100 : return 5;
case 102 : return 6;
case 104 : return 7;
case 106 : if (formnum < 20 || formnum > 40) return 8;
break;
case 108 : return 15;
case 110 : return 12;
case 112 : return 18;
case 114 : return 19;
case 116 : return 16;
case 118 : return 17;
case 120 : return 20;
case 122 : return 21;
case 123 : return 10;
case 124 : return 22;
case 125 : return 11;
case 126 : return 1;
case 128 : return 2;
case 130 : return 13;
case 140 : return 14;
case 141 : return 3;
case 142 : return 9;
case 143 : return 4;
case 144 : return 23;
default : break;
}
return 0;
}
void IGESGeom_ReadWriteModule::ReadOwnParams
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGeom_BSplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineCurve tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 2 : {
DeclareAndCast(IGESGeom_BSplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineSurface tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 3 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundary tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 4 : {
DeclareAndCast(IGESGeom_BoundedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundedSurface tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 5 : {
DeclareAndCast(IGESGeom_CircularArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCircularArc tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 6 : {
DeclareAndCast(IGESGeom_CompositeCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCompositeCurve tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolConicArc tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 8 : {
DeclareAndCast(IGESGeom_CopiousData,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCopiousData tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 9 : {
DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCurveOnSurface tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 10 : {
DeclareAndCast(IGESGeom_Direction,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolDirection tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 11 : {
DeclareAndCast(IGESGeom_Flash,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolFlash tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 12 : {
DeclareAndCast(IGESGeom_Line,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolLine tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetCurve tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 14 : {
DeclareAndCast(IGESGeom_OffsetSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetSurface tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 15 : {
DeclareAndCast(IGESGeom_Plane,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPlane tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 16 : {
DeclareAndCast(IGESGeom_Point,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPoint tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 17 : {
DeclareAndCast(IGESGeom_RuledSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolRuledSurface tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 18 : {
DeclareAndCast(IGESGeom_SplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineCurve tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 19 : {
DeclareAndCast(IGESGeom_SplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineSurface tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 20 : {
DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSurfaceOfRevolution tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 21 : {
DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTabulatedCylinder tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTransformationMatrix tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 23 : {
DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTrimmedSurface tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
default : break;
}
}
void IGESGeom_ReadWriteModule::WriteOwnParams
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
IGESData_IGESWriter& IW) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGeom_BSplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineCurve tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 2 : {
DeclareAndCast(IGESGeom_BSplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineSurface tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 3 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundary tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 4 : {
DeclareAndCast(IGESGeom_BoundedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundedSurface tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 5 : {
DeclareAndCast(IGESGeom_CircularArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCircularArc tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 6 : {
DeclareAndCast(IGESGeom_CompositeCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCompositeCurve tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolConicArc tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 8 : {
DeclareAndCast(IGESGeom_CopiousData,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCopiousData tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 9 : {
DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCurveOnSurface tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 10 : {
DeclareAndCast(IGESGeom_Direction,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolDirection tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 11 : {
DeclareAndCast(IGESGeom_Flash,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolFlash tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 12 : {
DeclareAndCast(IGESGeom_Line,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolLine tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetCurve tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 14 : {
DeclareAndCast(IGESGeom_OffsetSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetSurface tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 15 : {
DeclareAndCast(IGESGeom_Plane,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPlane tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 16 : {
DeclareAndCast(IGESGeom_Point,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPoint tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 17 : {
DeclareAndCast(IGESGeom_RuledSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolRuledSurface tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 18 : {
DeclareAndCast(IGESGeom_SplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineCurve tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 19 : {
DeclareAndCast(IGESGeom_SplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineSurface tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 20 : {
DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSurfaceOfRevolution tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 21 : {
DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTabulatedCylinder tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTransformationMatrix tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 23 : {
DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTrimmedSurface tool;
tool.WriteOwnParams(anent,IW);
}
break;
default : break;
}
}

View File

@@ -0,0 +1,87 @@
--
-- File : RuledSurface.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class RuledSurface from IGESGeom inherits IGESEntity
---Purpose: defines IGESRuledSurface, Type <118> Form <0-1>
-- in package IGESGeom
-- A ruled surface is formed by moving a line connecting points
-- of equal relative arc length or equal relative parametric
-- value on two parametric curves from a start point to a
-- terminate point on the curves. The parametric curves may be
-- points, lines, circles, conics, rational B-splines,
-- parametric splines or any parametric curve defined in
-- the IGES specification.
uses
Pnt from gp
is
Create returns mutable RuledSurface;
-- Specific Methods pertaining to the class
Init (me : mutable;
aCurve, anotherCurve : IGESEntity;
aDirFlag, aDevFlag : Integer);
---Purpose : This method is used to set the fields of the class
-- RuledSurface
-- - aCurve : First parametric curve
-- - anotherCurve : Second parametric curve
-- - aDirFlag : Direction Flag
-- 0 = Join first to first, last to last
-- 1 = Join first to last, last to first
-- - aDevFlag : Developable Surface Flag
-- 1 = Developable
-- 0 = Possibly not
SetRuledByParameter (me : mutable; mode : Boolean);
---Purpose : Sets <me> to be Ruled by Parameter (Form 1) if <mode> is
-- True, or Ruled by Length (Form 0) else
IsRuledByParameter (me) returns Boolean;
---Purpose : Returns True if Form is 1
FirstCurve (me) returns IGESEntity;
---Purpose : returns the first curve
SecondCurve (me) returns IGESEntity;
---Purpose : returns the second curve
DirectionFlag (me) returns Integer;
---Purpose : return the sense of direction
-- 0 = Join first to first, last to last
-- 1 = Join first to last, last to first
IsDevelopable (me) returns Boolean;
---Purpose : returns True if developable else False
fields
--
-- Class : IGESGeom_RuledSurface
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class RuledSurface.
--
-- Reminder : A RuledSurface instance is defined by :
-- Two parametric curves, and a flag indicating direction
-- (whether first point of one curve is joined to first
-- point of another or last point of one curve is joined
-- to the first point of another), and a flag indicating
-- whether the surface is developable or not.
theCurve1 : IGESEntity;
theCurve2 : IGESEntity;
theDirFlag : Integer;
theDevFlag : Integer;
end RuledSurface;

View File

@@ -0,0 +1,58 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_RuledSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_RuledSurface.ixx>
IGESGeom_RuledSurface::IGESGeom_RuledSurface () { }
void IGESGeom_RuledSurface::Init
(const Handle(IGESData_IGESEntity)& aCurve,
const Handle(IGESData_IGESEntity)& anotherCurve,
const Standard_Integer aDirFlag,
const Standard_Integer aDevFlag)
{
theCurve1 = aCurve;
theCurve2 = anotherCurve;
theDirFlag = aDirFlag;
theDevFlag = aDevFlag;
InitTypeAndForm(118,FormNumber());
// FormNumber 0-1 : Ruling spec. 0/Arc Length 1/Parameter
}
void IGESGeom_RuledSurface::SetRuledByParameter (const Standard_Boolean F)
{
InitTypeAndForm(118, (F ? 1 : 0));
}
Handle(IGESData_IGESEntity) IGESGeom_RuledSurface::FirstCurve () const
{
return theCurve1;
}
Handle(IGESData_IGESEntity) IGESGeom_RuledSurface::SecondCurve () const
{
return theCurve2;
}
Standard_Integer IGESGeom_RuledSurface::DirectionFlag () const
{
return theDirFlag;
}
Standard_Boolean IGESGeom_RuledSurface::IsDevelopable () const
{
return (theDevFlag == 1);
}
Standard_Boolean IGESGeom_RuledSurface::IsRuledByParameter () const
{
return (FormNumber() != 0);
}

View File

@@ -0,0 +1,29 @@
-- File: IGESGeom_SpecificModule.cdl
-- Created: Tue Sep 7 11:14:37 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class SpecificModule from IGESGeom inherits SpecificModule from IGESData
---Purpose : Defines Services attached to IGES Entities :
-- Dump & OwnCorrect, for IGESGeom
uses Messenger from Message, IGESEntity, IGESDumper
is
Create returns mutable SpecificModule from IGESGeom;
---Purpose : Creates a SpecificModule from IGESGeom & puts it into SpecificLib
OwnDump (me; CN : Integer; ent : IGESEntity;
dumper : IGESDumper; S : Messenger from Message; own : Integer);
---Purpose : Specific Dump (own parameters) for IGESGeom
OwnCorrect (me; CN : Integer; ent : mutable IGESEntity)
returns Boolean is redefined;
---Purpose : Performs non-ambiguous Correction on Entities which support
-- them (Boundary,ConicArc,Flash,OffsetCurve,TransformationMatrix)
end SpecificModule;

View File

@@ -0,0 +1,278 @@
#include <IGESGeom_SpecificModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESGeom_BSplineCurve.hxx>
#include <IGESGeom_BSplineSurface.hxx>
#include <IGESGeom_Boundary.hxx>
#include <IGESGeom_BoundedSurface.hxx>
#include <IGESGeom_CircularArc.hxx>
#include <IGESGeom_CompositeCurve.hxx>
#include <IGESGeom_ConicArc.hxx>
#include <IGESGeom_CopiousData.hxx>
#include <IGESGeom_CurveOnSurface.hxx>
#include <IGESGeom_Direction.hxx>
#include <IGESGeom_Flash.hxx>
#include <IGESGeom_Line.hxx>
#include <IGESGeom_OffsetCurve.hxx>
#include <IGESGeom_OffsetSurface.hxx>
#include <IGESGeom_Plane.hxx>
#include <IGESGeom_Point.hxx>
#include <IGESGeom_RuledSurface.hxx>
#include <IGESGeom_SplineCurve.hxx>
#include <IGESGeom_SplineSurface.hxx>
#include <IGESGeom_SurfaceOfRevolution.hxx>
#include <IGESGeom_TabulatedCylinder.hxx>
#include <IGESGeom_TransformationMatrix.hxx>
#include <IGESGeom_TrimmedSurface.hxx>
#include <IGESGeom_ToolBSplineCurve.hxx>
#include <IGESGeom_ToolBSplineSurface.hxx>
#include <IGESGeom_ToolBoundary.hxx>
#include <IGESGeom_ToolBoundedSurface.hxx>
#include <IGESGeom_ToolCircularArc.hxx>
#include <IGESGeom_ToolCompositeCurve.hxx>
#include <IGESGeom_ToolConicArc.hxx>
#include <IGESGeom_ToolCopiousData.hxx>
#include <IGESGeom_ToolCurveOnSurface.hxx>
#include <IGESGeom_ToolDirection.hxx>
#include <IGESGeom_ToolFlash.hxx>
#include <IGESGeom_ToolLine.hxx>
#include <IGESGeom_ToolOffsetCurve.hxx>
#include <IGESGeom_ToolOffsetSurface.hxx>
#include <IGESGeom_ToolPlane.hxx>
#include <IGESGeom_ToolPoint.hxx>
#include <IGESGeom_ToolRuledSurface.hxx>
#include <IGESGeom_ToolSplineCurve.hxx>
#include <IGESGeom_ToolSplineSurface.hxx>
#include <IGESGeom_ToolSurfaceOfRevolution.hxx>
#include <IGESGeom_ToolTabulatedCylinder.hxx>
#include <IGESGeom_ToolTransformationMatrix.hxx>
#include <IGESGeom_ToolTrimmedSurface.hxx>
// Each Module is attached to a Protocol : it must interprete Case Numbers
// (arguments <CN> of various methods) in accordance to values returned by
// the method TypeNumber from this Protocol
IGESGeom_SpecificModule::IGESGeom_SpecificModule() { }
void IGESGeom_SpecificModule::OwnDump
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S,
const Standard_Integer own) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGeom_BSplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineCurve tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 2 : {
DeclareAndCast(IGESGeom_BSplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBSplineSurface tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 3 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundary tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 4 : {
DeclareAndCast(IGESGeom_BoundedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolBoundedSurface tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 5 : {
DeclareAndCast(IGESGeom_CircularArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCircularArc tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 6 : {
DeclareAndCast(IGESGeom_CompositeCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCompositeCurve tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolConicArc tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 8 : {
DeclareAndCast(IGESGeom_CopiousData,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCopiousData tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 9 : {
DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolCurveOnSurface tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 10 : {
DeclareAndCast(IGESGeom_Direction,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolDirection tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 11 : {
DeclareAndCast(IGESGeom_Flash,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolFlash tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 12 : {
DeclareAndCast(IGESGeom_Line,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolLine tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetCurve tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 14 : {
DeclareAndCast(IGESGeom_OffsetSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolOffsetSurface tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 15 : {
DeclareAndCast(IGESGeom_Plane,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPlane tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 16 : {
DeclareAndCast(IGESGeom_Point,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolPoint tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 17 : {
DeclareAndCast(IGESGeom_RuledSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolRuledSurface tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 18 : {
DeclareAndCast(IGESGeom_SplineCurve,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineCurve tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 19 : {
DeclareAndCast(IGESGeom_SplineSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSplineSurface tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 20 : {
DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolSurfaceOfRevolution tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 21 : {
DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTabulatedCylinder tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTransformationMatrix tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 23 : {
DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent);
if (anent.IsNull()) return;
IGESGeom_ToolTrimmedSurface tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
default : break;
}
}
Standard_Boolean IGESGeom_SpecificModule::OwnCorrect
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
// Applies only on some types
switch (CN) {
case 3 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolBoundary tool;
return tool.OwnCorrect(anent);
}
case 7 : {
DeclareAndCast(IGESGeom_ConicArc,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolConicArc tool;
return tool.OwnCorrect(anent);
}
case 9 : {
DeclareAndCast(IGESGeom_Boundary,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolBoundary tool;
return tool.OwnCorrect(anent);
}
case 11 : {
DeclareAndCast(IGESGeom_Flash,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolFlash tool;
return tool.OwnCorrect(anent);
}
case 13 : {
DeclareAndCast(IGESGeom_OffsetCurve,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolOffsetCurve tool;
return tool.OwnCorrect(anent);
}
case 22 : {
DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent);
if (anent.IsNull()) break;
IGESGeom_ToolTransformationMatrix tool;
return tool.OwnCorrect(anent);
}
default : break;
}
return Standard_False;
}

View File

@@ -0,0 +1,170 @@
--
-- File : SplineCurve.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class SplineCurve from IGESGeom
inherits IGESEntity
---Purpose: Defines IGESSplineCurve, Type <112> Form <0>
-- in package IGESGeom
-- The parametric spline is a sequence of parametric
-- polynomial segments. The curve could be of the type
-- Linear, Quadratic, Cubic, Wilson-Fowler, Modified
-- Wilson-Fowler, B-Spline. The N polynomial segments
-- are delimited by the break points T(1), T(2), T(3),
-- ..., T(N+1).
uses
Pnt from gp,
HArray1OfReal from TColStd,
HArray2OfReal from TColStd
raises DimensionMismatch, OutOfRange
is
Create returns mutable SplineCurve;
-- Specific Methods pertaining to the class
Init (me : mutable;
aType, aDegree : Integer;
nbDimensions : Integer;
allBreakPoints : HArray1OfReal;
allXPolynomials : HArray2OfReal;
allYPolynomials : HArray2OfReal;
allZPolynomials : HArray2OfReal;
allXvalues : HArray1OfReal;
allYvalues : HArray1OfReal;
allZvalues : HArray1OfReal)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- SplineCurve
-- - aType : Spline Type
-- 1 = Linear
-- 2 = Quadratic
-- 3 = Cubic
-- 4 = Wilson-Fowler
-- 5 = Modified Wilson-Fowler
-- 6 = B Spline
-- - aDegree : Degree of continuity w.r.t. arc length
-- - nbDimensions : Number of dimensions
-- 2 = Planar
-- 3 = Non-planar
-- - allBreakPoints : Array of break points
-- - allXPolynomials : X coordinate polynomials of segments
-- - allYPolynomials : Y coordinate polynomials of segments
-- - allZPolynomials : Z coordinate polynomials of segments
-- - allXValues : Values of 1st, 2nd, 3rd derivatives of
-- X polynomials at the terminate point
-- and values of X at terminate point
-- - allYValues : Values of 1st, 2nd, 3rd derivatives of
-- Y polynomials at the terminate point
-- and values of Y at terminate point
-- - allZvalues : Values of 1st, 2nd, 3rd derivatives of
-- Z polynomials at the terminate point
-- and values of Z at terminate point
-- raises exception if allXPolynomials, allYPolynomials
-- & allZPolynomials are not of same size OR allXValues, allYValues
-- & allZValues are not of size 4
SplineType(me) returns Integer;
---Purpose : returns the type of Spline curve
Degree(me) returns Integer;
---Purpose : returns the degree of the curve
NbDimensions(me) returns Integer;
---Purpose : returns the number of dimensions
-- 2 = Planar
-- 3 = Non-planar
NbSegments(me) returns Integer;
---Purpose : returns the number of segments
BreakPoint(me ; Index : Integer) returns Real
raises OutOfRange;
---Purpose : returns breakpoint of piecewise polynomial
-- raises exception if Index <= 0 or Index > NbSegments() + 1
XCoordPolynomial(me ; Index : Integer; AX, BX, CX, DX : out Real)
raises OutOfRange;
---Purpose: returns X coordinate polynomial for segment referred to by Index
-- raises exception if Index <= 0 or Index > NbSegments()
YCoordPolynomial(me ; Index : Integer; AY, BY, CY, DY : out Real)
raises OutOfRange;
---Purpose: returns Y coordinate polynomial for segment referred to by Index
-- raises exception if Index <= 0 or Index > NbSegments()
ZCoordPolynomial(me ; Index : Integer; AZ, BZ, CZ, DZ : out Real)
raises OutOfRange;
---Purpose: returns Z coordinate polynomial for segment referred to by Index
-- raises exception if Index <= 0 or Index > NbSegments()
XValues(me ; TPX0, TPX1, TPX2, TPX3 : out Real);
---Purpose: returns the value of X polynomial, the values of 1st, 2nd and
-- 3rd derivatives of the X polynomial at the terminate point
YValues(me ; TPY0, TPY1, TPY2, TPY3 : out Real);
---Purpose: returns the value of Y polynomial, the values of 1st, 2nd and
-- 3rd derivatives of the Y polynomial at the termminate point
ZValues(me ; TPZ0, TPZ1, TPZ2, TPZ3 : out Real);
---Purpose: returns the value of Z polynomial, the values of 1st, 2nd and
-- 3rd derivatives of the Z polynomial at the termminate point
fields
--
-- Class : IGESGeom_SplineCurve
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class SplineCurve.
--
-- Reminder : A SplineCurve instance is defined by :
-- The type of spline, degree of continuity, the number of
-- dimensions, the number of segments, the break points, the
-- X, Y, Z polynomials for all the segments, the first, second
-- and third derivative values of X, Y, Z polynomials at the
-- terminate point.
theType : Integer;
theDegree : Integer;
theNbDimensions : Integer;
theBreakPoints : HArray1OfReal;
theXCoordsPolynomial : HArray2OfReal;
-- stores X coordinate polynomial for all breakpoints.
-- size of array is (N X 4)
-- i.e., AX(1), BX(1), CX(1), DX(1)
-- ... , ... , ... , ...
-- AX(N), BX(N), CX(N), DX(N)
theYCoordsPolynomial : HArray2OfReal;
-- stores Y coordinate polynomial for all breakpoints.
-- size of array is (N X 4)
-- i.e., AY(1), BY(1), CY(1), DY(1)
-- ... , ... , ... , ...
-- AY(N), BY(N), CY(N), DY(N)
theZCoordsPolynomial : HArray2OfReal;
-- stores Z coordinate polynomial for all breakpoints.
-- size of array is (N X 4)
-- i.e., AZ(1), BZ(1), CZ(1), DZ(1)
-- ... , ... , ... , ...
-- AZ(N), BZ(N), CZ(N), DZ(N)
theXvalues : HArray1OfReal;
-- Stores X value, X 1st derivative, X 2nd derivative/2!
-- and X 3rd derivative/3!
theYvalues : HArray1OfReal;
-- Stores Y value, Y 1st derivative, Y 2nd derivative/2!
-- and Y 3rd derivative/3!
theZvalues : HArray1OfReal;
-- Stores Z value, Z 1st derivative, Z 2nd derivative/2!
-- and Z 3rd derivative/3!
end SplineCurve;

View File

@@ -0,0 +1,151 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_SplineCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_SplineCurve.ixx>
IGESGeom_SplineCurve::IGESGeom_SplineCurve () { }
void IGESGeom_SplineCurve::Init
(const Standard_Integer aType,
const Standard_Integer aDegree,
const Standard_Integer nbDimensions,
const Handle(TColStd_HArray1OfReal)& allBreakPoints,
const Handle(TColStd_HArray2OfReal)& allXPolynomials,
const Handle(TColStd_HArray2OfReal)& allYPolynomials,
const Handle(TColStd_HArray2OfReal)& allZPolynomials,
const Handle(TColStd_HArray1OfReal)& allXvalues,
const Handle(TColStd_HArray1OfReal)& allYvalues,
const Handle(TColStd_HArray1OfReal)& allZvalues)
{
Standard_Integer len = allXPolynomials->ColLength();
if ((len != allYPolynomials->ColLength()) ||
(len != allZPolynomials->ColLength()) )
Standard_DimensionMismatch::Raise
("IGESGeom_SplineCurve : Column Length of HArray2s in Init");
if (allBreakPoints->Lower() != 1 || allXvalues->Lower() != 1 ||
allYvalues->Lower() != 1 || allZvalues->Lower() != 1 ||
allXPolynomials->LowerCol() != 1 || allXPolynomials->LowerRow() != 1 ||
allYPolynomials->LowerCol() != 1 || allXPolynomials->LowerRow() != 1 ||
allZPolynomials->LowerCol() != 1 || allZPolynomials->LowerRow() != 1)
Standard_DimensionMismatch::Raise
("IGESGeom_SplineCurve : Lower Indices of HArrays in Init");
len = allXPolynomials->RowLength();
if ((len != allYPolynomials->RowLength()) ||
(len != allZPolynomials->RowLength()) )
Standard_DimensionMismatch::Raise
("IGESGeom_SplineCurve : Row Length of HArray2s in Init");
len = allXvalues->Length();
if ((len != allYvalues->Length()) || (len != allZvalues->Length()) )
Standard_DimensionMismatch::Raise
("IGESGeom_SplineCurve : Length of HArray1s in Init");
theType = aType;
theDegree = aDegree;
theNbDimensions = nbDimensions;
theBreakPoints = allBreakPoints;
theXCoordsPolynomial = allXPolynomials;
theYCoordsPolynomial = allYPolynomials;
theZCoordsPolynomial = allZPolynomials;
theXvalues = allXvalues;
theYvalues = allYvalues;
theZvalues = allZvalues;
InitTypeAndForm(112,0);
}
Standard_Integer IGESGeom_SplineCurve::SplineType () const
{
return theType;
}
Standard_Integer IGESGeom_SplineCurve::Degree () const
{
return theDegree;
}
Standard_Integer IGESGeom_SplineCurve::NbDimensions () const
{
return theNbDimensions;
}
Standard_Integer IGESGeom_SplineCurve::NbSegments () const
{
if(theBreakPoints.IsNull())
return 0;
else
return ((theBreakPoints->Length()) - 1);
}
Standard_Real IGESGeom_SplineCurve::BreakPoint
(const Standard_Integer Index) const
{
return theBreakPoints->Value(Index);
}
void IGESGeom_SplineCurve::XCoordPolynomial
(const Standard_Integer Index, Standard_Real& AX,
Standard_Real& BX, Standard_Real& CX, Standard_Real& DX) const
{
AX = theXCoordsPolynomial->Value(Index, 1);
BX = theXCoordsPolynomial->Value(Index, 2);
CX = theXCoordsPolynomial->Value(Index, 3);
DX = theXCoordsPolynomial->Value(Index, 4);
}
void IGESGeom_SplineCurve::YCoordPolynomial
(const Standard_Integer Index, Standard_Real& AY,
Standard_Real& BY, Standard_Real& CY, Standard_Real& DY) const
{
AY = theYCoordsPolynomial->Value(Index, 1);
BY = theYCoordsPolynomial->Value(Index, 2);
CY = theYCoordsPolynomial->Value(Index, 3);
DY = theYCoordsPolynomial->Value(Index, 4);
}
void IGESGeom_SplineCurve::ZCoordPolynomial
(const Standard_Integer Index, Standard_Real& AZ,
Standard_Real& BZ, Standard_Real& CZ, Standard_Real& DZ) const
{
AZ = theZCoordsPolynomial->Value(Index, 1);
BZ = theZCoordsPolynomial->Value(Index, 2);
CZ = theZCoordsPolynomial->Value(Index, 3);
DZ = theZCoordsPolynomial->Value(Index, 4);
}
void IGESGeom_SplineCurve::XValues
(Standard_Real& TPX0, Standard_Real& TPX1,
Standard_Real& TPX2, Standard_Real& TPX3) const
{
TPX0 = theXvalues->Value(1);
TPX1 = theXvalues->Value(2);
TPX2 = theXvalues->Value(3);
TPX3 = theXvalues->Value(4);
}
void IGESGeom_SplineCurve::YValues
(Standard_Real& TPY0, Standard_Real& TPY1,
Standard_Real& TPY2, Standard_Real& TPY3) const
{
TPY0 = theYvalues->Value(1);
TPY1 = theYvalues->Value(2);
TPY2 = theYvalues->Value(3);
TPY3 = theYvalues->Value(4);
}
void IGESGeom_SplineCurve::ZValues
(Standard_Real& TPZ0, Standard_Real& TPZ1,
Standard_Real& TPZ2, Standard_Real& TPZ3) const
{
TPZ0 = theZvalues->Value(1);
TPZ1 = theZvalues->Value(2);
TPZ2 = theZvalues->Value(3);
TPZ3 = theZvalues->Value(4);
}

View File

@@ -0,0 +1,135 @@
--
-- File : SplineSurface.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class SplineSurface from IGESGeom inherits IGESEntity
---Purpose: defines IGESSplineSurface, Type <114> Form <0>
-- in package IGESGeom
-- A parametric spline surface is a grid of polynomial
-- patches. Patch could be of the type Linear, Quadratic,
-- Cubic, Wilson-Fowler, Modified Wilson-Fowler, B-Spline
-- The M * N grid of patches is defined by the 'u' break
-- points TU(1), TU(2), ..., TU(M+1) and the 'v' break
-- points TV(1), TV(2), TV(3) ..., TV(N+1).
uses
Pnt from gp,
HArray1OfReal from TColStd,
HArray2OfReal from TColStd,
HArray2OfHArray1OfReal from IGESBasic
raises DimensionMismatch, OutOfRange
is
Create returns mutable SplineSurface;
-- Specific Methods pertaining to the class
Init (me : mutable;
aBoundaryType, aPatchType : Integer;
allUBreakpoints, allVBreakpoints : HArray1OfReal;
allXCoeffs, allYCoeffs, allZCoeffs : HArray2OfHArray1OfReal)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- SplineSurface
-- - aBoundaryType : Type of Spline boundary
-- 1 = Linear
-- 2 = Quadratic
-- 3 = Cubic
-- 4 = Wilson-Fowler
-- 5 = Modified Wilson-Fowler
-- 6 = B-spline
-- - aPatchType : Type of patch contained in the grid
-- 1 = Cartesian Product
-- 0 = Unspecified
-- - allUBreakpoints : u values of grid lines
-- - allVBreakpoints : v values of grid lines
-- - allXCoeffs : X coefficients of M x N patches
-- - allYCoeffs : Y coefficients of M x N patches
-- - allZCoeffs : Z coefficients of M x N patches
-- raises exception if allXCoeffs, allYCoeffs & allZCoeffs are not
-- of the same size.
-- or if the size of each element of the double array is not 16
NbUSegments(me) returns Integer;
---Purpose : returns the number of U segments
NbVSegments(me) returns Integer;
---Purpose : returns the number of V segments
BoundaryType(me) returns Integer;
---Purpose : returns boundary type
PatchType(me) returns Integer;
---Purpose : returns patch type
UBreakPoint(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns U break point of the grid line referred to by anIndex
-- raises exception if anIndex <= 0 or anIndex > NbUSegments() + 1
VBreakPoint(me; anIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns V break point of the grid line referred to by anIndex
-- raises exception if anIndex <= 0 or anIndex > NbVSegments() + 1
XPolynomial(me; anIndex1, anIndex2 : Integer) returns HArray1OfReal
raises OutOfRange;
---Purpose : returns X polynomial of patch referred to by anIndex1, anIndex2
-- raises exception if anIndex1 <= 0 or anIndex1 > NbUSegments()
-- or anIndex2 <= 0 or anIndex2 > NbVSegments()
YPolynomial(me; anIndex1, anIndex2 : Integer) returns HArray1OfReal
raises OutOfRange;
---Purpose : returns Y polynomial of patch referred to by anIndex1, anIndex2
-- raises exception if anIndex1 <= 0 or anIndex1 > NbUSegments()
-- or anIndex2 <= 0 or anIndex2 > NbVSegments()
ZPolynomial(me; anIndex1, anIndex2 : Integer) returns HArray1OfReal
raises OutOfRange;
---Purpose : returns Z polynomial of patch referred to by anIndex1, anIndex2
-- raises exception if anIndex1 <= 0 or anIndex1 > NbUSegments()
-- or anIndex2 <= 0 or anIndex2 > NbVSegments()
Polynomials (me; XCoef, YCoef, ZCoef : out HArray2OfHArray1OfReal);
---Purpose : returns in one all the polynomial values "in bulk"
-- usefull for massive treatements
fields
--
-- Class : IGESGeom_SplineSurface
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class SplineSurface.
--
-- Reminder : A SplineSurface instance is defined by :
-- Spline boundary type, the type of patches in the grid
-- the number of U, V segments, the break points, the X, Y, Z
-- polynomials for each patch.
theBoundaryType : Integer;
thePatchType : Integer;
theUBreakPoints : HArray1OfReal;
theVBreakPoints : HArray1OfReal;
theXCoeffs : HArray2OfHArray1OfReal;
-- each element of the HArray2 is of size 16
-- the HArray2 is of size MN where M is the number of
-- U segments and N is the number of V segments
theYCoeffs : HArray2OfHArray1OfReal;
-- each element of the HArray2 is of size 16
-- the HArray2 is of size MN where M is the number of
-- U segments and N is the number of V segments
theZCoeffs : HArray2OfHArray1OfReal;
-- each element of the HArray2 is of size 16
-- the HArray2 is of size MN where M is the number of
-- U segments and N is the number of V segments
end SplineSurface;

View File

@@ -0,0 +1,133 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_SplineSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_SplineSurface.ixx>
IGESGeom_SplineSurface::IGESGeom_SplineSurface () { }
void IGESGeom_SplineSurface::Init
(const Standard_Integer aBoundaryType,
const Standard_Integer aPatchType,
const Handle(TColStd_HArray1OfReal)& allUBreakPoints,
const Handle(TColStd_HArray1OfReal)& allVBreakPoints,
const Handle(IGESBasic_HArray2OfHArray1OfReal)& allXCoeffs,
const Handle(IGESBasic_HArray2OfHArray1OfReal)& allYCoeffs,
const Handle(IGESBasic_HArray2OfHArray1OfReal)& allZCoeffs)
{
Standard_Integer i,j;
if (allUBreakPoints->Lower() != 1 || allVBreakPoints->Lower() != 1)
Standard_DimensionMismatch::Raise
("IGESGeom_SplineSurface: Lower Indices of BreakPoints in Init");
Standard_Integer nbUSegs = allUBreakPoints->Length() - 1;
Standard_Integer nbVSegs = allVBreakPoints->Length() - 1;
Standard_Integer len = allXCoeffs->RowLength();
if ((len != allYCoeffs->RowLength()) || (len != allZCoeffs->RowLength()))
Standard_DimensionMismatch::Raise
("IGESGeom_SplineSurface: Row Length of HArray2s in Init");
if (allXCoeffs->LowerCol() != 1 || allXCoeffs->LowerRow() != 1 ||
allYCoeffs->LowerCol() != 1 || allYCoeffs->LowerRow() != 1 ||
allZCoeffs->LowerCol() != 1 || allZCoeffs->LowerRow() != 1 )
Standard_DimensionMismatch::Raise
("IGESGeom_SplineSurface: Lower Col-Row Indices of HArray2s in Init");
len = allXCoeffs->ColLength();
if ((len != allYCoeffs->ColLength()) || (len != allZCoeffs->ColLength()))
Standard_DimensionMismatch::Raise
("IGESGeom_SplineSurface: Column Length of HArray2s in Init");
Handle(TColStd_HArray1OfReal) temp1;
Handle(TColStd_HArray1OfReal) temp2;
Handle(TColStd_HArray1OfReal) temp3;
for (i = 1; i <= nbUSegs; i++)
for (j = 1; j <= nbVSegs; j++)
{
temp1 = allXCoeffs->Value(i,j);
temp2 = allYCoeffs->Value(i,j);
temp3 = allZCoeffs->Value(i,j);
if ((temp1.IsNull() || temp1->Length() != 16) ||
(temp2.IsNull() || temp2->Length() != 16) ||
(temp3.IsNull() || temp3->Length() != 16))
Standard_DimensionMismatch::Raise
("IGESGeom_SplineSurface: Lengths of elements of HArray2s in Init");
}
theBoundaryType = aBoundaryType;
thePatchType = aPatchType;
theUBreakPoints = allUBreakPoints;
theVBreakPoints = allVBreakPoints;
theXCoeffs = allXCoeffs;
theYCoeffs = allYCoeffs;
theZCoeffs = allZCoeffs;
InitTypeAndForm(114,0);
}
Standard_Integer IGESGeom_SplineSurface::NbUSegments () const
{
return (theUBreakPoints->Length() - 1);
}
Standard_Integer IGESGeom_SplineSurface::NbVSegments () const
{
return (theVBreakPoints->Length() - 1);
}
Standard_Integer IGESGeom_SplineSurface::BoundaryType () const
{
return theBoundaryType;
}
Standard_Integer IGESGeom_SplineSurface::PatchType () const
{
return thePatchType;
}
Standard_Real IGESGeom_SplineSurface::UBreakPoint
(const Standard_Integer Index) const
{
return theUBreakPoints->Value(Index);
}
Standard_Real IGESGeom_SplineSurface::VBreakPoint
(const Standard_Integer Index) const
{
return theVBreakPoints->Value(Index);
}
Handle(TColStd_HArray1OfReal) IGESGeom_SplineSurface::XPolynomial
(const Standard_Integer Index1, const Standard_Integer Index2) const
{
return(theXCoeffs->Value(Index1,Index2));
}
Handle(TColStd_HArray1OfReal) IGESGeom_SplineSurface::YPolynomial
(const Standard_Integer Index1, const Standard_Integer Index2) const
{
return(theYCoeffs->Value(Index1,Index2));
}
Handle(TColStd_HArray1OfReal) IGESGeom_SplineSurface::ZPolynomial
(const Standard_Integer Index1, const Standard_Integer Index2) const
{
return(theZCoeffs->Value(Index1,Index2));
}
void IGESGeom_SplineSurface::Polynomials
(Handle(IGESBasic_HArray2OfHArray1OfReal)& allXCoeffs,
Handle(IGESBasic_HArray2OfHArray1OfReal)& allYCoeffs,
Handle(IGESBasic_HArray2OfHArray1OfReal)& allZCoeffs) const
{
allXCoeffs = theXCoeffs;
allYCoeffs = theYCoeffs;
allZCoeffs = theZCoeffs;
}

View File

@@ -0,0 +1,73 @@
--
-- File : SurfaceOfRevolution.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class SurfaceOfRevolution from IGESGeom inherits IGESEntity
---Purpose: defines IGESSurfaceOfRevolution, Type <120> Form <0>
-- in package IGESGeom
-- A surface of revolution is defined by an axis of rotation
-- a generatrix, and start and terminate rotation angles. The
-- surface is created by rotating the generatrix about the axis
-- of rotation through the start and terminate rotation angles.
uses
Pnt from gp,
Dir from gp,
Vec from gp,
Ax1 from gp,
Trsf from gp,
Line from IGESGeom
is
Create returns mutable SurfaceOfRevolution;
-- Specific Methods pertaining to the class
Init (me : mutable;
anAxis : Line;
aGeneratrix : IGESEntity;
aStartAngle : Real;
anEndAngle : Real);
---Purpose : This method is used to set the fields of the class Line
-- - anAxis : Axis of revolution
-- - aGeneratrix : The curve which is revolved about the axis
-- - aStartAngle : Start angle of the surface of revolution
-- - anEndAngle : End angle of the surface of revolution
AxisOfRevolution (me) returns Line;
---Purpose : returns the axis of revolution
Generatrix (me) returns IGESEntity;
---Purpose : returns the curve which is revolved about the axis
StartAngle (me) returns Real;
---Purpose : returns start angle of revolution
EndAngle (me) returns Real;
---Purpose : returns end angle of revolution
fields
--
-- Class : IGESGeom_SurfaceOfRevolution
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class SurfaceOfRevolution.
--
-- Reminder : A SurfaceOfRevolution instance is defined by :
-- An axis, a generatrix curve which is rotated about
-- the axis, the start and ending angles of rotation.
theLine : Line;
theGeneratrix : IGESEntity;
theStartAngle : Real;
theEndAngle : Real;
end SurfaceOfRevolution;

View File

@@ -0,0 +1,46 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_SurfaceOfRevolution.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_SurfaceOfRevolution.ixx>
IGESGeom_SurfaceOfRevolution::IGESGeom_SurfaceOfRevolution () { }
void IGESGeom_SurfaceOfRevolution::Init
(const Handle(IGESGeom_Line)& anAxis,
const Handle(IGESData_IGESEntity)& aGeneratrix,
const Standard_Real aStartAngle, const Standard_Real anEndAngle)
{
theLine = anAxis;
theGeneratrix = aGeneratrix;
theStartAngle = aStartAngle;
theEndAngle = anEndAngle;
InitTypeAndForm(120,0);
}
Handle(IGESGeom_Line) IGESGeom_SurfaceOfRevolution::AxisOfRevolution () const
{
return theLine;
}
Handle(IGESData_IGESEntity) IGESGeom_SurfaceOfRevolution::Generatrix () const
{
return theGeneratrix;
}
Standard_Real IGESGeom_SurfaceOfRevolution::StartAngle () const
{
return theStartAngle;
}
Standard_Real IGESGeom_SurfaceOfRevolution::EndAngle () const
{
return theEndAngle;
}

View File

@@ -0,0 +1,66 @@
--
-- File : TabulatedCylinder.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class TabulatedCylinder from IGESGeom inherits IGESEntity
---Purpose: defines IGESTabulatedCylinder, Type <122> Form <0>
-- in package IGESGeom
-- A tabulated cylinder is a surface formed by moving a line
-- segment called generatrix parallel to itself along a curve
-- called directrix. The curve may be a line, circular arc,
-- conic arc, parametric spline curve, rational B-spline
-- curve or composite curve.
uses
Pnt from gp,
XYZ from gp
is
Create returns mutable TabulatedCylinder;
-- Specific Methods pertaining to the class
Init (me : mutable;
aDirectrix : IGESEntity;
anEnd : XYZ);
---Purpose : This method is used to set the fields of the class
-- TabulatedCylinder
-- - aDirectrix : Directrix Curve of the tabulated cylinder
-- - anEnd : Coordinates of the terminate point of the
-- generatrix
-- The start point of the directrix is identical to the start
-- point of the generatrix
Directrix (me) returns IGESEntity;
---Purpose : returns the directrix curve of the tabulated cylinder
EndPoint(me) returns Pnt;
---Purpose : returns end point of generatrix of the tabulated cylinder
TransformedEndPoint(me) returns Pnt;
---Purpose : returns end point of generatrix of the tabulated cylinder
-- after applying Transf. Matrix
fields
--
-- Class : IGESGeom_TabulatedCylinder
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class TabulatedCylinder.
--
-- Reminder : A TabulatedCylinder instance is defined by :
-- A directrix curve and the coordinates of end points of
-- directrix curve
theDirectrix : IGESEntity;
theEnd : XYZ;
end TabulatedCylinder;

View File

@@ -0,0 +1,41 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_TabulatedCylinder.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_TabulatedCylinder.ixx>
#include <gp_GTrsf.hxx>
IGESGeom_TabulatedCylinder::IGESGeom_TabulatedCylinder () { }
void IGESGeom_TabulatedCylinder::Init
(const Handle(IGESData_IGESEntity)& aDirectrix,
const gp_XYZ& anEnd)
{
theDirectrix = aDirectrix;
theEnd = anEnd;
InitTypeAndForm(122,0);
}
Handle(IGESData_IGESEntity) IGESGeom_TabulatedCylinder::Directrix () const
{
return theDirectrix;
}
gp_Pnt IGESGeom_TabulatedCylinder::EndPoint () const
{
return ( gp_Pnt(theEnd) );
}
gp_Pnt IGESGeom_TabulatedCylinder::TransformedEndPoint () const
{
gp_XYZ EndPoint = theEnd;
if (HasTransf()) Location().Transforms(EndPoint);
return ( gp_Pnt(EndPoint) );
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolBSplineCurve.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolBSplineCurve from IGESGeom
---Purpose : Tool to work on a BSplineCurve. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses BSplineCurve from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolBSplineCurve;
---Purpose : Returns a ToolBSplineCurve, ready to work
ReadOwnParams (me; ent : mutable BSplineCurve;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : BSplineCurve;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : BSplineCurve;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a BSplineCurve <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : BSplineCurve) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : BSplineCurve;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : BSplineCurve; entto : mutable BSplineCurve;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : BSplineCurve;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolBSplineCurve;

View File

@@ -0,0 +1,409 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_BSplineCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
//#54 rln 24.12.98 CCI60005
#include <IGESGeom_ToolBSplineCurve.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColgp_HArray1OfXYZ.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 29/07/98
#include <Message_Msg.hxx>
//=======================================================================
//function : IGESGeom_ToolBSplineCurve
//purpose :
//=======================================================================
IGESGeom_ToolBSplineCurve::IGESGeom_ToolBSplineCurve ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineCurve::ReadOwnParams(const Handle(IGESGeom_BSplineCurve)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */,
IGESData_ParamReader& PR) const
{
// MGE 29/07/98
// Building of messages
//========================================
Message_Msg Msg99("XSTEP_99");
Message_Msg Msg100("XSTEP_100");
Message_Msg Msg101("XSTEP_101");
Message_Msg Msg102("XSTEP_102");
Message_Msg Msg103("XSTEP_103");
//========================================
Standard_Integer anIndex, aDegree;
Standard_Boolean aPlanar, aClosed, aPolynomial, aPeriodic;
Standard_Real aUmin, aUmax, normX,normY,normZ;
gp_XYZ aNorm (0.,0.,0.);
Handle(TColStd_HArray1OfReal) allKnots;
Handle(TColStd_HArray1OfReal) allWeights;
Handle(TColgp_HArray1OfXYZ) allPoles;
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
//st = PR.ReadInteger(PR.Current(), Msg97, anIndex); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadInteger(PR.Current(), "Upper Index Of Sum", anIndex);
//szv#4:S4163:12Mar99 optimized
/*if (st && anIndex >= 0) {
allPoles = new TColgp_HArray1OfXYZ(0, anIndex);
// allWeights = new TColStd_HArray1OfReal(1, anIndex+1); done by ReadReals
}
if (st && anIndex < 0)
{
PR.SendFail(Msg97);
anIndex = 0;
}*/
if (PR.ReadInteger(PR.Current(), anIndex)) {
if (anIndex < 0) {
Message_Msg Msg97("XSTEP_97");
PR.SendFail(Msg97);
anIndex = 0;
}
else {
allPoles = new TColgp_HArray1OfXYZ(0, anIndex);
// allWeights = new TColStd_HArray1OfReal(1, anIndex+1); done by ReadReals
}
}
else{
Message_Msg Msg97("XSTEP_97");
PR.SendFail(Msg97);
}
//st = PR.ReadInteger(PR.Current(), Msg98, aDegree); //szv#4:S4163:12Mar99 moved in if
// if (st && ! allWeights.IsNull() ) done by ReadReals
// allKnots = new TColStd_HArray1OfReal(-aDegree, anIndex+1);
if (!PR.ReadInteger(PR.Current(), aDegree)){
aDegree = 0; //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg98("XSTEP_98");
PR.SendFail(Msg98);
}
//szv#4:S4163:12Mar99 `st=` not needed
PR.ReadBoolean(PR.Current(), Msg99, aPlanar);
PR.ReadBoolean(PR.Current(), Msg100, aClosed);
PR.ReadBoolean(PR.Current(), Msg101, aPolynomial);
PR.ReadBoolean(PR.Current(), Msg102, aPeriodic);
//st = PR.ReadBoolean(PR.Current(), "Planar/Non Planar Flag", aPlanar);
//st = PR.ReadBoolean(PR.Current(), "Open/Closed Flag", aClosed);
//st = PR.ReadBoolean(PR.Current(), "Rational/Polynomial Flag", aPolynomial);
//st = PR.ReadBoolean(PR.Current(), "NonPeriodic/Periodic Flag", aPeriodic);
Standard_Integer nbKnots = anIndex + aDegree + 2;
// Reading all the knot sequences
PR.ReadReals(PR.CurrentList(nbKnots), Msg103 , allKnots, -aDegree); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReals
// (PR.CurrentList(nbKnots), "Knot sequence values", allKnots, -aDegree);
if (! allPoles.IsNull() )
{
Message_Msg Msg104("XSTEP_104");
Message_Msg Msg105("XSTEP_105");
PR.ReadReals(PR.CurrentList(anIndex+1), Msg104, allWeights,0); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReals(PR.CurrentList(anIndex+1), "Weights", allWeights,0);
for (Standard_Integer I = 0; I <= anIndex; I ++)
{
gp_XYZ tempPole;
//st = PR.ReadXYZ(PR.CurrentList(1, 3), Msg105, tempPole); //szv#4:S4163:12Mar99 moved down
//st = PR.ReadXYZ(PR.CurrentList(1, 3), "Control Points", tempPole);
if (PR.ReadXYZ(PR.CurrentList(1, 3), Msg105, tempPole)) allPoles->SetValue(I, tempPole);
}
}
if (!PR.ReadReal(PR.Current(), aUmin)){
Message_Msg Msg106("XSTEP_106");
PR.SendFail(Msg106);
} //szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadReal(PR.Current(), aUmax)){
Message_Msg Msg107("XSTEP_107");
PR.SendFail(Msg107);
} //szv#4:S4163:12Mar99 `st=` not needed
/*
st = PR.ReadReal(PR.Current(), "Starting Parameter Value", aUmin);
st = PR.ReadReal(PR.Current(), "Ending Parameter Value", aUmax);
*/
Standard_Boolean st = Standard_False;
if (PR.DefinedElseSkip()){
st = PR.ReadReal(PR.Current(), normX);
if(!st){
Message_Msg Msg108("XSTEP_108");
PR.SendFail(Msg108);
}
}
//st = PR.ReadReal(PR.Current(), "Unit Normal X", normX);
else normX = 0.;
if (PR.DefinedElseSkip()){
st = PR.ReadReal(PR.Current(), normY);
if(!st){
Message_Msg Msg108("XSTEP_108");
PR.SendFail(Msg108);
}
}
//st = PR.ReadReal(PR.Current(), "Unit Normal Y", normY);
else normY = 0.;
if (PR.DefinedElseSkip()){
st = PR.ReadReal(PR.Current(), normZ);
if(!st){
Message_Msg Msg108("XSTEP_108");
PR.SendFail(Msg108);
}
}
//st = PR.ReadReal(PR.Current(), "Unit Normal Z", normZ);
else normZ = 0.;
if (st) aNorm.SetCoord(normX,normY,normZ);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(anIndex,aDegree, aPlanar, aClosed, aPolynomial, aPeriodic,
allKnots, allWeights, allPoles, aUmin, aUmax, aNorm);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineCurve::WriteOwnParams
(const Handle(IGESGeom_BSplineCurve)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer low, up ;
Standard_Integer I ;
Standard_Integer index = ent->UpperIndex();
Standard_Integer degree = ent->Degree();
IW.Send(index);
IW.Send(degree);
IW.SendBoolean(ent->IsPlanar());
IW.SendBoolean(ent->IsClosed());
IW.SendBoolean(ent->IsPolynomial());
IW.SendBoolean(ent->IsPeriodic());
low = -degree;
up = index + 1;
for (I = low; I <= up; I ++)
IW.Send(ent->Knot(I));
low = 0;
up = index;
for (I = low; I <= up; I ++)
IW.Send(ent->Weight(I));
for (I = low; I <= up; I ++) {
IW.Send((ent->Pole(I)).X());
IW.Send((ent->Pole(I)).Y());
IW.Send((ent->Pole(I)).Z());
}
IW.Send(ent->UMin());
IW.Send(ent->UMax());
IW.Send(ent->Normal().X());
IW.Send(ent->Normal().Y());
IW.Send(ent->Normal().Z());
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineCurve::OwnShared(const Handle(IGESGeom_BSplineCurve)& /* ent */,
Interface_EntityIterator& /* iter */) const
{
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineCurve::OwnCopy
(const Handle(IGESGeom_BSplineCurve)& another,
const Handle(IGESGeom_BSplineCurve)& ent, Interface_CopyTool& /* TC */) const
{
Standard_Integer I;
Standard_Integer low, up;
Standard_Integer anIndex, aDegree;
Standard_Boolean aPlanar, aClosed, aPolynomial, aPeriodic;
Handle(TColStd_HArray1OfReal) allKnots, allWeights;
Handle(TColgp_HArray1OfXYZ) allPoles;
Standard_Real aUmin, aUmax;
gp_XYZ aNorm;
anIndex = another->UpperIndex();
aDegree = another->Degree();
aPlanar = another->IsPlanar();
aClosed = another->IsClosed();
aPolynomial = another->IsPolynomial();
aPeriodic = another->IsPeriodic();
allKnots = new TColStd_HArray1OfReal(-aDegree, anIndex+1);
low = -aDegree;
up = anIndex + 1;
for (I = low; I <= up; I++)
allKnots->SetValue(I, another->Knot(I));
allWeights = new TColStd_HArray1OfReal(0, anIndex);
low = 0;
up = anIndex;
for (I = low; I <= up; I++)
allWeights->SetValue(I, another->Weight(I));
allPoles = new TColgp_HArray1OfXYZ(0, anIndex);
for (I = low; I <= up; I++)
allPoles->SetValue(I, (another->Pole(I)).XYZ());
aUmin = another->UMin();
aUmax = another->UMax();
aNorm = another->Normal();
ent->Init (anIndex,aDegree, aPlanar, aClosed, aPolynomial, aPeriodic,
allKnots, allWeights, allPoles, aUmin, aUmax, aNorm);
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolBSplineCurve::DirChecker
(const Handle(IGESGeom_BSplineCurve)& /* ent */ ) const
{
IGESData_DirChecker DC(126, 0, 5);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineCurve::OwnCheck(const Handle(IGESGeom_BSplineCurve)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 29/07/98
// Building of messages
//========================================
//Message_Msg Msg104("XSTEP_104");
//Message_Msg Msg109("XSTEP_109");
//========================================
Standard_Real eps = 1.E-04; // Tolerance des tests ??
// Standard_Real norm = ent->Normal().SquareModulus();
//modified by rln 17/12/97 check of flag PROP2 according to IGES Standard
//It is possible to compare V(0) and V(1) only if StartingParameter = FirstKnot
//and EndingParameter = LastKnot (else we must build real geometrical curve)
//The fail is replaced with warning because it is not a serious problem
//if (ent->UMin() == ent->Knot(-ent->Degree() ) &&
// ent->UMax() == ent->Knot( ent->UpperIndex() + 1) ) {
// Standard_Real udif = ent->UMax() - ent->UMin();
// if (udif < 0) udif = -udif;
// Standard_Real udif = ent->Pole(0).SquareDistance (ent->Pole(ent->UpperIndex()));
// if (udif < eps * eps && !ent->IsClosed())
// ach.AddWarning("V(0) == V(1) for an Open Curve (PROP2 = 0)");
// if (udif >= eps * eps && ent->IsClosed())
// ach.AddWarning("V(0) != V(1) for a Closed Curve (PROP2 = 1)");
//}
Standard_Integer lower = 0;
Standard_Integer upper = ent->UpperIndex();
Standard_Boolean Flag = Standard_True;
Standard_Integer I; // svv Jan 11 2000 : porting on DEC
for (I = 0; ((I < upper) && (Flag)); I++)
Flag &= (ent->Weight(I) > 0);
if (!Flag) {
Message_Msg Msg104("XSTEP_104");
ach->SendFail(Msg104);
}
Flag = Standard_True;
Standard_Real tempVal = ent->Weight(lower);
for (I = lower; ((I < upper) && (Flag)); I++)
Flag &= (ent->Weight(I) == tempVal);
/*
if (Flag && !ent->IsPolynomial(Standard_True))
ach.AddWarning("All weights equal & PROP3 != 1 (Curve Not Polynomial)");
if (!Flag && ent->IsPolynomial(Standard_True))
ach.AddWarning("All weights not equal & PROP3 != 0 (Curve Not Rational)");
*/
if (ent->IsPlanar()) {
gp_XYZ aNorm = ent->Normal();
Standard_Real epsn = eps * 10.; // Tolerance ?? ici large
Standard_Real normod = aNorm.SquareModulus();
if (normod < epsn) {
Message_Msg Msg109("XSTEP_109");
ach->AddWarning(Msg109);
}
}
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineCurve::OwnDump(const Handle(IGESGeom_BSplineCurve)& ent,
const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
Standard_Integer upind = ent->UpperIndex();
S << "BSplineCurve from IGESGeom" << endl;
S << "Sum UpperIndex : " << upind;
S << " Degree : " << ent->Degree() << " ";
S << (ent->IsPlanar() ? "Planar" : "NonPlanar") << endl;
S << (ent->IsClosed() ? "Closed" : "Open") << " ";
S << (ent->IsPeriodic() ? "Periodic" : "NonPeriodic") << " ";//#54 rln 24.12.98 CCI60005
S << (ent->IsPolynomial(Standard_True) ? "Polynomial" : "Rational");
S << endl << "Knots : ";
IGESData_DumpVals(S ,level,-ent->Degree(), upind+1,ent->Knot);
S << endl << "Weights : ";
IGESData_DumpVals(S ,level,0, upind,ent->Weight);
S << endl << "Control Points (Poles) : ";
IGESData_DumpListXYZL(S ,level,0, upind, ent->Pole, ent->Location());
S << endl << "Starting Parameter Value : " << ent->UMin();
S << " " << "Ending Parameter Value : " << ent->UMax() << endl;
S << "Unit Normal : ";
IGESData_DumpXYZL(S,level, ent->Normal(), ent->Location());
S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolBSplineSurface.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolBSplineSurface from IGESGeom
---Purpose : Tool to work on a BSplineSurface. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses BSplineSurface from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolBSplineSurface;
---Purpose : Returns a ToolBSplineSurface, ready to work
ReadOwnParams (me; ent : mutable BSplineSurface;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : BSplineSurface;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : BSplineSurface;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a BSplineSurface <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : BSplineSurface) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : BSplineSurface;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : BSplineSurface; entto : mutable BSplineSurface;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : BSplineSurface;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolBSplineSurface;

View File

@@ -0,0 +1,497 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_BSplineSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolBSplineSurface.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <TColgp_HArray2OfXYZ.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 31/07/98
#include <Message_Msg.hxx>
//=======================================================================
//function : IGESGeom_ToolBSplineSurface
//purpose :
//=======================================================================
IGESGeom_ToolBSplineSurface::IGESGeom_ToolBSplineSurface ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineSurface::ReadOwnParams
(const Handle(IGESGeom_BSplineSurface)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
// MGE 31/07/98
// Building of messages
//========================================
Message_Msg Msg100("XSTEP_100");
Message_Msg Msg101("XSTEP_101");
Message_Msg Msg102("XSTEP_102");
Message_Msg Msg103("XSTEP_103");
Message_Msg Msg159("XSTEP_159");
//========================================
Standard_Integer I, J;
Standard_Integer anIndexU, anIndexV, aDegU, aDegV;
Standard_Boolean aCloseU, aCloseV, aPolynom, aPeriodU, aPeriodV;
Standard_Real aUmin, aUmax, aVmin, aVmax;
Standard_Real tempVal;
gp_XYZ tempXYZ;
Handle(TColStd_HArray1OfReal) allKnotsU;
Handle(TColStd_HArray1OfReal) allKnotsV;
Handle(TColStd_HArray2OfReal) allWeights;
Handle(TColgp_HArray2OfXYZ) allPoles;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Boolean FlagindexU = PR.ReadInteger(PR.Current(), anIndexU);
Standard_Boolean FlagindexV = PR.ReadInteger(PR.Current(), anIndexV);
if (!FlagindexU || !FlagindexV){
Message_Msg Msg97("XSTEP_97");
PR.SendFail(Msg97);
}
Standard_Boolean FlagdegU = PR.ReadInteger(PR.Current(), aDegU);
Standard_Boolean FlagdegV = PR.ReadInteger(PR.Current(), aDegV);
if (!FlagdegU || !FlagdegV){
Message_Msg Msg98("XSTEP_98");
PR.SendFail(Msg98);
}
//szv#4:S4163:12Mar99 `st=` not needed
PR.ReadBoolean(PR.Current(), Msg100,aCloseU);
PR.ReadBoolean(PR.Current(), Msg100,aCloseV);
PR.ReadBoolean(PR.Current(), Msg101, aPolynom);
PR.ReadBoolean(PR.Current(), Msg102, aPeriodU);
PR.ReadBoolean(PR.Current(), Msg102, aPeriodV);
/*
Standard_Boolean FlagindexU =
PR.ReadInteger(PR.Current(), "Upper Index in U", anIndexU);
Standard_Boolean FlagindexV =
PR.ReadInteger(PR.Current(), "Upper Index in V", anIndexV);
Standard_Boolean FlagdegU =
PR.ReadInteger(PR.Current(), "Degree Of First Basis Functions", aDegU);
Standard_Boolean FlagdegV =
PR.ReadInteger(PR.Current(), "Degree Of Second Basis Functions",aDegV);
st = PR.ReadBoolean(PR.Current(), "Closed/Open flag in U Direction",aCloseU);
st = PR.ReadBoolean(PR.Current(), "Closed/Open flag in V Direction",aCloseV);
st = PR.ReadBoolean(PR.Current(), "Polynomial / Rational", aPolynom);
st = PR.ReadBoolean(PR.Current(), "Periodic flag in U direction", aPeriodU);
st = PR.ReadBoolean(PR.Current(), "Periodic flag in V direction", aPeriodV);
*/
if ( FlagdegU && FlagindexU )
{
// allKnotsU = new TColStd_HArray1OfReal(-aDegU, anIndexU+1); done by :
Standard_Integer tempind = anIndexU+aDegU+2;
PR.ReadReals(PR.CurrentList(tempind), Msg103, allKnotsU, -aDegU); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReals(PR.CurrentList(tempind), "First knot sequence values", allKnotsU, -aDegU);
}
if ( FlagdegV && FlagindexV )
{
// allKnotsV = new TColStd_HArray1OfReal(-aDegV, anIndexV+1); done by :
Standard_Integer tempind = anIndexV+aDegV+2;
PR.ReadReals(PR.CurrentList(tempind), Msg103, allKnotsV, -aDegV); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReals(PR.CurrentList(tempind), "Second knot sequence values", allKnotsV, -aDegV);
}
if ( FlagindexU && FlagindexV )
{
allWeights = new TColStd_HArray2OfReal (0, anIndexU, 0, anIndexV);
allPoles = new TColgp_HArray2OfXYZ (0, anIndexU, 0, anIndexV);
Standard_Boolean BadWeigth = Standard_False;
Message_Msg Msg105("XSTEP_105");
for (J = 0; J <= anIndexV; J ++) {
for (I = 0; I <= anIndexU; I ++) {
//st = PR.ReadReal(PR.Current(), Msg104, tempVal); //szv#4:S4163:12Mar99 moved down
//st = PR.ReadReal(PR.Current(), "Weights", tempVal);
if (PR.ReadReal(PR.Current(), tempVal)) {
if(tempVal<Precision::PConfusion()) { // skl for OCC2821 11.06.2003
BadWeigth = Standard_True;
}
allWeights->SetValue(I, J, tempVal);
}
else{
Message_Msg Msg104("XSTEP_104");
PR.SendFail(Msg104);
}
}
}
if(BadWeigth) { // skl for OCC2821 11.06.2003
for (J = 0; J <= anIndexV; J ++) {
for (I = 0; I <= anIndexU; I ++) {
allWeights->SetValue(I, J, 1.);
}
}
}
for (J = 0; J <= anIndexV; J ++)
for (I = 0; I <= anIndexU; I ++) {
//st = PR.ReadXYZ (PR.CurrentList(1, 3), Msg105, tempXYZ); //szv#4:S4163:12Mar99 moved down
//st = PR.ReadXYZ (PR.CurrentList(1, 3), "Control Points", tempXYZ);
if (PR.ReadXYZ (PR.CurrentList(1, 3), Msg105, tempXYZ))
allPoles->SetValue(I, J, tempXYZ);
}
}
//szv#4:S4163:12Mar99 `st=` not needed
/* PR.ReadReal(PR.Current(), Msg106, aUmin);
PR.ReadReal(PR.Current(), Msg107, aUmax);
PR.ReadReal(PR.Current(), Msg106, aVmin);
PR.ReadReal(PR.Current(), Msg107, aVmax);
*/
if (!PR.ReadReal(PR.Current(), aUmin) || !PR.ReadReal(PR.Current(), aVmin)){
Message_Msg Msg106("XSTEP_106");
PR.SendFail(Msg106);
}
if (!PR.ReadReal(PR.Current(), aUmax) || !PR.ReadReal(PR.Current(), aVmax)){
Message_Msg Msg107("XSTEP_107");
PR.SendFail(Msg107);
}
/*
st = PR.ReadReal(PR.Current(), "Starting Value For U Direction", aUmin);
st = PR.ReadReal(PR.Current(), "Ending Value For U Direction", aUmax);
st = PR.ReadReal(PR.Current(), "Starting Value For V Direction", aVmin);
st = PR.ReadReal(PR.Current(), "Ending Value For U Direction", aVmax);
*/
// PROTECTION contre ANSYS 5.3 qui ecrit 3 flottants en plus ...
Standard_Integer icur = PR.CurrentNumber(), imax = PR.NbParams();
Standard_Real bid; Standard_Integer pbfin = 0;
//st = Standard_True; //szv#4:S4163:12Mar99 not needed
while (imax >= icur) {
Interface_ParamType pt = PR.ParamType(icur);
if (pt == Interface_ParamReal) {
if (!PR.ReadReal (PR.Current(),bid)){
PR.SendFail(Msg159);
} //szv#4:S4163:12Mar99 `st=` not needed
if (pbfin == 0) pbfin = 1;
}
else if (pt == Interface_ParamInteger || pt == Interface_ParamVoid) break;
else pbfin = -1;
icur ++;
}
if (pbfin > 0) PR.SendWarning(Msg159);
if (pbfin < 0){
Message_Msg Msg158("XSTEP_158");
PR.SendFail(Msg158);
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(anIndexU, anIndexV, aDegU, aDegV, aCloseU, aCloseV,
aPolynom, aPeriodU, aPeriodV, allKnotsU, allKnotsV,
allWeights, allPoles, aUmin, aUmax, aVmin, aVmax);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineSurface::WriteOwnParams
(const Handle(IGESGeom_BSplineSurface)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer indU = ent->UpperIndexU();
Standard_Integer indV = ent->UpperIndexV();
Standard_Integer degU = ent->DegreeU();
Standard_Integer degV = ent->DegreeV();
Standard_Integer I, J;
IW.Send(indU);
IW.Send(indV);
IW.Send(degU);
IW.Send(degV);
IW.SendBoolean(ent->IsClosedU());
IW.SendBoolean(ent->IsClosedV());
IW.SendBoolean(ent->IsPolynomial());
IW.SendBoolean(ent->IsPeriodicU());
IW.SendBoolean(ent->IsPeriodicV());
for (I = -degU; I <= indU + 1; I ++)
IW.Send(ent->KnotU(I));
for (I = -degV; I <= indV + 1; I ++)
IW.Send(ent->KnotV(I));
for (J = 0; J <= indV; J ++)
for (I = 0; I <= indU; I ++)
IW.Send(ent->Weight(I, J));
for (J = 0; J <= indV; J ++)
for (I = 0; I <= indU; I ++) {
gp_XYZ tempXYZ = ent->Pole(I, J).XYZ();
IW.Send(tempXYZ.X());
IW.Send(tempXYZ.Y());
IW.Send(tempXYZ.Z());
}
IW.Send(ent->UMin());
IW.Send(ent->UMax());
IW.Send(ent->VMin());
IW.Send(ent->VMax());
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineSurface::OwnShared(const Handle(IGESGeom_BSplineSurface)& /* ent */,
Interface_EntityIterator& /* iter */) const
{
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineSurface::OwnCopy(const Handle(IGESGeom_BSplineSurface)& another,
const Handle(IGESGeom_BSplineSurface)& ent,
Interface_CopyTool& /* TC */) const
{
Standard_Integer I, J;
Standard_Integer anIndexU, anIndexV, aDegU, aDegV;
Standard_Boolean aCloseU, aCloseV, aPolynom;
Standard_Boolean aPeriodU, aPeriodV;
Standard_Real aUmin, aUmax, aVmin, aVmax;
anIndexU = another->UpperIndexU();
anIndexV = another->UpperIndexV();
aDegU = another->DegreeU();
aDegV = another->DegreeV();
aCloseU = another->IsClosedU();
aCloseV = another->IsClosedV();
aPolynom = another->IsPolynomial();
aPeriodU = another->IsPeriodicU();
aPeriodV = another->IsPeriodicV();
Handle(TColStd_HArray1OfReal) allKnotsU =
new TColStd_HArray1OfReal(-aDegU, anIndexU+1);
Handle(TColStd_HArray1OfReal) allKnotsV =
new TColStd_HArray1OfReal(-aDegV, anIndexV+1);
for (I = -aDegU; I <= anIndexU + 1; I ++)
allKnotsU->SetValue(I, another->KnotU(I));
for (I = -aDegV; I <= anIndexV + 1; I ++)
allKnotsV->SetValue(I, another->KnotV(I));
Handle(TColStd_HArray2OfReal) allWeights =
new TColStd_HArray2OfReal (0, anIndexU, 0, anIndexV);
Handle(TColgp_HArray2OfXYZ) allPoles =
new TColgp_HArray2OfXYZ (0, anIndexU, 0, anIndexV);
for (J = 0; J <= anIndexV; J ++)
for (I = 0; I <= anIndexU; I ++)
allWeights->SetValue(I, J, another->Weight(I,J));
for (J = 0; J <= anIndexV; J ++)
for (I = 0; I <= anIndexU; I ++)
allPoles->SetValue(I, J, another->Pole(I, J).XYZ());
aUmin = another->UMin();
aUmax = another->UMax();
aVmin = another->VMin();
aVmax = another->VMax();
ent->Init (anIndexU, anIndexV, aDegU, aDegV, aCloseU, aCloseV,
aPolynom, aPeriodU, aPeriodV, allKnotsU, allKnotsV,
allWeights, allPoles, aUmin, aUmax, aVmin, aVmax);
ent->SetFormNumber(another->FormNumber());
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolBSplineSurface::DirChecker
(const Handle(IGESGeom_BSplineSurface)& /* ent */ ) const
{
IGESData_DirChecker DC(128, 0, 9);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineSurface::OwnCheck(const Handle(IGESGeom_BSplineSurface)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 31/07/98
// Building of messages
//========================================
//Message_Msg Msg104("XSTEP_104");
//Message_Msg Msg160("XSTEP_160");
//Message_Msg Msg161("XSTEP_161");
//========================================
//Standard_Real eps = 1.E-04; // Tolerance des tests ?? //szv#4:S4163:12Mar99 not needed
//modified by rln 18/12/97 check of flag PROP2 according to IGES Standard
//The same as in IGESGeom_ToolBSplineCurve::OwnCheck()
//It is possible to compare U(0) and U(1) only if UStartingParameter = UFirstKnot
//and UEndingParameter = ULastKnot and the same for V(0),V(1)
//(else we must build real geometrical curve)
//The fail is replaced with warning because it is not a serious problem
/*
if (ent->UMin() == ent->KnotU(-ent->DegreeU() ) &&
ent->UMax() == ent->KnotU( ent->UpperIndexU() + 1) ) {
Standard_Real udif = Max (ent->Pole(0, 0).SquareDistance (ent->Pole(ent->UpperIndexU(), 0)),
ent->Pole(0, ent->UpperIndexV()).SquareDistance (ent->Pole(ent->UpperIndexU(), ent->UpperIndexV())));
// if ((ent->UMin() == ent->UMax()) && !ent->IsClosedU())
// if (udif < eps * eps && !ent->IsClosedU())
// ach.AddWarning("U(0) == U(1) & PROP1 != 1");
// if ((ent->UMin() != ent->UMax()) && ent->IsClosedU())
// if (udif >= eps * eps && ent->IsClosedU())
// ach.AddWarning("U(0) != U(1) & PROP1 != 0");
}
if (ent->VMin() == ent->KnotV(-ent->DegreeV() ) &&
ent->VMax() == ent->KnotV( ent->UpperIndexV() + 1) ) {
Standard_Real vdif = Max (ent->Pole(0, 0).SquareDistance (ent->Pole(0, ent->UpperIndexV())),
ent->Pole(ent->UpperIndexU(), 0).SquareDistance (ent->Pole(ent->UpperIndexU(), ent->UpperIndexV())));
// if ((ent->VMin() == ent->VMax()) && !ent->IsClosedV())
// if (vdif < eps * eps && !ent->IsClosedV())
// ach.AddWarning("V(0) == V(1) & PROP2 != 1");
// if ((ent->VMin() != ent->VMax()) && ent->IsClosedV())
// if (vdif >= eps * eps && ent->IsClosedV())
// ach.AddWarning("V(0) != V(1) & PROP2 != 0");
}
*/
Standard_Boolean Flag = Standard_True;
Standard_Integer indU = ent->UpperIndexU();
Standard_Integer indV = ent->UpperIndexV();
Standard_Integer I,J;
if (ent->NbKnotsU() != (indU + ent->DegreeU() +2)) {
Message_Msg Msg160("XSTEP_160");
Msg160.Arg(indU + ent->DegreeU() +2);
ach->SendFail(Msg160);
}
if (ent->NbKnotsV() != (indV + ent->DegreeV() +2)) {
Message_Msg Msg161("XSTEP_161");
Msg161.Arg(indV + ent->DegreeV() +2);
ach->SendFail(Msg161);
}
for ( J = 0; ((J < indV) && (Flag)); J ++)
for ( I = 0; ((I < indU) && (Flag)); I ++)
Flag &= (ent->Weight(I,J) > 0);
if (!Flag) {
Message_Msg Msg104("XSTEP_104");
ach->SendFail(Msg104);
}
Flag = Standard_True;
Standard_Real tempVal = ent->Weight(0,0);
for ( J = 0; ((J < indV) && (Flag)); J ++)
for ( I = 0; ((I < indU) && (Flag)); I ++)
Flag &= (ent->Weight(I,J) == tempVal);
// Standard_Boolean Flap = ent->IsPolynomial(Standard_True);
// if (Flag && !Flap)
// ach.AddWarning("All weights equal & PROP3 != 1. (Surface not Polynomial)");
// if (!Flag && Flap)
// ach.AddWarning("All weights not equal & PROP3 != 0 (Surface not Rational)");
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolBSplineSurface::OwnDump(const Handle(IGESGeom_BSplineSurface)& ent,
const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
S << "BSplineSurface from IGESGeom" << endl << endl;
Standard_Integer indU = ent->UpperIndexU();
Standard_Integer indV = ent->UpperIndexV();
Standard_Integer degU = ent->DegreeU();
Standard_Integer degV = ent->DegreeV();
S << "In U : Upper Knot Index : " << indU;
S << " Degree : " << degU << " ";
S << (ent->IsClosedU() ? "Closed" : "Open") << " ";
S << (ent->IsPeriodicU() ? "Periodic" : "Non Periodic");
S << endl;
S << "In V : Upper Knot Index : " << indV;
S << " Degree : " << degV << " ";
S << (ent->IsClosedV() ? "Closed" : "Open") << " ";
S << (ent->IsPeriodicV() ? "Periodic" : "Non Periodic") << " ";
S << (ent->IsPolynomial(Standard_True) ? "Polynomial" : "Rational") << endl;
S << "Starting Parameter for U direction : " << ent->UMin() << endl;
S << "Ending Parameter for U direction : " << ent->UMax() << endl;
S << "Starting Parameter for V direction : " << ent->VMin() << endl;
S << "Ending Parameter for V direction : " << ent->VMax() << endl;
S << " Knots in U : ";
IGESData_DumpVals(S ,level,-degU, indU+1,ent->KnotU);
S << endl;
S << " Knots in V : ";
IGESData_DumpVals(S ,level,-degV, indV+1,ent->KnotV);
S << endl;
S << "Weights : (Row -> IndexU, Col -> IndexV)";
IGESData_DumpRectVals(S ,level,0, indU,0,indV,ent->Weight);
S << endl;
S << "Control Points (Poles) : ";
//IGESData_DumpRectXYZL(S,level,1, ent->NbPoles(),ent->Pole, ent->Location());
if (level < 5) { S << " [ content : ask level > 4 ]" << endl; return; }
gp_GTrsf loca = ent->Location();
for (Standard_Integer JP = 0; JP <= indV; JP ++)
for (Standard_Integer IP = 0; IP <= indU; IP ++) {
if (IP == 0) S << endl;
S <<" - ["<<IP<<","<<JP<<"]: ";
IGESData_DumpXYZL(S,level,ent->Pole(IP,JP),loca);
}
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESGeom_ToolBoundary.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolBoundary from IGESGeom
---Purpose : Tool to work on a Boundary. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Boundary from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolBoundary;
---Purpose : Returns a ToolBoundary, ready to work
ReadOwnParams (me; ent : mutable Boundary;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : Boundary;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Boundary;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Boundary <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable Boundary) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a Boundary
-- (if BoundaryType = 0, Nullify all ParameterCurves)
DirChecker (me; ent : Boundary) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Boundary;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Boundary; entto : mutable Boundary;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Boundary;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolBoundary;

View File

@@ -0,0 +1,446 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Boundary.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolBoundary.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESBasic_HArray1OfHArray1OfIGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
// MGE 30/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
//=======================================================================
//function : IGESGeom_ToolBoundary
//purpose :
//=======================================================================
IGESGeom_ToolBoundary::IGESGeom_ToolBoundary ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBoundary::ReadOwnParams(const Handle(IGESGeom_Boundary)& ent,
const Handle(IGESData_IGESReaderData)& IR,
IGESData_ParamReader& PR) const
{
// MGE 30/07/98
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer num; //szv#4:S4163:12Mar99 j not needed, i moved down in `for`
Standard_Integer tempType, tempPreference;
Handle(IGESData_IGESEntity) tempSurface;
Handle(TColStd_HArray1OfInteger) tempSenses;
Handle(IGESData_HArray1OfIGESEntity) tempModelCurves;
Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) tempParameterCurves;
IGESData_Status aStatus;
//szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadInteger(PR.Current(), tempType)){
Message_Msg Msg122("XTSEP_122");
PR.SendFail(Msg122);
}
if (!PR.ReadInteger(PR.Current(), tempPreference)){
Message_Msg Msg123("XTSEP_123");
PR.SendFail(Msg123);
}
if (!PR.ReadEntity(IR, PR.Current(), aStatus, tempSurface)){
Message_Msg Msg124("XTSEP_124");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg124.Arg(Msg216.Value());
PR.SendFail(Msg124);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg124.Arg(Msg217.Value());
PR.SendFail(Msg124);
break; }
default:{
}
}
}
if (PR.ReadInteger(PR.Current(), num) && (num > 0)) {
tempSenses = new TColStd_HArray1OfInteger(1, num);
tempModelCurves = new IGESData_HArray1OfIGESEntity(1, num);
tempParameterCurves = new IGESBasic_HArray1OfHArray1OfIGESEntity(1, num);
}
else{
Message_Msg Msg126("XTSEP_126");
PR.SendFail(Msg126);
}
if (!tempSenses.IsNull() && !tempModelCurves.IsNull() && !tempParameterCurves.IsNull() ) {
for ( Standard_Integer i = 1; i <= num; i++ ) //szv#4:S4163:12Mar99 Standard_Integer moved in `for`
{
Handle(IGESData_IGESEntity) tempEnt;
//st = PR.ReadEntity(IR, PR.Current(), Msg127, tempEnt); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadEntity(IR, PR.Current(), "Model Space Curves", tempEnt);
if (PR.ReadEntity(IR, PR.Current(), aStatus, tempEnt))
tempModelCurves->SetValue(i, tempEnt);
else {
Message_Msg Msg127("XTSEP_127");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg127.Arg(Msg216.Value());
PR.SendFail(Msg127);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg127.Arg(Msg217.Value());
PR.SendFail(Msg127);
break; }
default:{
}
}
}
Standard_Integer tempSense;
//st = PR.ReadInteger(PR.Current(), Msg128, tempSense); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadInteger(PR.Current(), "Orientation flags", tempSense);
if (PR.ReadInteger(PR.Current(), tempSense))
tempSenses->SetValue(i, tempSense);
else{
Message_Msg Msg128("XTSEP_128");
PR.SendFail(Msg128);
}
Standard_Integer tempCount;
//st = PR.ReadInteger(PR.Current(), Msg129, tempCount); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadInteger(PR.Current(), "Count of Parameter Space Curves", tempCount);
//szv#4:S4163:12Mar99 optimized
/*
if (st && tempCount >= 0)
{
Handle(IGESData_HArray1OfIGESEntity) tempParCurves;
if (tempCount > 0)
st = PR.ReadEnts (IR,PR.CurrentList(tempCount), Msg130, tempParCurves);
//st = PR.ReadEnts (IR,PR.CurrentList(tempCount), "Parameter Space Curves", tempParCurves);
*/
/*
{
tempParCurves = new
IGESData_HArray1OfIGESEntity(1, tempCount);
for ( j = 1; j <= tempCount; j++ ) {
Handle(IGESData_IGESEntity) tempEnt;
st = PR.ReadEntity(IR, PR.Current(),
"Parameter Space Curves", tempEnt);
if (st) tempParCurves->SetValue(j, tempEnt);
}
}
*/
/*
tempParameterCurves->SetValue(i, tempParCurves);
}
if (st && tempCount < 0)
PR.SendFail(Msg129);
*/
if (PR.ReadInteger(PR.Current(), tempCount) && (tempCount >= 0)) {
Handle(IGESData_HArray1OfIGESEntity) tempParCurves;
if (tempCount > 0){
Message_Msg Msg130("XTSEP_130");
PR.ReadEnts (IR,PR.CurrentList(tempCount), Msg130, tempParCurves); //szv#4:S4163:12Mar99 `st=` not needed
}
tempParameterCurves->SetValue(i, tempParCurves);
}
else {
Message_Msg Msg129("XTSEP_129");
PR.SendFail(Msg129);
}
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempType, tempPreference, tempSurface, tempModelCurves,
tempSenses, tempParameterCurves);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBoundary::WriteOwnParams(const Handle(IGESGeom_Boundary)& ent,
IGESData_IGESWriter& IW) const
{
Standard_Integer i, j, num1;
IW.Send(ent->BoundaryType());
IW.Send(ent->PreferenceType());
IW.Send(ent->Surface());
IW.Send(ent->NbModelSpaceCurves());
for ( num1 = ent->NbModelSpaceCurves(), i = 1; i <= num1; i++)
{
IW.Send(ent->ModelSpaceCurve(i));
IW.Send(ent->Sense(i));
Handle(IGESData_HArray1OfIGESEntity) curves = ent->ParameterCurves(i);
Standard_Integer nbc = ent->NbParameterCurves(i);
IW.Send(nbc);
if (nbc > 0)
{
for ( j = 1; j <= nbc; j ++)
IW.Send(curves->Value(j));
}
}
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolBoundary::OwnShared(const Handle(IGESGeom_Boundary)& ent,
Interface_EntityIterator& iter) const
{
Standard_Integer i, j, num1;
iter.GetOneItem(ent->Surface());
for ( num1 = ent->NbModelSpaceCurves(), i = 1; i <= num1; i++)
{
iter.GetOneItem(ent->ModelSpaceCurve(i));
Handle(IGESData_HArray1OfIGESEntity) curves = ent->ParameterCurves(i);
if (!curves.IsNull())
{
Standard_Integer nbc = curves->Length();
for ( j = 1; j <= nbc; j ++)
iter.GetOneItem(curves->Value(j));
}
}
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolBoundary::OwnCopy(const Handle(IGESGeom_Boundary)& another,
const Handle(IGESGeom_Boundary)& ent,
Interface_CopyTool& TC) const
{
Standard_Integer i, j;
Standard_Integer tempType = another->BoundaryType();
Standard_Integer tempPreference = another->PreferenceType();
Standard_Integer num1 = another->NbModelSpaceCurves();
DeclareAndCast(IGESData_IGESEntity, tempSurface,
TC.Transferred(another->Surface()) );
Handle(TColStd_HArray1OfInteger) tempSenses =
new TColStd_HArray1OfInteger(1, num1);
Handle(IGESData_HArray1OfIGESEntity) tempModelCurves =
new IGESData_HArray1OfIGESEntity(1, num1);
Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) tempParameterCurves =
new IGESBasic_HArray1OfHArray1OfIGESEntity(1, num1);
for ( i = 1; i <= num1; i++ )
{
DeclareAndCast(IGESData_IGESEntity, tempEnt,
TC.Transferred(another->ModelSpaceCurve(i)) );
tempModelCurves->SetValue(i, tempEnt);
tempSenses->SetValue(i, another->Sense(i));
Standard_Integer num2 = another->NbParameterCurves(i);
Handle(IGESData_HArray1OfIGESEntity) ParCurves =
another->ParameterCurves(i);
Handle(IGESData_HArray1OfIGESEntity) tempParCurves;
if (num2 > 0) tempParCurves = new IGESData_HArray1OfIGESEntity(1, num2);
for ( j = 1; j <= num2; j++ )
{
DeclareAndCast(IGESData_IGESEntity, tempEnt1,
TC.Transferred(ParCurves->Value(j)) );
tempParCurves->SetValue(j, tempEnt1);
}
tempParameterCurves->SetValue(i, tempParCurves);
}
ent->Init(tempType, tempPreference, tempSurface, tempModelCurves,
tempSenses, tempParameterCurves);
}
//=======================================================================
//function : OwnCorrect
//purpose :
//=======================================================================
Standard_Boolean IGESGeom_ToolBoundary::OwnCorrect
(const Handle(IGESGeom_Boundary)& ent) const
{
// Standard_Boolean t0 = (ent->BoundaryType() == 0);
Standard_Boolean res = Standard_False;
Standard_Boolean r2d = Standard_False;
Standard_Integer nb = ent->NbModelSpaceCurves();
Standard_Integer i; // svv Jan11 2000 : porting on DEC
for (i = 1; i <= nb; i ++) {
Standard_Integer nbi = ent->NbParameterCurves(i);
if (nbi == 0) continue;
for (Standard_Integer j = 1; j <= nbi; j ++) {
Handle(IGESData_IGESEntity) c2d = ent->ParameterCurve (i,j);
if (c2d.IsNull()) continue;
c2d->InitStatus
(c2d->BlankStatus(),c2d->SubordinateStatus(),5,c2d->HierarchyStatus());
res = Standard_True;
}
r2d = Standard_True;
}
if (!r2d) return res;
if (ent->BoundaryType() != 0) return res; // OK
// Reste Boundary Type : s ilya des ParameterCurves, il doit valoir 1
// On reconstruit donc la Boundary a l identique, mais avec BoundaryType = 1
// si type = 0, annuller tous les ParameterCurves
// -> On reconstruit, avec ParameterCurves Nulles
// En plus, les ParameterCurves doivent avoir leur UseFlag a 5
Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) cv2d =
new IGESBasic_HArray1OfHArray1OfIGESEntity(1,nb);
Handle(IGESData_HArray1OfIGESEntity) modcv =
new IGESData_HArray1OfIGESEntity(1,nb);
Handle(TColStd_HArray1OfInteger) senses = new TColStd_HArray1OfInteger(1,nb);
for (i = 1; i <= nb; i ++) {
senses->SetValue(i, ent->Sense(i));
modcv->SetValue (i, ent->ModelSpaceCurve(i));
cv2d->SetValue (i, ent->ParameterCurves(i));
}
ent->Init (1, ent->PreferenceType(), ent->Surface(),
modcv, senses, cv2d);
return Standard_True;
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolBoundary::DirChecker
(const Handle(IGESGeom_Boundary)& /* ent */ ) const
{
IGESData_DirChecker DC(141, 0);
DC.Structure(IGESData_DefVoid);
DC.GraphicsIgnored();
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.SubordinateStatusRequired(0);
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolBoundary::OwnCheck(const Handle(IGESGeom_Boundary)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 30/07/98
// Building of messages
//========================================
//Message_Msg Msg122("XTSEP_122");
//Message_Msg Msg123("XTSEP_123");
//Message_Msg Msg125("XTSEP_125");
//Message_Msg Msg128("XTSEP_128");
//========================================
if ((ent->BoundaryType() != 0) && (ent->BoundaryType() != 1)) {
Message_Msg Msg122("XTSEP_122");
ach->SendFail(Msg122);
}
if ((ent->PreferenceType() < 0) || (ent->PreferenceType() > 3)) {
Message_Msg Msg123("XTSEP_123");
ach->SendFail(Msg123);
}
// il faudrait aussi tester que, pour BoundaryType = 1, la Surface est bien
// Parametrique ... (au moins un cas ne passe pas : c est Plane 108)
if (ent->BoundaryType() == 1) {
if (ent->Surface()->TypeNumber() == 108) {
Message_Msg Msg125("XTSEP_125");
ach->SendFail(Msg125);
}
}
Standard_Integer i, num;
for ( num = ent->NbModelSpaceCurves(), i = 1; i <= num; i++ )
if (ent->Sense(i) != 1 && ent->Sense(i) != 2) {
Message_Msg Msg128("XTSEP_128");
ach->SendFail(Msg128);
}
/*
if (ent->BoundaryType() == 0)
for ( num = ent->NbModelSpaceCurves(), i = 1; i <= num; i++ )
if (ent->NbParameterCurves(i) != 0)
{
char mess[80];
sprintf(mess,"Nb. Parameter Space Curve %d !=0 while Boundary Type=0",i);
ach.SendFail(mess);
}
*/
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolBoundary::OwnDump(const Handle(IGESGeom_Boundary)& ent,
const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
Standard_Integer i, num, sublevel = (level > 4) ? 1 : 0;
S << "IGESGeom_Boundary" << endl;
S << "Bounded Surface Representation Type : " << ent->BoundaryType() << endl;
S << "Trimming Curves Representation : " << ent->PreferenceType() << endl;
S << "Bounded Surface : ";
dumper.Dump(ent->Surface(),S, sublevel);
S << endl;
S << "Model Space Curves : " << endl;
S << "Orientation Flags : " << endl;
S << "Parameter Curves Set : ";
IGESData_DumpEntities
(S,dumper,-level,1,ent->NbModelSpaceCurves(),ent->ModelSpaceCurve);
S << endl;
if (level > 4)
for ( num = ent->NbModelSpaceCurves(), i = 1; i <= num; i++ )
{
S << "[" << i << "]: ";
S << "Model Space Curve : ";
dumper.Dump (ent->ModelSpaceCurve(i),S, 1);
S << " Orientation Flags : " << ent->Sense(i) << endl;
S << " Parameter Curves : ";
Handle(IGESData_HArray1OfIGESEntity) curves = ent->ParameterCurves(i);
if (!curves.IsNull()) {
IGESData_DumpEntities(S,dumper, level,1,curves->Length(),curves->Value);
}
else S << " List Empty";
S << endl;
}
S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolBoundedSurface.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolBoundedSurface from IGESGeom
---Purpose : Tool to work on a BoundedSurface. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses BoundedSurface from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolBoundedSurface;
---Purpose : Returns a ToolBoundedSurface, ready to work
ReadOwnParams (me; ent : mutable BoundedSurface;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : BoundedSurface;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : BoundedSurface;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a BoundedSurface <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : BoundedSurface) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : BoundedSurface;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : BoundedSurface; entto : mutable BoundedSurface;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : BoundedSurface;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolBoundedSurface;

View File

@@ -0,0 +1,246 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_BoundedSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolBoundedSurface.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESGeom_Boundary.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESGeom_HArray1OfBoundary.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 31/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
//=======================================================================
//function : IGESGeom_ToolBoundedSurface
//purpose :
//=======================================================================
IGESGeom_ToolBoundedSurface::IGESGeom_ToolBoundedSurface ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBoundedSurface::ReadOwnParams(const Handle(IGESGeom_BoundedSurface)& ent,
const Handle(IGESData_IGESReaderData)& IR,
IGESData_ParamReader& PR) const
{
// MGE 31/07/98
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer num, i;
Standard_Integer tempType;
Handle(IGESData_IGESEntity) tempSurface;
Handle(IGESGeom_HArray1OfBoundary) tempBounds;
IGESData_Status aStatus;
//szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadInteger(PR.Current(), tempType)){
Message_Msg Msg165("XTSEP_165");
PR.SendFail(Msg165);
}
if (!PR.ReadEntity(IR, PR.Current(), aStatus, tempSurface)){
Message_Msg Msg166("XTSEP_166");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg166.Arg(Msg216.Value());
PR.SendFail(Msg166);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg166.Arg(Msg217.Value());
PR.SendFail(Msg166);
break; }
default:{
}
}
}
//st = PR.ReadInteger(PR.Current(), Msg167, num); //szv#4:S4163:12Mar99 moved in if
/*
st = PR.ReadInteger(PR.Current(), "Bounded Surface Representation Type", tempType);
st = PR.ReadEntity(IR, PR.Current(), "Surface to be Bounded", tempSurface);
st = PR.ReadInteger(PR.Current(), "Number Of Boundary Entities", num);
*/
//szv#4:S4163:12Mar99 optimized
//if (st && num > 0) tempBounds = new IGESGeom_HArray1OfBoundary(1, num);
//if (st && num <= 0) PR.SendFail(Msg167);
if (PR.ReadInteger(PR.Current(), num) && (num > 0)) {
tempBounds = new IGESGeom_HArray1OfBoundary(1, num);
}
else{
Message_Msg Msg167("XTSEP_167");
PR.SendFail(Msg167);
}
if (!tempBounds.IsNull()){
for ( i = 1; i <= num; i++ )
{
Handle(IGESGeom_Boundary) tempEnt;
//st = PR.ReadEntity(IR, PR.Current(), Msg168, tempEnt); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadEntity(IR, PR.Current(), "Boundary Entities", tempEnt);
if (PR.ReadEntity(IR, PR.Current(), aStatus, tempEnt))
tempBounds->SetValue(i, tempEnt);
else{
Message_Msg Msg168("XTSEP_168");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg168.Arg(Msg216.Value());
PR.SendFail(Msg168);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg168.Arg(Msg217.Value());
PR.SendFail(Msg168);
break; }
default:{
}
}
}
}
}
//sln 28.09.2001, BUC61004, If(tempBounds.IsNull()) function ent->Init is not called in order to avoid exception
if(!tempBounds.IsNull())
{
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(tempType, tempSurface, tempBounds);
}
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolBoundedSurface::WriteOwnParams(const Handle(IGESGeom_BoundedSurface)& ent,
IGESData_IGESWriter& IW) const
{
Standard_Integer i, num;
IW.Send(ent->RepresentationType());
IW.Send(ent->Surface());
IW.Send(ent->NbBoundaries());
for ( num = ent->NbBoundaries(), i = 1; i <= num; i++ )
IW.Send(ent->Boundary(i));
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolBoundedSurface::OwnShared(const Handle(IGESGeom_BoundedSurface)& ent,
Interface_EntityIterator& iter) const
{
Standard_Integer i, num;
iter.GetOneItem(ent->Surface());
for ( num = ent->NbBoundaries(), i = 1; i <= num; i++ )
iter.GetOneItem(ent->Boundary(i));
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolBoundedSurface::OwnCopy(const Handle(IGESGeom_BoundedSurface)& another,
const Handle(IGESGeom_BoundedSurface)& ent,
Interface_CopyTool& TC) const
{
Standard_Integer i, num;
Standard_Integer tempType = another->RepresentationType();
DeclareAndCast(IGESData_IGESEntity, tempSurface,
TC.Transferred(another->Surface()));
num = another->NbBoundaries();
Handle(IGESGeom_HArray1OfBoundary) tempBounds;
if (num > 0) tempBounds = new IGESGeom_HArray1OfBoundary(1, num);
for (i = 1; i <= num; i++)
{
DeclareAndCast(IGESGeom_Boundary, tempBoundary,
TC.Transferred(another->Boundary(i)));
tempBounds->SetValue(i, tempBoundary);
}
ent->Init(tempType, tempSurface, tempBounds);
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolBoundedSurface::DirChecker
(const Handle(IGESGeom_BoundedSurface)& /* ent */ ) const
{
IGESData_DirChecker DC(143,0);
DC.Structure(IGESData_DefVoid);
DC.GraphicsIgnored();
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.UseFlagRequired(0);
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolBoundedSurface::OwnCheck(const Handle(IGESGeom_BoundedSurface)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 31/07/98
// Building of messages
//========================================
//Message_Msg Msg165("XTSEP_165");
//========================================
if ((ent->RepresentationType() != 0) && (ent->RepresentationType() != 1)) {
Message_Msg Msg165("XTSEP_165");
ach->SendFail(Msg165);
}
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolBoundedSurface::OwnDump(const Handle(IGESGeom_BoundedSurface)& ent,
const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
Standard_Integer sublevel = (level > 4) ? 1 : 0;
S << "IGESGeom_BoundedSurface" << endl;
S << "Representation Type : " << ent->RepresentationType() << endl;
S << "Surface to be Bounded : ";
dumper.Dump(ent->Surface(),S, sublevel);
S << endl;
S << "Boundary Entities : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbBoundaries(),ent->Boundary);
S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolCircularArc.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolCircularArc from IGESGeom
---Purpose : Tool to work on a CircularArc. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses CircularArc from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolCircularArc;
---Purpose : Returns a ToolCircularArc, ready to work
ReadOwnParams (me; ent : mutable CircularArc;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : CircularArc;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : CircularArc;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a CircularArc <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : CircularArc) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : CircularArc;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : CircularArc; entto : mutable CircularArc;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : CircularArc;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolCircularArc;

View File

@@ -0,0 +1,140 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CircularArc.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolCircularArc.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt2d.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_MSG.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
// MGE 28/07/98
#include <Message_Msg.hxx>
IGESGeom_ToolCircularArc::IGESGeom_ToolCircularArc () { }
void IGESGeom_ToolCircularArc::ReadOwnParams
(const Handle(IGESGeom_CircularArc)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
// MGE 28/07/98
// Building of messages
//=====================================
Message_Msg Msg76("XSTEP_76");
Message_Msg Msg77("XSTEP_77");
Message_Msg Msg78("XSTEP_78");
//=====================================
Standard_Real aZT;
gp_XY aCenter, aStart, anEnd;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
// MGE 28/07/98
if (!PR.ReadReal(PR.Current(), aZT)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg75("XSTEP_75");
PR.SendFail(Msg75);
}
PR.ReadXY(PR.CurrentList(1, 2), Msg76, aCenter); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadXY(PR.CurrentList(1, 2), Msg77, aStart); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadXY(PR.CurrentList(1, 2), Msg78, anEnd); //szv#4:S4163:12Mar99 `st=` not needed
/*
st = PR.ReadReal(PR.Current(), "Shift above z-plane", aZT);
st = PR.ReadXY(PR.CurrentList(1, 2), "Center Of Arc", aCenter);
st = PR.ReadXY(PR.CurrentList(1, 2), "Start Point Of Arc", aStart);
st = PR.ReadXY(PR.CurrentList(1, 2), "End Point Of Arc", anEnd);
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aZT, aCenter, aStart, anEnd);
}
void IGESGeom_ToolCircularArc::WriteOwnParams
(const Handle(IGESGeom_CircularArc)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->ZPlane());
IW.Send(ent->Center().X());
IW.Send(ent->Center().Y());
IW.Send(ent->StartPoint().X());
IW.Send(ent->StartPoint().Y());
IW.Send(ent->EndPoint().X());
IW.Send(ent->EndPoint().Y());
}
void IGESGeom_ToolCircularArc::OwnShared
(const Handle(IGESGeom_CircularArc)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESGeom_ToolCircularArc::OwnCopy
(const Handle(IGESGeom_CircularArc)& another,
const Handle(IGESGeom_CircularArc)& ent, Interface_CopyTool& /* TC */) const
{
ent->Init(another->ZPlane(), another->Center().XY(),
another->StartPoint().XY(), another->EndPoint().XY());
}
IGESData_DirChecker IGESGeom_ToolCircularArc::DirChecker
(const Handle(IGESGeom_CircularArc)& /* ent */ ) const
{
IGESData_DirChecker DC(100, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGeom_ToolCircularArc::OwnCheck
(const Handle(IGESGeom_CircularArc)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
/*
//Standard_Real eps = 1.E-04; // Tolerance des tests ?? //szv#4:S4163:12Mar99 not needed
Standard_Real Rad1 = Sqrt(Square(ent->StartPoint().X() - ent->Center().X()) +
Square(ent->StartPoint().Y() - ent->Center().Y()));
Standard_Real Rad2 = Sqrt(Square(ent->EndPoint().X() - ent->Center().X()) +
Square(ent->EndPoint().Y() - ent->Center().Y()));
Standard_Real ratio = Abs(Rad1 - Rad2) / (Rad1+Rad2);
if (ratio > eps) {
char mess[80];
sprintf(mess,"Radius at Start & End Points, relative gap over %f",
Interface_MSG::Intervalled (ratio));
ach.AddFail(mess,"Radius at Start & End Points, relative gap over %f");
}
*/
}
void IGESGeom_ToolCircularArc::OwnDump
(const Handle(IGESGeom_CircularArc)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "CircularArc from IGESGeom" << endl;
S << "Z-Plane Displacement : " << ent->ZPlane() << endl;
S << "Center : ";
IGESData_DumpXYLZ(S,level, ent->Center(), ent->Location(), ent->ZPlane());
S << endl;
S << "Start Point : ";
IGESData_DumpXYLZ(S,level, ent->StartPoint(), ent->Location(),ent->ZPlane());
S << endl;
S << "End Point : ";
IGESData_DumpXYLZ(S,level, ent->EndPoint(), ent->Location(), ent->ZPlane());
S << endl;
if (level <= 5) return;
S<< " Normal Axis : "; IGESData_DumpXYZL(S,level,ent->Axis(),ent->VectorLocation());
S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolCompositeCurve.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolCompositeCurve from IGESGeom
---Purpose : Tool to work on a CompositeCurve. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses CompositeCurve from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolCompositeCurve;
---Purpose : Returns a ToolCompositeCurve, ready to work
ReadOwnParams (me; ent : mutable CompositeCurve;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : CompositeCurve;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : CompositeCurve;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a CompositeCurve <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : CompositeCurve) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : CompositeCurve;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : CompositeCurve; entto : mutable CompositeCurve;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : CompositeCurve;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolCompositeCurve;

View File

@@ -0,0 +1,110 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CompositeCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolCompositeCurve.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 28/07/98
#include <Message_Msg.hxx>
IGESGeom_ToolCompositeCurve::IGESGeom_ToolCompositeCurve () { }
void IGESGeom_ToolCompositeCurve::ReadOwnParams
(const Handle(IGESGeom_CompositeCurve)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 28/07/98
// Building of messages
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Handle(IGESData_HArray1OfIGESEntity) tempEntities;
Standard_Integer num; //szv#4:S4163:12Mar99 i not needed
Standard_Boolean st = PR.ReadInteger(PR.Current(), num);
// st = PR.ReadInteger(PR.Current(), "Number of Components", num);
if (st && (num > 0)){
Message_Msg Msg80("XSTEP_80");
PR.ReadEnts (IR,PR.CurrentList(num),Msg80,tempEntities); //szv#4:S4163:12Mar99 `st=` not needed
//else st = PR.ReadEnts (IR,PR.CurrentList(num),"List of Components",tempEntities);
}
//if (st && num <= 0) PR.SendFail(Msg79);
else{
Message_Msg Msg79("XSTEP_79");
PR.SendFail(Msg79);
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(tempEntities);
}
void IGESGeom_ToolCompositeCurve::WriteOwnParams
(const Handle(IGESGeom_CompositeCurve)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer num = ent->NbCurves(); Standard_Integer i;
IW.Send(num);
for ( num = ent->NbCurves(), i = 1; i <= num; i++ )
IW.Send(ent->Curve(i));
}
void IGESGeom_ToolCompositeCurve::OwnShared
(const Handle(IGESGeom_CompositeCurve)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer num = ent->NbCurves();
for ( Standard_Integer i = 1; i <= num; i++ )
iter.GetOneItem(ent->Curve(i));
}
void IGESGeom_ToolCompositeCurve::OwnCopy
(const Handle(IGESGeom_CompositeCurve)& another,
const Handle(IGESGeom_CompositeCurve)& ent, Interface_CopyTool& TC) const
{
Standard_Integer i, num = another->NbCurves();
Handle(IGESData_HArray1OfIGESEntity) tempEntities =
new IGESData_HArray1OfIGESEntity(1, num);
for ( i = 1; i <= num; i++ )
{
DeclareAndCast(IGESData_IGESEntity, new_ent,
TC.Transferred(another->Curve(i)));
tempEntities->SetValue(i, new_ent);
}
ent->Init(tempEntities);
}
IGESData_DirChecker IGESGeom_ToolCompositeCurve::DirChecker
(const Handle(IGESGeom_CompositeCurve)& /* ent */ ) const
{
IGESData_DirChecker DC(102, 0);
DC.Structure(IGESData_DefVoid);
DC.GraphicsIgnored();
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
return DC;
}
void IGESGeom_ToolCompositeCurve::OwnCheck
(const Handle(IGESGeom_CompositeCurve)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESGeom_ToolCompositeCurve::OwnDump
(const Handle(IGESGeom_CompositeCurve)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGeom_CompositeCurve" << endl;
S << "Curve Entities : " << endl;
IGESData_DumpEntities(S,dumper ,level,1, ent->NbCurves(),ent->Curve);
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESGeom_ToolConicArc.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolConicArc from IGESGeom
---Purpose : Tool to work on a ConicArc. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses ConicArc from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolConicArc;
---Purpose : Returns a ToolConicArc, ready to work
ReadOwnParams (me; ent : mutable ConicArc;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : ConicArc;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : ConicArc;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a ConicArc <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable ConicArc) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a ConicArc
-- (FormNumber recomputed according case Ellips-Parab-Hyperb)
DirChecker (me; ent : ConicArc) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : ConicArc;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : ConicArc; entto : mutable ConicArc;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : ConicArc;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolConicArc;

View File

@@ -0,0 +1,305 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_ConicArc.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolConicArc.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Dir2d.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_MSG.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
// MGE 28/07/98
#include <Message_Msg.hxx>
//=======================================================================
//function : IGESGeom_ToolConicArc
//purpose :
//=======================================================================
IGESGeom_ToolConicArc::IGESGeom_ToolConicArc ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolConicArc::ReadOwnParams(const Handle(IGESGeom_ConicArc)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */,
IGESData_ParamReader& PR) const
{
// MGE 28/07/98
// Building of messages
//======================================
Message_Msg Msg83("XSTEP_83");
Message_Msg Msg84("XSTEP_84");
//======================================
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Real A, B, C, D, E, F, ZT;
gp_XY tempStart, tempEnd;
/* PR.ReadReal(PR.Current(), Msg81, A); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg81, B); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg81, C); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg81, D); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg81, E); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg81, F); //szv#4:S4163:12Mar99 `st=` not needed
*/
if ((!PR.ReadReal(PR.Current(),A)) || (!PR.ReadReal(PR.Current(),B)) ||
(!PR.ReadReal(PR.Current(),C)) || (!PR.ReadReal(PR.Current(),D)) ||
(!PR.ReadReal(PR.Current(),E)) || (!PR.ReadReal(PR.Current(),F))){
Message_Msg Msg81("XSTEP_81");
PR.SendFail(Msg81);
}
if (!PR.ReadReal(PR.Current(), ZT)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg82("XSTEP_82");
PR.SendFail(Msg82);
}
PR.ReadXY(PR.CurrentList(1, 2),Msg83, tempStart); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadXY(PR.CurrentList(1, 2), Msg84, tempEnd); //szv#4:S4163:12Mar99 `st=` not needed
/*
st = PR.ReadReal(PR.Current(), "Conic Coefficient A", A);
st = PR.ReadReal(PR.Current(), "Conic Coefficient B", B);
st = PR.ReadReal(PR.Current(), "Conic Coefficient C", C);
st = PR.ReadReal(PR.Current(), "Conic Coefficient D", D);
st = PR.ReadReal(PR.Current(), "Conic Coefficient E", E);
st = PR.ReadReal(PR.Current(), "Conic Coefficient F", F);
st = PR.ReadReal(PR.Current(), "Z-plane shift", ZT);
st = PR.ReadXY(PR.CurrentList(1, 2), "Starting Point Of Arc", tempStart);
st = PR.ReadXY(PR.CurrentList(1, 2), "End Point Of Arc", tempEnd);
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(A, B, C, D, E, F, ZT, tempStart, tempEnd);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolConicArc::WriteOwnParams(const Handle(IGESGeom_ConicArc)& ent,
IGESData_IGESWriter& IW) const
{
Standard_Real A,B,C,D,E,F;
ent->Equation(A,B,C,D,E,F);
IW.Send(A);
IW.Send(B);
IW.Send(C);
IW.Send(D);
IW.Send(E);
IW.Send(F);
IW.Send(ent->ZPlane());
IW.Send(ent->StartPoint().X());
IW.Send(ent->StartPoint().Y());
IW.Send(ent->EndPoint().X());
IW.Send(ent->EndPoint().Y());
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolConicArc::OwnShared(const Handle(IGESGeom_ConicArc)& /* ent */,
Interface_EntityIterator& /* iter */) const
{
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolConicArc::OwnCopy(const Handle(IGESGeom_ConicArc)& another,
const Handle(IGESGeom_ConicArc)& ent,
Interface_CopyTool& /* TC */) const
{
Standard_Real A,B,C,D,E,F;
another->Equation(A,B,C,D,E,F);
ent->Init(A, B, C, D, E, F, another->ZPlane(),
another->StartPoint().XY(), another->EndPoint().XY());
}
//=======================================================================
//function : OwnCorrect
//purpose :
//=======================================================================
Standard_Boolean IGESGeom_ToolConicArc::OwnCorrect
(const Handle(IGESGeom_ConicArc)& ent) const
{
return ent->OwnCorrect(); // form selon coefs. 1 Ellipse, 2 Hyper, 3 Para
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolConicArc::DirChecker
(const Handle(IGESGeom_ConicArc)& /* ent */ ) const
{
IGESData_DirChecker DC(104, 0, 3);
DC.Structure(IGESData_DefVoid);
DC.GraphicsIgnored();
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 28/07/98
// Building of messages
//=====================================
//Message_Msg Msg71("XSTEP_71");
//=====================================
//char mess[80]; //szv#4:S4163:12Mar99 not needed
Standard_Integer cfn = ent->ComputedFormNumber();
Standard_Integer fn = ent->FormNumber();
if (cfn == 0) {}
// ach.AddFail("Coefficients do not define correctly a Conic");
else if (fn != 0 && fn != cfn) {
Message_Msg Msg71("XSTEP_71");
ach->SendFail(Msg71);
}
//szv#4:S4163:12Mar99 not needed
//if (ach.HasFailed()) return; // les tests suivant deviennent sans objet
//Standard_Real eps = 1.E-04; // Tolerance des Tests ??
//Standard_Real A,B,C,D,E,F;
//ent->Equation(A,B,C,D,E,F);
//Standard_Real x = ent->StartPoint().X();
//Standard_Real y = ent->StartPoint().Y();
//Standard_Real eq = (A*x*x + B*x*y + C*y*y + D*x + E*y + F);
// These messages are transfered in the translation procedure
/* if (eq < -eps || eq > eps) {
sprintf(mess,"Start point does not satisfy conic equation, gap over %f",
Interface_MSG::Intervalled(eq));
ach.AddFail(mess,"Start point does not satisfy conic equation, gap over %f");
}
*/
//szv#4:S4163:12Mar99 not needed
//x = ent->EndPoint().X();
//y = ent->EndPoint().Y();
//eq = (A*x*x + B*x*y + C*y*y + D*x + E*y + F);
/* if (eq < -eps || eq > eps) {
sprintf(mess,"End point does not satisfy conic equation, gap over %f",
Interface_MSG::Intervalled(eq));
ach.AddFail(mess,"End point does not satisfy conic equation, gap over %f");
}
*/
/* Les tests qui suivant ont-ils un sens ??
if (ent->FormNumber() == 2) // Hyperbola
{
Standard_Real xc = -D / (2 * A);
Standard_Real yc = -E / (2 * C);
gp_Dir2d d0(1, 0);
gp_Dir2d d1(ent->StartPoint().X() - xc, ent->StartPoint().Y() - yc);
gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc);
Standard_Real t1 = d0.Angle(d1);
Standard_Real t2 = d0.Angle(d2);
t1 += (t1 > 0 ? 0 : 2*PI);
t2 += (t2 > 0 ? 0 : 2*PI);
t2 += (t1 <= t2 ? 0 : 2*PI);
if ( !(0 <= t1 && t1 <= 2*PI) || !(0 <= t2-t1 && t2-t1 <= 2*PI) )
ach.AddFail("Parameter Error for Hyperbola");
}
else if (ent->FormNumber() == 3)
{
Standard_Real xc = -D / (2 * A);
Standard_Real yc = -E / (2 * C);
gp_Dir2d d0(1, 0);
gp_Dir2d d1(ent->StartPoint().X() - xc, ent->StartPoint().Y() - yc);
gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc);
Standard_Real t1 = d0.Angle(d1);
Standard_Real t2 = d0.Angle(d2);
if ( !(-PI/2 < t1 && t1 < PI/2) || !(-PI/2 < t2 && t2 < PI/2) )
ach.AddFail("Parameter Error for Parabola");
}
*/
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolConicArc::OwnDump(const Handle(IGESGeom_ConicArc)& ent,
const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
Standard_Real A,B,C,D,E,F;
ent->Equation(A,B,C,D,E,F);
S << "IGESGeom_ConicArc" << endl;
Standard_Integer cf = ent->FormNumber();
if (cf == 0) cf = ent->ComputedFormNumber();
if (cf == 1) S << " -- Ellipse --" << endl;
else if (cf == 2) S << " -- Hyperbola --" << endl;
else if (cf == 3) S << " -- Parabola --" << endl;
else S << " -- (Undetermined type of Conic) --" << endl;
S << "Conic Coefficient A : " << A << endl;
S << "Conic Coefficient B : " << B << endl;
S << "Conic Coefficient C : " << C << endl;
S << "Conic Coefficient D : " << D << endl;
S << "Conic Coefficient E : " << E << endl;
S << "Conic Coefficient F : " << F << endl;
S << "Z-Plane shift : " << ent->ZPlane() << endl;
S << "Start Point : ";
IGESData_DumpXYLZ(S,level, ent->StartPoint(), ent->Location(),ent->ZPlane());
S << endl;
S << "End Point : ";
IGESData_DumpXYLZ(S,level, ent->EndPoint(), ent->Location(), ent->ZPlane());
S << endl;
if (level <= 4) S<<" -- Computed Definition : ask level > 4" << endl;
else {
gp_Pnt Cen; gp_Dir Ax; Standard_Real Rmin,Rmax;
ent->Definition (Cen,Ax,Rmin,Rmax);
S << " -- Computed Definition (and Transformed if level > 5)" << endl;
if (cf != 3) {
S<<" Center : "; IGESData_DumpXYZL(S,level,Cen,ent->Location());
S<<endl;
}
S << " Main Axis : "; IGESData_DumpXYZL(S,level,Ax,ent->VectorLocation());
S<<endl;
if (cf == 3) S << " Focal : " << Rmin << endl;
else if (Rmin == Rmax) S << " Radius (Major = Minor) : " << Rmin << endl;
else S << " Major Radius : " << Rmax << " Minor Radius : " << Rmin <<endl;
S<< " Normal Axis : "; IGESData_DumpXYZL(S,level,ent->Axis(),ent->VectorLocation());
S << endl;
}
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolCopiousData.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolCopiousData from IGESGeom
---Purpose : Tool to work on a CopiousData. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses CopiousData from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolCopiousData;
---Purpose : Returns a ToolCopiousData, ready to work
ReadOwnParams (me; ent : mutable CopiousData;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : CopiousData;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : CopiousData;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a CopiousData <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : CopiousData) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : CopiousData;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : CopiousData; entto : mutable CopiousData;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : CopiousData;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolCopiousData;

View File

@@ -0,0 +1,299 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CopiousData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolCopiousData.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <gp_XY.hxx>
// MGE 28/07/98
#include <Message_Msg.hxx>
//=======================================================================
//function : IGESGeom_ToolCopiousData
//purpose :
//=======================================================================
IGESGeom_ToolCopiousData::IGESGeom_ToolCopiousData ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolCopiousData::ReadOwnParams(const Handle(IGESGeom_CopiousData)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */,
IGESData_ParamReader& PR) const
{
// MGE 28/07/98
// Building of messages
Standard_Integer aDataType, nbData;
Standard_Real aZPlane = 0;
Handle(TColStd_HArray1OfReal) allData;
Standard_Integer upper;
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Boolean data = Standard_False;
if (!PR.ReadInteger(PR.Current(), aDataType)){ //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadInteger(PR.Current(), "Data Type", aDataType);
Message_Msg Msg85("XSTEP_85");
PR.SendFail(Msg85);
}
Standard_Boolean st = PR.ReadInteger(PR.Current(), nbData);
//st = PR.ReadInteger(PR.Current(), "Number of n-tuples", nbData);
if (st && (nbData > 0)) data = Standard_True;
else {
Message_Msg Msg86("XSTEP_86");
PR.SendFail(Msg86);
}
if (aDataType == 1){
if (!PR.ReadReal(PR.Current(), aZPlane)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg87("XSTEP_87");
PR.SendFail(Msg87);
}
//if (aDataType == 1) st = PR.ReadReal(PR.Current(), "Z Plane", aZPlane);
}
if ( data )
{
if (aDataType == 1) upper = 2*nbData;
else if (aDataType == 2) upper = 3*nbData;
else upper = 6*nbData;
Message_Msg Msg88("XSTEP_88");
//allData = new TColStd_HArray1OfReal(1, upper) then fill it :
PR.ReadReals(PR.CurrentList(upper),Msg88, allData); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReals(PR.CurrentList(upper), "Tuples", allData);
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aDataType, aZPlane, allData);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolCopiousData::WriteOwnParams(const Handle(IGESGeom_CopiousData)& ent,
IGESData_IGESWriter& IW) const
{
Standard_Integer upper = ent->NbPoints();
Standard_Integer dtype = ent->DataType();
IW.Send(dtype);
IW.Send(upper);
if (ent->DataType() == 1)
IW.Send(ent->ZPlane());
for (Standard_Integer I = 1; I <= upper; I++) {
// DataType = 1 : XY , 2 : XYZ , 3 : XYZ*2
IW.Send( ent->Data(I,1) );
IW.Send( ent->Data(I,2) );
if (dtype > 1) IW.Send( ent->Data(I,3) );
if (dtype <= 2) continue;
IW.Send( ent->Data(I,4) );
IW.Send( ent->Data(I,5) );
IW.Send( ent->Data(I,6) );
}
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolCopiousData::OwnShared(const Handle(IGESGeom_CopiousData)& /* ent */,
Interface_EntityIterator& /* iter */) const
{
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolCopiousData::OwnCopy(const Handle(IGESGeom_CopiousData)& another,
const Handle(IGESGeom_CopiousData)& ent,
Interface_CopyTool& /* TC */) const
{
Standard_Integer upper;
Standard_Real aZPlane = 0;
Standard_Integer nbTuples = another->NbPoints();
Standard_Integer aDataType = another->DataType();
Handle(TColStd_HArray1OfReal) allData;
if (aDataType == 1) upper = 2*nbTuples;
else if (aDataType == 2) upper = 3*nbTuples;
else upper = 6*nbTuples;
allData = new TColStd_HArray1OfReal(1, upper);
if (aDataType == 1) aZPlane = another->ZPlane();
for (Standard_Integer I = 1; I <= nbTuples; I++) {
switch (aDataType) {
case 1:
allData->SetValue(2*I-1, another->Data(I,1));
allData->SetValue(2*I , another->Data(I,2));
break;
case 2:
allData->SetValue(3*I-2, another->Data(I,1));
allData->SetValue(3*I-1, another->Data(I,2));
allData->SetValue(3*I , another->Data(I,3));
break;
case 3:
allData->SetValue(6*I-5, another->Data(I,1));
allData->SetValue(6*I-4, another->Data(I,2));
allData->SetValue(6*I-3, another->Data(I,3));
allData->SetValue(6*I-2, another->Data(I,4));
allData->SetValue(6*I-1, another->Data(I,5));
allData->SetValue(6*I , another->Data(I,6));
break;
}
}
ent->Init(aDataType, aZPlane, allData);
if (another->IsClosedPath2D()) ent->SetClosedPath2D();
else ent->SetPolyline (another->IsPolyline());
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolCopiousData::DirChecker
(const Handle(IGESGeom_CopiousData)& ent ) const
{
IGESData_DirChecker DC(106, 1, 63);
DC.Structure(IGESData_DefVoid);
if (ent->FormNumber() <= 3)
{
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
}
else
{
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefValue);
}
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored ();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolCopiousData::OwnCheck(const Handle(IGESGeom_CopiousData)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 28/07/98
// Building of messages
//======================================
Message_Msg Msg71("XSTEP_71");
//Message_Msg Msg85("XSTEP_85");
//======================================
Standard_Integer fn = ent->FormNumber();
if ( (fn > 3 && fn < 11) || (fn > 14 && fn < 63)) {
// Message_Msg Msg71("XSTEP_71");
ach->SendFail(Msg71);
}
Standard_Integer dt = ent->DataType();
if (dt < 1 || dt > 3) {
Message_Msg Msg85("XSTEP_85");
ach->SendFail(Msg85);
}
if ((dt == 1 && (fn != 1 && fn != 11 && fn != 63)) ||
(dt == 2 && (fn != 2 && fn != 12)) || (dt == 3 && (fn != 3 && fn != 13))) {
// Message_Msg Msg71("XSTEP_71");
ach->SendFail(Msg71);
}
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolCopiousData::OwnDump(const Handle(IGESGeom_CopiousData)& ent,
const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
Standard_Integer nbPnts = ent->NbPoints();
Standard_Integer dtype = ent->DataType();
Standard_Integer i;
gp_GTrsf loca = ent->Location();
gp_GTrsf locv = ent->VectorLocation();
Standard_Boolean yatr = (level > 5 && ent->HasTransf());
S << "IGESGeom_CopiousData" << endl;
if (ent->IsPointSet()) S << "Point Set ";
else if (ent->IsPolyline()) S << "Polyline ";
else if (ent->IsClosedPath2D()) S << "Closed Path 2D ";
S << "DataType " << ent->DataType() << " ";
S << "Number of T-uples = " << nbPnts << " ";
if (dtype == 1) {
S << "(Points 2D) ";
S << "ZPlane = " << ent->ZPlane() << endl;
}
else if (dtype == 2)
S << "(Points 3D)" << endl;
else if (dtype == 3)
S << "(Points 3D + Vectors 3D)" << endl;
if (level > 4) {
for (i = 1; i <= nbPnts; i ++) {
gp_XYZ T = ent->Point(i).XYZ();
if (dtype == 1)
S << "[" << i << "] (" << T.X() << "," << T.Y() << ")";
else
S << "[" << i << "] (" << T.X() << "," << T.Y() << "," << T.Z() << ")";
if (yatr) {
loca.Transforms(T);
S << " Transformed ("<< T.X() << "," << T.Y() << "," << T.Z() << ")";
}
if (dtype == 3) {
// gp_XYZ P = ent->Vector(i).XYZ();
S << "\n Vector (" << T.X() << "," << T.Y() << "," << T.Z() << ")";
if (yatr) {
locv.Transforms(T);
S << " Transformed ("<< T.X() << "," << T.Y() << "," << T.Z() << ")";
}
}
S << endl;
}
}
else S << " [ for content, ask level > 4 ]";
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESGeom_ToolCurveOnSurface.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolCurveOnSurface from IGESGeom
---Purpose : Tool to work on a CurveOnSurface. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses CurveOnSurface from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolCurveOnSurface;
---Purpose : Returns a ToolCurveOnSurface, ready to work
ReadOwnParams (me; ent : mutable CurveOnSurface;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : CurveOnSurface;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : CurveOnSurface;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a CurveOnSurface <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable CurveOnSurface) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a CurveOnSurface
-- (its CurveUV must have UseFlag at 5)
DirChecker (me; ent : CurveOnSurface) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : CurveOnSurface;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : CurveOnSurface; entto : mutable CurveOnSurface;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : CurveOnSurface;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolCurveOnSurface;

View File

@@ -0,0 +1,278 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_CurveOnSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolCurveOnSurface.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <Interface_Macros.hxx>
// MGE 30/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
//=======================================================================
//function : IGESGeom_ToolCurveOnSurface
//purpose :
//=======================================================================
IGESGeom_ToolCurveOnSurface::IGESGeom_ToolCurveOnSurface ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolCurveOnSurface::ReadOwnParams
(const Handle(IGESGeom_CurveOnSurface)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 30/07/98
Standard_Integer aMode, aPreference;
Handle(IGESData_IGESEntity) aSurface;
Handle(IGESData_IGESEntity) aCurveUV;
Handle(IGESData_IGESEntity) aCurve3D;
IGESData_Status aStatus;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
if (!PR.ReadInteger(PR.Current(), aMode)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg276("XSTEP_276");
PR.SendFail(Msg276);
}
if (!PR.ReadEntity(IR, PR.Current(),aStatus, aSurface)){
Message_Msg Msg131("XSTEP_131");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg131.Arg(Msg216.Value());
PR.SendFail(Msg131);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg131.Arg(Msg217.Value());
PR.SendFail(Msg131);
break; }
default:{
}
}
} //szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurveUV, Standard_True)){
Message_Msg Msg132("XSTEP_132");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg132.Arg(Msg216.Value());
PR.SendFail(Msg132);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg132.Arg(Msg217.Value());
PR.SendFail(Msg132);
break; }
default:{
}
}
} //szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurve3D, Standard_True)){; //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg133("XSTEP_133");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg133.Arg(Msg216.Value());
PR.SendFail(Msg133);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg133.Arg(Msg217.Value());
PR.SendFail(Msg133);
break; }
default:{
}
}
}
if (!PR.ReadInteger(PR.Current(), aPreference)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg277("XSTEP_277");
PR.SendFail(Msg277);
}
/*
st = PR.ReadInteger(PR.Current(), "Creation mode of curve", aMode);
st = PR.ReadEntity(IR, PR.Current(), "Surface (on which curve lies)", aSurface);
st = PR.ReadEntity(IR, PR.Current(), "Curve UV", aCurveUV, Standard_True);
st = PR.ReadEntity(IR, PR.Current(), "Curve 3D", aCurve3D, Standard_True);
st = PR.ReadInteger(PR.Current(), "Preferred representation", aPreference);
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(aMode, aSurface, aCurveUV, aCurve3D, aPreference);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolCurveOnSurface::WriteOwnParams
(const Handle(IGESGeom_CurveOnSurface)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->CreationMode());
IW.Send(ent->Surface());
IW.Send(ent->CurveUV());
IW.Send(ent->Curve3D());
IW.Send(ent->PreferenceMode());
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolCurveOnSurface::OwnShared(const Handle(IGESGeom_CurveOnSurface)& ent,
Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Surface());
iter.GetOneItem(ent->CurveUV());
iter.GetOneItem(ent->Curve3D());
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolCurveOnSurface::OwnCopy(const Handle(IGESGeom_CurveOnSurface)& another,
const Handle(IGESGeom_CurveOnSurface)& ent,
Interface_CopyTool& TC) const
{
DeclareAndCast(IGESData_IGESEntity, aSurface, TC.Transferred(another->Surface()));
DeclareAndCast(IGESData_IGESEntity, aCurveUV, TC.Transferred(another->CurveUV()));
DeclareAndCast(IGESData_IGESEntity, aCurve3D, TC.Transferred(another->Curve3D()));
Standard_Integer aMode = another->CreationMode();
Standard_Integer aPreference = another->PreferenceMode();
ent->Init(aMode, aSurface, aCurveUV, aCurve3D, aPreference);
}
//=======================================================================
//function : OwnCorrect
//purpose :
//=======================================================================
Standard_Boolean IGESGeom_ToolCurveOnSurface::OwnCorrect
(const Handle(IGESGeom_CurveOnSurface)& ent) const
{
Handle(IGESData_IGESEntity) c2d = ent->CurveUV();
if (c2d.IsNull()) return Standard_False;
Standard_Integer uf = c2d->UseFlag();
if (uf == 5) return Standard_False;
c2d->InitStatus
(c2d->BlankStatus(),c2d->SubordinateStatus(),5,c2d->HierarchyStatus());
return Standard_True;
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolCurveOnSurface::DirChecker
(const Handle(IGESGeom_CurveOnSurface)& /* ent */ ) const
{
IGESData_DirChecker DC(142, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.UseFlagRequired (5);
DC.HierarchyStatusIgnored ();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolCurveOnSurface::OwnCheck(const Handle(IGESGeom_CurveOnSurface)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 30/07/98
// Building of messages
//========================================
//Message_Msg Msg134 = Message_Msg("XSTEP_134");
//========================================
// if (ent->CreationMode() < 0 || ent->CreationMode() > 3)
// ach.SendFail("Incorrect value for the Creation Mode");
// Standard_Integer pref = ent->PreferenceMode();
// if (pref < 0 || pref > 3)
// ach.SendFail("Incorrect value for the Preference Mode");
// tolerance a la norme
// if (pref == 1 && ent->CurveUV().IsNull())
// ach.AddWarning("Preference Mode asks UV and Curve UV not defined");
// if (pref == 2 && ent->Curve3D().IsNull())
// ach.AddWarning("Preference Mode asks UV and Curve UV not defined");
if (ent->CurveUV().IsNull() && ent->Curve3D().IsNull()) {
Message_Msg Msg134 = Message_Msg("XSTEP_134");
ach->SendFail(Msg134);
}
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolCurveOnSurface::OwnDump(const Handle(IGESGeom_CurveOnSurface)& ent,
const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
S << "IGESGeom_CurveOnSurface" << endl << endl;
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
Standard_Integer crem = ent->CreationMode();
S << "Creation Mode : " << crem << " i.e. ";
if (crem == 0) S << " <Unspecified>" << endl;
else if (crem == 1) S << " Projection of a Curve on a Surface" << endl;
else if (crem == 2) S << " Intersection of two Surfaces" << endl;
else if (crem == 3) S << " Isoparametric Curve (either U or V)" << endl;
else S << " <Incorrect Value>" << endl;
S << "The Surface on which the curve lies : ";
dumper.Dump(ent->Surface(),S, sublevel);
S << endl;
S << "The curve B (in the parametric space (u, v)) : ";
dumper.Dump(ent->CurveUV(),S, sublevel);
S << endl;
S << "The curve C (in the 3D Space) : ";
dumper.Dump(ent->Curve3D(),S, sublevel);
S << endl;
Standard_Integer pref = ent->PreferenceMode();
S << "Preferred representation mode : " << pref << " i.e. ";
if (pref == 0) S << " <Unspecified>" << endl;
else if (pref == 1) S << " Curve B on Surface" << endl;
else if (pref == 2) S << " Curve C in 3D Space" << endl;
else if (pref == 3) S << " Curves B & C equally preferred" << endl;
else S << " <Incorrect Value>" << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolDirection.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolDirection from IGESGeom
---Purpose : Tool to work on a Direction. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Direction from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolDirection;
---Purpose : Returns a ToolDirection, ready to work
ReadOwnParams (me; ent : mutable Direction;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : Direction;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Direction;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Direction <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : Direction) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Direction;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Direction; entto : mutable Direction;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Direction;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolDirection;

View File

@@ -0,0 +1,105 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Direction.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolDirection.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XY.hxx>
#include <gp_XYZ.hxx>
#include <gp_Vec.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESGeom_ToolDirection::IGESGeom_ToolDirection () { }
void IGESGeom_ToolDirection::ReadOwnParams
(const Handle(IGESGeom_Direction)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
gp_XYZ aDirection;
gp_XY tmpXY;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Real tmpReal;
//st = PR.ReadXY(PR.CurrentList(1, 2), "Direction", tmpXY); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadXY(PR.CurrentList(1, 2), "Direction", tmpXY)) {
aDirection.SetX(tmpXY.X());
aDirection.SetY(tmpXY.Y());
}
if (PR.DefinedElseSkip())
{
//st = PR.ReadReal(PR.Current(), "Direction", tmpReal); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Direction", tmpReal))
aDirection.SetZ(tmpReal);
}
else
{
aDirection.SetZ(0.0); // Default value.
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aDirection);
}
void IGESGeom_ToolDirection::WriteOwnParams
(const Handle(IGESGeom_Direction)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->Value().X());
IW.Send(ent->Value().Y());
IW.Send(ent->Value().Z());
}
void IGESGeom_ToolDirection::OwnShared
(const Handle(IGESGeom_Direction)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESGeom_ToolDirection::OwnCopy
(const Handle(IGESGeom_Direction)& another,
const Handle(IGESGeom_Direction)& ent, Interface_CopyTool& /* TC */) const
{
ent->Init(another->Value().XYZ());
}
IGESData_DirChecker IGESGeom_ToolDirection::DirChecker
(const Handle(IGESGeom_Direction)& /* ent */ ) const
{
IGESData_DirChecker DC(123, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.BlankStatusIgnored ();
DC.SubordinateStatusRequired (1);
DC.UseFlagRequired (2);
DC.HierarchyStatusIgnored ();
return DC;
}
void IGESGeom_ToolDirection::OwnCheck
(const Handle(IGESGeom_Direction)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->Value().XYZ().SquareModulus() <= 0.0)
ach->AddFail("Direction : The values indicate no direction");
}
void IGESGeom_ToolDirection::OwnDump
(const Handle(IGESGeom_Direction)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGeom_Direction" << endl << endl;
S << "Value : ";
IGESData_DumpXYZL(S,level, ent->Value(), ent->VectorLocation());
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESGeom_ToolFlash.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolFlash from IGESGeom
---Purpose : Tool to work on a Flash. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Flash from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolFlash;
---Purpose : Returns a ToolFlash, ready to work
ReadOwnParams (me; ent : mutable Flash;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : Flash;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Flash;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Flash <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable Flash) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a Flash
-- (LineFont in Directory Entry forced to Rank = 1)
DirChecker (me; ent : Flash) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Flash;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Flash; entto : mutable Flash;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Flash;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolFlash;

View File

@@ -0,0 +1,179 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Flash.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolFlash.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt2d.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_LineFontEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESGeom_ToolFlash::IGESGeom_ToolFlash () { }
void IGESGeom_ToolFlash::ReadOwnParams
(const Handle(IGESGeom_Flash)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
gp_XY aPoint;
Standard_Real aDim1, aDim2, aRotation;
Handle(IGESData_IGESEntity) aReference;
Standard_Integer fn = ent->FormNumber(); // for default cases
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
aDim1 = aDim2 = aRotation = 0.; // default values
// Reading reference of flash
PR.ReadXY(PR.CurrentList(1, 2), "Reference of Flash", aPoint); //szv#4:S4163:12Mar99 `st=` not needed
// Reading first flash sizing parameter
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(), "First Flash sizing parameter", aDim1); //szv#4:S4163:12Mar99 `st=` not needed
else if (fn > 0) PR.AddFail("Fist Flash sizing parameter : undefined");
// Reading second flash sizing parameter
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(), "Second Flash sizing parameter", aDim2); //szv#4:S4163:12Mar99 `st=` not needed
else {
if (fn > 1) PR.AddFail("Second Flash sizing parameter : not defined");
}
// Reading rotation of flash about reference point
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(), "Rotation about ref. point", aRotation); //szv#4:S4163:12Mar99 `st=` not needed
else {
if (fn == 2 || fn == 4) PR.AddFail("Rotation about ref. point : not defined");
}
if ( PR.IsParamEntity(PR.CurrentNumber()) )
// Reading the referenced entity
PR.ReadEntity(IR, PR.Current(), "Referenced entity", aReference); //szv#4:S4163:12Mar99 `st=` not needed
// "else" not necessary as this is the last field
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init (aPoint, aDim1, aDim2, aRotation, aReference);
}
void IGESGeom_ToolFlash::WriteOwnParams
(const Handle(IGESGeom_Flash)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->ReferencePoint().X() );
IW.Send( ent->ReferencePoint().Y() );
IW.Send( ent->Dimension1() );
IW.Send( ent->Dimension2() );
IW.Send( ent->Rotation() );
IW.Send( ent->ReferenceEntity() );
}
void IGESGeom_ToolFlash::OwnShared
(const Handle(IGESGeom_Flash)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem( ent->ReferenceEntity() );
}
void IGESGeom_ToolFlash::OwnCopy
(const Handle(IGESGeom_Flash)& another,
const Handle(IGESGeom_Flash)& ent, Interface_CopyTool& TC) const
{
gp_XY aPoint = (another->ReferencePoint()).XY();
Standard_Real aDim1 = another->Dimension1();
Standard_Real aDim2 = another->Dimension2();
Standard_Real aRotation = another->Rotation();
DeclareAndCast(IGESData_IGESEntity, aReference,
TC.Transferred(another->ReferenceEntity()));
ent->Init(aPoint, aDim1, aDim2, aRotation, aReference);
}
Standard_Boolean IGESGeom_ToolFlash::OwnCorrect
(const Handle(IGESGeom_Flash)& ent) const
{
Standard_Integer fn = ent->FormNumber();
Standard_Boolean res0 = (ent->RankLineFont() != 1);
if (res0) {
Handle(IGESData_LineFontEntity) nulfont;
ent->InitLineFont(nulfont,1); // ranklinefont force a 1
}
Standard_Boolean res1 = Standard_False;
Handle(IGESData_IGESEntity) ref = ent->ReferenceEntity();
if (fn != 0 && !ref.IsNull()) {
ref.Nullify();
res1 = Standard_True;
}
Standard_Real d1 = ent->Dimension1();
Standard_Real d2 = ent->Dimension2();
Standard_Real rt = ent->Rotation();
if (fn == 0 && d1 != 0.) { d1 = 0.; res1 = Standard_True; }
if (fn <= 1 && d2 != 0.) { d2 = 0.; res1 = Standard_True; }
if ((fn <= 1 || fn == 3) && rt != 0.) { rt = 0.; res1 = Standard_True; }
if (res1) ent->Init (ent->ReferencePoint().XY(), d1, d2, rt, ref);
return (res0 || res1);
}
IGESData_DirChecker IGESGeom_ToolFlash::DirChecker
(const Handle(IGESGeom_Flash)& /* ent */ ) const
{
IGESData_DirChecker DC(125, 0, 4);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefValue);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusRequired(0);
return DC;
}
void IGESGeom_ToolFlash::OwnCheck
(const Handle(IGESGeom_Flash)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Integer fn = ent->FormNumber();
if (ent->RankLineFont() != 1)
ach->AddFail("LineFontPattern : Value != 1");
if (ent->ReferenceEntity().IsNull()) {
if (fn == 0)
ach->AddFail("Flash defined by a Reference Entity, which is absent");
}
else if (fn != 0) ach->AddWarning("Reference Entity present though useless");
if (fn == 1 && ent->Dimension2() != 0.)
ach->AddWarning("Dimension 2 present though useless");
if ((fn == 1 || fn == 3) && ent->Rotation() != 0.)
ach->AddWarning("Rotation present though useless");
}
void IGESGeom_ToolFlash::OwnDump
(const Handle(IGESGeom_Flash)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
Standard_Integer fn = ent->FormNumber();
S << "IGESGeom_Flash" << endl;
switch (fn) {
case 0 : S << " -- Form defined by reference entity --" << endl; break;
case 1 : S << " -- Circular -- "; break;
case 2 : S << " -- Rectangle -- "; break;
case 3 : S << " -- Donut -- "; break;
case 4 : S << " -- Canoe -- "; break;
default : break;
}
S << "Flash reference point : ";
IGESData_DumpXYL(S,level, ent->ReferencePoint(), ent->Location());
S << " First sizing parameter : " << ent->Dimension1() << " ";
S << " Second sizing parameter : " << ent->Dimension2() << endl;
S << " Rotation about reference entity : " << ent->Rotation() << endl;
S << "Reference Entity : ";
dumper.Dump(ent->ReferenceEntity(),S, sublevel);
S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolLine.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolLine from IGESGeom
---Purpose : Tool to work on a Line. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Line from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolLine;
---Purpose : Returns a ToolLine, ready to work
ReadOwnParams (me; ent : mutable Line;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : Line;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Line;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Line <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : Line) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Line;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Line; entto : mutable Line;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Line;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolLine;

View File

@@ -0,0 +1,107 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Line.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolLine.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 29/07/98
#include <Message_Msg.hxx>
IGESGeom_ToolLine::IGESGeom_ToolLine () { }
void IGESGeom_ToolLine::ReadOwnParams
(const Handle(IGESGeom_Line)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
// MGE 29/07/98
// Building of messages
//====================================
Message_Msg Msg89("XSTEP_89");
Message_Msg Msg90("XSTEP_90");
//====================================
gp_XYZ aStart, anEnd;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
PR.ReadXYZ(PR.CurrentList(1, 3),Msg89, aStart); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadXYZ(PR.CurrentList(1, 3), Msg90, anEnd); //szv#4:S4163:12Mar99 `st=` not needed
/* st = PR.ReadXYZ(PR.CurrentList(1, 3), "Starting Point", aStart);
st = PR.ReadXYZ(PR.CurrentList(1, 3), "End Point", anEnd);
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aStart, anEnd);
}
void IGESGeom_ToolLine::WriteOwnParams
(const Handle(IGESGeom_Line)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->StartPoint().X());
IW.Send(ent->StartPoint().Y());
IW.Send(ent->StartPoint().Z());
IW.Send(ent->EndPoint().X());
IW.Send(ent->EndPoint().Y());
IW.Send(ent->EndPoint().Z());
}
void IGESGeom_ToolLine::OwnShared
(const Handle(IGESGeom_Line)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESGeom_ToolLine::OwnCopy
(const Handle(IGESGeom_Line)& another,
const Handle(IGESGeom_Line)& ent, Interface_CopyTool& /* TC */) const
{
ent->Init(another->StartPoint().XYZ(), another->EndPoint().XYZ());
}
IGESData_DirChecker IGESGeom_ToolLine::DirChecker
(const Handle(IGESGeom_Line)& /* ent */ ) const
{
IGESData_DirChecker DC(110, 0,2);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGeom_ToolLine::OwnCheck
(const Handle(IGESGeom_Line)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESGeom_ToolLine::OwnDump
(const Handle(IGESGeom_Line)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer infin = ent->Infinite();
switch (infin) {
case 1 : S << "Semi-Infinite Line"<<endl; break;
case 2 : S << "Infinite Line"<<endl; break;
default : S << "Bounded Line"<<endl; break;
}
S << "Line from IGESGeom" << endl;
S << "Starting Point : ";
IGESData_DumpXYZL(S,level, ent->StartPoint(), ent->Location());
S << endl;
S << "End Point : ";
IGESData_DumpXYZL(S,level, ent->EndPoint(), ent->Location());
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESGeom_ToolOffsetCurve.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolOffsetCurve from IGESGeom
---Purpose : Tool to work on a OffsetCurve. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses OffsetCurve from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolOffsetCurve;
---Purpose : Returns a ToolOffsetCurve, ready to work
ReadOwnParams (me; ent : mutable OffsetCurve;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : OffsetCurve;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : OffsetCurve;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a OffsetCurve <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable OffsetCurve) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a OffsetCurve
-- (if OffsetType is not 3, OffsetFunction is cleared)
DirChecker (me; ent : OffsetCurve) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : OffsetCurve;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : OffsetCurve; entto : mutable OffsetCurve;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : OffsetCurve;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolOffsetCurve;

View File

@@ -0,0 +1,358 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_OffsetCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
//:l9 abv 15.01.99: CTS22023 and TEC0278: issue data fail on offset tapered flag
// only if type is not constant
#include <IGESGeom_ToolOffsetCurve.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Vec.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 30/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
//=======================================================================
//function : IGESGeom_ToolOffsetCurve
//purpose :
//=======================================================================
IGESGeom_ToolOffsetCurve::IGESGeom_ToolOffsetCurve ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolOffsetCurve::ReadOwnParams(const Handle(IGESGeom_OffsetCurve)& ent,
const Handle(IGESData_IGESReaderData)& IR,
IGESData_ParamReader& PR) const
{
// MGE 30/07/98
// Building of messages
//========================================
Message_Msg Msg121("XSTEP_121");
//========================================
Standard_Integer anOffsetType, aFunctionCoord, aTaperedOffsetType;
Standard_Real offDistance1, offDistance2;
Standard_Real arcLength1, arcLength2, anOffsetParam, anotherOffsetParam;
gp_XYZ aNormalVec;
Handle(IGESData_IGESEntity) aBaseCurve;
Handle(IGESData_IGESEntity) aFunction;
IGESData_Status aStatus;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
// Reading the curve entity to be offset
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aBaseCurve)){
Message_Msg Msg110("XSTEP_110");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg110.Arg(Msg216.Value());
PR.SendFail(Msg110);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg110.Arg(Msg217.Value());
PR.SendFail(Msg110);
break; }
default:{
}
}
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadEntity(IR, PR.Current(), "Curve to be offset", aBaseCurve);
// Reading the offset distance flag
if (!PR.ReadInteger(PR.Current(), anOffsetType)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg111("XSTEP_111");
PR.SendFail(Msg111);
}
//st = PR.ReadInteger(PR.Current(), "Offset Distance Flag", anOffsetType);
// Reading the curve entity describing the offset as a function, can be Null
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aFunction, Standard_True)){
Message_Msg Msg112("XSTEP_112");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg112.Arg(Msg216.Value());
PR.SendFail(Msg112);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg112.Arg(Msg217.Value());
PR.SendFail(Msg112);
break; }
default:{
}
}
} //szv#4:S4163:12Mar99 `st=` not needed
/*
st = PR.ReadEntity(IR, PR.Current(), "Curve whose coordinate describes the offset", aFunction, Standard_True);
*/
// Reading the coordinate describing the offset as a function
if (!PR.ReadInteger(PR.Current(), aFunctionCoord)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg113("XSTEP_113");
PR.SendFail(Msg113);
}
//st = PR.ReadInteger(PR.Current(), "Coordinate of the curve", aFunctionCoord);
// Reading the tapered offset type flag
if (!PR.ReadInteger(PR.Current(), aTaperedOffsetType)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg114("XSTEP_114");
PR.SendFail(Msg114);
}
//st = PR.ReadInteger(PR.Current(), "Tapered offset type flag", aTaperedOffsetType);
// Reading the first offset distance
if (!PR.ReadReal(PR.Current(), offDistance1)){
Message_Msg Msg115("XSTEP_115");
PR.SendFail(Msg115);
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReal(PR.Current(), "First Offset distance", offDistance1);
// Reading the arc length or parameter value of the first offset distance
if (!PR.ReadReal(PR.Current(), arcLength1)){
Message_Msg Msg116("XSTEP_116");
PR.SendFail(Msg116);
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReal(PR.Current(), "Arc length of first offset distance", arcLength1);
// Reading the second offset distance
if (!PR.ReadReal(PR.Current(),offDistance2)){
Message_Msg Msg117("XSTEP_117");
PR.SendFail(Msg117);
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReal(PR.Current(), "Second Offset distance", offDistance2);
// Reading the arc length or parameter value of the second offset distance
if (!PR.ReadReal(PR.Current(), arcLength2)){
Message_Msg Msg118("XSTEP_118");
PR.SendFail(Msg118);
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReal(PR.Current(), "Arc length of Second offset distance", arcLength2);
// Reading the Unit vector normal to plane
PR.ReadXYZ (PR.CurrentList(1, 3), Msg121, aNormalVec); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadXYZ (PR.CurrentList(1, 3), "Unit vector normal to plane", aNormalVec);
// Reading the offset curve starting parameter value
if (!PR.ReadReal(PR.Current(), anOffsetParam)){
Message_Msg Msg119("XSTEP_119");
PR.SendFail(Msg119);
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReal(PR.Current(), "Starting parameter value of Offset curve", anOffsetParam);
// Reading the offset curve ending parameter value
if (!PR.ReadReal(PR.Current(), anotherOffsetParam)){
Message_Msg Msg120("XSTEP_120");
PR.SendFail(Msg120);
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReal(PR.Current(), "Ending parameter value of Offset curve", anotherOffsetParam);
// Reading the Unit vector normal to plane
PR.ReadXYZ (PR.CurrentList(1, 3), Msg121, aNormalVec); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadXYZ (PR.CurrentList(1, 3), "Unit vector normal to plane", aNormalVec);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(aBaseCurve, anOffsetType, aFunction, aFunctionCoord,
aTaperedOffsetType, offDistance1, arcLength1, offDistance2,
arcLength2, aNormalVec, anOffsetParam, anotherOffsetParam);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolOffsetCurve::WriteOwnParams(const Handle(IGESGeom_OffsetCurve)& ent,
IGESData_IGESWriter& IW) const
{
IW.Send(ent->BaseCurve());
IW.Send(ent->OffsetType());
IW.Send(ent->Function());
IW.Send(ent->FunctionParameter());
IW.Send(ent->TaperedOffsetType());
IW.Send(ent->FirstOffsetDistance());
IW.Send(ent->ArcLength1());
IW.Send(ent->SecondOffsetDistance());
IW.Send(ent->ArcLength2());
IW.Send(ent->NormalVector().X());
IW.Send(ent->NormalVector().Y());
IW.Send(ent->NormalVector().Z());
IW.Send(ent->StartParameter());
IW.Send(ent->EndParameter());
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolOffsetCurve::OwnShared(const Handle(IGESGeom_OffsetCurve)& ent,
Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->BaseCurve());
iter.GetOneItem(ent->Function());
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolOffsetCurve::OwnCopy(const Handle(IGESGeom_OffsetCurve)& another,
const Handle(IGESGeom_OffsetCurve)& ent,
Interface_CopyTool& TC) const
{
Standard_Integer anOffsetType, aFunctionCoord, aTaperedOffsetType;
Standard_Real offDistance1, offDistance2;
Standard_Real arcLength1, arcLength2, anOffsetParam1, anOffsetParam2;
DeclareAndCast(IGESData_IGESEntity, aBaseCurve,
TC.Transferred(another->BaseCurve()));
anOffsetType = another->OffsetType();
DeclareAndCast(IGESData_IGESEntity, aFunction,
TC.Transferred(another->Function()));
aFunctionCoord = another->FunctionParameter();
aTaperedOffsetType = another->TaperedOffsetType();
offDistance1 = another->FirstOffsetDistance();
arcLength1 = another->ArcLength1();
offDistance2 = another->SecondOffsetDistance();
arcLength2 = another->ArcLength2();
gp_XYZ aNormalVec = (another->NormalVector()).XYZ();
anOffsetParam1 = another->StartParameter();
anOffsetParam2 = another->EndParameter();
ent->Init(aBaseCurve, anOffsetType, aFunction, aFunctionCoord,
aTaperedOffsetType, offDistance1, arcLength1, offDistance2,
arcLength2, aNormalVec, anOffsetParam1, anOffsetParam2);
}
//=======================================================================
//function : OwnCorrect
//purpose :
//=======================================================================
Standard_Boolean IGESGeom_ToolOffsetCurve::OwnCorrect
(const Handle(IGESGeom_OffsetCurve)& ent) const
{
if (ent->OffsetType() == 3) return Standard_False;
Handle(IGESData_IGESEntity) func = ent->Function();
if (func.IsNull()) return Standard_False;
// OffsetType != 3 : reconstruire avec Offset Function Nulle
func.Nullify();
ent->Init (ent->BaseCurve(), ent->OffsetType(), func,0, // func+coord Nuls
ent->TaperedOffsetType(),
ent->FirstOffsetDistance(), ent->ArcLength1(),
ent->SecondOffsetDistance(), ent->ArcLength2(),
ent->NormalVector().XYZ(),
ent->StartParameter(), ent->EndParameter() );
return Standard_True;
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolOffsetCurve::DirChecker
(const Handle(IGESGeom_OffsetCurve)& /* ent */ ) const
{
IGESData_DirChecker DC(130, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolOffsetCurve::OwnCheck(const Handle(IGESGeom_OffsetCurve)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 30/07/98
// Building of messages
//========================================
//Message_Msg Msg111("XSTEP_111");
//Message_Msg Msg114("XSTEP_114");
//========================================
Standard_Integer ot = ent->OffsetType();
if (ot < 1 || ot > 3) {
Message_Msg Msg111("XSTEP_111");
ach->SendFail(Msg111);
}
/* if (ot == 3) if (ent->Function().IsNull())
ach.SendFail("Offset Function Not Defined while Offset Type = 3");
if (ot == 3 && (ent->FunctionParameter() < 1 || ent->FunctionParameter() > 3))
ach.SendFail("Offset Function Parameter != 1-2 or 3 (rq : for X-Y or Z)");
*/
if (ot !=1 && //:l9 abv 15.01.99: CTS22023 and TEC0278: only if ot is function
(ent->TaperedOffsetType() < 1) || (ent->TaperedOffsetType() > 2)) {
Message_Msg Msg114("XSTEP_114");
ach->SendFail(Msg114);
}
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolOffsetCurve::OwnDump(const Handle(IGESGeom_OffsetCurve)& ent,
const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESGeom_OffsetCurve" << endl;
S << "The curve to be offset : " << endl;
dumper.Dump(ent->BaseCurve(),S, sublevel);
S << "Offset Distance Flag : " << ent->OffsetType() << endl;
S << "Curve entity whose coordinate defines the offset : ";
dumper.Dump(ent->Function(),S, sublevel);
S << endl;
S << "In which Coordinate to use : " << ent->FunctionParameter() << endl;
S << "Tapered Offset Type Flag : " << ent->TaperedOffsetType() << endl;
S << "First Offset Distance : " << ent->FirstOffsetDistance() << " ";
S << "Arc Length : " << ent->ArcLength1() << endl;
S << "Second Offset Distance : " << ent->SecondOffsetDistance() << " ";
S << "Arc Length : " << ent->ArcLength2() << endl;
S << "Normal Vector : ";
IGESData_DumpXYZL(S,level, ent->NormalVector(), ent->VectorLocation()); S<<endl;
S << "Offset curve Parameters. Starting : " << ent->StartParameter() << " ";
S << "Ending : " << ent->EndParameter() << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolOffsetSurface.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolOffsetSurface from IGESGeom
---Purpose : Tool to work on a OffsetSurface. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses OffsetSurface from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolOffsetSurface;
---Purpose : Returns a ToolOffsetSurface, ready to work
ReadOwnParams (me; ent : mutable OffsetSurface;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : OffsetSurface;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : OffsetSurface;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a OffsetSurface <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : OffsetSurface) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : OffsetSurface;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : OffsetSurface; entto : mutable OffsetSurface;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : OffsetSurface;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolOffsetSurface;

View File

@@ -0,0 +1,143 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_OffsetSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolOffsetSurface.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Vec.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 31/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
IGESGeom_ToolOffsetSurface::IGESGeom_ToolOffsetSurface () { }
void IGESGeom_ToolOffsetSurface::ReadOwnParams
(const Handle(IGESGeom_OffsetSurface)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 31/07/98
// Building of messages
//========================================
Message_Msg Msg162("XSTEP_162");
//========================================
gp_XYZ anIndicator;
Standard_Real aDistance;
Handle(IGESData_IGESEntity) aSurface;
IGESData_Status aStatus;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
// Reading the offset indicator
PR.ReadXYZ(PR.CurrentList(1, 3), Msg162, anIndicator); //szv#4:S4163:12Mar99 `st=` not needed
// Reading the offset distance
if (!PR.ReadReal(PR.Current(), aDistance)){
Message_Msg Msg163("XSTEP_163");
PR.SendFail(Msg163);
} //szv#4:S4163:12Mar99 `st=` not needed
// Reading the surface entity to be offset
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aSurface)){
Message_Msg Msg164("XSTEP_164");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg164.Arg(Msg216.Value());
PR.SendFail(Msg164);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg164.Arg(Msg217.Value());
PR.SendFail(Msg164);
break; }
default:{
}
}
}//szv#4:S4163:12Mar99 `st=` not needed
/*
// Reading the offset indicator
st = PR.ReadXYZ(PR.CurrentList(1, 3), "Offset Indicator", anIndicator);
// Reading the offset distance
st = PR.ReadReal(PR.Current(), "The Offset Distance ", aDistance);
// Reading the surface entity to be offset
st = PR.ReadEntity(IR, PR.Current(), "Surface entity to be offset", aSurface);
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(anIndicator, aDistance, aSurface);
}
void IGESGeom_ToolOffsetSurface::WriteOwnParams
(const Handle(IGESGeom_OffsetSurface)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->OffsetIndicator().X() );
IW.Send( ent->OffsetIndicator().Y() );
IW.Send( ent->OffsetIndicator().Z() );
IW.Send( ent->Distance() );
IW.Send( ent->Surface() );
}
void IGESGeom_ToolOffsetSurface::OwnShared
(const Handle(IGESGeom_OffsetSurface)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem( ent->Surface() );
}
void IGESGeom_ToolOffsetSurface::OwnCopy
(const Handle(IGESGeom_OffsetSurface)& another,
const Handle(IGESGeom_OffsetSurface)& ent, Interface_CopyTool& TC) const
{
DeclareAndCast(IGESData_IGESEntity, aSurface, TC.Transferred(another->Surface()) );
gp_XYZ anIndicator = (another->OffsetIndicator()).XYZ();
Standard_Real aDistance = another->Distance();
ent->Init(anIndicator, aDistance, aSurface);
}
IGESData_DirChecker IGESGeom_ToolOffsetSurface::DirChecker
(const Handle(IGESGeom_OffsetSurface)& /* ent */ ) const
{
IGESData_DirChecker DC(140, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGeom_ToolOffsetSurface::OwnCheck
(const Handle(IGESGeom_OffsetSurface)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESGeom_ToolOffsetSurface::OwnDump
(const Handle(IGESGeom_OffsetSurface)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESGeom_OffsetSurface" << endl;
S << "Offset Indicator : ";
IGESData_DumpXYZL(S,level, ent->OffsetIndicator(), ent->VectorLocation());
S << endl;
S << "Offset Distance : " << ent->Distance() << " ";
S << "Surface to be offset : ";
dumper.Dump(ent->Surface(),S, sublevel);
S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolPlane.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolPlane from IGESGeom
---Purpose : Tool to work on a Plane. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Plane from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolPlane;
---Purpose : Returns a ToolPlane, ready to work
ReadOwnParams (me; ent : mutable Plane;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : Plane;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Plane;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Plane <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : Plane) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Plane;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Plane; entto : mutable Plane;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Plane;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolPlane;

View File

@@ -0,0 +1,267 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Plane.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolPlane.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_MSG.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
// MGE 30/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
//=======================================================================
//function : IGESGeom_ToolPlane
//purpose :
//=======================================================================
IGESGeom_ToolPlane::IGESGeom_ToolPlane ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolPlane::ReadOwnParams(const Handle(IGESGeom_Plane)& ent,
const Handle(IGESData_IGESReaderData)& IR,
IGESData_ParamReader& PR) const
{
// MGE 30/07/98
Standard_Real A, B, C, D, aSize = 0.;
Handle(IGESData_IGESEntity) aCurve;
gp_XYZ attach (0.,0.,0.);
IGESData_Status aStatus;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
/* PR.ReadReal(PR.Current(), Msg135, A); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg135, B); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg135, C); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), Msg135, D); //szv#4:S4163:12Mar99 `st=` not needed
*/
if ((!PR.ReadReal(PR.Current(),A)) || (!PR.ReadReal(PR.Current(),B)) ||
(!PR.ReadReal(PR.Current(),C)) || (!PR.ReadReal(PR.Current(),D))){
Message_Msg Msg135("XSTEP_135");
PR.SendFail(Msg135);
}
/*
st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", A);
st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", B);
st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", C);
st = PR.ReadReal(PR.Current(), "Coefficient Of Plane", D);
*/
if (PR.IsParamDefined(PR.CurrentNumber())) {
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurve,Standard_True)){
Message_Msg Msg136("XSTEP_136");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg136.Arg(Msg216.Value());
PR.SendFail(Msg136);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg136.Arg(Msg217.Value());
PR.SendFail(Msg136);
break; }
default:{
}
}
}
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadEntity(IR, PR.Current(), "Bounding Curve", aCurve,Standard_True);
// en principe exige si FormNumber != 0 ... cf OwnCheck (Load accepte)
if (PR.IsParamDefined(PR.CurrentNumber())) {
Message_Msg Msg139("XSTEP_139");
PR.ReadXYZ(PR.CurrentList(1, 3), Msg139, attach); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadXYZ(PR.CurrentList(1, 3), "Coord of DisplaySymbol", attach);
if (!PR.ReadReal(PR.Current(), aSize)){
Message_Msg Msg138("XSTEP_138");
PR.SendFail(Msg138);
} //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReal(PR.Current(), "DisplaySymbol Size", aSize);
}// else {
/* for (int i = 1; i <= 4; i ++) st = PR.DefinedElseSkip();
PR.AddWarning("Display Symbol not defined at all");
*/
// }
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(A, B, C, D, aCurve, attach, aSize);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolPlane::WriteOwnParams(const Handle(IGESGeom_Plane)& ent,
IGESData_IGESWriter& IW) const
{
Standard_Real A,B,C,D;
ent->Equation(A,B,C,D);
IW.Send(A);
IW.Send(B);
IW.Send(C);
IW.Send(D);
IW.Send(ent->BoundingCurve());
IW.Send(ent->SymbolAttach().X());
IW.Send(ent->SymbolAttach().Y());
IW.Send(ent->SymbolAttach().Z());
IW.Send(ent->SymbolSize());
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolPlane::OwnShared(const Handle(IGESGeom_Plane)& ent,
Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->BoundingCurve());
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolPlane::OwnCopy(const Handle(IGESGeom_Plane)& another,
const Handle(IGESGeom_Plane)& ent,
Interface_CopyTool& TC) const
{
Standard_Real A, B, C, D;
another->Equation(A, B, C, D);
gp_XYZ attach = (another->SymbolAttach()).XYZ();
Standard_Real aSize = another->SymbolSize();
DeclareAndCast(IGESData_IGESEntity,aCurve,
TC.Transferred(another->BoundingCurve()));
ent->Init(A, B, C, D, aCurve, attach, aSize);
ent->SetFormNumber(another->FormNumber());
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolPlane::DirChecker
(const Handle(IGESGeom_Plane)& ent ) const
{
IGESData_DirChecker DC(108,-1,1);
DC.Structure(IGESData_DefVoid);
if (ent->FormNumber() != 0)
{
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
}
else
{
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.HierarchyStatusIgnored();
}
DC.Color(IGESData_DefAny);
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolPlane::OwnCheck(const Handle(IGESGeom_Plane)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 30/07/98
// Building of messages
//========================================
//Message_Msg Msg71("XSTEP_71");
//Message_Msg Msg137("XSTEP_137");
//========================================
//szv#4:S4163:12Mar99 not needed
//Standard_Real eps = 1.E-06; // ?? Precision
//Standard_Real A,B,C,D;
//ent->Equation(A,B,C,D);
if (ent->FormNumber() < -1 || ent->FormNumber() > 1) {
Message_Msg Msg71("XSTEP_71");
ach->SendFail(Msg71);
}
//szv#4:S4163:12Mar99 `!=` wrong operation on Standard_Boolean
Standard_Boolean unbounded1 = ent->BoundingCurve().IsNull();
Standard_Boolean unbounded2 = (ent->FormNumber() == 0);
if ( (unbounded1 && !unbounded2) || (!unbounded1 && unbounded2) ) {
Message_Msg Msg137("XSTEP_137");
ach->SendFail(Msg137);
}
// These messages are transfered in the translation procedure
// if ( (A*A + B*B + C*C) < eps) // pas nul !
// ach.SendFail("Incorrect Coefficients for the Plane");
if ( !ent->HasBoundingCurve()) return;
// Symbol : verifie si Size defini > 0 (sinon, n a pas de signification)
/* Standard_Real ec = 0.;
if (ent->SymbolSize() > 0.) ec = A*ent->SymbolAttach().X() + B*ent->SymbolAttach().Y() +
C * ent->SymbolAttach().Z() - D;
if ( ec > eps || ec < -eps) {
char mess[80];
sprintf(mess,"Symbol Attach not in the Plane, gap/equation over %f",
Interface_MSG::Intervalled(ec));
ach.SendWarning(mess,"Symbol Attach not in the Plane");
}
*/
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolPlane::OwnDump(const Handle(IGESGeom_Plane)& ent,
const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
S << "IGESGeom_Plane" << endl;
Standard_Real A,B,C,D;
ent->Equation(A,B,C,D);
S << "Plane Coefficient A : " << A << endl;
S << "Plane Coefficient B : " << B << endl;
S << "Plane Coefficient C : " << C << endl;
S << "Plane Coefficient D : " << D << endl;
S << "The Bounding Curve : " ;
dumper.Dump(ent->BoundingCurve(),S, (level <= 4) ? 0 : 1);
S << endl;
S << "Display Symbol Location : ";
IGESData_DumpXYZL(S,level, ent->SymbolAttach(), ent->Location());
S << " Size : " << ent->SymbolSize() << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolPoint.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolPoint from IGESGeom
---Purpose : Tool to work on a Point. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Point from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolPoint;
---Purpose : Returns a ToolPoint, ready to work
ReadOwnParams (me; ent : mutable Point;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : Point;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Point;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Point <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : Point) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Point;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Point; entto : mutable Point;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Point;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolPoint;

View File

@@ -0,0 +1,135 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_Point.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolPoint.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESBasic_SubfigureDef.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 28/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
IGESGeom_ToolPoint::IGESGeom_ToolPoint () { }
void IGESGeom_ToolPoint::ReadOwnParams
(const Handle(IGESGeom_Point)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 28/07/98
// Building of messages
//==================================
Message_Msg Msg73("XSTEP_73");
//==================================
gp_XYZ aPoint;
Handle(IGESBasic_SubfigureDef) aSymbol;
IGESData_Status aStatus;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
PR.ReadXYZ(PR.CurrentList(1, 3), Msg73, aPoint); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadXYZ(PR.CurrentList(1, 3), "Point", aPoint);
if (PR.DefinedElseSkip()){
if (!PR.ReadEntity(IR, PR.Current(), aStatus,
STANDARD_TYPE(IGESBasic_SubfigureDef), aSymbol, Standard_True)){
Message_Msg Msg74("XSTEP_74");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg74.Arg(Msg216.Value());
PR.SendFail(Msg74);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg74.Arg(Msg217.Value());
PR.SendFail(Msg74);
break; }
case IGESData_TypeError: {
Message_Msg Msg218 ("IGES_218");
Msg74.Arg(Msg218.Value());
PR.SendFail(Msg74);
break; }
default:{
}
}
}
//szv#4:S4163:12Mar99 `st=` not needed
}
// st = PR.ReadEntity(IR, PR.Current(), "Display Symbol",
// STANDARD_TYPE(IGESBasic_SubfigureDef), aSymbol, Standard_True);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aPoint, aSymbol);
}
void IGESGeom_ToolPoint::WriteOwnParams
(const Handle(IGESGeom_Point)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->Value().X());
IW.Send(ent->Value().Y());
IW.Send(ent->Value().Z());
IW.Send(ent->DisplaySymbol());
}
void IGESGeom_ToolPoint::OwnShared
(const Handle(IGESGeom_Point)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->DisplaySymbol());
}
void IGESGeom_ToolPoint::OwnCopy
(const Handle(IGESGeom_Point)& another,
const Handle(IGESGeom_Point)& ent, Interface_CopyTool& TC) const
{
gp_XYZ aPoint = (another->Value()).XYZ();
DeclareAndCast(IGESBasic_SubfigureDef, aSymbol,
TC.Transferred(another->DisplaySymbol()));
ent->Init(aPoint, aSymbol);
}
IGESData_DirChecker IGESGeom_ToolPoint::DirChecker
(const Handle(IGESGeom_Point)& ent ) const
{
IGESData_DirChecker DC(116,0);
DC.Structure(IGESData_DefVoid);
if (ent->HasDisplaySymbol())
{
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefValue);
}
DC.Color(IGESData_DefAny);
return DC;
}
void IGESGeom_ToolPoint::OwnCheck
(const Handle(IGESGeom_Point)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESGeom_ToolPoint::OwnDump
(const Handle(IGESGeom_Point)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGeom_Point" << endl;
S << " Value : ";
IGESData_DumpXYZL(S,level, ent->Value(), ent->Location());
S << endl;
S << " Display Symbol : ";
dumper.Dump(ent->DisplaySymbol(),S, (level <= 4) ? 0 : 1);
S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolRuledSurface.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolRuledSurface from IGESGeom
---Purpose : Tool to work on a RuledSurface. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses RuledSurface from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolRuledSurface;
---Purpose : Returns a ToolRuledSurface, ready to work
ReadOwnParams (me; ent : mutable RuledSurface;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : RuledSurface;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : RuledSurface;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a RuledSurface <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : RuledSurface) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : RuledSurface;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : RuledSurface; entto : mutable RuledSurface;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : RuledSurface;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolRuledSurface;

View File

@@ -0,0 +1,154 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_RuledSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolRuledSurface.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <Interface_Macros.hxx>
// MGE 31/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
IGESGeom_ToolRuledSurface::IGESGeom_ToolRuledSurface () { }
void IGESGeom_ToolRuledSurface::ReadOwnParams
(const Handle(IGESGeom_RuledSurface)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 31/07/98
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer aDirFlag, aDevFlag;
Handle(IGESData_IGESEntity) aCurve, anotherCurve;
IGESData_Status aStatus;
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aCurve)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg148("XSTEP_148");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg148.Arg(Msg216.Value());
PR.SendFail(Msg148);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg148.Arg(Msg217.Value());
PR.SendFail(Msg148);
break; }
default:{
}
}
}
if (!PR.ReadEntity(IR, PR.Current(), aStatus, anotherCurve)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg149("XSTEP_149");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg149.Arg(Msg216.Value());
PR.SendFail(Msg149);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg149.Arg(Msg217.Value());
PR.SendFail(Msg149);
break; }
default:{
}
}
}
if (!PR.ReadInteger(PR.Current(), aDirFlag)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg150("XSTEP_150");
PR.SendFail(Msg150);
}
if (!PR.ReadInteger(PR.Current(), aDevFlag)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg151("XSTEP_151");
PR.SendFail(Msg151);
}
/*
st = PR.ReadEntity(IR, PR.Current(), "First Curve", aCurve);
st = PR.ReadEntity(IR, PR.Current(), "Second Curve", anotherCurve);
st = PR.ReadInteger(PR.Current(), "DirFlag", aDirFlag);
st = PR.ReadInteger(PR.Current(), "DevFlag ", aDevFlag);
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aCurve, anotherCurve, aDirFlag, aDevFlag);
}
void IGESGeom_ToolRuledSurface::WriteOwnParams
(const Handle(IGESGeom_RuledSurface)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->FirstCurve());
IW.Send(ent->SecondCurve());
IW.Send(ent->DirectionFlag());
IW.SendBoolean(ent->IsDevelopable());
}
void IGESGeom_ToolRuledSurface::OwnShared
(const Handle(IGESGeom_RuledSurface)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->FirstCurve());
iter.GetOneItem(ent->SecondCurve());
}
void IGESGeom_ToolRuledSurface::OwnCopy
(const Handle(IGESGeom_RuledSurface)& another,
const Handle(IGESGeom_RuledSurface)& ent, Interface_CopyTool& TC) const
{
DeclareAndCast(IGESData_IGESEntity, aCurve,
TC.Transferred(another->FirstCurve()));
DeclareAndCast(IGESData_IGESEntity, anotherCurve,
TC.Transferred(another->SecondCurve()));
Standard_Integer aDirFlag = another->DirectionFlag();
Standard_Integer aDevFlag = (another->IsDevelopable() ? 1 : 0);
ent->Init(aCurve, anotherCurve, aDirFlag, aDevFlag);
}
IGESData_DirChecker IGESGeom_ToolRuledSurface::DirChecker
(const Handle(IGESGeom_RuledSurface)& /*ent*/ ) const
{
IGESData_DirChecker DC(118, 0, 1);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGeom_ToolRuledSurface::OwnCheck
(const Handle(IGESGeom_RuledSurface)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESGeom_ToolRuledSurface::OwnDump
(const Handle(IGESGeom_RuledSurface)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESGeom_RuledSurface" << endl;
S << "First Curve : ";
dumper.Dump(ent->FirstCurve(),S, tempSubLevel);
S << endl;
S << "Second Curve : ";
dumper.Dump(ent->SecondCurve(),S, tempSubLevel);
S << endl;
S << "Direction Flag : " << ent->DirectionFlag() << " i.e.";
if (ent->DirectionFlag() == 0) S<< "Join First to First, Last to Last"<<endl;
else S<< "Join First to Last, Last to First"<<endl;
if (ent->IsDevelopable()) S << " .. Is Developable" << endl;
else S << " .. Is possibly not developable .." << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolSplineCurve.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolSplineCurve from IGESGeom
---Purpose : Tool to work on a SplineCurve. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses SplineCurve from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolSplineCurve;
---Purpose : Returns a ToolSplineCurve, ready to work
ReadOwnParams (me; ent : mutable SplineCurve;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : SplineCurve;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : SplineCurve;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a SplineCurve <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : SplineCurve) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : SplineCurve;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : SplineCurve; entto : mutable SplineCurve;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : SplineCurve;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolSplineCurve;

View File

@@ -0,0 +1,351 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_SplineCurve.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolSplineCurve.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
// MGE 29/07/98
#include <Message_Msg.hxx>
IGESGeom_ToolSplineCurve::IGESGeom_ToolSplineCurve () { }
void IGESGeom_ToolSplineCurve::ReadOwnParams
(const Handle(IGESGeom_SplineCurve)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
// MGE 29/07/98
// Building of messages
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbSegments;
Standard_Integer aType, aDegree, nbDimensions;;
Handle(TColStd_HArray1OfReal) allBreakPoints;
Handle(TColStd_HArray2OfReal) allXPolynomials;
Handle(TColStd_HArray2OfReal) allYPolynomials;
Handle(TColStd_HArray2OfReal) allZPolynomials;
Handle(TColStd_HArray1OfReal) allXvalues = new TColStd_HArray1OfReal(1, 4);
Handle(TColStd_HArray1OfReal) allYvalues = new TColStd_HArray1OfReal(1, 4);
Handle(TColStd_HArray1OfReal) allZvalues = new TColStd_HArray1OfReal(1, 4);
//szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadInteger(PR.Current(), aType)){
Message_Msg Msg91("XSTEP_91");
PR.SendFail(Msg91);
}
if (!PR.ReadInteger(PR.Current(), aDegree)){
Message_Msg Msg92("XSTEP_92");
PR.SendFail(Msg92);
}
if (!PR.ReadInteger(PR.Current(), nbDimensions)){
Message_Msg Msg93("XSTEP_93");
PR.SendFail(Msg93);
}
//st = PR.ReadInteger(PR.Current(), Msg94, nbSegments); //szv#4:S4163:12Mar99 moved in if
/*
st = PR.ReadInteger(PR.Current(), "Spline Type", aType);
st = PR.ReadInteger(PR.Current(), "Degree Continuity", aDegree);
st = PR.ReadInteger(PR.Current(), "Number Of Dimensions", nbDimensions);
st = PR.ReadInteger(PR.Current(), "Number Of Segments", nbSegments);
*/
if (PR.ReadInteger(PR.Current(), nbSegments)) {
if (nbSegments <= 0){
Message_Msg Msg94("XSTEP_94");
PR.SendFail(Msg94);
}
else {
allXPolynomials = new TColStd_HArray2OfReal (1, nbSegments, 1, 4);
allYPolynomials = new TColStd_HArray2OfReal (1, nbSegments, 1, 4);
allZPolynomials = new TColStd_HArray2OfReal (1, nbSegments, 1, 4);
allBreakPoints = new TColStd_HArray1OfReal (1, (nbSegments + 1));
}
Message_Msg Msg95("XSTEP_95");
PR.ReadReals(PR.CurrentList(nbSegments + 1), Msg95, allBreakPoints); //szv#4:S4163:12Mar99 `st=` not needed
/*
st = PR.ReadReals(PR.CurrentList(nbSegments + 1), "Break Points",
allBreakPoints);
*/
}
else{
Message_Msg Msg94("XSTEP_94");
PR.SendFail(Msg94);
}
Handle(TColStd_HArray1OfReal) temp;
temp = new TColStd_HArray1OfReal(1,4);
if (! allXPolynomials.IsNull()) {
Standard_Integer I;
for (I = 1; I <= nbSegments; I++)
{
//st = PR.ReadReals(PR.CurrentList(4),"X-Coordinate Polynomial",temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReals(PR.CurrentList(4),"X-Coordinate Polynomial",temp)) {
Standard_Integer J;
for (J = 1; J <= 4; J++)
allXPolynomials->SetValue(I, J, temp->Value(J));
}
//st = PR.ReadReals(PR.CurrentList(4),"Y-Coordinate Polynomial",temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReals(PR.CurrentList(4),"Y-Coordinate Polynomial",temp)) {
Standard_Integer J;
for (J = 1; J <= 4; J++)
allYPolynomials->SetValue(I, J, temp->Value(J));
}
//st = PR.ReadReals(PR.CurrentList(4),"Z-Coordinate Polynomial",temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReals(PR.CurrentList(4),"Z-Coordinate Polynomial",temp)) {
Standard_Integer J;
for (J = 1; J <= 4; J++)
allZPolynomials->SetValue(I, J, temp->Value(J));
}
}
}
//st = PR.ReadReals(PR.CurrentList(4), "TerminatePoint X-Values", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReals(PR.CurrentList(4), "TerminatePoint X-Values", temp)) {
Standard_Integer J;
for (J = 1; J <= 4; J++)
allXvalues->SetValue(J, temp->Value(J));
}
//st = PR.ReadReals(PR.CurrentList(4), "TerminatePoint Y-Values", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReals(PR.CurrentList(4), "TerminatePoint Y-Values", temp)) {
Standard_Integer J;
for (J = 1; J <= 4; J++)
allYvalues->SetValue(J, temp->Value(J));
}
//st = PR.ReadReals(PR.CurrentList(4), "TerminatePoint Z-Values", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReals(PR.CurrentList(4), "TerminatePoint Z-Values", temp)) {
Standard_Integer J;
for (J = 1; J <= 4; J++)
allZvalues->SetValue(J, temp->Value(J));
}
//sln 28.09.2001, BUC61004, If the condition is true function ent->Init is not called in order to avoid exception
if(allBreakPoints.IsNull() || allXPolynomials.IsNull() || allYPolynomials.IsNull() || allZPolynomials.IsNull())
return;
else
{
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(aType, aDegree, nbDimensions, allBreakPoints,
allXPolynomials, allYPolynomials, allZPolynomials,
allXvalues, allYvalues, allZvalues);
}
}
void IGESGeom_ToolSplineCurve::WriteOwnParams
(const Handle(IGESGeom_SplineCurve)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->SplineType());
IW.Send(ent->Degree());
IW.Send(ent->NbDimensions());
Standard_Integer nbSegments = ent->NbSegments();
IW.Send(nbSegments);
Standard_Integer I;
for (I = 1; I <= nbSegments + 1; I++)
IW.Send(ent->BreakPoint(I));
Standard_Real AX,BX,CX,DX, AY,BY,CY,DY, AZ,BZ,CZ,DZ;
for (I = 1; I <= nbSegments; I++) {
//no need to declare (hides the same name in an outer scope)
// Standard_Real AX,BX,CX,DX, AY,BY,CY,DY, AZ,BZ,CZ,DZ;
ent->XCoordPolynomial(I,AX,BX,CX,DX);
ent->YCoordPolynomial(I,AY,BY,CY,DY);
ent->ZCoordPolynomial(I,AZ,BZ,CZ,DZ);
IW.Send(AX); IW.Send(BX); IW.Send(CX); IW.Send(DX);
IW.Send(AY); IW.Send(BY); IW.Send(CY); IW.Send(DY);
IW.Send(AZ); IW.Send(BZ); IW.Send(CZ); IW.Send(DZ);
}
ent->XValues(AX,BX,CX,DX);
ent->YValues(AY,BY,CY,DY);
ent->ZValues(AZ,BZ,CZ,DZ);
IW.Send(AX); IW.Send(BX); IW.Send(CX); IW.Send(DX);
IW.Send(AY); IW.Send(BY); IW.Send(CY); IW.Send(DY);
IW.Send(AZ); IW.Send(BZ); IW.Send(CZ); IW.Send(DZ);
}
void IGESGeom_ToolSplineCurve::OwnShared
(const Handle(IGESGeom_SplineCurve)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESGeom_ToolSplineCurve::OwnCopy
(const Handle(IGESGeom_SplineCurve)& another,
const Handle(IGESGeom_SplineCurve)& ent, Interface_CopyTool& /* TC */) const
{
Standard_Integer I;
Standard_Real A, B, C, D;
Standard_Integer aType = another->SplineType();
Standard_Integer aDegree = another->Degree();
Standard_Integer nbDimensions = another->NbDimensions();
Standard_Integer nbSegments = another->NbSegments();
Handle(TColStd_HArray1OfReal) allBreakPoints =
new TColStd_HArray1OfReal(1, nbSegments+1);
for (I = 1; I <= (nbSegments + 1); I++)
allBreakPoints->SetValue(I, another->BreakPoint(I));
Handle(TColStd_HArray2OfReal) allXPolynomials =
new TColStd_HArray2OfReal(1, nbSegments, 1, 4);
Handle(TColStd_HArray2OfReal) allYPolynomials =
new TColStd_HArray2OfReal(1, nbSegments, 1, 4);
Handle(TColStd_HArray2OfReal) allZPolynomials =
new TColStd_HArray2OfReal(1, nbSegments, 1, 4);
for (I = 1; I <= nbSegments; I++) {
another->XCoordPolynomial(I, A, B, C, D);
allXPolynomials->SetValue(I, 1, A);
allXPolynomials->SetValue(I, 2, B);
allXPolynomials->SetValue(I, 3, C);
allXPolynomials->SetValue(I, 4, D);
another->YCoordPolynomial(I, A, B, C, D);
allYPolynomials->SetValue(I, 1, A);
allYPolynomials->SetValue(I, 2, B);
allYPolynomials->SetValue(I, 3, C);
allYPolynomials->SetValue(I, 4, D);
another->ZCoordPolynomial(I, A, B, C, D);
allZPolynomials->SetValue(I, 1, A);
allZPolynomials->SetValue(I, 2, B);
allZPolynomials->SetValue(I, 3, C);
allZPolynomials->SetValue(I, 4, D);
}
Handle(TColStd_HArray1OfReal) allXvalues =
new TColStd_HArray1OfReal(1, 4);
Handle(TColStd_HArray1OfReal) allYvalues =
new TColStd_HArray1OfReal(1, 4);
Handle(TColStd_HArray1OfReal) allZvalues =
new TColStd_HArray1OfReal(1, 4);
another->XValues(A, B, C, D);
allXvalues->SetValue(1, A);
allXvalues->SetValue(2, B);
allXvalues->SetValue(3, C);
allXvalues->SetValue(4, D);
another->YValues(A, B, C, D);
allYvalues->SetValue(1, A);
allYvalues->SetValue(2, B);
allYvalues->SetValue(3, C);
allYvalues->SetValue(4, D);
another->ZValues(A, B, C, D);
allZvalues->SetValue(1, A);
allZvalues->SetValue(2, B);
allZvalues->SetValue(3, C);
allZvalues->SetValue(4, D);
ent->Init(aType, aDegree, nbDimensions, allBreakPoints,
allXPolynomials, allYPolynomials, allZPolynomials,
allXvalues, allYvalues, allZvalues);
}
IGESData_DirChecker IGESGeom_ToolSplineCurve::DirChecker
(const Handle(IGESGeom_SplineCurve)& /* ent */ ) const
{
IGESData_DirChecker DC(112, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGeom_ToolSplineCurve::OwnCheck
(const Handle(IGESGeom_SplineCurve)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
// MGE 29/07/98
// Building of messages
if (ent->SplineType() < 1 || ent->SplineType() > 6){
Message_Msg Msg91("XSTEP_91");
ach->SendFail(Msg91);
}
if (ent->NbDimensions() == 2) {
Standard_Integer nbSegments = ent->NbSegments();
Standard_Real AZ,BZ,CZ,DZ;
Message_Msg Msg96("XSTEP_96");
for (Standard_Integer I = 1; I <= nbSegments; I ++) {
ent->ZCoordPolynomial(I,AZ,BZ,CZ,DZ);
if (BZ != 0 || CZ != 0 || DZ != 0) {
ach->SendFail(Msg96);
}
}
}
else if (ent->NbDimensions() != 3){
Message_Msg Msg93("XSTEP_93");
ach->SendFail(Msg93);
}
}
void IGESGeom_ToolSplineCurve::OwnDump
(const Handle(IGESGeom_SplineCurve)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGeom_SplineCurve" << endl;
Standard_Integer nbSegments = ent->NbSegments();
S << "Spline Type : " << ent->SplineType() << " ";
switch (ent->SplineType())
{
case 1 : S << "(Linear)"; break;
case 2 : S << "(Quadratic)"; break;
case 3 : S << "(Cubic)"; break;
case 4 : S << "(Wilson-Fowler)"; break;
case 5 : S << "(Modified Wison-Fowler)"; break;
case 6 : S << "(B-Spline)"; break;
default : S << "(Invalid value)"; break;
}
S << endl;
S << "Degree Of Continuity : " << ent->Degree() << endl;
S << "Number Of Dimensions : " << ent->NbDimensions() << endl;
S << "Number Of Segments : " << ent->NbSegments() << endl;
S << "Segment Break Points : ";
IGESData_DumpVals(S ,level,1, nbSegments+1,ent->BreakPoint);
if (level <= 4) {
S << " [ also ask level > 4 for X-Y-Z Polynomials ]" << endl;
return;
}
S << " -- Polynomial Values --" << endl;
Standard_Real AX,BX,CX,DX, AY,BY,CY,DY, AZ,BZ,CZ,DZ;
for (Standard_Integer I = 1; I <= nbSegments; I++) {
//no need to declare (hides the same name in an outer scope)
// Standard_Real AX,BX,CX,DX, AY,BY,CY,DY, AZ,BZ,CZ,DZ;
ent->XCoordPolynomial(I,AX,BX,CX,DX);
ent->YCoordPolynomial(I,AY,BY,CY,DY);
ent->ZCoordPolynomial(I,AZ,BZ,CZ,DZ);
S << "Segment "<<I<<" : X Y Z"<<endl;
S << " A ... "<<AX<<" "<<AY<<" "<<AZ<<endl;
S << " B ... "<<BX<<" "<<BY<<" "<<BZ<<endl;
S << " C ... "<<CX<<" "<<CY<<" "<<CZ<<endl;
S << " D ... "<<DX<<" "<<DY<<" "<<DZ<<endl;
}
ent->XValues(AX,BX,CX,DX);
ent->YValues(AY,BY,CY,DY);
ent->ZValues(AZ,BZ,CZ,DZ);
S << "Terminate Point : X Y Z"<<endl;
S << " Value "<<AX<<" "<<AY<<" "<<AZ<<endl;
S << " 1st Derivative "<<BX<<" "<<BY<<" "<<BZ<<endl;
S << " 2nd Der./2! "<<CX<<" "<<CY<<" "<<CZ<<endl;
S << " 3rd Der./3! "<<DX<<" "<<DY<<" "<<DZ<<endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolSplineSurface.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolSplineSurface from IGESGeom
---Purpose : Tool to work on a SplineSurface. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses SplineSurface from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolSplineSurface;
---Purpose : Returns a ToolSplineSurface, ready to work
ReadOwnParams (me; ent : mutable SplineSurface;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : SplineSurface;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : SplineSurface;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a SplineSurface <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : SplineSurface) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : SplineSurface;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : SplineSurface; entto : mutable SplineSurface;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : SplineSurface;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolSplineSurface;

View File

@@ -0,0 +1,349 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_SplineSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolSplineSurface.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESBasic_HArray2OfHArray1OfReal.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 30/07/98
#include <Message_Msg.hxx>
IGESGeom_ToolSplineSurface::IGESGeom_ToolSplineSurface () { }
void IGESGeom_ToolSplineSurface::ReadOwnParams
(const Handle(IGESGeom_SplineSurface)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
// MGE 30/07/98
Standard_Integer aBoundaryType, aPatchType, allNbUSegments, allNbVSegments;
Standard_Integer i, j, k;
Standard_Boolean ubreak=Standard_False, vbreak=Standard_False;
Handle(TColStd_HArray1OfReal) allUBreakPoints;
Handle(TColStd_HArray1OfReal) allVBreakPoints;
Handle(IGESBasic_HArray2OfHArray1OfReal) allXCoeffs;
Handle(IGESBasic_HArray2OfHArray1OfReal) allYCoeffs;
Handle(IGESBasic_HArray2OfHArray1OfReal) allZCoeffs;
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
//szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadInteger(PR.Current(), aBoundaryType)){
Message_Msg Msg140("XSTEP_140");
PR.SendFail(Msg140);
}
if (!PR.ReadInteger(PR.Current(), aPatchType)){
Message_Msg Msg278("XSTEP_278");
PR.SendFail(Msg278);
}
//st = PR.ReadInteger(PR.Current(), Msg141, allNbUSegments); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(),allNbUSegments)) {
ubreak = Standard_True;
allUBreakPoints = new TColStd_HArray1OfReal(1, allNbUSegments+1);
}
else{
Message_Msg Msg141("XSTEP_141");
PR.SendFail(Msg141);
}
//st = PR.ReadInteger(PR.Current(), Msg142, allNbVSegments); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadInteger(PR.Current(), "Number Of V Segments", allNbVSegments);
if (PR.ReadInteger(PR.Current(),allNbVSegments)) {
vbreak = Standard_True;
allVBreakPoints = new TColStd_HArray1OfReal(1, allNbVSegments+1);
}
else{
Message_Msg Msg142("XSTEP_142");
PR.SendFail(Msg142);
}
if (!allUBreakPoints.IsNull()){
Message_Msg Msg143("XSTEP_143");
PR.ReadReals(PR.CurrentList(allNbUSegments+1), Msg143, allUBreakPoints); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReals(PR.CurrentList(allNbUSegments+1), "U Break Points", allUBreakPoints);
}
if (!allVBreakPoints.IsNull()){
Message_Msg Msg144("XSTEP_144");
PR.ReadReals(PR.CurrentList(allNbVSegments+1), Msg144, allVBreakPoints); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadReals(PR.CurrentList(allNbVSegments+1), "V Break Points", allVBreakPoints);
}
if (ubreak && vbreak)
{
allXCoeffs = new IGESBasic_HArray2OfHArray1OfReal(1, allNbUSegments, 1, allNbVSegments);
allYCoeffs = new IGESBasic_HArray2OfHArray1OfReal(1, allNbUSegments, 1, allNbVSegments);
allZCoeffs = new IGESBasic_HArray2OfHArray1OfReal(1, allNbUSegments, 1, allNbVSegments);
}
Handle(TColStd_HArray1OfReal) Temp; // = new TColStd_HArray1OfReal(1, 16);
if (! allXCoeffs.IsNull()) {
Standard_Boolean st;
Message_Msg Msg145_X("XSTEP_145");
Msg145_X.Arg("X");
Message_Msg Msg145_Y("XSTEP_145");
Msg145_Y.Arg("Y");
Message_Msg Msg145_Z("XSTEP_145");
Msg145_Z.Arg("Z");
for (i = 1; i <= allNbUSegments; i++) {
for (j = 1; j <= allNbVSegments; j++) {
st = PR.ReadReals (PR.CurrentList(16),Msg145_X,Temp);
//st = PR.ReadReals (PR.CurrentList(16),"X Coefficient Of Patch",Temp);
if (st && Temp->Length() == 16) allXCoeffs->SetValue(i,j,Temp);
else {
Message_Msg Msg147_X("XSTEP_147");
Msg147_X.Arg("X");
PR.SendFail (Msg147_X);
}
st = PR.ReadReals (PR.CurrentList(16),Msg145_Y,Temp);
//st = PR.ReadReals (PR.CurrentList(16),"Y Coefficient Of Patch",Temp);
if (st && Temp->Length() == 16) allYCoeffs->SetValue(i, j, Temp);
else {
Message_Msg Msg147_Y("XSTEP_147");
Msg147_Y.Arg("Y");
PR.SendFail (Msg147_Y);
}
st = PR.ReadReals (PR.CurrentList(16),Msg145_Z,Temp);
//st = PR.ReadReals (PR.CurrentList(16),"Z Coefficient Of Patch",Temp);
if (st && Temp->Length() == 16) allZCoeffs->SetValue(i, j, Temp);
else if (i < allNbUSegments || j < allNbVSegments) {
Message_Msg Msg147_Z("XSTEP_147");
Msg147_Z.Arg("Z");
PR.SendFail (Msg147_Z);
}
else {
// Si fin manquante ... On refait temp !
// Les valeurs n ont pas ete lues ... il faut d abord les relire !
Temp = new TColStd_HArray1OfReal (1,16); Temp->Init(0.);
for (k = 1; k <= 16; k ++) {
Standard_Real vl;
if (!PR.ReadReal (PR.Current(),vl)) {
Message_Msg Msg146("XSTEP_146");
PR.SendFail(Msg146);
break;
}
//if (!PR.ReadReal (PR.Current(),"Z of very last patch",vl)) break;
Temp->SetValue(k,vl);
}
allZCoeffs->SetValue(i, j, Temp);
PR.Mend("Last patch incomplete, defaulted");
}
}
for (Standard_Integer kk = 1; kk <= 48; kk++)
PR.SetCurrentNumber(PR.CurrentNumber() + 1);
//Skip the Arbitrary Values
}
}
if (vbreak)
for (k = 1; k <= 48*(allNbVSegments+1); k++)
PR.SetCurrentNumber(PR.CurrentNumber() + 1);
// Skip the Arbitrary Values
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(aBoundaryType , aPatchType, allUBreakPoints, allVBreakPoints,
allXCoeffs, allYCoeffs, allZCoeffs);
}
void IGESGeom_ToolSplineSurface::WriteOwnParams
(const Handle(IGESGeom_SplineSurface)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer I,J,k;
IW.Send(ent->BoundaryType());
IW.Send(ent->PatchType());
Standard_Integer nbUSegs = ent->NbUSegments();
Standard_Integer nbVSegs = ent->NbVSegments();
IW.Send(nbUSegs);
IW.Send(nbVSegs);
for (I = 1; I <= nbUSegs + 1; I ++)
IW.Send(ent->UBreakPoint(I));
for (I = 1; I <= nbVSegs + 1; I ++)
IW.Send(ent->VBreakPoint(I));
for (I = 1; I <= nbUSegs; I++)
{
for (J = 1 ; J <= nbVSegs; J++)
{
for (k = 1; k <= 16; k++)
IW.Send((ent->XPolynomial(I, J))->Value(k));
for (k = 1; k <= 16; k++)
IW.Send((ent->YPolynomial(I, J))->Value(k));
for (k = 1; k <= 16; k++)
IW.Send((ent->ZPolynomial(I, J))->Value(k));
}
for (k = 1; k <= 48; k++)
IW.Send( 0.0); //Send Arbitrary Values
}
for (J = 1; J <= (nbVSegs+1)*48; J++)
IW.Send( 0.0); //Send Arbitrary Values
}
void IGESGeom_ToolSplineSurface::OwnShared
(const Handle(IGESGeom_SplineSurface)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESGeom_ToolSplineSurface::OwnCopy
(const Handle(IGESGeom_SplineSurface)& another,
const Handle(IGESGeom_SplineSurface)& ent, Interface_CopyTool& /* TC */) const
{
Standard_Integer aBoundaryType, aPatchType, allNbUSegments, allNbVSegments;
Standard_Integer I, J;
aBoundaryType = another->BoundaryType();
aPatchType = another->PatchType();
allNbUSegments = another->NbUSegments();
allNbVSegments = another->NbVSegments();
Handle(TColStd_HArray1OfReal) allUBreakPoints =
new TColStd_HArray1OfReal(1, allNbUSegments+1);
Handle(TColStd_HArray1OfReal) allVBreakPoints =
new TColStd_HArray1OfReal(1, allNbVSegments+1);
for ( I =1; I <= allNbUSegments+1; I++)
allUBreakPoints->SetValue(I, another->UBreakPoint(I));
for ( I =1; I <= allNbVSegments+1; I++)
allVBreakPoints->SetValue(I, another->VBreakPoint(I));
Handle(IGESBasic_HArray2OfHArray1OfReal) allXCoeffs = new
IGESBasic_HArray2OfHArray1OfReal(1,allNbUSegments,1,allNbVSegments);
Handle(IGESBasic_HArray2OfHArray1OfReal) allYCoeffs = new
IGESBasic_HArray2OfHArray1OfReal(1,allNbUSegments,1,allNbVSegments);
Handle(IGESBasic_HArray2OfHArray1OfReal) allZCoeffs = new
IGESBasic_HArray2OfHArray1OfReal(1,allNbUSegments,1,allNbVSegments);
Handle(TColStd_HArray1OfReal) temp =
new TColStd_HArray1OfReal(1, 16);
for (I =1; I <= allNbUSegments; I++)
for (J = 1; J <= allNbVSegments; J++)
{
temp = another->XPolynomial(I, J);
allXCoeffs->SetValue(I,J,temp);
temp = another->YPolynomial(I,J);
allYCoeffs->SetValue(I,J,temp);
temp = another->ZPolynomial(I,J);
allZCoeffs->SetValue(I,J,temp);
}
ent->Init(aBoundaryType , aPatchType, allUBreakPoints, allVBreakPoints,
allXCoeffs, allYCoeffs, allZCoeffs);
}
IGESData_DirChecker IGESGeom_ToolSplineSurface::DirChecker
(const Handle(IGESGeom_SplineSurface)& /* ent */ ) const
{
IGESData_DirChecker DC(114,0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored ();
return DC;
}
void IGESGeom_ToolSplineSurface::OwnCheck
(const Handle(IGESGeom_SplineSurface)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
// MGE 30/07/98
// Building of messages
//========================================
// Message_Msg Msg140("XSTEP_140");
//========================================
if (ent->BoundaryType() < 1 || ent->BoundaryType() > 6){
Message_Msg Msg140("XSTEP_140");
ach->SendFail(Msg140);
}
// if (ent->PatchType() < 0 || ent->PatchType() > 1)
// ach.AddFail("Incorrect Patch Type not in [0-1]");
}
void IGESGeom_ToolSplineSurface::OwnDump
(const Handle(IGESGeom_SplineSurface)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGeom_SplineSurface" << endl;
Standard_Integer I, J;
Standard_Integer nbUSegs = ent->NbUSegments();
Standard_Integer nbVSegs = ent->NbVSegments();
Handle(TColStd_HArray1OfReal) temp;
S << "The Spline Boundary Type : " << ent->BoundaryType() ;
switch (ent->BoundaryType())
{
case 1 : S << " (Linear)"; break;
case 2 : S << " (Quadratic)"; break;
case 3 : S << " (Cubic)"; break;
case 4 : S << " (Wilson-Fowler)"; break;
case 5 : S << " (Modified Wison-Fowler)"; break;
case 6 : S << " (B-Spline)"; break;
default : S << " (Invalid value)"; break;
}
S << endl;
S << "The Patch Type : " << ent->PatchType();
if (ent->PatchType() == 1) S << " (Cartesian Product)";
else S << " (Unspecified)";
S << endl;
S << "Number Of Segments. In U : "
<< nbUSegs << " " << " In V : " << nbVSegs << endl;
S << "The U Break Points : ";
IGESData_DumpVals(S ,level,1, nbUSegs+1,ent->UBreakPoint);
S <<endl<< "The V Break Points : ";
IGESData_DumpVals(S ,level,1, nbVSegs+1,ent->VBreakPoint);
S <<endl<< " X-Y-Z Polynomials Of Segments : ";
S << endl;
if (level > 4)
{
for (I = 1; I <= nbUSegs; I++)
for (J = 1; J <= nbVSegs; J++)
{
S << "[" << I <<"," << J << "]: " << endl;
S << "X Polynomial : ";
temp = ent->XPolynomial(I,J);
IGESData_DumpVals(S,level,1, temp->Length(),temp->Value);
S << endl;
S << "Y Polynomial : ";
temp = ent->YPolynomial(I,J);
IGESData_DumpVals(S,level,1, temp->Length(),temp->Value);
S << endl;
S << "Z Polynomial : ";
temp = ent->ZPolynomial(I,J);
IGESData_DumpVals(S,level,1, temp->Length(),temp->Value);
S << endl;
}
}
else S << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolSurfaceOfRevolution.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolSurfaceOfRevolution from IGESGeom
---Purpose : Tool to work on a SurfaceOfRevolution. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses SurfaceOfRevolution from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolSurfaceOfRevolution;
---Purpose : Returns a ToolSurfaceOfRevolution, ready to work
ReadOwnParams (me; ent : mutable SurfaceOfRevolution;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : SurfaceOfRevolution;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : SurfaceOfRevolution;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a SurfaceOfRevolution <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : SurfaceOfRevolution) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : SurfaceOfRevolution;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : SurfaceOfRevolution; entto : mutable SurfaceOfRevolution;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : SurfaceOfRevolution;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolSurfaceOfRevolution;

View File

@@ -0,0 +1,162 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_SurfaceOfRevolution.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolSurfaceOfRevolution.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESGeom_Line.hxx>
#include <IGESData_IGESEntity.hxx>
#include <Interface_Macros.hxx>
// MGE 31/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
IGESGeom_ToolSurfaceOfRevolution::IGESGeom_ToolSurfaceOfRevolution () { }
void IGESGeom_ToolSurfaceOfRevolution::ReadOwnParams
(const Handle(IGESGeom_SurfaceOfRevolution)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 31/07/98
Handle(IGESGeom_Line) anAxis;
Handle(IGESData_IGESEntity) aGeneratrix;
Standard_Real aStartAngle, anEndAngle;
IGESData_Status aStatus;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
if (!PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESGeom_Line), anAxis)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg152("XSTEP_152");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg152.Arg(Msg216.Value());
PR.SendFail(Msg152);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg152.Arg(Msg217.Value());
PR.SendFail(Msg152);
break; }
case IGESData_TypeError: {
Message_Msg Msg218 ("IGES_218");
Msg152.Arg(Msg218.Value());
PR.SendFail(Msg152);
break; }
default:{
}
}
}
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aGeneratrix)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg153("XSTEP_153");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg153.Arg(Msg216.Value());
PR.SendFail(Msg153);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg153.Arg(Msg217.Value());
PR.SendFail(Msg153);
break; }
default:{
}
}
}
if (!PR.ReadReal(PR.Current(), aStartAngle)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg154("XSTEP_154");
PR.SendFail(Msg154);
}
if (!PR.ReadReal(PR.Current(), anEndAngle)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg155("XSTEP_155");
PR.SendFail(Msg155);
}
/*
st = PR.ReadEntity(IR, PR.Current(), "Axis", STANDARD_TYPE(IGESGeom_Line), anAxis);
st = PR.ReadEntity(IR, PR.Current(), "Generatrix", aGeneratrix);
st = PR.ReadReal(PR.Current(), "StartAngle", aStartAngle);
st = PR.ReadReal(PR.Current(), "EndAngle", anEndAngle);
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(anAxis, aGeneratrix, aStartAngle, anEndAngle);
}
void IGESGeom_ToolSurfaceOfRevolution::WriteOwnParams
(const Handle(IGESGeom_SurfaceOfRevolution)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->AxisOfRevolution());
IW.Send(ent->Generatrix());
IW.Send(ent->StartAngle());
IW.Send(ent->EndAngle());
}
void IGESGeom_ToolSurfaceOfRevolution::OwnShared
(const Handle(IGESGeom_SurfaceOfRevolution)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->AxisOfRevolution());
iter.GetOneItem(ent->Generatrix());
}
void IGESGeom_ToolSurfaceOfRevolution::OwnCopy
(const Handle(IGESGeom_SurfaceOfRevolution)& another,
const Handle(IGESGeom_SurfaceOfRevolution)& ent, Interface_CopyTool& TC) const
{
DeclareAndCast(IGESGeom_Line, anAxis,
TC.Transferred(another->AxisOfRevolution()));
DeclareAndCast(IGESData_IGESEntity, aGeneratrix,
TC.Transferred(another->Generatrix()));
Standard_Real aStartAngle = another->StartAngle();
Standard_Real anEndAngle = another->EndAngle();
ent->Init(anAxis, aGeneratrix, aStartAngle, anEndAngle);
}
IGESData_DirChecker IGESGeom_ToolSurfaceOfRevolution::DirChecker
(const Handle(IGESGeom_SurfaceOfRevolution)& /*ent*/ ) const
{
IGESData_DirChecker DC(120, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored ();
return DC;
}
void IGESGeom_ToolSurfaceOfRevolution::OwnCheck
(const Handle(IGESGeom_SurfaceOfRevolution)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
// Standard_Real diffang = ent->EndAngle() - ent->StartAngle();
// if (diffang <= 0.0 || diffang > 2.0 * PI)
// ach.AddFail("0 < TA - SA <= 2Pi is not satisfied");
}
void IGESGeom_ToolSurfaceOfRevolution::OwnDump
(const Handle(IGESGeom_SurfaceOfRevolution)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGeom_SurfaceOfRevolution" << endl << endl;
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "Axis Of Revolution : ";
dumper.Dump(ent->AxisOfRevolution(),S, sublevel);
S << endl;
S << "Generatrix : ";
dumper.Dump(ent->Generatrix(),S, sublevel);
S << endl;
S << "Start Angle : " << ent->StartAngle() << " ";
S << "End Angle : " << ent->EndAngle() << endl;
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolTabulatedCylinder.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolTabulatedCylinder from IGESGeom
---Purpose : Tool to work on a TabulatedCylinder. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses TabulatedCylinder from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolTabulatedCylinder;
---Purpose : Returns a ToolTabulatedCylinder, ready to work
ReadOwnParams (me; ent : mutable TabulatedCylinder;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : TabulatedCylinder;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : TabulatedCylinder;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a TabulatedCylinder <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : TabulatedCylinder) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : TabulatedCylinder;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : TabulatedCylinder; entto : mutable TabulatedCylinder;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : TabulatedCylinder;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolTabulatedCylinder;

View File

@@ -0,0 +1,129 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_TabulatedCylinder.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolTabulatedCylinder.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 31/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
IGESGeom_ToolTabulatedCylinder::IGESGeom_ToolTabulatedCylinder () { }
void IGESGeom_ToolTabulatedCylinder::ReadOwnParams
(const Handle(IGESGeom_TabulatedCylinder)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 31/07/98
// Building of messages
//========================================
Message_Msg Msg157("XSTEP_157");
//========================================
Handle(IGESData_IGESEntity) aDirectrix;
gp_XYZ anEnd;
IGESData_Status aStatus;
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
// Reading the directrix curve entity
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aDirectrix)){ //szv#4:S4163:12Mar99 `st=` not needed
Message_Msg Msg156("XSTEP_156");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg156.Arg(Msg216.Value());
PR.SendFail(Msg156);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg156.Arg(Msg217.Value());
PR.SendFail(Msg156);
break; }
default:{
}
}
}
//st = PR.ReadEntity(IR, PR.Current(), "Directrix", aDirectrix);
// Reading the terminate point of the generatrix
PR.ReadXYZ(PR.CurrentList(1, 3), Msg157, anEnd); //szv#4:S4163:12Mar99 `st=` not needed
//st = PR.ReadXYZ(PR.CurrentList(1, 3), "Terminate Point", anEnd);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aDirectrix, anEnd);
}
void IGESGeom_ToolTabulatedCylinder::WriteOwnParams
(const Handle(IGESGeom_TabulatedCylinder)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->Directrix() );
IW.Send( ent->EndPoint().X() );
IW.Send( ent->EndPoint().Y() );
IW.Send( ent->EndPoint().Z() );
}
void IGESGeom_ToolTabulatedCylinder::OwnShared
(const Handle(IGESGeom_TabulatedCylinder)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem( ent->Directrix() );
}
void IGESGeom_ToolTabulatedCylinder::OwnCopy
(const Handle(IGESGeom_TabulatedCylinder)& another,
const Handle(IGESGeom_TabulatedCylinder)& ent, Interface_CopyTool& TC) const
{
DeclareAndCast(IGESData_IGESEntity, aDirectrix,
TC.Transferred(another->Directrix()));
gp_XYZ anEnd = another->EndPoint().XYZ();
ent->Init(aDirectrix, anEnd);
}
IGESData_DirChecker IGESGeom_ToolTabulatedCylinder::DirChecker
(const Handle(IGESGeom_TabulatedCylinder)& /* ent */ ) const
{
IGESData_DirChecker DC(122, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGeom_ToolTabulatedCylinder::OwnCheck
(const Handle(IGESGeom_TabulatedCylinder)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{ }
void IGESGeom_ToolTabulatedCylinder::OwnDump
(const Handle(IGESGeom_TabulatedCylinder)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESGeom_TabulatedCylinder" << endl;
S << "Directrix : ";
dumper.Dump(ent->Directrix(),S, sublevel);
S << endl;
S << "Terminate Point : ";
IGESData_DumpXYZL(S,level, ent->EndPoint(), ent->Location());
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESGeom_ToolTransformationMatrix.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolTransformationMatrix from IGESGeom
---Purpose : Tool to work on a TransformationMatrix. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses TransformationMatrix from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolTransformationMatrix;
---Purpose : Returns a ToolTransformationMatrix, ready to work
ReadOwnParams (me; ent : mutable TransformationMatrix;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : TransformationMatrix;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : TransformationMatrix;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a TransformationMatrix <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable TransformationMatrix) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a TransformationMatrix
-- (FormNumber if 0 or 1, recomputed according Positive/Negative)
DirChecker (me; ent : TransformationMatrix) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : TransformationMatrix;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : TransformationMatrix; entto : mutable TransformationMatrix;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : TransformationMatrix;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolTransformationMatrix;

View File

@@ -0,0 +1,222 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_TransformationMatrix.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolTransformationMatrix.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <gp_GTrsf.hxx>
#include <Interface_Macros.hxx>
// MGE 03/08/98
#include <Message_Msg.hxx>
//=======================================================================
//function : IGESGeom_ToolTransformationMatrix
//purpose :
//=======================================================================
IGESGeom_ToolTransformationMatrix::IGESGeom_ToolTransformationMatrix ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolTransformationMatrix::ReadOwnParams
(const Handle(IGESGeom_TransformationMatrix)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
// MGE 03/08/98
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Real temp;
Handle(TColStd_HArray2OfReal) aMatrix = new TColStd_HArray2OfReal(1,3,1,4);
for (Standard_Integer I = 1; I <= 3; I++) {
for (Standard_Integer J = 1; J <= 4; J++) {
//st = PR.ReadReal(PR.Current(), Msg215, temp); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadReal(PR.Current(), "Matrix Elements", temp);
if (PR.ReadReal(PR.Current(), temp))
aMatrix->SetValue(I, J, temp);
else{
Message_Msg Msg215("XSTEP_215");
PR.SendFail(Msg215);
}
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aMatrix);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolTransformationMatrix::WriteOwnParams
(const Handle(IGESGeom_TransformationMatrix)& ent, IGESData_IGESWriter& IW) const
{
for (Standard_Integer I = 1; I <= 3; I++) {
for (Standard_Integer J = 1; J <= 4; J++) {
IW.Send(ent->Data(I, J));
}
}
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolTransformationMatrix::OwnShared
(const Handle(IGESGeom_TransformationMatrix)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolTransformationMatrix::OwnCopy
(const Handle(IGESGeom_TransformationMatrix)& another,
const Handle(IGESGeom_TransformationMatrix)& ent, Interface_CopyTool& /*TC*/) const
{
Handle(TColStd_HArray2OfReal) data = new TColStd_HArray2OfReal(1, 3, 1, 4);
for (Standard_Integer I = 1; I <= 3;I++) {
for (Standard_Integer J = 1; J <= 4; J++) {
data->SetValue(I, J, another->Data(I, J));
}
}
ent->Init(data);
ent->SetFormNumber(another->FormNumber());
}
//=======================================================================
//function : OwnCorrect
//purpose :
//=======================================================================
Standard_Boolean IGESGeom_ToolTransformationMatrix::OwnCorrect
(const Handle(IGESGeom_TransformationMatrix)& ent) const
{
if (ent->FormNumber() > 1) return Standard_False;
Standard_Integer cfn = (ent->Value().IsNegative() ? 1 : 0);
if (cfn == ent->FormNumber()) return Standard_False;
ent->SetFormNumber(cfn);
return Standard_True;
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolTransformationMatrix::DirChecker
(const Handle(IGESGeom_TransformationMatrix)& /*ent*/) const
{
IGESData_DirChecker DC(124);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefAny);
DC.Color(IGESData_DefAny);
DC.BlankStatusIgnored();
DC.SubordinateStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolTransformationMatrix::OwnCheck
(const Handle(IGESGeom_TransformationMatrix)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
// MGE 03/08/98
// Building of messages
//========================================
//Message_Msg Msg71("XSTEP_71");
//========================================
Standard_Integer form = ent->FormNumber();
if ((form != 0) && (form != 1) && ((form < 10) || (form > 12))) {
Message_Msg Msg71("XSTEP_71");
ach->SendFail(Msg71);
}
// Theses messages are transfered in the translation procedure
/*
if (form > 1) return; // ce qui suit : matrice orthogonale
if (form == 0 && ent->Value().IsNegative())
ach.AddFail("For Form 0, Determinant is not Positive");
else if (form == 1 && !ent->Value().IsNegative())
ach.AddFail("For Form 1, Determinant is not Negative");
Standard_Real p12 = ent->Data(1,1)*ent->Data(2,1) +
ent->Data(1,2)*ent->Data(2,2) + ent->Data(1,3)*ent->Data(2,3);
Standard_Real p13 = ent->Data(1,1)*ent->Data(3,1) +
ent->Data(1,2)*ent->Data(3,2) + ent->Data(1,3)*ent->Data(3,3);
Standard_Real p23 = ent->Data(2,1)*ent->Data(3,1) +
ent->Data(2,2)*ent->Data(3,2) + ent->Data(2,3)*ent->Data(3,3);
Standard_Real ep = 1.e-05; // ?? Tolorance des tests ?
if (p12 < -ep || p12 > ep || p13 < -ep || p13 > ep || p23 < -ep || p23 > ep)
ach.AddFail("Matrix is not orthogonal");
*/
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolTransformationMatrix::OwnDump
(const Handle(IGESGeom_TransformationMatrix)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGeom_TransformationMatrix" << endl;
S << "| R11, R12, R13, T1 | "
<< ent->Data(1, 1) << ", " << ent->Data(1, 2) << ", "
<< ent->Data(1, 3) << ", " << ent->Data(1, 4) << endl;
S << "| R21, R22, R23, T2 | "
<< ent->Data(2, 1) << ", " << ent->Data(2, 2) << ", "
<< ent->Data(2, 3) << ", " << ent->Data(2, 4) << endl;
S << "| R31, R32, R33, T3 | "
<< ent->Data(3, 1) << ", " << ent->Data(3, 2) << ", "
<< ent->Data(3, 3) << ", " << ent->Data(3, 4) << endl;
switch (ent->FormNumber()) {
case 0 : S << "-- Direct Orthogonal Matrix" << endl; break;
case 1 : S << "-- Reverse Orthogonal Matrix" << endl; break;
case 10 : S << "-- Cartesien Coordinate System" << endl; break;
case 11 : S << "-- Cylindrical Coordinate System" << endl; break;
case 12 : S << "-- Spherical Coordinate System" << endl; break;
default : S << "-- (Incorrect Form Number)" << endl; break;
}
}

View File

@@ -0,0 +1,59 @@
-- File: IGESGeom_ToolTrimmedSurface.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolTrimmedSurface from IGESGeom
---Purpose : Tool to work on a TrimmedSurface. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses TrimmedSurface from IGESGeom,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolTrimmedSurface;
---Purpose : Returns a ToolTrimmedSurface, ready to work
ReadOwnParams (me; ent : mutable TrimmedSurface;
IR : IGESReaderData; PR : in out ParamReader)
raises DomainError is static;
---Purpose : Reads own parameters from file. <PR> gives access to them,
-- <IR> detains parameter types and values
WriteOwnParams (me; ent : TrimmedSurface;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : TrimmedSurface;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a TrimmedSurface <ent>, from
-- its specific (own) parameters
DirChecker (me; ent : TrimmedSurface) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : TrimmedSurface;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : TrimmedSurface; entto : mutable TrimmedSurface;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : TrimmedSurface;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolTrimmedSurface;

View File

@@ -0,0 +1,297 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_TrimmedSurface.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_ToolTrimmedSurface.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESGeom_CurveOnSurface.hxx>
#include <IGESGeom_HArray1OfCurveOnSurface.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
// MGE 31/07/98
#include <Message_Msg.hxx>
#include <IGESData_Status.hxx>
//=======================================================================
//function : IGESGeom_ToolTrimmedSurface
//purpose :
//=======================================================================
IGESGeom_ToolTrimmedSurface::IGESGeom_ToolTrimmedSurface ()
{
}
//=======================================================================
//function : ReadOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolTrimmedSurface::ReadOwnParams
(const Handle(IGESGeom_TrimmedSurface)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
// MGE 31/07/98
// Building of messages
//========================================
//========================================
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer aFlag;
Standard_Integer count;
Handle(IGESData_IGESEntity) aSurface;
Handle(IGESGeom_CurveOnSurface) anOuter;
Handle(IGESGeom_HArray1OfCurveOnSurface) anInner;
IGESData_Status aStatus;
//szv#4:S4163:12Mar99 `st=` not needed
if (!PR.ReadEntity(IR, PR.Current(), aStatus, aSurface)){
Message_Msg Msg169("XSTEP_169");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg169.Arg(Msg216.Value());
PR.SendFail(Msg169);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg169.Arg(Msg217.Value());
PR.SendFail(Msg169);
break; }
default:{
}
}
}
if (!PR.ReadInteger(PR.Current(), aFlag)){
Message_Msg Msg170("XSTEP_170");
PR.SendFail(Msg170);
}
//st = PR.ReadInteger(PR.Current(), Msg171, count); //szv#4:S4163:12Mar99 moved in if
/*
st = PR.ReadEntity(IR, PR.Current(), "Surface to be trimmed", aSurface);
st = PR.ReadInteger(PR.Current(), "Outer boundary type", aFlag);
st = PR.ReadInteger(PR.Current(), "Number of inner boundary closed curves", count);
*/
if (PR.ReadInteger(PR.Current(), count)) {
if (count < 0){
Message_Msg Msg171("XSTEP_171");
PR.SendFail (Msg171);
}
else if (count > 0) anInner =
new IGESGeom_HArray1OfCurveOnSurface(1, count);
}
else {
Message_Msg Msg171("XSTEP_171");
PR.SendFail(Msg171);
}
if (!PR.ReadEntity(IR, PR.Current(), aStatus,
STANDARD_TYPE(IGESGeom_CurveOnSurface), anOuter,Standard_True)){
Message_Msg Msg172("XSTEP_172");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg172.Arg(Msg216.Value());
PR.SendFail(Msg172);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg172.Arg(Msg217.Value());
PR.SendFail(Msg172);
break; }
case IGESData_TypeError: {
Message_Msg Msg218 ("IGES_218");
Msg172.Arg(Msg218.Value());
PR.SendFail(Msg172);
break; }
default:{
}
}
} //szv#4:S4163:12Mar99 `st=` not needed
/* st = PR.ReadEntity(IR, PR.Current(), "Outer boundary curve",
STANDARD_TYPE(IGESGeom_CurveOnSurface), anOuter,Standard_True);
*/
if (! anInner.IsNull()) {
Standard_Integer I;
for (I = 1; I <= count; I++ ) {
Handle(IGESGeom_CurveOnSurface) tempEnt;
//st = PR.ReadEntity(IR, PR.Current(), Msg173,
//STANDARD_TYPE(IGESGeom_CurveOnSurface), tempEnt); //szv#4:S4163:12Mar99 moved in if
/* st = PR.ReadEntity(IR, PR.Current(), "Inner boundary curves",
STANDARD_TYPE(IGESGeom_CurveOnSurface), tempEnt);
*/
if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESGeom_CurveOnSurface), tempEnt))
anInner->SetValue(I, tempEnt);
else{
Message_Msg Msg173("XSTEP_173");
switch(aStatus) {
case IGESData_ReferenceError: {
Message_Msg Msg216 ("IGES_216");
Msg173.Arg(Msg216.Value());
PR.SendFail(Msg173);
break; }
case IGESData_EntityError: {
Message_Msg Msg217 ("IGES_217");
Msg173.Arg(Msg217.Value());
PR.SendFail(Msg173);
break; }
case IGESData_TypeError: {
Message_Msg Msg218 ("IGES_218");
Msg173.Arg(Msg218.Value());
PR.SendFail(Msg173);
break; }
default:{
}
}
}
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(aSurface, aFlag, anOuter, anInner);
}
//=======================================================================
//function : WriteOwnParams
//purpose :
//=======================================================================
void IGESGeom_ToolTrimmedSurface::WriteOwnParams
(const Handle(IGESGeom_TrimmedSurface)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer up = ent->NbInnerContours();
IW.Send(ent->Surface());
IW.Send(ent->OuterBoundaryType());
IW.Send(up);
IW.Send(ent->OuterContour());
Standard_Integer I;
for (I = 1; I <= up; I ++)
IW.Send(ent->InnerContour(I));
}
//=======================================================================
//function : OwnShared
//purpose :
//=======================================================================
void IGESGeom_ToolTrimmedSurface::OwnShared(const Handle(IGESGeom_TrimmedSurface)& ent,
Interface_EntityIterator& iter) const
{
Standard_Integer up = ent->NbInnerContours();
iter.GetOneItem(ent->Surface());
iter.GetOneItem(ent->OuterContour());
Standard_Integer I;
for (I = 1; I <= up; I ++) iter.GetOneItem(ent->InnerContour(I));
}
//=======================================================================
//function : OwnCopy
//purpose :
//=======================================================================
void IGESGeom_ToolTrimmedSurface::OwnCopy(const Handle(IGESGeom_TrimmedSurface)& another,
const Handle(IGESGeom_TrimmedSurface)& ent,
Interface_CopyTool& TC) const
{
Handle(IGESGeom_HArray1OfCurveOnSurface) anInner;
DeclareAndCast(IGESData_IGESEntity, aSurface,
TC.Transferred(another->Surface()));
Standard_Integer aFlag = another->OuterBoundaryType();
DeclareAndCast(IGESGeom_CurveOnSurface, anOuter,
TC.Transferred(another->OuterContour()));
Standard_Integer count = another->NbInnerContours();
if (count > 0) {
anInner = new IGESGeom_HArray1OfCurveOnSurface(1, count);
Standard_Integer I;
for (I = 1; I <= count; I++) {
DeclareAndCast(IGESGeom_CurveOnSurface, temp,
TC.Transferred(another->InnerContour(I)));
anInner->SetValue(I, temp);
}
}
ent->Init(aSurface, aFlag, anOuter, anInner);
}
//=======================================================================
//function : DirChecker
//purpose :
//=======================================================================
IGESData_DirChecker IGESGeom_ToolTrimmedSurface::DirChecker
(const Handle(IGESGeom_TrimmedSurface)& /* ent */ ) const
{
IGESData_DirChecker DC(144, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
// DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.UseFlagRequired (0);
DC.HierarchyStatusIgnored();
return DC;
}
//=======================================================================
//function : OwnCheck
//purpose :
//=======================================================================
void IGESGeom_ToolTrimmedSurface::OwnCheck(const Handle(IGESGeom_TrimmedSurface)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
// MGE 31/07/98
// Building of messages
//========================================
//Message_Msg Msg172("XSTEP_172");
//========================================
if (ent->OuterBoundaryType() != 0 && ent->OuterBoundaryType() != 1) {
Message_Msg Msg172("XSTEP_172");
ach->SendFail(Msg172);
}
}
//=======================================================================
//function : OwnDump
//purpose :
//=======================================================================
void IGESGeom_ToolTrimmedSurface::OwnDump(const Handle(IGESGeom_TrimmedSurface)& ent,
const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S,
const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESGeom_TrimmedSurface" << endl;
S << "Surface to be trimmed : ";
dumper.Dump(ent->Surface(),S, tempSubLevel);
S << endl;
S << "Boundary type : " << ent->OuterBoundaryType() << endl;
S << "Outer Boundary : ";
dumper.Dump(ent->OuterContour(),S, tempSubLevel);
S << endl;
S << "Inner Boundaries : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbInnerContours(),ent->InnerContour);
S << endl;
}

View File

@@ -0,0 +1,69 @@
--
-- File : TransformationMatrix.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Kiran )
--
---Copyright : MATRA-DATAVISION 1993
--
class TransformationMatrix from IGESGeom inherits TransfEntity
---Purpose: defines IGESTransformationMatrix, Type <124> Form <0>
-- in package IGESGeom
-- The transformation matrix entity transforms three-row column
-- vectors by means of matrix multiplication and then a vector
-- addition. This entity can be considered as an "operator"
-- entity in that it starts with the input vector, operates on
-- it as described above, and produces the output vector.
uses
HArray2OfReal from TColStd,
IGESEntity from IGESData,
GTrsf from gp
raises DimensionMismatch, OutOfRange
is
Create returns mutable TransformationMatrix;
-- Specific Methods pertaining to the class
Init (me : mutable;
aMatrix : HArray2OfReal)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- TransformationMatrix
-- - aMatrix : 3 x 4 array containing elements of the
-- transformation matrix
-- raises exception if aMatrix is not 3 x 4 array
SetFormNumber (me : mutable; form : Integer) raises OutOfRange;
---Purpose : Changes FormNumber (indicates the Type of Transf :
-- Transformation 0-1 or Coordinate System 10-11-12)
-- Error if not in ranges [0-1] or [10-12]
Data (me; I, J : Integer) returns Real raises OutOfRange;
---Purpose : returns individual Data
-- Errro if I not in [1-3] or J not in [1-4]
Value (me) returns GTrsf;
---Purpose : returns the transformation matrix
-- 4th row elements of GTrsf will always be 0, 0, 0, 1 (not defined)
fields
--
-- Class : IGESGeom_TransformationMatrix
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class TransformationMatrix.
--
-- Reminder : A TransformationMatrix instance is defined by :
-- the coefficients of a 3 X 4 matrix
theData : HArray2OfReal;
end TransformationMatrix;

View File

@@ -0,0 +1,69 @@
//--------------------------------------------------------------------
//
// File Name : IGESGeom_TransformationMatrix.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGeom_TransformationMatrix.ixx>
#include <Standard_OutOfRange.hxx>
IGESGeom_TransformationMatrix::IGESGeom_TransformationMatrix () { }
void IGESGeom_TransformationMatrix::Init
(const Handle(TColStd_HArray2OfReal)& aMatrix)
{
if(aMatrix.IsNull()) {
theData = new TColStd_HArray2OfReal(1,3,1,4);
theData->Init(0.0);
Standard_Integer i =1;
for( ;i <=3; i++)
theData->SetValue(i,i,1.0);
}
if ((aMatrix->RowLength() != 4) || (aMatrix->ColLength() != 3))
Standard_DimensionMismatch::Raise
("IGESGeom_TransformationMatrix : Init");
theData = aMatrix;
if(theData.IsNull()) {
return;
}
InitTypeAndForm(124,FormNumber());
}
void IGESGeom_TransformationMatrix::SetFormNumber (const Standard_Integer fm)
{
if(theData.IsNull())
cout<<"Inavalid Transformation Data"<<endl;
if ((fm < 0 || fm > 1) && (fm < 10 || fm > 12)) Standard_OutOfRange::Raise
("IGESGeom_TransformationMatrix : SetFormNumber");
InitTypeAndForm(124,fm);
}
Standard_Real IGESGeom_TransformationMatrix::Data
(const Standard_Integer I, const Standard_Integer J) const
{
return theData->Value(I,J);
}
gp_GTrsf IGESGeom_TransformationMatrix::Value () const
{
gp_GTrsf Matrix;
if(!theData.IsNull()) {
for (Standard_Integer I = 1; I <= 3; I++) {
for (Standard_Integer J = 1; J <= 4; J++) {
Matrix.SetValue(I, J, theData->Value(I, J));
}
}
}
return Matrix;
}

Some files were not shown because too many files have changed in this diff Show More