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:
1
src/IGESSolid/FILES
Executable file
1
src/IGESSolid/FILES
Executable file
@@ -0,0 +1 @@
|
||||
IGESSolid_CMPLRS.edl
|
207
src/IGESSolid/IGESSolid.cdl
Executable file
207
src/IGESSolid/IGESSolid.cdl
Executable file
@@ -0,0 +1,207 @@
|
||||
--
|
||||
-- File : IGESSolid.cdl
|
||||
-- Created : Mon 11 Jan 1993
|
||||
-- Author : SIVA
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
package IGESSolid
|
||||
|
||||
|
||||
---Purpose : This package consists of B-Rep and CSG Solid entities
|
||||
|
||||
uses
|
||||
|
||||
Standard,
|
||||
TCollection,
|
||||
TColStd,
|
||||
TColgp,
|
||||
gp,
|
||||
Message,
|
||||
Interface,
|
||||
IGESData,
|
||||
IGESBasic,
|
||||
IGESGeom
|
||||
|
||||
is
|
||||
|
||||
class Block;
|
||||
-- Type 150 Form 0
|
||||
---Purpose : The Block is a rectangular parallelopiped, defined with
|
||||
-- one vertex at (X1, Y1, Z1) and three edges lying along
|
||||
-- the local +X, +Y, +Z axes.
|
||||
|
||||
class RightAngularWedge;
|
||||
-- Type 152 Form 0
|
||||
---Purpose : A right angular wedge is a triangular/trapezoidal prism
|
||||
|
||||
class Cylinder;
|
||||
-- Type 154
|
||||
---Purpose : Defines a cylinder
|
||||
|
||||
class ConeFrustum;
|
||||
-- Type 156 Form 0
|
||||
---Purpose : The Cone Frustum is defined by the center of the
|
||||
-- larger circular face of the frustum, its radius, a unit
|
||||
-- vector in the axis direction, a height in this direction
|
||||
-- and a second circular face with radius which is lesser
|
||||
-- than the first face.
|
||||
|
||||
class Sphere;
|
||||
-- Type 158 Form 0
|
||||
---Purpose : Defines a sphere.
|
||||
|
||||
class Torus;
|
||||
-- Type 160 Form 0
|
||||
---Purpose : A Torus is a solid formed by revolving a circular disc
|
||||
-- about a specified coplanar axis.
|
||||
|
||||
class SolidOfRevolution;
|
||||
-- Type 162 Form 0,1
|
||||
---Purpose : This entity is defined by revolving the area determined
|
||||
-- by a planar curve about a specified axis through a given
|
||||
-- fraction of full rotation.
|
||||
|
||||
class SolidOfLinearExtrusion;
|
||||
-- Type 164
|
||||
---Purpose : Solid of linear extrusion is defined by translating an
|
||||
-- area determined by a planar curve
|
||||
|
||||
class Ellipsoid;
|
||||
-- Type 168 Form 0
|
||||
---Purpose : The ellipsoid is a solid bounded by the surface defined
|
||||
-- by:
|
||||
-- X^2 Y^2 Z^2
|
||||
-- ----- + ----- + ----- = 1
|
||||
-- LX^2 LY^2 LZ^2
|
||||
|
||||
class BooleanTree;
|
||||
-- Type 180 Form 0
|
||||
---Purpose : The Boolean tree describes a binary tree structure
|
||||
-- composed of regularized Boolean operations and operands,
|
||||
-- in post-order notation.
|
||||
|
||||
class SelectedComponent;
|
||||
-- Type 182 Form 0
|
||||
---Purpose : The Selected Component entity provides a means of
|
||||
-- selecting one component of a disjoint CSG solid
|
||||
|
||||
class SolidAssembly;
|
||||
-- Type 184 Form 0
|
||||
---Purpose : Solid assembly is a collection of items which possess a
|
||||
-- shared fixed geometric relationship.
|
||||
|
||||
class ManifoldSolid;
|
||||
-- Type 186 Form 0
|
||||
---Purpose : A manifold solid is a bounded, closed, and finite volume
|
||||
-- in three dimensional Euclidean space
|
||||
|
||||
class PlaneSurface;
|
||||
-- Type 190 Form 0,1
|
||||
---Purpose : A plane surface entity is defined by a point on the
|
||||
-- surface and a normal to it.
|
||||
|
||||
class CylindricalSurface;
|
||||
-- Type 192
|
||||
---Purpose : Defines a cylindrical surface
|
||||
|
||||
class ConicalSurface;
|
||||
-- Type 194 Form 0,1
|
||||
---Purpose : Defines a conical surface
|
||||
|
||||
class SphericalSurface;
|
||||
-- Type 196 Form 0,1
|
||||
---Purpose : Defines a spherical surface
|
||||
|
||||
class ToroidalSurface;
|
||||
-- Type 198 Form 0,1
|
||||
---Purpose : Defines a toroidal surface
|
||||
|
||||
class SolidInstance;
|
||||
-- Type 430 Form 0
|
||||
---Purpose : This provides a mechanism for replicating a solid
|
||||
-- representation.
|
||||
|
||||
class VertexList;
|
||||
-- Type 502 Form 1
|
||||
---Purpose : It contains one or more vertices.
|
||||
|
||||
class EdgeList;
|
||||
-- Type 504
|
||||
---Purpose : It contains one or more edge tuples.
|
||||
|
||||
class Loop;
|
||||
-- Type 508 Form 1
|
||||
---Purpose : A Loop entity specifies a bound of a face. It represents
|
||||
-- a connected collection of face boundaries, seams, and
|
||||
-- poles of a single face.
|
||||
|
||||
class Face;
|
||||
-- Type 510 Form 1
|
||||
---Purpose : Face entity is a bound (partial) which has finite area
|
||||
|
||||
class Shell;
|
||||
-- Type 514 Form 1
|
||||
---Purpose : Shell entity is a connected entity of dimensionality 2
|
||||
-- which divides R3 into two arcwise connected open subsets,
|
||||
-- one of which is finite. Inside of the shell is defined to
|
||||
-- be the finite region.
|
||||
|
||||
-- Tool for Entities --
|
||||
|
||||
class ToolBlock;
|
||||
class ToolRightAngularWedge;
|
||||
class ToolCylinder;
|
||||
class ToolConeFrustum;
|
||||
class ToolSphere;
|
||||
class ToolTorus;
|
||||
class ToolSolidOfRevolution;
|
||||
class ToolSolidOfLinearExtrusion;
|
||||
class ToolEllipsoid;
|
||||
class ToolBooleanTree;
|
||||
class ToolSelectedComponent;
|
||||
class ToolSolidAssembly;
|
||||
class ToolManifoldSolid;
|
||||
class ToolPlaneSurface;
|
||||
class ToolCylindricalSurface;
|
||||
class ToolConicalSurface;
|
||||
class ToolSphericalSurface;
|
||||
class ToolToroidalSurface;
|
||||
class ToolSolidInstance;
|
||||
class ToolVertexList;
|
||||
class ToolEdgeList;
|
||||
class ToolLoop;
|
||||
class ToolFace;
|
||||
class ToolShell;
|
||||
|
||||
-- Definition and Exploitation of Entities defined in this Package
|
||||
|
||||
class Protocol;
|
||||
class ReadWriteModule;
|
||||
class GeneralModule;
|
||||
class SpecificModule;
|
||||
|
||||
class TopoBuilder;
|
||||
---Purpose : a tool to build BREP IGES Entities
|
||||
|
||||
-- Instantiations
|
||||
|
||||
class Array1OfLoop instantiates Array1 from TCollection (Loop);
|
||||
class Array1OfFace instantiates Array1 from TCollection (Face);
|
||||
class Array1OfShell instantiates Array1 from TCollection (Shell);
|
||||
class Array1OfVertexList instantiates Array1 from TCollection (VertexList);
|
||||
class HArray1OfLoop instantiates HArray1 from TCollection (Loop,Array1OfLoop);
|
||||
class HArray1OfFace instantiates HArray1 from TCollection (Face,Array1OfFace);
|
||||
class HArray1OfShell instantiates HArray1 from TCollection (Shell,Array1OfShell);
|
||||
class HArray1OfVertexList instantiates HArray1 from TCollection (VertexList,Array1OfVertexList);
|
||||
|
||||
-- Package methods
|
||||
|
||||
Init;
|
||||
---Purpose : Prepares dynamic data (Protocol, Modules) for this package
|
||||
|
||||
Protocol returns Protocol from IGESSolid;
|
||||
---Purpose : Returns the Protocol for this Package
|
||||
|
||||
end IGESSolid;
|
34
src/IGESSolid/IGESSolid.cxx
Executable file
34
src/IGESSolid/IGESSolid.cxx
Executable file
@@ -0,0 +1,34 @@
|
||||
#include <IGESSolid.ixx>
|
||||
#include <IGESSolid_Protocol.hxx>
|
||||
#include <IGESSolid_GeneralModule.hxx>
|
||||
#include <IGESSolid_ReadWriteModule.hxx>
|
||||
#include <IGESSolid_SpecificModule.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_ReaderLib.hxx>
|
||||
#include <IGESData_WriterLib.hxx>
|
||||
#include <IGESData_SpecificLib.hxx>
|
||||
#include <IGESGeom.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(IGESSolid_Protocol) protocol;
|
||||
|
||||
|
||||
|
||||
void IGESSolid::Init ()
|
||||
{
|
||||
IGESGeom::Init();
|
||||
if (protocol.IsNull()) {
|
||||
protocol = new IGESSolid_Protocol;
|
||||
Interface_GeneralLib::SetGlobal (new IGESSolid_GeneralModule, protocol);
|
||||
Interface_ReaderLib::SetGlobal (new IGESSolid_ReadWriteModule,protocol);
|
||||
IGESData_WriterLib::SetGlobal (new IGESSolid_ReadWriteModule,protocol);
|
||||
IGESData_SpecificLib::SetGlobal (new IGESSolid_SpecificModule, protocol);
|
||||
}
|
||||
}
|
||||
|
||||
Handle(IGESSolid_Protocol) IGESSolid::Protocol ()
|
||||
{
|
||||
return protocol;
|
||||
}
|
108
src/IGESSolid/IGESSolid_Block.cdl
Executable file
108
src/IGESSolid/IGESSolid_Block.cdl
Executable file
@@ -0,0 +1,108 @@
|
||||
--
|
||||
-- File : Block.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class Block from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines Block, Type <150> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- The Block is a rectangular parallelopiped, defined with
|
||||
-- one vertex at (X1, Y1, Z1) and three edges lying along
|
||||
-- the local +X, +Y, +Z axes.
|
||||
|
||||
uses
|
||||
|
||||
Dir from gp,
|
||||
Pnt from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Block;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aSize, aCorner, aXAxis, aZAxis : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class Block
|
||||
-- - aSize : Length in each local directions
|
||||
-- - aCorner : Corner point coordinates. Default (0,0,0)
|
||||
-- - aXAxis : Unit vector defining local X-axis
|
||||
-- default (1,0,0)
|
||||
-- - aZAxis : Unit vector defining local Z-axis
|
||||
-- default (0,0,1)
|
||||
|
||||
Size (me) returns XYZ;
|
||||
---Purpose : returns the size of the block
|
||||
|
||||
XLength (me) returns Real;
|
||||
---Purpose : returns the length of the Block along the local X-direction
|
||||
|
||||
YLength (me) returns Real;
|
||||
---Purpose : returns the length of the Block along the local Y-direction
|
||||
|
||||
ZLength (me) returns Real;
|
||||
---Purpose : returns the length of the Block along the local Z-direction
|
||||
|
||||
Corner (me) returns Pnt;
|
||||
---Purpose : returns the corner point coordinates of the Block
|
||||
|
||||
TransformedCorner (me) returns Pnt;
|
||||
---Purpose : returns the corner point coordinates of the Block after applying
|
||||
-- the TransformationMatrix
|
||||
|
||||
XAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local X-axis
|
||||
|
||||
TransformedXAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local X-axis after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
YAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local Y-axis
|
||||
-- it is the cross product of ZAxis and XAxis
|
||||
|
||||
TransformedYAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local Y-axis after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
ZAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local X-axis
|
||||
|
||||
TransformedZAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local Z-axis after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_Block
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class Block.
|
||||
--
|
||||
-- Reminder : A Block instance is defined by :
|
||||
-- - a vertex at (X1,Y1,Z1) and three edges lying along the local
|
||||
-- - +X, +Y, and +Z axes. The local X and Z axis are defined by
|
||||
-- - the unit vectors (I1,J1,K1) and (I2,J2,K2) respectively. The
|
||||
-- - local Y-axis is derived by taking the cross product of Z into
|
||||
-- - X. The block is specified by the positive lengths (LX,LY,LZ)
|
||||
-- - along these axes.
|
||||
|
||||
theSize : XYZ;
|
||||
-- length in the local axes
|
||||
|
||||
theCorner : XYZ;
|
||||
-- corner point coordinates
|
||||
|
||||
theXAxis : XYZ;
|
||||
-- unit vector defining local X-axis
|
||||
|
||||
theZAxis : XYZ;
|
||||
-- unit vector defining local Z-axis
|
||||
|
||||
end Block;
|
116
src/IGESSolid/IGESSolid_Block.cxx
Executable file
116
src/IGESSolid/IGESSolid_Block.cxx
Executable file
@@ -0,0 +1,116 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Block.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_Block.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_Block::IGESSolid_Block () { }
|
||||
|
||||
|
||||
void IGESSolid_Block::Init
|
||||
(const gp_XYZ& aSize, const gp_XYZ& aCorner,
|
||||
const gp_XYZ& aXAxis, const gp_XYZ& aZAxis)
|
||||
{
|
||||
theSize = aSize;
|
||||
theCorner = aCorner; // default (0,0,0)
|
||||
theXAxis = aXAxis; // default (1,0,0)
|
||||
theZAxis = aZAxis; // default (0,0,1)
|
||||
InitTypeAndForm(150,0);
|
||||
}
|
||||
|
||||
gp_XYZ IGESSolid_Block::Size () const
|
||||
{
|
||||
return theSize;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Block::XLength () const
|
||||
{
|
||||
return theSize.X();
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Block::YLength () const
|
||||
{
|
||||
return theSize.Y();
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Block::ZLength () const
|
||||
{
|
||||
return theSize.Z();
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Block::Corner () const
|
||||
{
|
||||
return gp_Pnt(theCorner);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Block::TransformedCorner () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theCorner);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theCorner;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Block::XAxis () const
|
||||
{
|
||||
return gp_Dir(theXAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Block::TransformedXAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theXAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ xyz = theXAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(xyz);
|
||||
return gp_Dir(xyz);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Block::YAxis () const
|
||||
{
|
||||
return gp_Dir(theXAxis ^ theZAxis); // ^ overloaded
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Block::TransformedYAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theXAxis ^ theZAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ xyz = theXAxis ^ theZAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(xyz);
|
||||
return gp_Dir(xyz);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Block::ZAxis () const
|
||||
{
|
||||
return gp_Dir(theZAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Block::TransformedZAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theZAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ xyz(theZAxis);
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(xyz);
|
||||
return gp_Dir(xyz);
|
||||
}
|
||||
}
|
77
src/IGESSolid/IGESSolid_BooleanTree.cdl
Executable file
77
src/IGESSolid/IGESSolid_BooleanTree.cdl
Executable file
@@ -0,0 +1,77 @@
|
||||
--
|
||||
-- File : BooleanTree.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class BooleanTree from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines BooleanTree, Type <180> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- The Boolean tree describes a binary tree structure
|
||||
-- composed of regularized Boolean operations and operands,
|
||||
-- in post-order notation.
|
||||
|
||||
uses
|
||||
|
||||
HArray1OfInteger from TColStd,
|
||||
HArray1OfIGESEntity from IGESData
|
||||
|
||||
raises OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable BooleanTree;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
operands : HArray1OfIGESEntity;
|
||||
operations : HArray1OfInteger);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- BooleanTree
|
||||
-- - operands : Array containing pointer to DE of operands
|
||||
-- - operations : Array containing integer type for operations
|
||||
|
||||
Length (me) returns Integer;
|
||||
---Purpose : returns the length of the post-order list
|
||||
|
||||
IsOperand (me; Index: Integer) returns Boolean
|
||||
raises OutOfRange;
|
||||
---Purpose : returns True if Index'th value in the post-order list is an Operand;
|
||||
-- else returns False if it is an Integer Operations
|
||||
-- raises exception if Index < 1 or Index > Length()
|
||||
|
||||
Operand (me; Index : Integer) returns IGESEntity
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the Index'th value in the post-order list only if it is
|
||||
-- an operand else returns NULL
|
||||
-- raises exception if Index < 1 or Index > Length()
|
||||
|
||||
Operation (me; Index : Integer) returns Integer
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the Index'th value in the post-order list only if it is
|
||||
-- an operation else returns 0
|
||||
-- raises exception if Index < 1 or Index > Length()
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_BooleanTree
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class BooleanTree.
|
||||
--
|
||||
-- Reminder : A BooleanTree instance is defined by :
|
||||
-- - a list having operation codes (integers) or pointers to
|
||||
-- - operands. A positive value in the data entry implies an
|
||||
-- - operation code; a negative value implies the absolute value
|
||||
-- - is to be taken as a pointer to an operand.
|
||||
|
||||
theOperands : HArray1OfIGESEntity;
|
||||
|
||||
theOperations : HArray1OfInteger;
|
||||
|
||||
end BooleanTree;
|
54
src/IGESSolid/IGESSolid_BooleanTree.cxx
Executable file
54
src/IGESSolid/IGESSolid_BooleanTree.cxx
Executable file
@@ -0,0 +1,54 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_BooleanTree.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_BooleanTree.ixx>
|
||||
#include <Standard_DimensionError.hxx>
|
||||
|
||||
|
||||
IGESSolid_BooleanTree::IGESSolid_BooleanTree () { }
|
||||
|
||||
|
||||
void IGESSolid_BooleanTree::Init
|
||||
(const Handle(IGESData_HArray1OfIGESEntity)& operands,
|
||||
const Handle(TColStd_HArray1OfInteger)& operations)
|
||||
{
|
||||
if (operands->Lower() != 1 || operations->Lower() != 1 ||
|
||||
operands->Length() != operations->Length())
|
||||
Standard_DimensionError::Raise("IGESSolid_BooleanTree : Init");
|
||||
|
||||
theOperations = operations;
|
||||
theOperands = operands;
|
||||
InitTypeAndForm(180,0);
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_BooleanTree::Length () const
|
||||
{
|
||||
return theOperands->Length();
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_BooleanTree::IsOperand
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
return (!theOperands->Value(Index).IsNull());
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_BooleanTree::Operand
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
return theOperands->Value(Index);
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_BooleanTree::Operation
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
if (theOperands->Value(Index).IsNull())
|
||||
return theOperations->Value(Index);
|
||||
else
|
||||
return 0; // It is not an operation. (operations can be : 1-2-3)
|
||||
}
|
17
src/IGESSolid/IGESSolid_CMPLRS.edl
Executable file
17
src/IGESSolid/IGESSolid_CMPLRS.edl
Executable file
@@ -0,0 +1,17 @@
|
||||
-- File: CMPLRS.edl
|
||||
-- Author: Christian CAILLET
|
||||
-- History: Wed May 21 10:57:28 1997
|
||||
-- Copyright: Matra Datavision 1997
|
||||
|
||||
-- Pb compil gros code HP-UX sous WOK++
|
||||
-- trop de warning -> shut up
|
||||
|
||||
@if ( %Station == "hp" ) then
|
||||
|
||||
@string %CMPLRS_CXX_Options = %CMPLRS_CXX_Options " -w ";
|
||||
|
||||
-- Pb optimiseur (O2) pas fiable
|
||||
|
||||
@set %ModeOpt = "+O1";
|
||||
|
||||
@endif;
|
98
src/IGESSolid/IGESSolid_ConeFrustum.cdl
Executable file
98
src/IGESSolid/IGESSolid_ConeFrustum.cdl
Executable file
@@ -0,0 +1,98 @@
|
||||
--
|
||||
-- File : ConeFrustum.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class ConeFrustum from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines ConeFrustum, Type <156> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- The Cone Frustum is defined by the center of the
|
||||
-- larger circular face of the frustum, its radius, a unit
|
||||
-- vector in the axis direction, a height in this direction
|
||||
-- and a second circular face with radius which is lesser
|
||||
-- than the first face.
|
||||
|
||||
uses
|
||||
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable ConeFrustum;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
Ht : Real;
|
||||
R1 : Real;
|
||||
R2 : Real;
|
||||
Center : XYZ;
|
||||
anAxis : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- ConeFrustum
|
||||
-- - Ht : the Height of cone
|
||||
-- - R1 : Radius of the larger face
|
||||
-- - R2 : Radius of the smaller face (default 0)
|
||||
-- - Center : Center of the larger face (default (0,0,0))
|
||||
-- - anAxis : Unit vector in axis direction (default (0,0,1))
|
||||
|
||||
Height (me) returns Real;
|
||||
---Purpose : returns the height of the cone frustum
|
||||
|
||||
LargerRadius (me) returns Real;
|
||||
---Purpose : returns the radius of the larger face of the cone frustum
|
||||
|
||||
SmallerRadius (me) returns Real;
|
||||
---Purpose : returns the radius of the second face of the cone frustum
|
||||
|
||||
FaceCenter (me) returns Pnt;
|
||||
---Purpose : returns the center of the larger face of the cone frustum
|
||||
|
||||
TransformedFaceCenter (me) returns Pnt;
|
||||
---Purpose : returns the center of the larger face of the cone frustum
|
||||
-- after applying TransformationMatrix
|
||||
|
||||
Axis (me) returns Dir;
|
||||
---Purpose : returns the direction of the axis of the cone frustum
|
||||
|
||||
TransformedAxis (me) returns Dir;
|
||||
---Purpose : returns the direction of the axis of the cone frustum
|
||||
-- after applying TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_ConeFrustum
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class ConeFrustum.
|
||||
--
|
||||
-- Reminder : A ConeFrustum instance is defined by :
|
||||
-- The Cone Frustum is defined by the center of the
|
||||
-- larger circular face of the frustum(X1,Y1,Z1), its radius(R1),
|
||||
-- a unit vector in the axis direction(I1,J1,K1),a height in this
|
||||
-- direction(Height) and a second circular face with radius(R2)
|
||||
-- R1 > R2
|
||||
--
|
||||
|
||||
theHeight : Real;
|
||||
|
||||
theR1 : Real;
|
||||
-- the radius of the larger face of the cone frustum
|
||||
|
||||
theR2 : Real;
|
||||
-- the radius of the smaller face of the cone frustum
|
||||
|
||||
theFaceCenter : XYZ;
|
||||
-- the larger face center coordinates
|
||||
|
||||
theAxis : XYZ;
|
||||
-- the Unit vector in axis direction
|
||||
|
||||
end ConeFrustum;
|
76
src/IGESSolid/IGESSolid_ConeFrustum.cxx
Executable file
76
src/IGESSolid/IGESSolid_ConeFrustum.cxx
Executable file
@@ -0,0 +1,76 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_ConeFrustum.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ConeFrustum.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_ConeFrustum::IGESSolid_ConeFrustum () { }
|
||||
|
||||
|
||||
void IGESSolid_ConeFrustum::Init
|
||||
(const Standard_Real Ht, const Standard_Real R1, const Standard_Real R2,
|
||||
const gp_XYZ& Center, const gp_XYZ& anAxis)
|
||||
{
|
||||
theHeight = Ht;
|
||||
theR1 = R1;
|
||||
theR2 = R2; // default 0
|
||||
theFaceCenter = Center; // default (0,0,0)
|
||||
theAxis = anAxis; // default (0,0,1)
|
||||
InitTypeAndForm(156,0);
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_ConeFrustum::Height () const
|
||||
{
|
||||
return theHeight;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_ConeFrustum::LargerRadius () const
|
||||
{
|
||||
return theR1;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_ConeFrustum::SmallerRadius () const
|
||||
{
|
||||
return theR2;
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_ConeFrustum::FaceCenter () const
|
||||
{
|
||||
return gp_Pnt(theFaceCenter);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_ConeFrustum::TransformedFaceCenter () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theFaceCenter);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theFaceCenter;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_ConeFrustum::Axis () const
|
||||
{
|
||||
return gp_Dir(theAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_ConeFrustum::TransformedAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ xyz = theAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(xyz);
|
||||
return gp_Dir(xyz);
|
||||
}
|
||||
}
|
94
src/IGESSolid/IGESSolid_ConicalSurface.cdl
Executable file
94
src/IGESSolid/IGESSolid_ConicalSurface.cdl
Executable file
@@ -0,0 +1,94 @@
|
||||
--
|
||||
-- File : ConicalSurface.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class ConicalSurface from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines ConicalSurface, Type <194> Form Number <0,1>
|
||||
-- in package IGESSolid
|
||||
-- The right circular conical surface is defined by a
|
||||
-- point on the axis on the cone, the direction of the axis
|
||||
-- of the cone, the radius of the cone at the axis point and
|
||||
-- the cone semi-angle.
|
||||
|
||||
uses
|
||||
|
||||
Point from IGESGeom,
|
||||
Direction from IGESGeom
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable ConicalSurface;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aLocation : Point;
|
||||
anAxis : Direction;
|
||||
aRadius : Real;
|
||||
anAngle : Real;
|
||||
aRefdir : Direction);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- ConicalSurface
|
||||
-- - aLocation : Location of the point on axis
|
||||
-- - anAxis : Direction of the axis
|
||||
-- - aRadius : Radius at axis point
|
||||
-- - anAngle : Value of semi-angle in degrees (0<angle<90)
|
||||
-- - aRefdir : Reference direction (parametrised surface)
|
||||
-- Null if unparametrised surface.
|
||||
|
||||
LocationPoint(me) returns Point;
|
||||
---Purpose : returns the location of the point on the axis
|
||||
|
||||
Axis(me) returns Direction;
|
||||
---Purpose : returns the direction of the axis
|
||||
|
||||
Radius(me) returns Real;
|
||||
---Purpose : returns the radius at the axis point
|
||||
|
||||
SemiAngle(me) returns Real;
|
||||
---Purpose : returns the semi-angle value
|
||||
|
||||
ReferenceDir(me) returns Direction;
|
||||
---Purpose : returns the reference direction of the conical surface in case
|
||||
-- of parametrised surface. For unparametrised surface it returns
|
||||
-- NULL.
|
||||
|
||||
IsParametrised(me) returns Boolean;
|
||||
---Purpose : returns True if Form no is 1 else false
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_ConicalSurface
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class ConicalSurface.
|
||||
--
|
||||
-- Reminder : A ConicalSurface instance is defined by :
|
||||
-- a point on the axis of the cone(Location), the direction of
|
||||
-- the axis of the cone(Axis), the radius of the cone at the axis
|
||||
-- point(Radius) and the cone semi-angle(Angle). If the surface
|
||||
-- is parametrised then a reference direction is given(RefDir).
|
||||
--
|
||||
|
||||
theLocationPoint : Point;
|
||||
-- the location of the point on the axis
|
||||
|
||||
theAxis : Direction;
|
||||
-- the direction of the axis
|
||||
|
||||
theRadius : Real;
|
||||
-- the radius at the axis point
|
||||
|
||||
theAngle : Real;
|
||||
-- the semi-angle of the cone
|
||||
|
||||
theRefDir : Direction;
|
||||
-- the reference direction (for parametrised surface alone)
|
||||
|
||||
end ConicalSurface;
|
58
src/IGESSolid/IGESSolid_ConicalSurface.cxx
Executable file
58
src/IGESSolid/IGESSolid_ConicalSurface.cxx
Executable file
@@ -0,0 +1,58 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_ConicalSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ConicalSurface.ixx>
|
||||
|
||||
|
||||
IGESSolid_ConicalSurface::IGESSolid_ConicalSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_ConicalSurface::Init
|
||||
(const Handle(IGESGeom_Point)& aLocation,
|
||||
const Handle(IGESGeom_Direction)& anAxis,
|
||||
const Standard_Real aRadius, const Standard_Real anAngle,
|
||||
const Handle(IGESGeom_Direction)& aRefdir)
|
||||
{
|
||||
theLocationPoint = aLocation;
|
||||
theAxis = anAxis;
|
||||
theRadius = aRadius;
|
||||
theAngle = anAngle;
|
||||
theRefDir = aRefdir;
|
||||
InitTypeAndForm(194, (theRefDir.IsNull() ? 0 : 1));
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Point) IGESSolid_ConicalSurface::LocationPoint () const
|
||||
{
|
||||
return theLocationPoint;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_ConicalSurface::Axis () const
|
||||
{
|
||||
return theAxis;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_ConicalSurface::Radius () const
|
||||
{
|
||||
return theRadius;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_ConicalSurface::SemiAngle () const
|
||||
{
|
||||
return theAngle;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_ConicalSurface::ReferenceDir () const
|
||||
{
|
||||
return theRefDir;
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_ConicalSurface::IsParametrised () const
|
||||
{
|
||||
return (!theRefDir.IsNull());
|
||||
}
|
83
src/IGESSolid/IGESSolid_Cylinder.cdl
Executable file
83
src/IGESSolid/IGESSolid_Cylinder.cdl
Executable file
@@ -0,0 +1,83 @@
|
||||
--
|
||||
-- File : Cylinder.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class Cylinder from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines Cylinder, Type <154> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- This defines a solid cylinder
|
||||
|
||||
uses
|
||||
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Cylinder;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aHeight : Real;
|
||||
aRadius : Real;
|
||||
aCenter : XYZ;
|
||||
anAxis : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- Cylinder
|
||||
-- - aHeight : Cylinder height
|
||||
-- - aRadius : Cylinder radius
|
||||
-- - aCenter : First face center coordinates (default (0,0,0))
|
||||
-- - anAxis : Unit vector in axis direction (default (0,0,1))
|
||||
|
||||
|
||||
Height (me) returns Real;
|
||||
---Purpose : returns the cylinder height
|
||||
|
||||
Radius (me) returns Real;
|
||||
---Purpose : returns the cylinder radius
|
||||
|
||||
FaceCenter (me) returns Pnt;
|
||||
---Purpose : returns the first face center coordinates.
|
||||
|
||||
TransformedFaceCenter (me) returns Pnt;
|
||||
---Purpose : returns the first face center after applying TransformationMatrix
|
||||
|
||||
Axis (me) returns Dir;
|
||||
---Purpose : returns the vector in axis direction
|
||||
|
||||
TransformedAxis (me) returns Dir;
|
||||
---Purpose : returns the vector in axis direction after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_Cylinder
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class Cylinder.
|
||||
--
|
||||
-- Reminder : A Cylinder instance is defined by :
|
||||
-- the center of one circular face(Center), a unit vector
|
||||
-- (Axis), a height(Height), and a radius (Radius).
|
||||
|
||||
theHeight : Real;
|
||||
-- the height of the cylinder
|
||||
|
||||
theRadius : Real;
|
||||
-- the radius of the face of the cylinder
|
||||
|
||||
theFaceCenter : XYZ;
|
||||
-- the center coordinates of the face
|
||||
|
||||
theAxis : XYZ;
|
||||
-- the unit vector along the axis
|
||||
|
||||
end Cylinder;
|
70
src/IGESSolid/IGESSolid_Cylinder.cxx
Executable file
70
src/IGESSolid/IGESSolid_Cylinder.cxx
Executable file
@@ -0,0 +1,70 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Cylinder.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_Cylinder.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_Cylinder::IGESSolid_Cylinder () { }
|
||||
|
||||
|
||||
void IGESSolid_Cylinder::Init
|
||||
(const Standard_Real aHeight, const Standard_Real aRadius,
|
||||
const gp_XYZ& aCenter, const gp_XYZ& anAxis)
|
||||
{
|
||||
theHeight = aHeight;
|
||||
theRadius = aRadius;
|
||||
theFaceCenter = aCenter;
|
||||
theAxis = anAxis;
|
||||
InitTypeAndForm(154,0);
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Cylinder::Height () const
|
||||
{
|
||||
return theHeight;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Cylinder::Radius () const
|
||||
{
|
||||
return theRadius;
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Cylinder::FaceCenter () const
|
||||
{
|
||||
return gp_Pnt(theFaceCenter);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Cylinder::TransformedFaceCenter () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theFaceCenter);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theFaceCenter;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Cylinder::Axis () const
|
||||
{
|
||||
return gp_Dir(theAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Cylinder::TransformedAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
81
src/IGESSolid/IGESSolid_CylindricalSurface.cdl
Executable file
81
src/IGESSolid/IGESSolid_CylindricalSurface.cdl
Executable file
@@ -0,0 +1,81 @@
|
||||
--
|
||||
-- File : CylindricalSurface.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class CylindricalSurface from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines CylindricalSurface, Type <192> Form Number <0,1>
|
||||
-- in package IGESSolid
|
||||
|
||||
uses
|
||||
|
||||
Point from IGESGeom,
|
||||
Direction from IGESGeom,
|
||||
Pnt from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable CylindricalSurface;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aLocation : Point;
|
||||
anAxis : Direction;
|
||||
aRadius : Real;
|
||||
aRefdir : Direction);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- CylindricalSurface
|
||||
-- - aLocation : the location of the point on axis
|
||||
-- - anAxis : the direction of the axis
|
||||
-- - aRadius : the radius at the axis point
|
||||
-- - aRefdir : the reference direction (parametrised surface)
|
||||
-- default NULL (unparametrised surface)
|
||||
|
||||
LocationPoint(me) returns Point;
|
||||
---Purpose : returns the point on the axis
|
||||
|
||||
Axis(me) returns Direction;
|
||||
---Purpose : returns the direction on the axis
|
||||
|
||||
Radius(me) returns Real;
|
||||
---Purpose : returns the radius at the axis point
|
||||
|
||||
IsParametrised(me) returns Boolean;
|
||||
---Purpose : returns whether the surface is parametrised or not
|
||||
|
||||
ReferenceDir(me) returns Direction;
|
||||
---Purpose : returns the reference direction only for parametrised surface
|
||||
-- else returns NULL
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_CylindricalSurface
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class CylindricalSurface.
|
||||
--
|
||||
-- Reminder : A CylindricalSurface instance is defined by :
|
||||
-- a point on the axis of the cylinder(Location), the direction
|
||||
-- of the axis of the cylinder(Axis) and a radius(Radius).In case
|
||||
-- of parametrised surface, a reference direction (RefDir) is
|
||||
-- provided.
|
||||
|
||||
theLocationPoint : Point;
|
||||
-- the location of the point on the axis
|
||||
|
||||
theAxis : Direction;
|
||||
-- the direction of the axis of the surface
|
||||
|
||||
theRadius : Real;
|
||||
-- the radius at the cylinder
|
||||
|
||||
theRefDir : Direction;
|
||||
-- the reference direction (for parametrised surface)
|
||||
|
||||
end CylindricalSurface;
|
53
src/IGESSolid/IGESSolid_CylindricalSurface.cxx
Executable file
53
src/IGESSolid/IGESSolid_CylindricalSurface.cxx
Executable file
@@ -0,0 +1,53 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_CylindricalSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_CylindricalSurface.ixx>
|
||||
|
||||
|
||||
IGESSolid_CylindricalSurface::IGESSolid_CylindricalSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_CylindricalSurface::Init
|
||||
(const Handle(IGESGeom_Point)& aLocation,
|
||||
const Handle(IGESGeom_Direction)& anAxis,
|
||||
const Standard_Real aRadius,
|
||||
const Handle(IGESGeom_Direction)& aRefdir)
|
||||
{
|
||||
theLocationPoint = aLocation;
|
||||
theAxis = anAxis;
|
||||
theRadius = aRadius;
|
||||
theRefDir = aRefdir;
|
||||
InitTypeAndForm(192, (theRefDir.IsNull() ? 0 : 1));
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Point) IGESSolid_CylindricalSurface::LocationPoint () const
|
||||
{
|
||||
return theLocationPoint;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_CylindricalSurface::Axis () const
|
||||
{
|
||||
return theAxis;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_CylindricalSurface::Radius () const
|
||||
{
|
||||
return theRadius;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_CylindricalSurface::ReferenceDir () const
|
||||
{
|
||||
return theRefDir;
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_CylindricalSurface::IsParametrised () const
|
||||
{
|
||||
return (!theRefDir.IsNull());
|
||||
}
|
||||
|
105
src/IGESSolid/IGESSolid_EdgeList.cdl
Executable file
105
src/IGESSolid/IGESSolid_EdgeList.cdl
Executable file
@@ -0,0 +1,105 @@
|
||||
--
|
||||
-- File : EdgeList.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class EdgeList from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines EdgeList, Type <504> Form <1>
|
||||
-- in package IGESSolid
|
||||
-- EdgeList is defined as a segment joining two vertices
|
||||
|
||||
uses
|
||||
|
||||
HArray1OfIGESEntity from IGESData,
|
||||
VertexList from IGESSolid,
|
||||
HArray1OfVertexList from IGESSolid,
|
||||
HArray1OfInteger from TColStd
|
||||
|
||||
raises DimensionMismatch, OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable EdgeList;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
curves : HArray1OfIGESEntity;
|
||||
startVertexList : HArray1OfVertexList;
|
||||
startVertexIndex : HArray1OfInteger;
|
||||
endVertexList : HArray1OfVertexList;
|
||||
endVertexIndex : HArray1OfInteger)
|
||||
raises DimensionMismatch;
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- EdgeList
|
||||
-- - curves : the model space curves
|
||||
-- - startVertexList : the vertex list that contains the
|
||||
-- start vertices
|
||||
-- - startVertexIndex : the index of the vertex in the
|
||||
-- corresponding vertex list
|
||||
-- - endVertexList : the vertex list that contains the
|
||||
-- end vertices
|
||||
-- - endVertexIndex : the index of the vertex in the
|
||||
-- corresponding vertex list
|
||||
-- raises exception if size of curves,startVertexList,startVertexIndex,
|
||||
-- endVertexList and endVertexIndex do no match
|
||||
|
||||
NbEdges (me) returns Integer;
|
||||
---Purpose : returns the number of edges in the edge list
|
||||
|
||||
Curve (me; num: Integer) returns IGESEntity
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the num'th model space curve
|
||||
-- raises Exception if num <= 0 or num > NbEdges()
|
||||
|
||||
StartVertexList (me; num: Integer) returns VertexList
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the num'th start vertex list
|
||||
-- raises Exception if num <= 0 or num > NbEdges()
|
||||
|
||||
StartVertexIndex (me; num: Integer) returns Integer
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the index of num'th start vertex in
|
||||
-- the corresponding start vertex list
|
||||
-- raises Exception if num <= 0 or num > NbEdges()
|
||||
|
||||
EndVertexList (me; num: Integer) returns VertexList
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the num'th end vertex list
|
||||
-- raises Exception if num <= 0 or num > NbEdges()
|
||||
|
||||
EndVertexIndex (me; num: Integer) returns Integer
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the index of num'th end vertex in
|
||||
-- the corresponding end vertex list
|
||||
-- raises Exception if num <= 0 or num > NbEdges()
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_EdgeList
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class EdgeList.
|
||||
--
|
||||
|
||||
theCurves : HArray1OfIGESEntity;
|
||||
-- the model space curves
|
||||
|
||||
theStartVertexList : HArray1OfVertexList;
|
||||
-- the start vertex list
|
||||
|
||||
theStartVertexIndex : HArray1OfInteger;
|
||||
-- the indices of the individual vertex into the start vertex list
|
||||
|
||||
theEndVertexList : HArray1OfVertexList;
|
||||
-- the terminate vertex list
|
||||
|
||||
theEndVertexIndex : HArray1OfInteger;
|
||||
-- the indices of the individual vertex into the terminate vertex list
|
||||
|
||||
end EdgeList;
|
74
src/IGESSolid/IGESSolid_EdgeList.cxx
Executable file
74
src/IGESSolid/IGESSolid_EdgeList.cxx
Executable file
@@ -0,0 +1,74 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_EdgeList.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_EdgeList.ixx>
|
||||
|
||||
|
||||
IGESSolid_EdgeList::IGESSolid_EdgeList () { }
|
||||
|
||||
|
||||
void IGESSolid_EdgeList::Init
|
||||
(const Handle(IGESData_HArray1OfIGESEntity)& Curves,
|
||||
const Handle(IGESSolid_HArray1OfVertexList)& startVertexList,
|
||||
const Handle(TColStd_HArray1OfInteger)& startVertexIndex,
|
||||
const Handle(IGESSolid_HArray1OfVertexList)& endVertexList,
|
||||
const Handle(TColStd_HArray1OfInteger)& endVertexIndex)
|
||||
{
|
||||
Standard_Integer nb = (Curves.IsNull() ? 0 : Curves->Length());
|
||||
|
||||
if (nb == 0 || Curves->Lower() != 1 ||
|
||||
startVertexList->Lower() != 1 || startVertexList->Length() != nb ||
|
||||
startVertexIndex->Lower() != 1 || startVertexIndex->Length() != nb ||
|
||||
endVertexList->Lower() != 1 || endVertexList->Length() != nb ||
|
||||
endVertexIndex->Lower() != 1 || endVertexIndex->Length() != nb )
|
||||
Standard_DimensionError::Raise("IGESSolid_EdgeList : Init");
|
||||
|
||||
theCurves = Curves;
|
||||
theStartVertexList = startVertexList;
|
||||
theStartVertexIndex = startVertexIndex;
|
||||
theEndVertexList = endVertexList;
|
||||
theEndVertexIndex = endVertexIndex;
|
||||
|
||||
InitTypeAndForm(504,1);
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_EdgeList::NbEdges () const
|
||||
{
|
||||
return (theCurves.IsNull() ? 0 : theCurves->Length());
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_EdgeList::Curve
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
return theCurves->Value(num);
|
||||
}
|
||||
|
||||
Handle(IGESSolid_VertexList) IGESSolid_EdgeList::StartVertexList
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
return theStartVertexList->Value(num);
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_EdgeList::StartVertexIndex
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
return theStartVertexIndex->Value(num);
|
||||
}
|
||||
|
||||
Handle(IGESSolid_VertexList) IGESSolid_EdgeList::EndVertexList
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
return theEndVertexList->Value(num);
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_EdgeList::EndVertexIndex
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
return theEndVertexIndex->Value(num);
|
||||
}
|
114
src/IGESSolid/IGESSolid_Ellipsoid.cdl
Executable file
114
src/IGESSolid/IGESSolid_Ellipsoid.cdl
Executable file
@@ -0,0 +1,114 @@
|
||||
--
|
||||
-- File : Ellipsoid.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class Ellipsoid from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines Ellipsoid, Type <168> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- The ellipsoid is a solid bounded by the surface defined
|
||||
-- by:
|
||||
-- X^2 Y^2 Z^2
|
||||
-- ----- + ----- + ----- = 1
|
||||
-- LX^2 LY^2 LZ^2
|
||||
|
||||
uses
|
||||
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Ellipsoid;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aSize : XYZ;
|
||||
aCenter : XYZ;
|
||||
anXAxis : XYZ;
|
||||
anZAxis : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- Ellipsoid
|
||||
-- - aSize : Lengths in the local X,Y,Z directions
|
||||
-- - aCenter : Center point of ellipsoid (default (0,0,0))
|
||||
-- - anXAxis : Unit vector defining local X-axis
|
||||
-- default (1,0,0)
|
||||
-- - anZAxis : Unit vector defining local Z-axis
|
||||
-- default (0,0,1)
|
||||
|
||||
Size (me) returns XYZ;
|
||||
---Purpose : returns the size
|
||||
|
||||
XLength (me) returns Real;
|
||||
---Purpose : returns the length in the local X-direction
|
||||
|
||||
YLength (me) returns Real;
|
||||
---Purpose : returns the length in the local Y-direction
|
||||
|
||||
ZLength (me) returns Real;
|
||||
---Purpose : returns the length in the local Z-direction
|
||||
|
||||
Center (me) returns Pnt;
|
||||
---Purpose : returns the center of the ellipsoid
|
||||
|
||||
TransformedCenter (me) returns Pnt;
|
||||
---Purpose : returns the center of the ellipsoid after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
XAxis (me) returns Dir;
|
||||
---Purpose : returns the vector corresponding to the local X-direction
|
||||
|
||||
TransformedXAxis (me) returns Dir;
|
||||
---Purpose : returns the vector corresponding to the local X-direction
|
||||
-- after applying TransformationMatrix
|
||||
|
||||
YAxis (me) returns Dir;
|
||||
---Purpose : returns the vector corresponding to the local Y-direction
|
||||
-- which is got by taking cross product of ZAxis and XAxis
|
||||
|
||||
TransformedYAxis (me) returns Dir;
|
||||
---Purpose : returns the vector corresponding to the local Y-direction
|
||||
-- (which is got by taking cross product of ZAxis and XAxis)
|
||||
-- after applying TransformationMatrix
|
||||
|
||||
ZAxis (me) returns Dir;
|
||||
---Purpose : returns the vector corresponding to the local Z-direction
|
||||
|
||||
TransformedZAxis (me) returns Dir;
|
||||
---Purpose : returns the vector corresponding to the local Z-direction
|
||||
-- after applying TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
|
||||
-- Class : IGESSolid_Ellipsoid
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class Ellipsoid.
|
||||
--
|
||||
-- Reminder : A Ellipsoid instance is defined by :
|
||||
-- its center at (Center), the local X & Z axes (XAxis)
|
||||
-- and (ZAxis) and the lengths along the local X, Y and Z
|
||||
-- axes. The local Y axis is got by taking the cross product
|
||||
-- of the local Z & X axes.
|
||||
|
||||
theSize : XYZ;
|
||||
-- lengths along the local X, Y, & Z directions
|
||||
|
||||
theCenter : XYZ;
|
||||
-- coordinates of point of center of ellipsoid
|
||||
|
||||
theXAxis : XYZ;
|
||||
-- vector defining local X-axis
|
||||
|
||||
theZAxis : XYZ;
|
||||
-- vector defining local Z-axis
|
||||
|
||||
end Ellipsoid;
|
116
src/IGESSolid/IGESSolid_Ellipsoid.cxx
Executable file
116
src/IGESSolid/IGESSolid_Ellipsoid.cxx
Executable file
@@ -0,0 +1,116 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Ellipsoid.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_Ellipsoid.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_Ellipsoid::IGESSolid_Ellipsoid () { }
|
||||
|
||||
|
||||
void IGESSolid_Ellipsoid::Init
|
||||
(const gp_XYZ& aSize, const gp_XYZ& aCenter,
|
||||
const gp_XYZ& anXAxis, const gp_XYZ& anZAxis)
|
||||
{
|
||||
theSize = aSize;
|
||||
theCenter = aCenter; // default (0,0,0)
|
||||
theXAxis = anXAxis; // default (1,0,0)
|
||||
theZAxis = anZAxis; // default (0,0,1)
|
||||
InitTypeAndForm(168,0);
|
||||
}
|
||||
|
||||
gp_XYZ IGESSolid_Ellipsoid::Size () const
|
||||
{
|
||||
return theSize;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Ellipsoid::XLength () const
|
||||
{
|
||||
return theSize.X();
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Ellipsoid::YLength () const
|
||||
{
|
||||
return theSize.Y();
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Ellipsoid::ZLength () const
|
||||
{
|
||||
return theSize.Z();
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Ellipsoid::Center () const
|
||||
{
|
||||
return gp_Pnt(theCenter);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Ellipsoid::TransformedCenter () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theCenter);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theCenter;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Ellipsoid::XAxis () const
|
||||
{
|
||||
return gp_Dir(theXAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Ellipsoid::TransformedXAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theXAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theXAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Ellipsoid::YAxis () const
|
||||
{
|
||||
return gp_Dir(theXAxis ^ theZAxis); // ^ overloaded
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Ellipsoid::TransformedYAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theXAxis ^ theZAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theXAxis ^ theZAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Ellipsoid::ZAxis () const
|
||||
{
|
||||
return gp_Dir(theZAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_Ellipsoid::TransformedZAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theZAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theZAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
71
src/IGESSolid/IGESSolid_Face.cdl
Executable file
71
src/IGESSolid/IGESSolid_Face.cdl
Executable file
@@ -0,0 +1,71 @@
|
||||
--
|
||||
-- File : Face.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen (SIVA)
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class Face from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines Face, Type <510> Form Number <1>
|
||||
-- in package IGESSolid
|
||||
-- Face entity is a bound (partial) which has finite area
|
||||
|
||||
uses
|
||||
|
||||
Loop from IGESSolid,
|
||||
HArray1OfLoop from IGESSolid
|
||||
|
||||
raises OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Face;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aSurface : IGESEntity;
|
||||
outerLoopFlag : Boolean;
|
||||
loops : HArray1OfLoop);
|
||||
---Purpose : This method is used to set the fields of the class Face
|
||||
-- - aSurface : Pointer to the underlying surface
|
||||
-- - outerLoopFlag : True means the first loop is the outer loop
|
||||
-- - loops : Array of loops bounding the face
|
||||
|
||||
Surface (me) returns IGESEntity;
|
||||
---Purpose : returns the underlying surface of the face
|
||||
|
||||
NbLoops (me) returns Integer;
|
||||
---Purpose : returns the number of the loops bounding the face
|
||||
|
||||
HasOuterLoop (me) returns Boolean;
|
||||
---Purpose : checks whether there is an outer loop or not
|
||||
|
||||
Loop (me; Index : Integer) returns Loop
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the Index'th loop that bounds the face
|
||||
-- raises exception if Index < 0 or Index >= NbLoops
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_Face
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class Face.
|
||||
--
|
||||
-- Reminder : A Face instance is defined by :
|
||||
-- a underlying surface (Surface) bounded by loops (Loops)
|
||||
|
||||
theSurface : IGESEntity;
|
||||
-- underlying surface
|
||||
|
||||
hasOuterLoop : Boolean;
|
||||
-- indicator for presence of the outer loop
|
||||
|
||||
theLoops : HArray1OfLoop;
|
||||
-- array of the bounding loops
|
||||
|
||||
end Face;
|
49
src/IGESSolid/IGESSolid_Face.cxx
Executable file
49
src/IGESSolid/IGESSolid_Face.cxx
Executable file
@@ -0,0 +1,49 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Face.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_Face.ixx>
|
||||
#include <Standard_DimensionMismatch.hxx>
|
||||
|
||||
|
||||
IGESSolid_Face::IGESSolid_Face () { }
|
||||
|
||||
|
||||
void IGESSolid_Face::Init
|
||||
(const Handle(IGESData_IGESEntity)& aSurface,
|
||||
const Standard_Boolean OuterLoopFlag,
|
||||
const Handle(IGESSolid_HArray1OfLoop)& Loops)
|
||||
{
|
||||
if (Loops->Lower() != 1)
|
||||
Standard_DimensionMismatch::Raise("IGESSolid_Face : Init");
|
||||
theSurface = aSurface;
|
||||
hasOuterLoop = OuterLoopFlag;
|
||||
theLoops = Loops;
|
||||
InitTypeAndForm(510,1);
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_Face::Surface () const
|
||||
{
|
||||
return theSurface;
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_Face::NbLoops () const
|
||||
{
|
||||
return theLoops->Length();
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_Face::HasOuterLoop () const
|
||||
{
|
||||
return hasOuterLoop;
|
||||
}
|
||||
|
||||
Handle(IGESSolid_Loop) IGESSolid_Face::Loop (const Standard_Integer Index) const
|
||||
{
|
||||
return theLoops->Value(Index);
|
||||
}
|
||||
|
51
src/IGESSolid/IGESSolid_GeneralModule.cdl
Executable file
51
src/IGESSolid/IGESSolid_GeneralModule.cdl
Executable file
@@ -0,0 +1,51 @@
|
||||
-- File: IGESSolid_GeneralModule.cdl
|
||||
-- Created: Mon May 10 15:00:51 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class GeneralModule from IGESSolid inherits GeneralModule from IGESData
|
||||
|
||||
---Purpose : Definition of General Services for IGESSolid (specific part)
|
||||
-- This Services comprise : Shared & Implied Lists, Copy, Check
|
||||
|
||||
uses OStream,
|
||||
Check, ShareTool, EntityIterator, CopyTool,
|
||||
IGESEntity, DirChecker
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable GeneralModule from IGESSolid;
|
||||
---Purpose : Creates a GeneralModule from IGESSolid 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
|
||||
|
||||
end GeneralModule;
|
794
src/IGESSolid/IGESSolid_GeneralModule.cxx
Executable file
794
src/IGESSolid/IGESSolid_GeneralModule.cxx
Executable file
@@ -0,0 +1,794 @@
|
||||
#include <IGESSolid_GeneralModule.ixx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Interface_Category.hxx>
|
||||
|
||||
#include <IGESSolid_Block.hxx>
|
||||
#include <IGESSolid_BooleanTree.hxx>
|
||||
#include <IGESSolid_ConeFrustum.hxx>
|
||||
#include <IGESSolid_ConicalSurface.hxx>
|
||||
#include <IGESSolid_Cylinder.hxx>
|
||||
#include <IGESSolid_CylindricalSurface.hxx>
|
||||
#include <IGESSolid_EdgeList.hxx>
|
||||
#include <IGESSolid_Ellipsoid.hxx>
|
||||
#include <IGESSolid_Face.hxx>
|
||||
#include <IGESSolid_Loop.hxx>
|
||||
#include <IGESSolid_ManifoldSolid.hxx>
|
||||
#include <IGESSolid_PlaneSurface.hxx>
|
||||
#include <IGESSolid_RightAngularWedge.hxx>
|
||||
#include <IGESSolid_SelectedComponent.hxx>
|
||||
#include <IGESSolid_Shell.hxx>
|
||||
#include <IGESSolid_SolidAssembly.hxx>
|
||||
#include <IGESSolid_SolidInstance.hxx>
|
||||
#include <IGESSolid_SolidOfLinearExtrusion.hxx>
|
||||
#include <IGESSolid_SolidOfRevolution.hxx>
|
||||
#include <IGESSolid_Sphere.hxx>
|
||||
#include <IGESSolid_SphericalSurface.hxx>
|
||||
#include <IGESSolid_ToroidalSurface.hxx>
|
||||
#include <IGESSolid_Torus.hxx>
|
||||
#include <IGESSolid_VertexList.hxx>
|
||||
|
||||
#include <IGESSolid_ToolBlock.hxx>
|
||||
#include <IGESSolid_ToolBooleanTree.hxx>
|
||||
#include <IGESSolid_ToolConeFrustum.hxx>
|
||||
#include <IGESSolid_ToolConicalSurface.hxx>
|
||||
#include <IGESSolid_ToolCylinder.hxx>
|
||||
#include <IGESSolid_ToolCylindricalSurface.hxx>
|
||||
#include <IGESSolid_ToolEdgeList.hxx>
|
||||
#include <IGESSolid_ToolEllipsoid.hxx>
|
||||
#include <IGESSolid_ToolFace.hxx>
|
||||
#include <IGESSolid_ToolLoop.hxx>
|
||||
#include <IGESSolid_ToolManifoldSolid.hxx>
|
||||
#include <IGESSolid_ToolPlaneSurface.hxx>
|
||||
#include <IGESSolid_ToolRightAngularWedge.hxx>
|
||||
#include <IGESSolid_ToolSelectedComponent.hxx>
|
||||
#include <IGESSolid_ToolShell.hxx>
|
||||
#include <IGESSolid_ToolSolidAssembly.hxx>
|
||||
#include <IGESSolid_ToolSolidInstance.hxx>
|
||||
#include <IGESSolid_ToolSolidOfLinearExtrusion.hxx>
|
||||
#include <IGESSolid_ToolSolidOfRevolution.hxx>
|
||||
#include <IGESSolid_ToolSphere.hxx>
|
||||
#include <IGESSolid_ToolSphericalSurface.hxx>
|
||||
#include <IGESSolid_ToolToroidalSurface.hxx>
|
||||
#include <IGESSolid_ToolTorus.hxx>
|
||||
#include <IGESSolid_ToolVertexList.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
|
||||
|
||||
|
||||
IGESSolid_GeneralModule::IGESSolid_GeneralModule () { }
|
||||
|
||||
|
||||
void IGESSolid_GeneralModule::OwnSharedCase
|
||||
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
switch (CN) {
|
||||
case 1 : {
|
||||
DeclareAndCast(IGESSolid_Block,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBlock tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBooleanTree tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConeFrustum tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConicalSurface tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESSolid_Cylinder,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylinder tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylindricalSurface tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESSolid_EdgeList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEdgeList tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 8 : {
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEllipsoid tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 9 : {
|
||||
DeclareAndCast(IGESSolid_Face,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolFace tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 10 : {
|
||||
DeclareAndCast(IGESSolid_Loop,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolLoop tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 11 : {
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolManifoldSolid tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 12 : {
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolPlaneSurface tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 13 : {
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolRightAngularWedge tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 14 : {
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSelectedComponent tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 15 : {
|
||||
DeclareAndCast(IGESSolid_Shell,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolShell tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 16 : {
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidAssembly tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 17 : {
|
||||
DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidInstance tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 18 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfLinearExtrusion tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 19 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfRevolution tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 20 : {
|
||||
DeclareAndCast(IGESSolid_Sphere,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphere tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 21 : {
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphericalSurface tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 22 : {
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolToroidalSurface tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 23 : {
|
||||
DeclareAndCast(IGESSolid_Torus,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolTorus tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 24 : {
|
||||
DeclareAndCast(IGESSolid_VertexList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolVertexList tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IGESData_DirChecker IGESSolid_GeneralModule::DirChecker
|
||||
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
|
||||
{
|
||||
switch (CN) {
|
||||
case 1 : {
|
||||
DeclareAndCast(IGESSolid_Block,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolBlock tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolBooleanTree tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolConeFrustum tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolConicalSurface tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESSolid_Cylinder,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolCylinder tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolCylindricalSurface tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESSolid_EdgeList,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolEdgeList tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 8 : {
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolEllipsoid tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 9 : {
|
||||
DeclareAndCast(IGESSolid_Face,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolFace tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 10 : {
|
||||
DeclareAndCast(IGESSolid_Loop,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolLoop tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 11 : {
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolManifoldSolid tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 12 : {
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolPlaneSurface tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 13 : {
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolRightAngularWedge tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 14 : {
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolSelectedComponent tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 15 : {
|
||||
DeclareAndCast(IGESSolid_Shell,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolShell tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 16 : {
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolSolidAssembly tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 17 : {
|
||||
DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolSolidInstance tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 18 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolSolidOfLinearExtrusion tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 19 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolSolidOfRevolution tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 20 : {
|
||||
DeclareAndCast(IGESSolid_Sphere,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolSphere tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 21 : {
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolSphericalSurface tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 22 : {
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolToroidalSurface tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 23 : {
|
||||
DeclareAndCast(IGESSolid_Torus,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolTorus tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
case 24 : {
|
||||
DeclareAndCast(IGESSolid_VertexList,anent,ent);
|
||||
if (anent.IsNull()) break;
|
||||
IGESSolid_ToolVertexList tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
default : break;
|
||||
}
|
||||
return IGESData_DirChecker(); // by default, no specific criterium
|
||||
}
|
||||
|
||||
|
||||
void IGESSolid_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(IGESSolid_Block,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBlock tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBooleanTree tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConeFrustum tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConicalSurface tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESSolid_Cylinder,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylinder tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylindricalSurface tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESSolid_EdgeList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEdgeList tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 8 : {
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEllipsoid tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 9 : {
|
||||
DeclareAndCast(IGESSolid_Face,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolFace tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 10 : {
|
||||
DeclareAndCast(IGESSolid_Loop,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolLoop tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 11 : {
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolManifoldSolid tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 12 : {
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolPlaneSurface tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 13 : {
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolRightAngularWedge tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 14 : {
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSelectedComponent tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 15 : {
|
||||
DeclareAndCast(IGESSolid_Shell,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolShell tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 16 : {
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidAssembly tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 17 : {
|
||||
DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidInstance tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 18 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfLinearExtrusion tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 19 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfRevolution tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 20 : {
|
||||
DeclareAndCast(IGESSolid_Sphere,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphere tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 21 : {
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphericalSurface tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 22 : {
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolToroidalSurface tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 23 : {
|
||||
DeclareAndCast(IGESSolid_Torus,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolTorus tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
case 24 : {
|
||||
DeclareAndCast(IGESSolid_VertexList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolVertexList tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean IGESSolid_GeneralModule::NewVoid
|
||||
(const Standard_Integer CN, Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
switch (CN) {
|
||||
case 1 : ent = new IGESSolid_Block; break;
|
||||
case 2 : ent = new IGESSolid_BooleanTree; break;
|
||||
case 3 : ent = new IGESSolid_ConeFrustum; break;
|
||||
case 4 : ent = new IGESSolid_ConicalSurface; break;
|
||||
case 5 : ent = new IGESSolid_Cylinder; break;
|
||||
case 6 : ent = new IGESSolid_CylindricalSurface; break;
|
||||
case 7 : ent = new IGESSolid_EdgeList; break;
|
||||
case 8 : ent = new IGESSolid_Ellipsoid; break;
|
||||
case 9 : ent = new IGESSolid_Face; break;
|
||||
case 10 : ent = new IGESSolid_Loop; break;
|
||||
case 11 : ent = new IGESSolid_ManifoldSolid; break;
|
||||
case 12 : ent = new IGESSolid_PlaneSurface; break;
|
||||
case 13 : ent = new IGESSolid_RightAngularWedge; break;
|
||||
case 14 : ent = new IGESSolid_SelectedComponent; break;
|
||||
case 15 : ent = new IGESSolid_Shell; break;
|
||||
case 16 : ent = new IGESSolid_SolidAssembly; break;
|
||||
case 17 : ent = new IGESSolid_SolidInstance; break;
|
||||
case 18 : ent = new IGESSolid_SolidOfLinearExtrusion; break;
|
||||
case 19 : ent = new IGESSolid_SolidOfRevolution; break;
|
||||
case 20 : ent = new IGESSolid_Sphere; break;
|
||||
case 21 : ent = new IGESSolid_SphericalSurface; break;
|
||||
case 22 : ent = new IGESSolid_ToroidalSurface; break;
|
||||
case 23 : ent = new IGESSolid_Torus; break;
|
||||
case 24 : ent = new IGESSolid_VertexList; break;
|
||||
default : return Standard_False; // by default, Failure on Recognize
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
||||
void IGESSolid_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(IGESSolid_Block,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Block,ento,entto);
|
||||
IGESSolid_ToolBlock tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESSolid_BooleanTree,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_BooleanTree,ento,entto);
|
||||
IGESSolid_ToolBooleanTree tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,ento,entto);
|
||||
IGESSolid_ToolConeFrustum tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,ento,entto);
|
||||
IGESSolid_ToolConicalSurface tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESSolid_Cylinder,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Cylinder,ento,entto);
|
||||
IGESSolid_ToolCylinder tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,ento,entto);
|
||||
IGESSolid_ToolCylindricalSurface tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESSolid_EdgeList,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_EdgeList,ento,entto);
|
||||
IGESSolid_ToolEdgeList tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 8 : {
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,ento,entto);
|
||||
IGESSolid_ToolEllipsoid tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 9 : {
|
||||
DeclareAndCast(IGESSolid_Face,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Face,ento,entto);
|
||||
IGESSolid_ToolFace tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 10 : {
|
||||
DeclareAndCast(IGESSolid_Loop,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Loop,ento,entto);
|
||||
IGESSolid_ToolLoop tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 11 : {
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,ento,entto);
|
||||
IGESSolid_ToolManifoldSolid tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 12 : {
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,ento,entto);
|
||||
IGESSolid_ToolPlaneSurface tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 13 : {
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,ento,entto);
|
||||
IGESSolid_ToolRightAngularWedge tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 14 : {
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,ento,entto);
|
||||
IGESSolid_ToolSelectedComponent tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 15 : {
|
||||
DeclareAndCast(IGESSolid_Shell,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Shell,ento,entto);
|
||||
IGESSolid_ToolShell tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 16 : {
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,ento,entto);
|
||||
IGESSolid_ToolSolidAssembly tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 17 : {
|
||||
DeclareAndCast(IGESSolid_SolidInstance,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_SolidInstance,ento,entto);
|
||||
IGESSolid_ToolSolidInstance tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 18 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,ento,entto);
|
||||
IGESSolid_ToolSolidOfLinearExtrusion tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 19 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,ento,entto);
|
||||
IGESSolid_ToolSolidOfRevolution tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 20 : {
|
||||
DeclareAndCast(IGESSolid_Sphere,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Sphere,ento,entto);
|
||||
IGESSolid_ToolSphere tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 21 : {
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,ento,entto);
|
||||
IGESSolid_ToolSphericalSurface tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 22 : {
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,ento,entto);
|
||||
IGESSolid_ToolToroidalSurface tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 23 : {
|
||||
DeclareAndCast(IGESSolid_Torus,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_Torus,ento,entto);
|
||||
IGESSolid_ToolTorus tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
case 24 : {
|
||||
DeclareAndCast(IGESSolid_VertexList,enfr,entfrom);
|
||||
DeclareAndCast(IGESSolid_VertexList,ento,entto);
|
||||
IGESSolid_ToolVertexList tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer IGESSolid_GeneralModule::CategoryNumber
|
||||
(const Standard_Integer CN, const Handle(Standard_Transient)& ,
|
||||
const Interface_ShareTool& ) const
|
||||
{
|
||||
return Interface_Category::Number("Shape");
|
||||
}
|
145
src/IGESSolid/IGESSolid_Loop.cdl
Executable file
145
src/IGESSolid/IGESSolid_Loop.cdl
Executable file
@@ -0,0 +1,145 @@
|
||||
--
|
||||
-- File : Loop.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class Loop from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines Loop, Type <508> Form Number <1>
|
||||
-- in package IGESSolid
|
||||
-- A Loop entity specifies a bound of a face. It represents
|
||||
-- a connected collection of face boundaries, seams, and
|
||||
-- poles of a single face.
|
||||
--
|
||||
-- From IGES-5.3, a Loop can be free with Form Number 0,
|
||||
-- else it is a bound of a face (it is the default)
|
||||
|
||||
uses
|
||||
|
||||
HArray1OfIGESEntity from IGESData,
|
||||
HArray1OfInteger from TColStd,
|
||||
HArray1OfHArray1OfInteger from IGESBasic,
|
||||
HArray1OfHArray1OfIGESEntity from IGESBasic
|
||||
|
||||
raises DimensionMismatch, OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Loop;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
types : HArray1OfInteger;
|
||||
edges : HArray1OfIGESEntity;
|
||||
index : HArray1OfInteger;
|
||||
orient : HArray1OfInteger;
|
||||
nbParameterCurves : HArray1OfInteger;
|
||||
isoparametricFlags : HArray1OfHArray1OfInteger;
|
||||
curves : HArray1OfHArray1OfIGESEntity from
|
||||
IGESBasic)
|
||||
raises DimensionMismatch;
|
||||
---Purpose : This method is used to set the fields of the class Loop
|
||||
-- - types : 0 = Edge; 1 = Vertex
|
||||
-- - edges : Pointer to the EdgeList or VertexList
|
||||
-- - index : Index of the edge into the EdgeList
|
||||
-- VertexList entity
|
||||
-- - orient : Orientation flag of the edge
|
||||
-- - nbParameterCurves : the number of parameter space curves
|
||||
-- for each edge
|
||||
-- - isoparametricFlags : the isoparametric flag of the
|
||||
-- parameter space curve
|
||||
-- - curves : the parameter space curves
|
||||
-- raises exception if length of types, edges, index, orient and
|
||||
-- nbParameterCurves do not match or the length of
|
||||
-- isoparametricFlags and curves do not match
|
||||
|
||||
IsBound (me) returns Boolean;
|
||||
---Purpose : Tells if a Loop is a Bound (FN 1) else it is free (FN 0)
|
||||
|
||||
SetBound (me : mutable; bound : Boolean);
|
||||
---Purpose : Sets or Unset the Bound Status (from Form Number)
|
||||
-- Default is True
|
||||
|
||||
NbEdges (me) returns Integer;
|
||||
---Purpose : returns the number of edge tuples
|
||||
|
||||
EdgeType (me; Index : Integer) returns Integer
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the type of Index'th edge (0 = Edge, 1 = Vertex)
|
||||
-- raises exception if Index <= 0 or Index > NbEdges()
|
||||
|
||||
Edge (me; Index : Integer) returns IGESEntity
|
||||
raises OutOfRange;
|
||||
---Purpose : return the EdgeList or VertexList corresponding to the Index
|
||||
-- raises exception if Index <= 0 or Index > NbEdges()
|
||||
|
||||
Orientation (me; Index : Integer) returns Boolean
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the orientation flag corresponding to Index'th edge
|
||||
-- raises exception if Index <= 0 or Index > NbEdges()
|
||||
|
||||
NbParameterCurves (me; Index : Integer) returns Integer
|
||||
raises OutOfRange;
|
||||
---Purpose : return the number of parameter space curves associated with
|
||||
-- Index'th Edge
|
||||
-- raises exception if Index <= 0 or Index > NbEdges()
|
||||
|
||||
IsIsoparametric (me; EdgeIndex, CurveIndex : Integer)
|
||||
returns Boolean
|
||||
raises OutOfRange;
|
||||
-- returns the EdgeIndex'th edge's CurveIndex'th isoparametric flag
|
||||
-- raises exception if EdgeIndex <= 0 or EdgeIndex > NbEdges() or
|
||||
-- if CurveIndex <= 0 or CurveIndex > NbParameterCurves(EdgeIndex)
|
||||
|
||||
ParametricCurve (me; EdgeIndex, CurveIndex : Integer) returns IGESEntity
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the CurveIndex'th parameter space curve associated with
|
||||
-- EdgeIndex'th edge
|
||||
-- raises exception if EdgeIndex <= 0 or EdgeIndex > NbEdges() or
|
||||
-- if CurveIndex <= 0 or CurveIndex > NbParameterCurves(EdgeIndex)
|
||||
|
||||
ListIndex (me; num : Integer) returns Integer
|
||||
raises OutOfRange;
|
||||
---Purpose : raises exception If num <= 0 or num > NbEdges()
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_Loop
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class Loop.
|
||||
--
|
||||
-- Reminder : A Loop instance is defined by :
|
||||
-- either an edge, an orientation, and optional parameter
|
||||
-- curves or (in case of a pole) a vertex and an optional
|
||||
-- parameter space curve.
|
||||
--
|
||||
|
||||
theTypes : HArray1OfInteger;
|
||||
-- array containing the type of the edge
|
||||
|
||||
theEdges : HArray1OfIGESEntity;
|
||||
-- array of Vertex List or Edge List entity
|
||||
|
||||
theIndex : HArray1OfInteger;
|
||||
-- array of list index into Vertex or Edge List entity
|
||||
|
||||
theOrientationFlags : HArray1OfInteger;
|
||||
-- array of orientation flags
|
||||
|
||||
theNbParameterCurves : HArray1OfInteger;
|
||||
-- no. of underlying parameter space curves
|
||||
|
||||
theIsoparametricFlags : HArray1OfHArray1OfInteger;
|
||||
-- Isoparametric flags of the space curves
|
||||
|
||||
theCurves : HArray1OfHArray1OfIGESEntity
|
||||
from IGESBasic;
|
||||
-- parameter space curves corresponding to the edges
|
||||
|
||||
end Loop;
|
106
src/IGESSolid/IGESSolid_Loop.cxx
Executable file
106
src/IGESSolid/IGESSolid_Loop.cxx
Executable file
@@ -0,0 +1,106 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Loop.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
//pdn 20.04.99 CTS22655 avoid of exceptions on empty loops
|
||||
|
||||
#include <IGESSolid_Loop.ixx>
|
||||
#include <IGESSolid_EdgeList.hxx>
|
||||
#include <IGESSolid_VertexList.hxx>
|
||||
|
||||
|
||||
IGESSolid_Loop::IGESSolid_Loop () { }
|
||||
|
||||
|
||||
void IGESSolid_Loop::Init
|
||||
(const Handle(TColStd_HArray1OfInteger)& Types,
|
||||
const Handle(IGESData_HArray1OfIGESEntity)& Edges,
|
||||
const Handle(TColStd_HArray1OfInteger)& Index,
|
||||
const Handle(TColStd_HArray1OfInteger)& Orient,
|
||||
const Handle(TColStd_HArray1OfInteger)& nbParameterCurves,
|
||||
const Handle(IGESBasic_HArray1OfHArray1OfInteger)& IsoparametricFlags,
|
||||
const Handle(IGESBasic_HArray1OfHArray1OfIGESEntity)& Curves)
|
||||
{
|
||||
Standard_Integer nb = Types->Length();
|
||||
|
||||
if (Types->Lower() != 1 ||
|
||||
Edges->Lower() != 1 || nb != Edges->Length() ||
|
||||
Index->Lower() != 1 || nb != Index->Length() ||
|
||||
Orient->Lower() != 1 || nb != Orient->Length() ||
|
||||
nbParameterCurves->Lower() != 1 || nb != nbParameterCurves->Length() ||
|
||||
IsoparametricFlags->Lower() != 1 || nb != IsoparametricFlags->Length() ||
|
||||
Curves->Lower() != 1 || nb != Curves->Length() )
|
||||
Standard_DimensionError::Raise("IGESSolid_Loop : Init");
|
||||
|
||||
theTypes = Types;
|
||||
theEdges = Edges;
|
||||
theIndex = Index;
|
||||
theOrientationFlags = Orient;
|
||||
theNbParameterCurves = nbParameterCurves;
|
||||
theIsoparametricFlags = IsoparametricFlags;
|
||||
theCurves = Curves;
|
||||
|
||||
InitTypeAndForm(508,1);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_Loop::IsBound () const
|
||||
{ return (FormNumber() == 1); }
|
||||
|
||||
void IGESSolid_Loop::SetBound (const Standard_Boolean bound)
|
||||
{ InitTypeAndForm(508, (bound ? 1 : 0)); }
|
||||
|
||||
|
||||
Standard_Integer IGESSolid_Loop::NbEdges () const
|
||||
{
|
||||
//pdn 20.04.99 CTS22655 to avoid exceptions on empty loops
|
||||
if(theEdges.IsNull()) return 0;
|
||||
return theEdges->Length();
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_Loop::EdgeType (const Standard_Integer Index) const
|
||||
{
|
||||
return theTypes->Value(Index);
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_Loop::Edge
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
return theEdges->Value(Index);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_Loop::Orientation (const Standard_Integer Index) const
|
||||
{
|
||||
return (theOrientationFlags->Value(Index) != 0);
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_Loop::NbParameterCurves
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
return theNbParameterCurves->Value(Index);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_Loop::IsIsoparametric
|
||||
(const Standard_Integer EdgeIndex, const Standard_Integer CurveIndex) const
|
||||
{
|
||||
if (!theIsoparametricFlags->Value(EdgeIndex).IsNull()) return
|
||||
(theIsoparametricFlags->Value(EdgeIndex)->Value(CurveIndex) != 0);
|
||||
else return Standard_False; // faut bien dire qq chose
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_Loop::ParametricCurve
|
||||
(const Standard_Integer EdgeIndex, const Standard_Integer CurveIndex) const
|
||||
{
|
||||
Handle(IGESData_IGESEntity) acurve; // par defaut sera nulle
|
||||
if (!theCurves->Value(EdgeIndex).IsNull()) acurve =
|
||||
theCurves->Value(EdgeIndex)->Value(CurveIndex);
|
||||
return acurve;
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_Loop::ListIndex (const Standard_Integer num) const
|
||||
{
|
||||
return theIndex->Value(num);
|
||||
}
|
85
src/IGESSolid/IGESSolid_ManifoldSolid.cdl
Executable file
85
src/IGESSolid/IGESSolid_ManifoldSolid.cdl
Executable file
@@ -0,0 +1,85 @@
|
||||
--
|
||||
-- File : ManifoldSolid.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class ManifoldSolid from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines ManifoldSolid, Type <186> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- A manifold solid is a bounded, closed, and finite volume
|
||||
-- in three dimensional Euclidean space
|
||||
|
||||
uses
|
||||
|
||||
Shell from IGESSolid,
|
||||
HArray1OfShell from IGESSolid,
|
||||
HArray1OfInteger from TColStd
|
||||
|
||||
raises DimensionMismatch, OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable ManifoldSolid;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aShell : Shell;
|
||||
shellflag : Boolean;
|
||||
voidShells : HArray1OfShell;
|
||||
voidShellFlags : HArray1OfInteger)
|
||||
raises DimensionMismatch;
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- ManifoldSolid
|
||||
-- - aShell : pointer to the shell
|
||||
-- - shellflag : orientation flag of shell
|
||||
-- - voidShells : the void shells
|
||||
-- - voidShellFlags : orientation of the void shells
|
||||
-- raises exception if length of voidShells and voidShellFlags
|
||||
-- do not match
|
||||
|
||||
Shell(me) returns Shell;
|
||||
---Purpose : returns the Shell entity which is being referred
|
||||
|
||||
OrientationFlag(me) returns Boolean;
|
||||
---Purpose : returns the orientation flag of the shell
|
||||
|
||||
NbVoidShells(me) returns Integer;
|
||||
---Purpose : returns the number of void shells
|
||||
|
||||
VoidShell(me; Index : Integer) returns Shell
|
||||
raises OutOfRange;
|
||||
---Purpose : returns Index'th void shell.
|
||||
-- raises exception if Index <= 0 or Index > NbVoidShells()
|
||||
|
||||
VoidOrientationFlag(me; Index : Integer) returns Boolean
|
||||
raises OutOfRange;
|
||||
---Purpose : returns Index'th orientation flag.
|
||||
-- raises exception if Index <= 0 or Index > NbVoidShells()
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_ManifoldSolid
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class ManifoldSolid.
|
||||
--
|
||||
-- Reminder : A ManifoldSolid instance is defined by :
|
||||
-- a shell bounded by more shells
|
||||
|
||||
theShell : Shell;
|
||||
|
||||
theOrientationFlag : Boolean;
|
||||
-- the orientation flag of the shell w.r.t. underlying face
|
||||
-- (True = agrees)
|
||||
|
||||
theVoidShells : HArray1OfShell;
|
||||
|
||||
theOrientFlags : HArray1OfInteger;
|
||||
|
||||
end ManifoldSolid;
|
62
src/IGESSolid/IGESSolid_ManifoldSolid.cxx
Executable file
62
src/IGESSolid/IGESSolid_ManifoldSolid.cxx
Executable file
@@ -0,0 +1,62 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_ManifoldSolid.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ManifoldSolid.ixx>
|
||||
|
||||
|
||||
IGESSolid_ManifoldSolid::IGESSolid_ManifoldSolid () { }
|
||||
|
||||
|
||||
void IGESSolid_ManifoldSolid::Init
|
||||
(const Handle(IGESSolid_Shell)& aShell,
|
||||
const Standard_Boolean Shellflag,
|
||||
const Handle(IGESSolid_HArray1OfShell)& VoidShells,
|
||||
const Handle(TColStd_HArray1OfInteger)& VoidShellFlags)
|
||||
{
|
||||
if (!VoidShells.IsNull())
|
||||
if (VoidShells->Lower() != 1 || VoidShellFlags->Lower() != 1 ||
|
||||
VoidShells->Length() != VoidShellFlags->Length())
|
||||
Standard_DimensionError::Raise("IGESSolid_ManifoldSolid : Init");
|
||||
|
||||
theShell = aShell;
|
||||
theOrientationFlag = Shellflag;
|
||||
theVoidShells = VoidShells;
|
||||
theOrientFlags = VoidShellFlags;
|
||||
InitTypeAndForm(186,0);
|
||||
}
|
||||
|
||||
Handle(IGESSolid_Shell) IGESSolid_ManifoldSolid::Shell () const
|
||||
{
|
||||
return theShell;
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_ManifoldSolid::OrientationFlag () const
|
||||
{
|
||||
return theOrientationFlag;
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_ManifoldSolid::NbVoidShells () const
|
||||
{
|
||||
return (theVoidShells.IsNull() ? 0 : theVoidShells->Length());
|
||||
}
|
||||
|
||||
Handle(IGESSolid_Shell) IGESSolid_ManifoldSolid::VoidShell
|
||||
(const Standard_Integer index) const
|
||||
{
|
||||
Handle(IGESSolid_Shell) ashell; // par defaut sera Null
|
||||
if (!theVoidShells.IsNull()) ashell = theVoidShells->Value(index);
|
||||
return ashell;
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_ManifoldSolid::VoidOrientationFlag
|
||||
(const Standard_Integer index) const
|
||||
{
|
||||
if (!theOrientFlags.IsNull()) return (theOrientFlags->Value(index) != 0);
|
||||
else return Standard_False; // pour retourner qqchose ...
|
||||
}
|
74
src/IGESSolid/IGESSolid_PlaneSurface.cdl
Executable file
74
src/IGESSolid/IGESSolid_PlaneSurface.cdl
Executable file
@@ -0,0 +1,74 @@
|
||||
--
|
||||
-- File : PlaneSurface.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class PlaneSurface from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines PlaneSurface, Type <190> Form Number <0,1>
|
||||
-- in package IGESSolid
|
||||
-- A plane surface entity is defined by a point on the
|
||||
-- surface and a normal to it.
|
||||
|
||||
uses
|
||||
|
||||
Point from IGESGeom,
|
||||
Direction from IGESGeom
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable PlaneSurface;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aLocation : Point;
|
||||
aNormal : Direction;
|
||||
refdir : Direction);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- PlaneSurface
|
||||
-- - aLocation : the point on the surface
|
||||
-- - aNormal : the surface normal direction
|
||||
-- - refdir : the reference direction (default NULL) for
|
||||
-- unparameterised curves
|
||||
|
||||
LocationPoint(me) returns Point;
|
||||
---Purpose : returns the point on the surface
|
||||
|
||||
Normal(me) returns Direction;
|
||||
---Purpose : returns the normal to the surface
|
||||
|
||||
ReferenceDir(me) returns Direction;
|
||||
---Purpose : returns the reference direction (for parameterised curve)
|
||||
-- returns NULL for unparameterised curve
|
||||
|
||||
IsParametrised(me) returns Boolean;
|
||||
---Purpose : returns True if parameterised, else False
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_PlaneSurface
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class PlaneSurface.
|
||||
--
|
||||
-- Reminder : A PlaneSurface instance is defined by :
|
||||
-- A plane surface entity is defined by a point(Location) on the
|
||||
-- surface and a normal(Normal) to it. In case of parameterised
|
||||
-- surface a reference direction (RefDir) is also given.
|
||||
--
|
||||
|
||||
theLocationPoint : Point;
|
||||
-- the point on the surface
|
||||
|
||||
theNormal : Direction;
|
||||
-- the normal to the surface
|
||||
|
||||
theRefDir : Direction;
|
||||
-- the reference direction of the surface
|
||||
|
||||
end PlaneSurface;
|
45
src/IGESSolid/IGESSolid_PlaneSurface.cxx
Executable file
45
src/IGESSolid/IGESSolid_PlaneSurface.cxx
Executable file
@@ -0,0 +1,45 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_PlaneSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_PlaneSurface.ixx>
|
||||
|
||||
|
||||
IGESSolid_PlaneSurface::IGESSolid_PlaneSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_PlaneSurface::Init
|
||||
(const Handle(IGESGeom_Point)& aLocation,
|
||||
const Handle(IGESGeom_Direction)& aNormal,
|
||||
const Handle(IGESGeom_Direction)& Refdir)
|
||||
{
|
||||
theLocationPoint = aLocation;
|
||||
theNormal = aNormal;
|
||||
theRefDir = Refdir;
|
||||
InitTypeAndForm(190, (theRefDir.IsNull() ? 0 : 1));
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Point) IGESSolid_PlaneSurface::LocationPoint () const
|
||||
{
|
||||
return theLocationPoint;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_PlaneSurface::Normal () const
|
||||
{
|
||||
return theNormal;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_PlaneSurface::ReferenceDir () const
|
||||
{
|
||||
return theRefDir;
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_PlaneSurface::IsParametrised () const
|
||||
{
|
||||
return (!theRefDir.IsNull());
|
||||
}
|
33
src/IGESSolid/IGESSolid_Protocol.cdl
Executable file
33
src/IGESSolid/IGESSolid_Protocol.cdl
Executable file
@@ -0,0 +1,33 @@
|
||||
-- File: IGESSolid_Protocol.cdl
|
||||
-- Created: Wed May 5 11:30:30 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class Protocol from IGESSolid inherits Protocol from IGESData
|
||||
|
||||
---Purpose : Description of Protocol for IGESSolid
|
||||
|
||||
uses Type, Protocol from Interface
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Protocol from IGESSolid;
|
||||
|
||||
NbResources (me) returns Integer is redefined;
|
||||
---Purpose : Gives the count of Resource Protocol. Here, one
|
||||
-- (Protocol from IGESGeom)
|
||||
|
||||
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;
|
104
src/IGESSolid/IGESSolid_Protocol.cxx
Executable file
104
src/IGESSolid/IGESSolid_Protocol.cxx
Executable file
@@ -0,0 +1,104 @@
|
||||
#include <IGESSolid_Protocol.ixx>
|
||||
|
||||
#include <IGESSolid_PlaneSurface.hxx>
|
||||
#include <IGESSolid_Block.hxx>
|
||||
#include <IGESSolid_RightAngularWedge.hxx>
|
||||
#include <IGESSolid_BooleanTree.hxx>
|
||||
#include <IGESSolid_SelectedComponent.hxx>
|
||||
#include <IGESSolid_ConeFrustum.hxx>
|
||||
#include <IGESSolid_Shell.hxx>
|
||||
#include <IGESSolid_ConicalSurface.hxx>
|
||||
#include <IGESSolid_SolidAssembly.hxx>
|
||||
#include <IGESSolid_Cylinder.hxx>
|
||||
#include <IGESSolid_SolidInstance.hxx>
|
||||
#include <IGESSolid_CylindricalSurface.hxx>
|
||||
#include <IGESSolid_SolidOfLinearExtrusion.hxx>
|
||||
#include <IGESSolid_EdgeList.hxx>
|
||||
#include <IGESSolid_SolidOfRevolution.hxx>
|
||||
#include <IGESSolid_Ellipsoid.hxx>
|
||||
#include <IGESSolid_Sphere.hxx>
|
||||
#include <IGESSolid_Face.hxx>
|
||||
#include <IGESSolid_SphericalSurface.hxx>
|
||||
#include <IGESSolid_ToroidalSurface.hxx>
|
||||
#include <IGESSolid_Loop.hxx>
|
||||
#include <IGESSolid_Torus.hxx>
|
||||
#include <IGESSolid_ManifoldSolid.hxx>
|
||||
#include <IGESSolid_VertexList.hxx>
|
||||
|
||||
#include <IGESGeom.hxx>
|
||||
#include <IGESGeom_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,atype24;
|
||||
|
||||
IGESSolid_Protocol::IGESSolid_Protocol ()
|
||||
{
|
||||
if (deja) return; deja = 1;
|
||||
atype01 = STANDARD_TYPE(IGESSolid_Block);
|
||||
atype02 = STANDARD_TYPE(IGESSolid_BooleanTree);
|
||||
atype03 = STANDARD_TYPE(IGESSolid_ConeFrustum);
|
||||
atype04 = STANDARD_TYPE(IGESSolid_ConicalSurface);
|
||||
atype05 = STANDARD_TYPE(IGESSolid_Cylinder);
|
||||
atype06 = STANDARD_TYPE(IGESSolid_CylindricalSurface);
|
||||
atype07 = STANDARD_TYPE(IGESSolid_EdgeList);
|
||||
atype08 = STANDARD_TYPE(IGESSolid_Ellipsoid);
|
||||
atype09 = STANDARD_TYPE(IGESSolid_Face);
|
||||
atype10 = STANDARD_TYPE(IGESSolid_Loop);
|
||||
atype11 = STANDARD_TYPE(IGESSolid_ManifoldSolid);
|
||||
atype12 = STANDARD_TYPE(IGESSolid_PlaneSurface);
|
||||
atype13 = STANDARD_TYPE(IGESSolid_RightAngularWedge);
|
||||
atype14 = STANDARD_TYPE(IGESSolid_SelectedComponent);
|
||||
atype15 = STANDARD_TYPE(IGESSolid_Shell);
|
||||
atype16 = STANDARD_TYPE(IGESSolid_SolidAssembly);
|
||||
atype17 = STANDARD_TYPE(IGESSolid_SolidInstance);
|
||||
atype18 = STANDARD_TYPE(IGESSolid_SolidOfLinearExtrusion);
|
||||
atype19 = STANDARD_TYPE(IGESSolid_SolidOfRevolution);
|
||||
atype20 = STANDARD_TYPE(IGESSolid_Sphere);
|
||||
atype21 = STANDARD_TYPE(IGESSolid_SphericalSurface);
|
||||
atype22 = STANDARD_TYPE(IGESSolid_ToroidalSurface);
|
||||
atype23 = STANDARD_TYPE(IGESSolid_Torus);
|
||||
atype24 = STANDARD_TYPE(IGESSolid_VertexList);
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_Protocol::NbResources () const
|
||||
{ return 1; }
|
||||
|
||||
Handle(Interface_Protocol) IGESSolid_Protocol::Resource
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
Handle(Interface_Protocol) res = IGESGeom::Protocol();;
|
||||
return res;
|
||||
}
|
||||
|
||||
Standard_Integer IGESSolid_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;
|
||||
else if (atype == atype24) return 24;
|
||||
return 0;
|
||||
}
|
37
src/IGESSolid/IGESSolid_ReadWriteModule.cdl
Executable file
37
src/IGESSolid/IGESSolid_ReadWriteModule.cdl
Executable file
@@ -0,0 +1,37 @@
|
||||
-- File: IGESSolid_ReadWriteModule.cdl
|
||||
-- Created: Mon Sep 6 19:22:12 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
class ReadWriteModule from IGESSolid inherits ReadWriteModule from IGESData
|
||||
|
||||
---Purpose : Defines Solid File Access Module for IGESSolid (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 IGESSolid;
|
||||
---Purpose : Creates a ReadWriteModule & puts it into ReaderLib & WriterLib
|
||||
|
||||
CaseIGES (me; typenum, formnum : Integer) returns Integer;
|
||||
---Purpose : Defines Case Numbers for Entities of IGESSolid
|
||||
|
||||
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 IGESSolid
|
||||
|
||||
WriteOwnParams (me; CN : Integer; ent : IGESEntity;
|
||||
IW : in out IGESWriter);
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
end ReadWriteModule;
|
451
src/IGESSolid/IGESSolid_ReadWriteModule.cxx
Executable file
451
src/IGESSolid/IGESSolid_ReadWriteModule.cxx
Executable file
@@ -0,0 +1,451 @@
|
||||
#include <IGESSolid_ReadWriteModule.ixx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
#include <IGESSolid_Block.hxx>
|
||||
#include <IGESSolid_BooleanTree.hxx>
|
||||
#include <IGESSolid_ConeFrustum.hxx>
|
||||
#include <IGESSolid_ConicalSurface.hxx>
|
||||
#include <IGESSolid_Cylinder.hxx>
|
||||
#include <IGESSolid_CylindricalSurface.hxx>
|
||||
#include <IGESSolid_EdgeList.hxx>
|
||||
#include <IGESSolid_Ellipsoid.hxx>
|
||||
#include <IGESSolid_Face.hxx>
|
||||
#include <IGESSolid_Loop.hxx>
|
||||
#include <IGESSolid_ManifoldSolid.hxx>
|
||||
#include <IGESSolid_PlaneSurface.hxx>
|
||||
#include <IGESSolid_RightAngularWedge.hxx>
|
||||
#include <IGESSolid_SelectedComponent.hxx>
|
||||
#include <IGESSolid_Shell.hxx>
|
||||
#include <IGESSolid_SolidAssembly.hxx>
|
||||
#include <IGESSolid_SolidInstance.hxx>
|
||||
#include <IGESSolid_SolidOfLinearExtrusion.hxx>
|
||||
#include <IGESSolid_SolidOfRevolution.hxx>
|
||||
#include <IGESSolid_Sphere.hxx>
|
||||
#include <IGESSolid_SphericalSurface.hxx>
|
||||
#include <IGESSolid_ToroidalSurface.hxx>
|
||||
#include <IGESSolid_Torus.hxx>
|
||||
#include <IGESSolid_VertexList.hxx>
|
||||
|
||||
#include <IGESSolid_ToolBlock.hxx>
|
||||
#include <IGESSolid_ToolBooleanTree.hxx>
|
||||
#include <IGESSolid_ToolConeFrustum.hxx>
|
||||
#include <IGESSolid_ToolConicalSurface.hxx>
|
||||
#include <IGESSolid_ToolCylinder.hxx>
|
||||
#include <IGESSolid_ToolCylindricalSurface.hxx>
|
||||
#include <IGESSolid_ToolEdgeList.hxx>
|
||||
#include <IGESSolid_ToolEllipsoid.hxx>
|
||||
#include <IGESSolid_ToolFace.hxx>
|
||||
#include <IGESSolid_ToolLoop.hxx>
|
||||
#include <IGESSolid_ToolManifoldSolid.hxx>
|
||||
#include <IGESSolid_ToolPlaneSurface.hxx>
|
||||
#include <IGESSolid_ToolRightAngularWedge.hxx>
|
||||
#include <IGESSolid_ToolSelectedComponent.hxx>
|
||||
#include <IGESSolid_ToolShell.hxx>
|
||||
#include <IGESSolid_ToolSolidAssembly.hxx>
|
||||
#include <IGESSolid_ToolSolidInstance.hxx>
|
||||
#include <IGESSolid_ToolSolidOfLinearExtrusion.hxx>
|
||||
#include <IGESSolid_ToolSolidOfRevolution.hxx>
|
||||
#include <IGESSolid_ToolSphere.hxx>
|
||||
#include <IGESSolid_ToolSphericalSurface.hxx>
|
||||
#include <IGESSolid_ToolToroidalSurface.hxx>
|
||||
#include <IGESSolid_ToolTorus.hxx>
|
||||
#include <IGESSolid_ToolVertexList.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
|
||||
|
||||
|
||||
IGESSolid_ReadWriteModule::IGESSolid_ReadWriteModule () { }
|
||||
|
||||
|
||||
Standard_Integer IGESSolid_ReadWriteModule::CaseIGES
|
||||
(const Standard_Integer typenum, const Standard_Integer formnum) const
|
||||
{
|
||||
switch (typenum) {
|
||||
case 150 : return 1;
|
||||
case 152 : return 13;
|
||||
case 154 : return 5;
|
||||
case 156 : return 3;
|
||||
case 158 : return 20;
|
||||
case 160 : return 23;
|
||||
case 162 : return 19;
|
||||
case 164 : return 18;
|
||||
case 168 : return 8;
|
||||
case 180 : return 2;
|
||||
case 182 : return 14;
|
||||
case 184 : return 16;
|
||||
case 186 : return 11;
|
||||
case 190 : return 12;
|
||||
case 192 : return 6;
|
||||
case 194 : return 4;
|
||||
case 196 : return 21;
|
||||
case 198 : return 22;
|
||||
case 430 : return 17;
|
||||
case 502 : return 24;
|
||||
case 504 : return 7;
|
||||
case 508 : return 10;
|
||||
case 510 : return 9;
|
||||
case 514 : return 15;
|
||||
default : break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void IGESSolid_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(IGESSolid_Block,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBlock tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBooleanTree tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConeFrustum tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConicalSurface tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESSolid_Cylinder,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylinder tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylindricalSurface tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESSolid_EdgeList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEdgeList tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 8 : {
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEllipsoid tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 9 : {
|
||||
DeclareAndCast(IGESSolid_Face,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolFace tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 10 : {
|
||||
DeclareAndCast(IGESSolid_Loop,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolLoop tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 11 : {
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolManifoldSolid tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 12 : {
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolPlaneSurface tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 13 : {
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolRightAngularWedge tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 14 : {
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSelectedComponent tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 15 : {
|
||||
DeclareAndCast(IGESSolid_Shell,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolShell tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 16 : {
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidAssembly tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 17 : {
|
||||
DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidInstance tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 18 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfLinearExtrusion tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 19 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfRevolution tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 20 : {
|
||||
DeclareAndCast(IGESSolid_Sphere,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphere tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 21 : {
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphericalSurface tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 22 : {
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolToroidalSurface tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 23 : {
|
||||
DeclareAndCast(IGESSolid_Torus,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolTorus tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
case 24 : {
|
||||
DeclareAndCast(IGESSolid_VertexList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolVertexList tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void IGESSolid_ReadWriteModule::WriteOwnParams
|
||||
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
|
||||
IGESData_IGESWriter& IW) const
|
||||
{
|
||||
switch (CN) {
|
||||
case 1 : {
|
||||
DeclareAndCast(IGESSolid_Block,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBlock tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBooleanTree tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConeFrustum tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConicalSurface tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESSolid_Cylinder,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylinder tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylindricalSurface tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESSolid_EdgeList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEdgeList tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 8 : {
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEllipsoid tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 9 : {
|
||||
DeclareAndCast(IGESSolid_Face,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolFace tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 10 : {
|
||||
DeclareAndCast(IGESSolid_Loop,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolLoop tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 11 : {
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolManifoldSolid tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 12 : {
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolPlaneSurface tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 13 : {
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolRightAngularWedge tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 14 : {
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSelectedComponent tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 15 : {
|
||||
DeclareAndCast(IGESSolid_Shell,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolShell tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 16 : {
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidAssembly tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 17 : {
|
||||
DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidInstance tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 18 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfLinearExtrusion tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 19 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfRevolution tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 20 : {
|
||||
DeclareAndCast(IGESSolid_Sphere,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphere tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 21 : {
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphericalSurface tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 22 : {
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolToroidalSurface tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 23 : {
|
||||
DeclareAndCast(IGESSolid_Torus,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolTorus tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
case 24 : {
|
||||
DeclareAndCast(IGESSolid_VertexList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolVertexList tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
115
src/IGESSolid/IGESSolid_RightAngularWedge.cdl
Executable file
115
src/IGESSolid/IGESSolid_RightAngularWedge.cdl
Executable file
@@ -0,0 +1,115 @@
|
||||
--
|
||||
-- File : RightAngularWedge.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class RightAngularWedge from IGESSolid inherits IGESEntity
|
||||
|
||||
|
||||
---Purpose: defines RightAngularWedge, Type <152> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- A right angular wedge is a triangular/trapezoidal prism
|
||||
|
||||
uses
|
||||
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable RightAngularWedge;
|
||||
|
||||
Init (me : mutable;
|
||||
aSize : XYZ;
|
||||
lowX : Real;
|
||||
aCorner : XYZ;
|
||||
anXAxis : XYZ;
|
||||
anZAxis : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- RightAngularWedge
|
||||
-- - aSize : the lengths along the local axes
|
||||
-- - lowX : the length at the smaller X-side
|
||||
-- - aCorner : the corner point coordinates
|
||||
-- default (0,0,0)
|
||||
-- - anXAxis : the unit vector defining local X-axis
|
||||
-- default (1,0,0)
|
||||
-- - anZAxis : the unit vector defining local Z-axis
|
||||
-- default (0,0,1)
|
||||
|
||||
Size(me) returns XYZ;
|
||||
---Purpose : returns the size
|
||||
|
||||
XBigLength (me) returns Real;
|
||||
---Purpose : returns the length along the local X-axis
|
||||
|
||||
XSmallLength (me) returns Real;
|
||||
---Purpose : returns the smaller length along the local X-direction at Y=LY
|
||||
|
||||
YLength (me) returns Real;
|
||||
---Purpose : returns the length along the local Y-axis
|
||||
|
||||
ZLength (me) returns Real;
|
||||
---Purpose : returns the length along the local Z-axis
|
||||
|
||||
Corner (me) returns Pnt;
|
||||
---Purpose : returns the corner point coordinates
|
||||
|
||||
TransformedCorner (me) returns Pnt;
|
||||
---Purpose : returns the corner point coordinates after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
XAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local X-axis
|
||||
|
||||
TransformedXAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local X-axis
|
||||
-- after applying the TransformationMatrix
|
||||
|
||||
YAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local Y-axis
|
||||
-- it is got by taking the cross product of ZAxis and XAxis
|
||||
|
||||
TransformedYAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local Y-axis
|
||||
-- after applying the TransformationMatrix
|
||||
|
||||
ZAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local Z-axis
|
||||
|
||||
TransformedZAxis (me) returns Dir;
|
||||
---Purpose : returns the direction defining the local Z-axis
|
||||
-- after applying the TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_RightAngularWedge
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class RightAngularWedge.
|
||||
--
|
||||
-- Reminder : A RightAngularWedge instance is defined by :
|
||||
-- a vertex at (X1,Y1,Z1) and three orthogonal edges lying
|
||||
-- along the local +X, +Y and +Z axes. The local X and Z axes
|
||||
-- are defined by a unit vector along the axes.
|
||||
|
||||
theSize : XYZ;
|
||||
-- the lengths along the local axes
|
||||
|
||||
theXSmallLength : Real;
|
||||
-- the length of X-direction at Y = LY
|
||||
|
||||
theCorner : XYZ;
|
||||
-- the corner point coordinates
|
||||
|
||||
theXAxis : XYZ;
|
||||
-- the unit vector along the local X-direction
|
||||
|
||||
theZAxis : XYZ;
|
||||
-- the unit vector along the local Z-direction
|
||||
|
||||
end RightAngularWedge;
|
122
src/IGESSolid/IGESSolid_RightAngularWedge.cxx
Executable file
122
src/IGESSolid/IGESSolid_RightAngularWedge.cxx
Executable file
@@ -0,0 +1,122 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_RightAngularWedge.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_RightAngularWedge.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_RightAngularWedge::IGESSolid_RightAngularWedge () { }
|
||||
|
||||
|
||||
void IGESSolid_RightAngularWedge::Init
|
||||
(const gp_XYZ& aSize, const Standard_Real LowX,
|
||||
const gp_XYZ& aCorner, const gp_XYZ& anXAxis, const gp_XYZ& anZAxis)
|
||||
{
|
||||
theSize = aSize;
|
||||
theXSmallLength = LowX;
|
||||
theCorner = aCorner; // default (0,0,0)
|
||||
theXAxis = anXAxis; // default (1,0,0)
|
||||
theZAxis = anZAxis; // default (0,0,1)
|
||||
InitTypeAndForm(152,0);
|
||||
}
|
||||
|
||||
gp_XYZ IGESSolid_RightAngularWedge::Size () const
|
||||
{
|
||||
return theSize;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_RightAngularWedge::XBigLength () const
|
||||
{
|
||||
return theSize.X();
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_RightAngularWedge::XSmallLength () const
|
||||
{
|
||||
return theXSmallLength;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_RightAngularWedge::YLength () const
|
||||
{
|
||||
return theSize.Y();
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_RightAngularWedge::ZLength () const
|
||||
{
|
||||
return theSize.Z();
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_RightAngularWedge::Corner () const
|
||||
{
|
||||
return gp_Pnt(theCorner);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_RightAngularWedge::TransformedCorner () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theCorner);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theCorner;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_RightAngularWedge::XAxis () const
|
||||
{
|
||||
return gp_Dir(theXAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_RightAngularWedge::TransformedXAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theXAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theXAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_RightAngularWedge::YAxis () const
|
||||
{
|
||||
return gp_Dir(theXAxis ^ theZAxis); // ^ overloaded
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_RightAngularWedge::TransformedYAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theXAxis ^ theZAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theXAxis ^ theZAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_RightAngularWedge::ZAxis () const
|
||||
{
|
||||
return gp_Dir(theZAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_RightAngularWedge::TransformedZAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theZAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theZAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
64
src/IGESSolid/IGESSolid_SelectedComponent.cdl
Executable file
64
src/IGESSolid/IGESSolid_SelectedComponent.cdl
Executable file
@@ -0,0 +1,64 @@
|
||||
--
|
||||
-- File : SelectedComponent.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class SelectedComponent from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines SelectedComponent, Type <182> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- The Selected Component entity provides a means of
|
||||
-- selecting one component of a disjoint CSG solid
|
||||
|
||||
uses
|
||||
|
||||
BooleanTree from IGESSolid,
|
||||
XYZ from gp,
|
||||
Pnt from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SelectedComponent;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
anEntity : BooleanTree;
|
||||
selectPnt : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- SelectedComponent
|
||||
-- - anEntity : the Boolean tree entity
|
||||
-- - selectPnt : Point in or on the desired component
|
||||
|
||||
Component(me) returns BooleanTree;
|
||||
---Purpose : returns the Boolean tree entity
|
||||
|
||||
SelectPoint(me) returns Pnt;
|
||||
---Purpose : returns the point on/in the selected component
|
||||
|
||||
TransformedSelectPoint(me) returns Pnt;
|
||||
---Purpose : returns the point on/in the selected component
|
||||
-- after applying TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_SelectedComponent
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class SelectedComponent.
|
||||
--
|
||||
-- Reminder : A SelectedComponent instance is defined by :
|
||||
-- a pointer to the Boolean Tree entity(Entity) and the X, Y
|
||||
-- and Z components (X,Y,Z) of a selected point.
|
||||
|
||||
theEntity : BooleanTree;
|
||||
-- the desired boolean tree entity
|
||||
|
||||
theSelectPoint : XYZ;
|
||||
-- the X, Y and Z coordinates of the point
|
||||
|
||||
end SelectedComponent;
|
44
src/IGESSolid/IGESSolid_SelectedComponent.cxx
Executable file
44
src/IGESSolid/IGESSolid_SelectedComponent.cxx
Executable file
@@ -0,0 +1,44 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SelectedComponent.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_SelectedComponent.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_SelectedComponent::IGESSolid_SelectedComponent () { }
|
||||
|
||||
|
||||
void IGESSolid_SelectedComponent::Init
|
||||
(const Handle(IGESSolid_BooleanTree)& anEntity, const gp_XYZ& SelectPnt)
|
||||
{
|
||||
theEntity = anEntity;
|
||||
theSelectPoint = SelectPnt;
|
||||
InitTypeAndForm(182,0);
|
||||
}
|
||||
|
||||
Handle(IGESSolid_BooleanTree) IGESSolid_SelectedComponent::Component () const
|
||||
{
|
||||
return theEntity;
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_SelectedComponent::SelectPoint () const
|
||||
{
|
||||
return gp_Pnt(theSelectPoint);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_SelectedComponent::TransformedSelectPoint () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theSelectPoint);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theSelectPoint;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
81
src/IGESSolid/IGESSolid_Shell.cdl
Executable file
81
src/IGESSolid/IGESSolid_Shell.cdl
Executable file
@@ -0,0 +1,81 @@
|
||||
--
|
||||
-- File : Shell.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class Shell from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines Shell, Type <514> Form Number <1>
|
||||
-- in package IGESSolid
|
||||
-- Shell entity is a connected entity of dimensionality 2
|
||||
-- which divides R3 into two arcwise connected open subsets,
|
||||
-- one of which is finite. Inside of the shell is defined to
|
||||
-- be the finite region.
|
||||
-- From IGES-5.3, Form can be <1> for Closed or <2> for Open
|
||||
|
||||
uses
|
||||
|
||||
Face from IGESSolid,
|
||||
HArray1OfFace from IGESSolid,
|
||||
HArray1OfInteger from TColStd
|
||||
|
||||
raises DimensionMismatch, OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Shell;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
allFaces : HArray1OfFace;
|
||||
allOrient : HArray1OfInteger)
|
||||
raises DimensionMismatch;
|
||||
---Purpose : This method is used to set the fields of the class Shell
|
||||
-- - allFaces : the faces comprising the shell
|
||||
-- - allOrient : the orientation flags of the shell
|
||||
-- raises exception if length of allFaces & allOrient do not match
|
||||
|
||||
IsClosed (me) returns Boolean;
|
||||
---Purpose : Tells if a Shell is Closed, i.e. if its FormNumber is 1
|
||||
-- (this is the default)
|
||||
|
||||
SetClosed (me : mutable; closed : Boolean);
|
||||
---Purpose : Sets or Unsets the Closed status (FormNumber = 1 else 2)
|
||||
|
||||
NbFaces (me) returns Integer;
|
||||
---Purpose : returns the number of the face entities in the shell
|
||||
|
||||
Face (me; Index : Integer) returns Face
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the Index'th face entity of the shell
|
||||
-- raises exception if Index <= 0 or Index > NbFaces()
|
||||
|
||||
Orientation (me; Index : Integer) returns Boolean
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the orientation of Index'th face w.r.t the direction of
|
||||
-- the underlying surface
|
||||
-- raises exception if Index <= 0 or Index > NbFaces()
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_Shell
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class Shell.
|
||||
--
|
||||
-- Reminder : A Shell instance is defined by :
|
||||
-- a number of face entities defined with their orientation
|
||||
-- with respect to the direction of the underlying surface
|
||||
|
||||
theFaces : HArray1OfFace;
|
||||
-- the faces comprising the shell
|
||||
|
||||
theOrientation : HArray1OfInteger;
|
||||
-- the orientation of the corresponding face
|
||||
|
||||
end Shell;
|
50
src/IGESSolid/IGESSolid_Shell.cxx
Executable file
50
src/IGESSolid/IGESSolid_Shell.cxx
Executable file
@@ -0,0 +1,50 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Shell.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_Shell.ixx>
|
||||
|
||||
|
||||
IGESSolid_Shell::IGESSolid_Shell () { }
|
||||
|
||||
|
||||
void IGESSolid_Shell::Init
|
||||
(const Handle(IGESSolid_HArray1OfFace)& Faces,
|
||||
const Handle(TColStd_HArray1OfInteger)& Orient)
|
||||
{
|
||||
if (Faces->Lower() != 1 || Orient->Lower() != 1 ||
|
||||
Faces->Length() != Orient->Length())
|
||||
Standard_DimensionError::Raise("IGESSolid_Shell : Init");
|
||||
|
||||
theFaces = Faces;
|
||||
theOrientation = Orient;
|
||||
InitTypeAndForm(514,1);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_Shell::IsClosed () const
|
||||
{ return (FormNumber() == 1); }
|
||||
|
||||
void IGESSolid_Shell::SetClosed (const Standard_Boolean closed)
|
||||
{ InitTypeAndForm(514, (closed ? 1 : 2)); }
|
||||
|
||||
|
||||
Standard_Integer IGESSolid_Shell::NbFaces () const
|
||||
{
|
||||
return theFaces->Length();
|
||||
}
|
||||
|
||||
Handle(IGESSolid_Face) IGESSolid_Shell::Face (const Standard_Integer Index) const
|
||||
{
|
||||
return theFaces->Value(Index);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_Shell::Orientation
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
return (theOrientation->Value(Index) != 0);
|
||||
}
|
84
src/IGESSolid/IGESSolid_SolidAssembly.cdl
Executable file
84
src/IGESSolid/IGESSolid_SolidAssembly.cdl
Executable file
@@ -0,0 +1,84 @@
|
||||
--
|
||||
-- File : SolidAssembly.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class SolidAssembly from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines SolidAssembly, Type <184> Form <0>
|
||||
-- in package IGESSolid
|
||||
-- Solid assembly is a collection of items which possess a
|
||||
-- shared fixed geometric relationship.
|
||||
--
|
||||
-- From IGES-5.3, From 1 says that at least one item is a Brep
|
||||
-- else all are Primitives, Boolean Trees, Solid Instances or
|
||||
-- other Assemblies
|
||||
|
||||
uses
|
||||
|
||||
HArray1OfIGESEntity from IGESData,
|
||||
TransformationMatrix from IGESGeom,
|
||||
HArray1OfTransformationMatrix from IGESGeom
|
||||
|
||||
raises DimensionMismatch, OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SolidAssembly;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
allItems : HArray1OfIGESEntity;
|
||||
allMatrices : HArray1OfTransformationMatrix)
|
||||
raises DimensionMismatch;
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- SolidAssembly
|
||||
-- - allItems : the collection of items
|
||||
-- - allMatrices : transformation matrices corresponding to each
|
||||
-- item
|
||||
-- raises exception if the length of allItems & allMatrices
|
||||
-- do not match
|
||||
|
||||
HasBrep (me) returns Boolean;
|
||||
---Purpose : Tells if at least one item is a Brep, from FormNumber
|
||||
|
||||
SetBrep (me : mutable; hasbrep : Boolean);
|
||||
---Purpose : Sets or Unsets the status "HasBrep" from FormNumber
|
||||
-- Default is False
|
||||
|
||||
NbItems (me) returns Integer;
|
||||
---Purpose : returns the number of items in the collection
|
||||
|
||||
Item (me; Index : Integer) returns IGESEntity
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the Index'th item
|
||||
-- raises exception if Index <= 0 or Index > NbItems()
|
||||
|
||||
TransfMatrix (me; Index : Integer) returns TransformationMatrix
|
||||
raises OutOfRange;
|
||||
---Purpose : returns the transformation matrix of the Index'th item
|
||||
-- raises exception if Index <= 0 or Index > NbItems()
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_SolidAssembly
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class SolidAssembly.
|
||||
--
|
||||
-- Reminder : A SolidAssembly instance is defined by :
|
||||
-- a collection of items (Items) and transformation matrix
|
||||
-- entities (Matrices)
|
||||
|
||||
theItems : HArray1OfIGESEntity;
|
||||
-- the collection of items
|
||||
|
||||
theMatrices : HArray1OfTransformationMatrix from IGESGeom;
|
||||
-- the transformation matrices
|
||||
|
||||
end SolidAssembly;
|
51
src/IGESSolid/IGESSolid_SolidAssembly.cxx
Executable file
51
src/IGESSolid/IGESSolid_SolidAssembly.cxx
Executable file
@@ -0,0 +1,51 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidAssembly.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_SolidAssembly.ixx>
|
||||
|
||||
|
||||
IGESSolid_SolidAssembly::IGESSolid_SolidAssembly () { }
|
||||
|
||||
|
||||
void IGESSolid_SolidAssembly::Init
|
||||
(const Handle(IGESData_HArray1OfIGESEntity)& Items,
|
||||
const Handle(IGESGeom_HArray1OfTransformationMatrix)& Matrices)
|
||||
{
|
||||
if (Items->Lower() != 1 || Matrices->Lower() != 1 ||
|
||||
Items->Length() != Matrices->Length())
|
||||
Standard_DimensionError::Raise("IGESSolid_SolidAssembly : Init");
|
||||
|
||||
theItems = Items;
|
||||
theMatrices = Matrices;
|
||||
InitTypeAndForm(184,0);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_SolidAssembly::HasBrep () const
|
||||
{ return (FormNumber() == 1); }
|
||||
|
||||
void IGESSolid_SolidAssembly::SetBrep (const Standard_Boolean hasbrep)
|
||||
{ InitTypeAndForm(184, (hasbrep ? 1 : 0)); }
|
||||
|
||||
|
||||
Standard_Integer IGESSolid_SolidAssembly::NbItems () const
|
||||
{
|
||||
return theItems->Length();
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_SolidAssembly::Item
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
return theItems->Value(Index);
|
||||
}
|
||||
|
||||
Handle(IGESGeom_TransformationMatrix) IGESSolid_SolidAssembly::TransfMatrix
|
||||
(const Standard_Integer Index) const
|
||||
{
|
||||
return theMatrices->Value(Index);
|
||||
}
|
59
src/IGESSolid/IGESSolid_SolidInstance.cdl
Executable file
59
src/IGESSolid/IGESSolid_SolidInstance.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
--
|
||||
-- File : SolidInstance.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class SolidInstance from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines SolidInstance, Type <430> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- This provides a mechanism for replicating a solid
|
||||
-- representation.
|
||||
--
|
||||
-- From IGES-5.3, Form may be <1> for a BREP
|
||||
-- Else it is for a Boolean Tree, Primitive, other Solid Inst.
|
||||
|
||||
uses Integer -- no one specific type
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SolidInstance;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
anEntity : IGESEntity);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- SolidInstance
|
||||
-- - anEntity : the entity corresponding to the solid
|
||||
|
||||
IsBrep (me) returns Boolean;
|
||||
---Purpose : Tells if a SolidInstance is for a BREP
|
||||
-- Default is False
|
||||
|
||||
SetBrep (me : mutable; brep : Boolean);
|
||||
---Purpose : Sets or unsets the Brep status (FormNumber = 1 else 0)
|
||||
|
||||
Entity(me) returns IGESEntity;
|
||||
---Purpose : returns the solid entity
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_SolidInstance
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class SolidInstance.
|
||||
--
|
||||
-- Reminder : A SolidInstance instance is defined by :
|
||||
-- a pointer to a solid entity
|
||||
--
|
||||
|
||||
theEntity : IGESEntity;
|
||||
-- the solid entity
|
||||
|
||||
end SolidInstance;
|
32
src/IGESSolid/IGESSolid_SolidInstance.cxx
Executable file
32
src/IGESSolid/IGESSolid_SolidInstance.cxx
Executable file
@@ -0,0 +1,32 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidInstance.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_SolidInstance.ixx>
|
||||
|
||||
|
||||
IGESSolid_SolidInstance::IGESSolid_SolidInstance () { }
|
||||
|
||||
|
||||
void IGESSolid_SolidInstance::Init
|
||||
(const Handle(IGESData_IGESEntity)& anEntity)
|
||||
{
|
||||
theEntity = anEntity;
|
||||
InitTypeAndForm(430,0);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_SolidInstance::IsBrep () const
|
||||
{ return (FormNumber() == 1); }
|
||||
|
||||
void IGESSolid_SolidInstance::SetBrep (const Standard_Boolean brep)
|
||||
{ InitTypeAndForm(430, (brep ? 1 : 0)); }
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_SolidInstance::Entity () const
|
||||
{
|
||||
return theEntity;
|
||||
}
|
72
src/IGESSolid/IGESSolid_SolidOfLinearExtrusion.cdl
Executable file
72
src/IGESSolid/IGESSolid_SolidOfLinearExtrusion.cdl
Executable file
@@ -0,0 +1,72 @@
|
||||
--
|
||||
-- File : SolidOfLinearExtrusion.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class SolidOfLinearExtrusion from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines SolidOfLinearExtrusion, Type <164> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- Solid of linear extrusion is defined by translatin an
|
||||
-- area determined by a planar curve
|
||||
|
||||
uses
|
||||
|
||||
Dir from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SolidOfLinearExtrusion;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aCurve : IGESEntity;
|
||||
aLength : Real;
|
||||
aDirection : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- SolidOfLinearExtrusion
|
||||
-- - aCurve : the planar curve that is to be translated
|
||||
-- - aLength : the length of extrusion
|
||||
-- - aDirection : the vector specifying the direction of extrusion
|
||||
-- default (0,0,1)
|
||||
|
||||
Curve (me) returns IGESEntity;
|
||||
---Purpose : returns the planar curve that is to be translated
|
||||
|
||||
ExtrusionLength (me) returns Real;
|
||||
---Purpose : returns the Extrusion Length
|
||||
|
||||
ExtrusionDirection (me) returns Dir;
|
||||
---Purpose : returns the Extrusion direction
|
||||
|
||||
TransformedExtrusionDirection (me) returns Dir;
|
||||
---Purpose : returns ExtrusionDirection after applying TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_SolidOfLinearExtrusion
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class SolidOfLinearExtrusion.
|
||||
--
|
||||
-- Reminder : A SolidOfLinearExtrusion instance is defined by :
|
||||
-- a planar curve(Curve) that is translated by a distance(Length)
|
||||
-- in the direction specified by a vector(I1,J1,K1).
|
||||
--
|
||||
|
||||
theCurve : IGESEntity;
|
||||
-- the planar curve
|
||||
|
||||
theLength : Real;
|
||||
-- the length of the extrusion
|
||||
|
||||
theDirection : XYZ;
|
||||
-- the vector defining the direction of the extrusion
|
||||
|
||||
end SolidOfLinearExtrusion;
|
53
src/IGESSolid/IGESSolid_SolidOfLinearExtrusion.cxx
Executable file
53
src/IGESSolid/IGESSolid_SolidOfLinearExtrusion.cxx
Executable file
@@ -0,0 +1,53 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidOfLinearExtrusion.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_SolidOfLinearExtrusion.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_SolidOfLinearExtrusion::IGESSolid_SolidOfLinearExtrusion () { }
|
||||
|
||||
|
||||
void IGESSolid_SolidOfLinearExtrusion::Init
|
||||
(const Handle(IGESData_IGESEntity)& aCurve,
|
||||
const Standard_Real Length, const gp_XYZ& Direction)
|
||||
{
|
||||
theCurve = aCurve;
|
||||
theLength = Length;
|
||||
theDirection = Direction; // default (0,0,1)
|
||||
InitTypeAndForm(164,0);
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_SolidOfLinearExtrusion::Curve () const
|
||||
{
|
||||
return theCurve;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_SolidOfLinearExtrusion::ExtrusionLength () const
|
||||
{
|
||||
return theLength;
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_SolidOfLinearExtrusion::ExtrusionDirection () const
|
||||
{
|
||||
return gp_Dir(theDirection);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_SolidOfLinearExtrusion::TransformedExtrusionDirection () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theDirection);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theDirection;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
97
src/IGESSolid/IGESSolid_SolidOfRevolution.cdl
Executable file
97
src/IGESSolid/IGESSolid_SolidOfRevolution.cdl
Executable file
@@ -0,0 +1,97 @@
|
||||
--
|
||||
-- File : SolidOfRevolution.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class SolidOfRevolution from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines SolidOfRevolution, Type <162> Form Number <0,1>
|
||||
-- in package IGESSolid
|
||||
-- This entity is defined by revolving the area determined
|
||||
-- by a planar curve about a specified axis through a given
|
||||
-- fraction of full rotation.
|
||||
|
||||
uses
|
||||
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SolidOfRevolution;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aCurve : IGESEntity;
|
||||
aFract : Real;
|
||||
aAxisPnt : XYZ;
|
||||
aDirection : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- SolidOfRevolution
|
||||
-- - aCurve : the curve entity that is to be revolved
|
||||
-- - aFract : the fraction of full rotation (default 1.0)
|
||||
-- - aAxisPnt : the point on the axis
|
||||
-- - aDirection : the direction of the axis
|
||||
|
||||
SetClosedToAxis (me : mutable; mode : Boolean);
|
||||
---Purpose : Sets the Curve to be by default, Closed to Axis (Form 0)
|
||||
-- if <mode> is True, Closed to Itself (Form 1) else
|
||||
|
||||
IsClosedToAxis (me) returns Boolean;
|
||||
---Purpose : Returns True if Form Number = 0
|
||||
-- if Form no is 0, then the curve is closed to axis
|
||||
-- if 1, the curve is closed to itself.
|
||||
|
||||
|
||||
Curve (me) returns IGESEntity;
|
||||
---Purpose : returns the curve entity that is to be revolved
|
||||
|
||||
Fraction (me) returns Real;
|
||||
---Purpose : returns the fraction of full rotation that the curve is to
|
||||
-- be rotated
|
||||
|
||||
AxisPoint (me) returns Pnt;
|
||||
---Purpose : returns the point on the axis
|
||||
|
||||
TransformedAxisPoint (me) returns Pnt;
|
||||
---Purpose : returns the point on the axis after applying Trans.Matrix
|
||||
|
||||
Axis (me) returns Dir;
|
||||
---Purpose : returns the direction of the axis
|
||||
|
||||
TransformedAxis (me) returns Dir;
|
||||
---Purpose : returns the direction of the axis after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_SolidOfRevolution
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class SolidOfRevolution.
|
||||
--
|
||||
-- Reminder : A SolidOfRevolution instance is defined by :
|
||||
-- the curve(Curve) rotated for a fraction (Fraction) of full
|
||||
-- rotation about an axis that is given by a point(X1,Y1,Z1) on
|
||||
-- the axis and the direction(I1,J1,K1)
|
||||
--
|
||||
|
||||
theCurve : IGESEntity;
|
||||
-- the curve that is to be rotated
|
||||
|
||||
theFraction : Real;
|
||||
-- the fraction of full rotation
|
||||
|
||||
theAxisPoint : XYZ;
|
||||
-- the coordinates of the point on the axis
|
||||
|
||||
theAxis : XYZ;
|
||||
-- the axis of rotation
|
||||
|
||||
end SolidOfRevolution;
|
82
src/IGESSolid/IGESSolid_SolidOfRevolution.cxx
Executable file
82
src/IGESSolid/IGESSolid_SolidOfRevolution.cxx
Executable file
@@ -0,0 +1,82 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidOfRevolution.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_SolidOfRevolution.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_SolidOfRevolution::IGESSolid_SolidOfRevolution () { }
|
||||
|
||||
|
||||
void IGESSolid_SolidOfRevolution::Init
|
||||
(const Handle(IGESData_IGESEntity)& aCurve, const Standard_Real Fract,
|
||||
const gp_XYZ& AxisPnt, const gp_XYZ& Direction)
|
||||
{
|
||||
theCurve = aCurve;
|
||||
theFraction = Fract; // default 1.0
|
||||
theAxisPoint = AxisPnt; // default (0,0,0)
|
||||
theAxis = Direction; // default (0,0,1)
|
||||
InitTypeAndForm(162,FormNumber());
|
||||
// Form 0 : Curve closed to Axis; Form 1 : Curve closed to itself
|
||||
}
|
||||
|
||||
void IGESSolid_SolidOfRevolution::SetClosedToAxis (const Standard_Boolean F)
|
||||
{
|
||||
InitTypeAndForm(162, (F ? 0 : 1));
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_SolidOfRevolution::IsClosedToAxis () const
|
||||
{
|
||||
return (FormNumber() == 0);
|
||||
}
|
||||
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESSolid_SolidOfRevolution::Curve () const
|
||||
{
|
||||
return theCurve;
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_SolidOfRevolution::Fraction () const
|
||||
{
|
||||
return theFraction;
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_SolidOfRevolution::AxisPoint () const
|
||||
{
|
||||
return gp_Pnt(theAxisPoint);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_SolidOfRevolution::TransformedAxisPoint () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theAxisPoint);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theAxisPoint;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_SolidOfRevolution::Axis () const
|
||||
{
|
||||
return gp_Dir(theAxis);
|
||||
}
|
||||
|
||||
gp_Dir IGESSolid_SolidOfRevolution::TransformedAxis () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Dir(theAxis);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theAxis;
|
||||
gp_GTrsf loc = Location();
|
||||
loc.SetTranslationPart(gp_XYZ(0.,0.,0.));
|
||||
loc.Transforms(tmp);
|
||||
return gp_Dir(tmp);
|
||||
}
|
||||
}
|
23
src/IGESSolid/IGESSolid_SpecificModule.cdl
Executable file
23
src/IGESSolid/IGESSolid_SpecificModule.cdl
Executable file
@@ -0,0 +1,23 @@
|
||||
-- File: IGESSolid_SpecificModule.cdl
|
||||
-- Created: Tue Sep 7 11:14:37 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class SpecificModule from IGESSolid inherits SpecificModule from IGESData
|
||||
|
||||
---Purpose : Defines Services attached to IGES Entities : Dump, for IGESSolid
|
||||
|
||||
uses Messenger from Message, IGESEntity, IGESDumper
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SpecificModule from IGESSolid;
|
||||
---Purpose : Creates a SpecificModule from IGESSolid & puts it into SpecificLib
|
||||
|
||||
OwnDump (me; CN : Integer; ent : IGESEntity;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer);
|
||||
---Purpose : Specific Dump (own parameters) for IGESSolid
|
||||
|
||||
end SpecificModule;
|
240
src/IGESSolid/IGESSolid_SpecificModule.cxx
Executable file
240
src/IGESSolid/IGESSolid_SpecificModule.cxx
Executable file
@@ -0,0 +1,240 @@
|
||||
#include <IGESSolid_SpecificModule.ixx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
#include <IGESSolid_Block.hxx>
|
||||
#include <IGESSolid_BooleanTree.hxx>
|
||||
#include <IGESSolid_ConeFrustum.hxx>
|
||||
#include <IGESSolid_ConicalSurface.hxx>
|
||||
#include <IGESSolid_Cylinder.hxx>
|
||||
#include <IGESSolid_CylindricalSurface.hxx>
|
||||
#include <IGESSolid_EdgeList.hxx>
|
||||
#include <IGESSolid_Ellipsoid.hxx>
|
||||
#include <IGESSolid_Face.hxx>
|
||||
#include <IGESSolid_Loop.hxx>
|
||||
#include <IGESSolid_ManifoldSolid.hxx>
|
||||
#include <IGESSolid_PlaneSurface.hxx>
|
||||
#include <IGESSolid_RightAngularWedge.hxx>
|
||||
#include <IGESSolid_SelectedComponent.hxx>
|
||||
#include <IGESSolid_Shell.hxx>
|
||||
#include <IGESSolid_SolidAssembly.hxx>
|
||||
#include <IGESSolid_SolidInstance.hxx>
|
||||
#include <IGESSolid_SolidOfLinearExtrusion.hxx>
|
||||
#include <IGESSolid_SolidOfRevolution.hxx>
|
||||
#include <IGESSolid_Sphere.hxx>
|
||||
#include <IGESSolid_SphericalSurface.hxx>
|
||||
#include <IGESSolid_ToroidalSurface.hxx>
|
||||
#include <IGESSolid_Torus.hxx>
|
||||
#include <IGESSolid_VertexList.hxx>
|
||||
|
||||
#include <IGESSolid_ToolBlock.hxx>
|
||||
#include <IGESSolid_ToolBooleanTree.hxx>
|
||||
#include <IGESSolid_ToolConeFrustum.hxx>
|
||||
#include <IGESSolid_ToolConicalSurface.hxx>
|
||||
#include <IGESSolid_ToolCylinder.hxx>
|
||||
#include <IGESSolid_ToolCylindricalSurface.hxx>
|
||||
#include <IGESSolid_ToolEdgeList.hxx>
|
||||
#include <IGESSolid_ToolEllipsoid.hxx>
|
||||
#include <IGESSolid_ToolFace.hxx>
|
||||
#include <IGESSolid_ToolLoop.hxx>
|
||||
#include <IGESSolid_ToolManifoldSolid.hxx>
|
||||
#include <IGESSolid_ToolPlaneSurface.hxx>
|
||||
#include <IGESSolid_ToolRightAngularWedge.hxx>
|
||||
#include <IGESSolid_ToolSelectedComponent.hxx>
|
||||
#include <IGESSolid_ToolShell.hxx>
|
||||
#include <IGESSolid_ToolSolidAssembly.hxx>
|
||||
#include <IGESSolid_ToolSolidInstance.hxx>
|
||||
#include <IGESSolid_ToolSolidOfLinearExtrusion.hxx>
|
||||
#include <IGESSolid_ToolSolidOfRevolution.hxx>
|
||||
#include <IGESSolid_ToolSphere.hxx>
|
||||
#include <IGESSolid_ToolSphericalSurface.hxx>
|
||||
#include <IGESSolid_ToolToroidalSurface.hxx>
|
||||
#include <IGESSolid_ToolTorus.hxx>
|
||||
#include <IGESSolid_ToolVertexList.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
|
||||
|
||||
|
||||
IGESSolid_SpecificModule::IGESSolid_SpecificModule() { }
|
||||
|
||||
|
||||
void IGESSolid_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(IGESSolid_Block,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBlock tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolBooleanTree tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConeFrustum tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolConicalSurface tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESSolid_Cylinder,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylinder tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolCylindricalSurface tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESSolid_EdgeList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEdgeList tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 8 : {
|
||||
DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolEllipsoid tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 9 : {
|
||||
DeclareAndCast(IGESSolid_Face,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolFace tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 10 : {
|
||||
DeclareAndCast(IGESSolid_Loop,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolLoop tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 11 : {
|
||||
DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolManifoldSolid tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 12 : {
|
||||
DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolPlaneSurface tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 13 : {
|
||||
DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolRightAngularWedge tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 14 : {
|
||||
DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSelectedComponent tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 15 : {
|
||||
DeclareAndCast(IGESSolid_Shell,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolShell tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 16 : {
|
||||
DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidAssembly tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 17 : {
|
||||
DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidInstance tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 18 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfLinearExtrusion tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 19 : {
|
||||
DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSolidOfRevolution tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 20 : {
|
||||
DeclareAndCast(IGESSolid_Sphere,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphere tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 21 : {
|
||||
DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolSphericalSurface tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 22 : {
|
||||
DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolToroidalSurface tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 23 : {
|
||||
DeclareAndCast(IGESSolid_Torus,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolTorus tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
case 24 : {
|
||||
DeclareAndCast(IGESSolid_VertexList,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
IGESSolid_ToolVertexList tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
61
src/IGESSolid/IGESSolid_Sphere.cdl
Executable file
61
src/IGESSolid/IGESSolid_Sphere.cdl
Executable file
@@ -0,0 +1,61 @@
|
||||
--
|
||||
-- File : Sphere.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class Sphere from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines Sphere, Type <158> Form Number <0>
|
||||
-- in package IGESSolid
|
||||
-- This defines a sphere with a center and radius
|
||||
|
||||
uses
|
||||
|
||||
Pnt from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Sphere;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aRadius : Real;
|
||||
aCenter : XYZ);
|
||||
---Purpose : This method is used to set the fields of the class Sphere
|
||||
-- - aRadius : the radius of the sphere
|
||||
-- - aCenter : the center point coordinates (default (0,0,0))
|
||||
|
||||
Radius (me) returns Real;
|
||||
---Purpose : returns the radius of the sphere
|
||||
|
||||
Center (me) returns Pnt;
|
||||
---Purpose : returns the center of the sphere
|
||||
|
||||
TransformedCenter (me) returns Pnt;
|
||||
---Purpose : returns the center of the sphere after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_Sphere
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class Sphere.
|
||||
--
|
||||
-- Reminder : A Sphere instance is defined by :
|
||||
-- its center (X1,Y1,Z1) and a radius (Radius) > 0
|
||||
--
|
||||
|
||||
theRadius : Real;
|
||||
-- the radius of the sphere
|
||||
|
||||
theCenter : XYZ;
|
||||
-- the center point coordinates
|
||||
|
||||
end Sphere;
|
44
src/IGESSolid/IGESSolid_Sphere.cxx
Executable file
44
src/IGESSolid/IGESSolid_Sphere.cxx
Executable file
@@ -0,0 +1,44 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Sphere.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_Sphere.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_Sphere::IGESSolid_Sphere () { }
|
||||
|
||||
|
||||
void IGESSolid_Sphere::Init
|
||||
(const Standard_Real aRadius, const gp_XYZ& aCenter)
|
||||
{
|
||||
theRadius = aRadius;
|
||||
theCenter = aCenter; // default (0,0,0)
|
||||
InitTypeAndForm(158,0);
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_Sphere::Radius () const
|
||||
{
|
||||
return theRadius;
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Sphere::Center () const
|
||||
{
|
||||
return gp_Pnt(theCenter);
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_Sphere::TransformedCenter () const
|
||||
{
|
||||
if (!HasTransf()) return gp_Pnt(theCenter);
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = theCenter;
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
90
src/IGESSolid/IGESSolid_SphericalSurface.cdl
Executable file
90
src/IGESSolid/IGESSolid_SphericalSurface.cdl
Executable file
@@ -0,0 +1,90 @@
|
||||
--
|
||||
-- File : SphericalSurface.cdl
|
||||
-- Created : Sat 9 Jan 1993
|
||||
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
|
||||
--
|
||||
---Copyright : MATRA-DATAVISION 1993
|
||||
--
|
||||
|
||||
class SphericalSurface from IGESSolid inherits IGESEntity
|
||||
|
||||
---Purpose: defines SphericalSurface, Type <196> Form Number <0,1>
|
||||
-- in package IGESSolid
|
||||
-- Spherical surface is defined by a center and radius.
|
||||
-- In case of parametrised surface an axis and a
|
||||
-- reference direction is provided.
|
||||
|
||||
uses
|
||||
|
||||
Point from IGESGeom,
|
||||
Direction from IGESGeom,
|
||||
Pnt from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SphericalSurface;
|
||||
|
||||
-- Specific Methods pertaining to the class
|
||||
|
||||
Init (me : mutable;
|
||||
aCenter : Point;
|
||||
aRadius : Real;
|
||||
anAxis : Direction;
|
||||
aRefdir : Direction);
|
||||
---Purpose : This method is used to set the fields of the class
|
||||
-- SphericalSurface
|
||||
-- - aCenter : the coordinates of the center point
|
||||
-- - aRadius : value of radius
|
||||
-- - anAxis : the direction of the axis
|
||||
-- Null in case of Unparametrised surface
|
||||
-- - aRefdir : the reference direction
|
||||
-- Null in case of Unparametrised surface
|
||||
|
||||
Center(me) returns Point;
|
||||
---Purpose : returns the center of the spherical surface
|
||||
|
||||
TransformedCenter(me) returns Pnt;
|
||||
---Purpose : returns the center of the spherical surface after applying
|
||||
-- TransformationMatrix
|
||||
|
||||
Radius(me) returns Real;
|
||||
---Purpose : returns the radius of the spherical surface
|
||||
|
||||
Axis(me) returns Direction;
|
||||
---Purpose : returns the direction of the axis (Parametrised surface)
|
||||
-- Null is returned if the surface is not parametrised
|
||||
|
||||
ReferenceDir(me) returns Direction;
|
||||
---Purpose : returns the reference direction (Parametrised surface)
|
||||
-- Null is returned if the surface is not parametrised
|
||||
|
||||
IsParametrised(me) returns Boolean;
|
||||
---Purpose : Returns True if the surface is parametrised, else False
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : IGESSolid_SphericalSurface
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to the definition
|
||||
-- of the Class SphericalSurface.
|
||||
--
|
||||
-- Reminder : A SphericalSurface instance is defined by :
|
||||
-- the center point coordinates (Center), a radius (Radius).
|
||||
-- In case of Parametrised surface, the direction of the axis
|
||||
-- (Axis) and a reference direction (RefDir) is given.
|
||||
--
|
||||
|
||||
theCenter : Point;
|
||||
-- the center of the spherical surface
|
||||
|
||||
theRadius : Real;
|
||||
-- the radius of the spherical surface
|
||||
|
||||
theAxis : Direction;
|
||||
-- the direction of the axis (Parametrised surface)
|
||||
|
||||
theRefDir : Direction;
|
||||
-- the reference direction (Parametrised surface)
|
||||
|
||||
end SphericalSurface;
|
64
src/IGESSolid/IGESSolid_SphericalSurface.cxx
Executable file
64
src/IGESSolid/IGESSolid_SphericalSurface.cxx
Executable file
@@ -0,0 +1,64 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SphericalSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_SphericalSurface.ixx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
|
||||
|
||||
IGESSolid_SphericalSurface::IGESSolid_SphericalSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_SphericalSurface::Init
|
||||
(const Handle(IGESGeom_Point)& aCenter,
|
||||
const Standard_Real aRadius,
|
||||
const Handle(IGESGeom_Direction)& anAxis,
|
||||
const Handle(IGESGeom_Direction)& aRefdir)
|
||||
{
|
||||
theCenter = aCenter;
|
||||
theRadius = aRadius;
|
||||
theAxis = anAxis;
|
||||
theRefDir = aRefdir;
|
||||
InitTypeAndForm(196, (theRefDir.IsNull() ? 0 : 1) );
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Point) IGESSolid_SphericalSurface::Center () const
|
||||
{
|
||||
return theCenter;
|
||||
}
|
||||
|
||||
gp_Pnt IGESSolid_SphericalSurface::TransformedCenter () const
|
||||
{
|
||||
if (!HasTransf()) return theCenter->Value();
|
||||
else
|
||||
{
|
||||
gp_XYZ tmp = (theCenter->Value()).XYZ();
|
||||
Location().Transforms(tmp);
|
||||
return gp_Pnt(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real IGESSolid_SphericalSurface::Radius () const
|
||||
{
|
||||
return theRadius;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_SphericalSurface::Axis () const
|
||||
{
|
||||
return theAxis;
|
||||
}
|
||||
|
||||
Handle(IGESGeom_Direction) IGESSolid_SphericalSurface::ReferenceDir () const
|
||||
{
|
||||
return theRefDir;
|
||||
}
|
||||
|
||||
Standard_Boolean IGESSolid_SphericalSurface::IsParametrised () const
|
||||
{
|
||||
return !(theRefDir.IsNull());
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolBlock.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolBlock.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolBlock.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolBlock from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Block. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Block from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolBlock;
|
||||
---Purpose : Returns a ToolBlock, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Block;
|
||||
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 : Block;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Block;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Block <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Block) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Block;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Block; entto : mutable Block;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Block;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolBlock;
|
181
src/IGESSolid/IGESSolid_ToolBlock.cxx
Executable file
181
src/IGESSolid/IGESSolid_ToolBlock.cxx
Executable file
@@ -0,0 +1,181 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Block.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolBlock.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolBlock::IGESSolid_ToolBlock () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolBlock::ReadOwnParams
|
||||
(const Handle(IGESSolid_Block)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
{
|
||||
gp_XYZ tempSize, tempCorner, tempXAxis, tempZAxis;
|
||||
Standard_Real tempreal;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadXYZ(PR.CurrentList(1, 3), "Size of Block", tempSize); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal))
|
||||
tempCorner.SetX(tempreal);
|
||||
}
|
||||
else tempCorner.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal))
|
||||
tempCorner.SetY(tempreal);
|
||||
}
|
||||
else tempCorner.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal))
|
||||
tempCorner.SetZ(tempreal);
|
||||
}
|
||||
else tempCorner.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal))
|
||||
tempXAxis.SetX(tempreal);
|
||||
}
|
||||
else tempXAxis.SetX(1.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal))
|
||||
tempXAxis.SetY(tempreal);
|
||||
}
|
||||
else tempXAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal))
|
||||
tempXAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempXAxis.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal))
|
||||
tempZAxis.SetX(tempreal);
|
||||
}
|
||||
else tempZAxis.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal))
|
||||
tempZAxis.SetY(tempreal);
|
||||
}
|
||||
else tempZAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal))
|
||||
tempZAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempZAxis.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init(tempSize, tempCorner, tempXAxis, tempZAxis);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempXAxis.IsEqual(ent->XAxis().XYZ(),eps)) PR.AddWarning
|
||||
("XAxis poorly unitary, normalized");
|
||||
if (!tempZAxis.IsEqual(ent->ZAxis().XYZ(),eps)) PR.AddWarning
|
||||
("ZAxis poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBlock::WriteOwnParams
|
||||
(const Handle(IGESSolid_Block)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Size().X());
|
||||
IW.Send(ent->Size().Y());
|
||||
IW.Send(ent->Size().Z());
|
||||
IW.Send(ent->Corner().X());
|
||||
IW.Send(ent->Corner().Y());
|
||||
IW.Send(ent->Corner().Z());
|
||||
IW.Send(ent->XAxis().X());
|
||||
IW.Send(ent->XAxis().Y());
|
||||
IW.Send(ent->XAxis().Z());
|
||||
IW.Send(ent->ZAxis().X());
|
||||
IW.Send(ent->ZAxis().Y());
|
||||
IW.Send(ent->ZAxis().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBlock::OwnShared
|
||||
(const Handle(IGESSolid_Block)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBlock::OwnCopy
|
||||
(const Handle(IGESSolid_Block)& another,
|
||||
const Handle(IGESSolid_Block)& ent, Interface_CopyTool& /* TC */) const
|
||||
{
|
||||
ent->Init(another->Size(), another->Corner().XYZ(),
|
||||
another->XAxis().XYZ(), another->ZAxis().XYZ());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolBlock::DirChecker
|
||||
(const Handle(IGESSolid_Block)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(150, 0);
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBlock::OwnCheck
|
||||
(const Handle(IGESSolid_Block)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
Standard_Real eps = 1.E-04;
|
||||
Standard_Real prosca = ent->XAxis() * ent->ZAxis();
|
||||
if (prosca < -eps || prosca > eps)
|
||||
ach->AddFail("Local Z axis : Not orthogonal to X axis");
|
||||
if (ent->Size().X() <= 0. || ent->Size().Y() <= 0. || ent->Size().Z() <= 0.)
|
||||
ach->AddFail("Size : Not positive lengths");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBlock::OwnDump
|
||||
(const Handle(IGESSolid_Block)& ent, const IGESData_IGESDumper& /* dumper */,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_Block" << endl;
|
||||
|
||||
S << "Size : ";
|
||||
IGESData_DumpXYZ(S, ent->Size());
|
||||
S << endl << "Corner : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Corner(), ent->Location());
|
||||
S << endl << "XAxis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->XAxis(), ent->VectorLocation());
|
||||
S << endl << "ZAxis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->ZAxis(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolBooleanTree.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolBooleanTree.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolBooleanTree.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolBooleanTree from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a BooleanTree. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses BooleanTree from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolBooleanTree;
|
||||
---Purpose : Returns a ToolBooleanTree, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable BooleanTree;
|
||||
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 : BooleanTree;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : BooleanTree;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a BooleanTree <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : BooleanTree) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : BooleanTree;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : BooleanTree; entto : mutable BooleanTree;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : BooleanTree;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolBooleanTree;
|
188
src/IGESSolid/IGESSolid_ToolBooleanTree.cxx
Executable file
188
src/IGESSolid/IGESSolid_ToolBooleanTree.cxx
Executable file
@@ -0,0 +1,188 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_BooleanTree.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolBooleanTree.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <IGESData_HArray1OfIGESEntity.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
IGESSolid_ToolBooleanTree::IGESSolid_ToolBooleanTree () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolBooleanTree::ReadOwnParams
|
||||
(const Handle(IGESSolid_BooleanTree)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
|
||||
Standard_Integer length, intvalue;
|
||||
Handle(IGESData_IGESEntity) entvalue;
|
||||
Handle(TColStd_HArray1OfInteger) tempOperations;
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempOperands;
|
||||
|
||||
Standard_Boolean st = PR.ReadInteger(PR.Current(), "Length of post-order notation", length);
|
||||
if (st && length > 0)
|
||||
{
|
||||
tempOperations = new TColStd_HArray1OfInteger(1,length); tempOperations->Init(0);
|
||||
tempOperands = new IGESData_HArray1OfIGESEntity(1,length);
|
||||
|
||||
// Op. 1-2 : Operands
|
||||
//st = PR.ReadEntity(IR, PR.Current(), "Operand 1", entvalue); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadEntity(IR, PR.Current(), "Operand 1", entvalue))
|
||||
tempOperands->SetValue(1, entvalue);
|
||||
|
||||
//st = PR.ReadEntity(IR, PR.Current(), "Operand 2", entvalue); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadEntity(IR, PR.Current(), "Operand 2", entvalue))
|
||||
tempOperands->SetValue(2, entvalue);
|
||||
|
||||
// Op. 3 -> length-1 : Operand or Operation
|
||||
for (Standard_Integer i = 3; i < length; i++)
|
||||
{
|
||||
Standard_Integer curnum = PR.CurrentNumber();
|
||||
PR.ReadInteger(PR.Current(), "Operation code", intvalue); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
if (intvalue < 0) {
|
||||
entvalue = PR.ParamEntity (IR,curnum);
|
||||
if (entvalue.IsNull()) PR.AddFail("Operand : incorrect reference");
|
||||
else tempOperands->SetValue(i, entvalue);
|
||||
}
|
||||
else tempOperations->SetValue(i, intvalue);
|
||||
}
|
||||
// Last Op. : Operation
|
||||
//st = PR.ReadInteger(PR.Current(), "Operation code", intvalue); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadInteger(PR.Current(), "Operation code", intvalue))
|
||||
tempOperations->SetValue(length, intvalue);
|
||||
}
|
||||
else PR.AddFail("Length of post-order : Not Positive");
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init(tempOperands, tempOperations);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBooleanTree::WriteOwnParams
|
||||
(const Handle(IGESSolid_BooleanTree)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
Standard_Integer length = ent->Length();
|
||||
|
||||
IW.Send(length);
|
||||
for (Standard_Integer i = 1; i <= length; i++)
|
||||
{
|
||||
if (ent->IsOperand(i)) IW.Send(ent->Operand(i), Standard_True);
|
||||
else IW.Send(ent->Operation(i));
|
||||
}
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBooleanTree::OwnShared
|
||||
(const Handle(IGESSolid_BooleanTree)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer length = ent->Length();
|
||||
for (Standard_Integer i = 1; i <= length; i++)
|
||||
{
|
||||
if (ent->IsOperand(i)) iter.GetOneItem(ent->Operand(i));
|
||||
}
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBooleanTree::OwnCopy
|
||||
(const Handle(IGESSolid_BooleanTree)& another,
|
||||
const Handle(IGESSolid_BooleanTree)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
Standard_Integer i;
|
||||
|
||||
Standard_Integer length = another->Length();
|
||||
Handle(TColStd_HArray1OfInteger) tempOperations =
|
||||
new TColStd_HArray1OfInteger(1, length);
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempOperands =
|
||||
new IGESData_HArray1OfIGESEntity(1, length);
|
||||
|
||||
for (i=1; i<= length; i++)
|
||||
{
|
||||
if (another->IsOperand(i)) // Operand
|
||||
{
|
||||
DeclareAndCast(IGESData_IGESEntity, new_ent,
|
||||
TC.Transferred(another->Operand(i)));
|
||||
tempOperands->SetValue(i, new_ent);
|
||||
}
|
||||
else // Operation
|
||||
tempOperations->SetValue(i, another->Operation(i));
|
||||
}
|
||||
ent->Init (tempOperands, tempOperations);
|
||||
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolBooleanTree::DirChecker
|
||||
(const Handle(IGESSolid_BooleanTree)& /*ent*/) const
|
||||
{
|
||||
IGESData_DirChecker DC(180, 0);
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.GraphicsIgnored (1);
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBooleanTree::OwnCheck
|
||||
(const Handle(IGESSolid_BooleanTree)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
Standard_Integer length = ent->Length();
|
||||
if (length <= 2)
|
||||
ach->AddFail("Length of post-order notation : Less than three");
|
||||
else {
|
||||
if (!ent->IsOperand(1)) ach->AddFail("First Item is not an Operand");
|
||||
if (!ent->IsOperand(2)) ach->AddFail("Second Item is not an Operand");
|
||||
if ( ent->IsOperand(length)) ach->AddFail("Last Item is not an Operation");
|
||||
}
|
||||
for (Standard_Integer i = 1; i <= length; i ++) {
|
||||
if (!ent->Operand(i).IsNull()) continue;
|
||||
if (ent->Operation(i) < 1 || ent->Operation(i) > 3) {
|
||||
char mess[80];
|
||||
sprintf(mess,"Item no. %d Incorrect",i);
|
||||
ach->AddFail(mess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IGESSolid_ToolBooleanTree::OwnDump
|
||||
(const Handle(IGESSolid_BooleanTree)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
Standard_Integer i, length = ent->Length();
|
||||
|
||||
S << "IGESSolid_Boolean Tree" << endl;
|
||||
|
||||
S << "Length of the post-order notation :" << length << endl;
|
||||
|
||||
if (level > 4)
|
||||
{
|
||||
S << "Post-order notation of the Boolean Tree :" << endl;
|
||||
for (i = 1; i <= length; i++)
|
||||
{
|
||||
if (ent->IsOperand(i))
|
||||
{
|
||||
S << "[" << i << "] Operand : ";
|
||||
dumper.Dump (ent->Operand(i),S, 1);
|
||||
S << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Integer opcode = ent->Operation(i);
|
||||
S << "[" << i << "] Operator : " << opcode;
|
||||
if (opcode == 1) S << " (Union)";
|
||||
else if (opcode == 2) S << " (Intersection)" << endl;
|
||||
else if (opcode == 3) S << " (Difference)" << endl;
|
||||
else S << " (incorrect value)" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
// S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolConeFrustum.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolConeFrustum.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolConeFrustum.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolConeFrustum from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a ConeFrustum. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses ConeFrustum from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolConeFrustum;
|
||||
---Purpose : Returns a ToolConeFrustum, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable ConeFrustum;
|
||||
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 : ConeFrustum;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : ConeFrustum;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a ConeFrustum <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : ConeFrustum) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : ConeFrustum;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : ConeFrustum; entto : mutable ConeFrustum;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : ConeFrustum;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolConeFrustum;
|
164
src/IGESSolid/IGESSolid_ToolConeFrustum.cxx
Executable file
164
src/IGESSolid/IGESSolid_ToolConeFrustum.cxx
Executable file
@@ -0,0 +1,164 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_ConeFrustum.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolConeFrustum.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolConeFrustum::IGESSolid_ToolConeFrustum () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolConeFrustum::ReadOwnParams
|
||||
(const Handle(IGESSolid_ConeFrustum)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Standard_Real tempHeight, tempR1, tempR2, tempreal;
|
||||
gp_XYZ tempCenter, tempAxis;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Height", tempHeight); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Larger face radius", tempR1); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
PR.ReadReal(PR.Current(), "Smaller face radius", tempR2); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
else
|
||||
tempR2 = 0.0;
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Face center (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Face center (X)", tempreal))
|
||||
tempCenter.SetX(tempreal);
|
||||
}
|
||||
else tempCenter.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Face center (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Face center (Y)", tempreal))
|
||||
tempCenter.SetY(tempreal);
|
||||
}
|
||||
else tempCenter.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Face center (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Face center (Z)", tempreal))
|
||||
tempCenter.SetZ(tempreal);
|
||||
}
|
||||
else tempCenter.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal))
|
||||
tempAxis.SetX(tempreal);
|
||||
}
|
||||
else tempAxis.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal))
|
||||
tempAxis.SetY(tempreal);
|
||||
}
|
||||
else tempAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal))
|
||||
tempAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempAxis.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init
|
||||
(tempHeight, tempR1, tempR2, tempCenter, tempAxis);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempAxis.IsEqual(ent->Axis().XYZ(),eps)) PR.AddWarning
|
||||
("Axis poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConeFrustum::WriteOwnParams
|
||||
(const Handle(IGESSolid_ConeFrustum)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Height());
|
||||
IW.Send(ent->LargerRadius());
|
||||
IW.Send(ent->SmallerRadius());
|
||||
IW.Send(ent->FaceCenter().X());
|
||||
IW.Send(ent->FaceCenter().Y());
|
||||
IW.Send(ent->FaceCenter().Z());
|
||||
IW.Send(ent->Axis().X());
|
||||
IW.Send(ent->Axis().Y());
|
||||
IW.Send(ent->Axis().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConeFrustum::OwnShared
|
||||
(const Handle(IGESSolid_ConeFrustum)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConeFrustum::OwnCopy
|
||||
(const Handle(IGESSolid_ConeFrustum)& another,
|
||||
const Handle(IGESSolid_ConeFrustum)& ent, Interface_CopyTool& /* TC */) const
|
||||
{
|
||||
ent->Init
|
||||
(another->Height(), another->LargerRadius(), another->SmallerRadius(),
|
||||
another->FaceCenter().XYZ(), another->Axis().XYZ());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolConeFrustum::DirChecker
|
||||
(const Handle(IGESSolid_ConeFrustum)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(156, 0);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConeFrustum::OwnCheck
|
||||
(const Handle(IGESSolid_ConeFrustum)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->Height() <= 0.0)
|
||||
ach->AddFail("Height : Value Not Positive");
|
||||
if (ent->LargerRadius() <= 0.0)
|
||||
ach->AddFail("Larger face radius : Value Not Positive");
|
||||
if (ent->SmallerRadius() < 0.0)
|
||||
ach->AddFail("Smaller face radius : Value Not Positive");
|
||||
if (ent->SmallerRadius() > ent->LargerRadius())
|
||||
ach->AddFail("Smaller face radius : is greater than Larger face radius");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConeFrustum::OwnDump
|
||||
(const Handle(IGESSolid_ConeFrustum)& ent, const IGESData_IGESDumper& /* dumper */,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_ConeFrustum" << endl;
|
||||
|
||||
S << "Height : " << ent->Height() << " ";
|
||||
S << "Larger face Radius : " << ent->LargerRadius() << " ";
|
||||
S << "Smaller face Radius : " << ent->SmallerRadius() << endl;
|
||||
S << "Face Center : ";
|
||||
IGESData_DumpXYZL(S,level, ent->FaceCenter(), ent->Location());
|
||||
S << endl << "Axis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Axis(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolConicalSurface.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolConicalSurface.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolConicalSurface.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolConicalSurface from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a ConicalSurface. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses ConicalSurface from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolConicalSurface;
|
||||
---Purpose : Returns a ToolConicalSurface, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable ConicalSurface;
|
||||
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 : ConicalSurface;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : ConicalSurface;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a ConicalSurface <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : ConicalSurface) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : ConicalSurface;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : ConicalSurface; entto : mutable ConicalSurface;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : ConicalSurface;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolConicalSurface;
|
144
src/IGESSolid/IGESSolid_ToolConicalSurface.cxx
Executable file
144
src/IGESSolid/IGESSolid_ToolConicalSurface.cxx
Executable file
@@ -0,0 +1,144 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_ConicalSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolConicalSurface.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESGeom_Point.hxx>
|
||||
#include <IGESGeom_Direction.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolConicalSurface::IGESSolid_ToolConicalSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolConicalSurface::ReadOwnParams
|
||||
(const Handle(IGESSolid_ConicalSurface)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESGeom_Point) tempLocation;
|
||||
Handle(IGESGeom_Direction) tempAxis;
|
||||
Handle(IGESGeom_Direction) tempRefdir; // default Unparametrised
|
||||
Standard_Real tempRadius, tempAngle;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Point on axis",
|
||||
STANDARD_TYPE(IGESGeom_Point), tempLocation); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Axis direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Semi-angle", tempAngle); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (ent->FormNumber() == 1) // Parametrised surface
|
||||
PR.ReadEntity(IR, PR.Current(), "Reference direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init
|
||||
(tempLocation, tempAxis, tempRadius, tempAngle, tempRefdir);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConicalSurface::WriteOwnParams
|
||||
(const Handle(IGESSolid_ConicalSurface)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->LocationPoint());
|
||||
IW.Send(ent->Axis());
|
||||
IW.Send(ent->Radius());
|
||||
IW.Send(ent->SemiAngle());
|
||||
if (ent->IsParametrised()) IW.Send(ent->ReferenceDir()); // cf FormNumber
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConicalSurface::OwnShared
|
||||
(const Handle(IGESSolid_ConicalSurface)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->LocationPoint());
|
||||
iter.GetOneItem(ent->Axis());
|
||||
iter.GetOneItem(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConicalSurface::OwnCopy
|
||||
(const Handle(IGESSolid_ConicalSurface)& another,
|
||||
const Handle(IGESSolid_ConicalSurface)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
Standard_Real tempRadius, tempAngle;
|
||||
//Standard_Boolean IsItParametrised = Standard_False; //szv#4:S4163:12Mar99 unused
|
||||
|
||||
DeclareAndCast(IGESGeom_Point, tempLocation,
|
||||
TC.Transferred(another->LocationPoint()));
|
||||
DeclareAndCast(IGESGeom_Direction, tempAxis,
|
||||
TC.Transferred(another->Axis()));
|
||||
tempRadius = another->Radius();
|
||||
tempAngle = another->SemiAngle();
|
||||
if (another->IsParametrised())
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Direction, tempRefdir,
|
||||
TC.Transferred(another->ReferenceDir()));
|
||||
ent->Init (tempLocation, tempAxis, tempRadius, tempAngle, tempRefdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(IGESGeom_Direction) tempRefdir;
|
||||
ent->Init (tempLocation, tempAxis, tempRadius, tempAngle, tempRefdir);
|
||||
}
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolConicalSurface::DirChecker
|
||||
(const Handle(IGESSolid_ConicalSurface)& /*ent*/) const
|
||||
{
|
||||
IGESData_DirChecker DC(194, 0, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.BlankStatusIgnored ();
|
||||
DC.SubordinateStatusRequired (1);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConicalSurface::OwnCheck
|
||||
(const Handle(IGESSolid_ConicalSurface)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->Radius() < 0.0)
|
||||
ach->AddFail("Radius : Value Negative");
|
||||
if (ent->SemiAngle() < 0.0 || ent->SemiAngle() > 90.0)
|
||||
ach->AddFail("Semi-angle : Value not in the range [0 - 90]");
|
||||
Standard_Integer fn = 0;
|
||||
if (ent->IsParametrised()) fn = 1;
|
||||
if (fn != ent->FormNumber()) ach->AddFail
|
||||
("Parametrised Status Mismatches with Form Number");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolConicalSurface::OwnDump
|
||||
(const Handle(IGESSolid_ConicalSurface)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_ConicalSurface" << endl;
|
||||
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
S << "Point on axis : ";
|
||||
dumper.Dump(ent->LocationPoint(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Axis direction : ";
|
||||
dumper.Dump(ent->Axis(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Radius : " << ent->Radius() << " ";
|
||||
S << "Semi-angle : " << ent->SemiAngle() << endl;
|
||||
if (ent->IsParametrised())
|
||||
{
|
||||
S << "Surface is Parametrised - Reference direction : " << endl;
|
||||
dumper.Dump(ent->ReferenceDir(),S, sublevel);
|
||||
S << endl;
|
||||
}
|
||||
else S << "Surface is UnParametrised" << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolCylinder.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolCylinder.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolCylinder.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolCylinder from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Cylinder. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Cylinder from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolCylinder;
|
||||
---Purpose : Returns a ToolCylinder, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Cylinder;
|
||||
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 : Cylinder;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Cylinder;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Cylinder <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Cylinder) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Cylinder;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Cylinder; entto : mutable Cylinder;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Cylinder;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolCylinder;
|
157
src/IGESSolid/IGESSolid_ToolCylinder.cxx
Executable file
157
src/IGESSolid/IGESSolid_ToolCylinder.cxx
Executable file
@@ -0,0 +1,157 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Cylinder.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolCylinder.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolCylinder::IGESSolid_ToolCylinder () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolCylinder::ReadOwnParams
|
||||
(const Handle(IGESSolid_Cylinder)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Standard_Real tempHeight, tempRadius, tempreal;
|
||||
gp_XYZ tempCenter, tempAxis;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Height", tempHeight); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Face center (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Face center (X)", tempreal))
|
||||
tempCenter.SetX(tempreal);
|
||||
}
|
||||
else tempCenter.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Face center (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Face center (Y)", tempreal))
|
||||
tempCenter.SetY(tempreal);
|
||||
}
|
||||
else tempCenter.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Face center (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Face center (Z)", tempreal))
|
||||
tempCenter.SetZ(tempreal);
|
||||
}
|
||||
else tempCenter.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal))
|
||||
tempAxis.SetX(tempreal);
|
||||
}
|
||||
else tempAxis.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal))
|
||||
tempAxis.SetY(tempreal);
|
||||
}
|
||||
else tempAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal))
|
||||
tempAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempAxis.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init
|
||||
(tempHeight, tempRadius, tempCenter, tempAxis);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempAxis.IsEqual(ent->Axis().XYZ(),eps)) PR.AddWarning
|
||||
("Axis poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylinder::WriteOwnParams
|
||||
(const Handle(IGESSolid_Cylinder)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Height());
|
||||
IW.Send(ent->Radius());
|
||||
IW.Send(ent->FaceCenter().X());
|
||||
IW.Send(ent->FaceCenter().Y());
|
||||
IW.Send(ent->FaceCenter().Z());
|
||||
IW.Send(ent->Axis().X());
|
||||
IW.Send(ent->Axis().Y());
|
||||
IW.Send(ent->Axis().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylinder::OwnShared
|
||||
(const Handle(IGESSolid_Cylinder)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylinder::OwnCopy
|
||||
(const Handle(IGESSolid_Cylinder)& another,
|
||||
const Handle(IGESSolid_Cylinder)& ent, Interface_CopyTool& /* TC */) const
|
||||
{
|
||||
ent->Init
|
||||
(another->Height(), another->Radius(), another->FaceCenter().XYZ(),
|
||||
another->Axis().XYZ());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolCylinder::DirChecker
|
||||
(const Handle(IGESSolid_Cylinder)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(154, 0);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylinder::OwnCheck
|
||||
(const Handle(IGESSolid_Cylinder)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->Height() <= 0.0)
|
||||
ach->AddFail("Height : Value < 0");
|
||||
if (ent->Radius() <= 0.0)
|
||||
ach->AddFail("Radius : Value < 0");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylinder::OwnDump
|
||||
(const Handle(IGESSolid_Cylinder)& ent, const IGESData_IGESDumper& /* dumper */,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
|
||||
// Standard_Boolean locprint = (ent->HasTransf() && level >=6);
|
||||
// gp_Pnt TCenter = ent->TransformedFaceCenter();
|
||||
// gp_Dir TAxis = ent->TransformedAxis();
|
||||
|
||||
S << "IGESSolid_Cylinder" << endl;
|
||||
|
||||
S << "Height : " << ent->Height() << " ";
|
||||
S << "Radius : " << ent->Radius() << endl;
|
||||
S << "Center : ";
|
||||
IGESData_DumpXYZL(S,level, ent->FaceCenter(), ent->Location());
|
||||
S << endl << "Axis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Axis(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolCylindricalSurface.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolCylindricalSurface.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolCylindricalSurface.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolCylindricalSurface from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a CylindricalSurface. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses CylindricalSurface from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolCylindricalSurface;
|
||||
---Purpose : Returns a ToolCylindricalSurface, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable CylindricalSurface;
|
||||
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 : CylindricalSurface;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : CylindricalSurface;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a CylindricalSurface <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : CylindricalSurface) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : CylindricalSurface;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : CylindricalSurface; entto : mutable CylindricalSurface;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : CylindricalSurface;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolCylindricalSurface;
|
136
src/IGESSolid/IGESSolid_ToolCylindricalSurface.cxx
Executable file
136
src/IGESSolid/IGESSolid_ToolCylindricalSurface.cxx
Executable file
@@ -0,0 +1,136 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_CylindricalSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolCylindricalSurface.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESGeom_Point.hxx>
|
||||
#include <IGESGeom_Direction.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolCylindricalSurface::IGESSolid_ToolCylindricalSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolCylindricalSurface::ReadOwnParams
|
||||
(const Handle(IGESSolid_CylindricalSurface)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESGeom_Point) tempLocation;
|
||||
Handle(IGESGeom_Direction) tempAxis;
|
||||
Handle(IGESGeom_Direction) tempRefdir; // default Unparametrised
|
||||
Standard_Real tempRadius;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Point on axis",
|
||||
STANDARD_TYPE(IGESGeom_Point), tempLocation); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Axis direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (ent->FormNumber() == 1) // Parametrised surface
|
||||
PR.ReadEntity(IR, PR.Current(), "Reference direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempLocation, tempAxis, tempRadius, tempRefdir);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylindricalSurface::WriteOwnParams
|
||||
(const Handle(IGESSolid_CylindricalSurface)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->LocationPoint());
|
||||
IW.Send(ent->Axis());
|
||||
IW.Send(ent->Radius());
|
||||
if (ent->IsParametrised()) IW.Send(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylindricalSurface::OwnShared
|
||||
(const Handle(IGESSolid_CylindricalSurface)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->LocationPoint());
|
||||
iter.GetOneItem(ent->Axis());
|
||||
iter.GetOneItem(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylindricalSurface::OwnCopy
|
||||
(const Handle(IGESSolid_CylindricalSurface)& another,
|
||||
const Handle(IGESSolid_CylindricalSurface)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
Standard_Real tempRadius;
|
||||
|
||||
DeclareAndCast(IGESGeom_Point, tempLocation,
|
||||
TC.Transferred(another->LocationPoint()));
|
||||
DeclareAndCast(IGESGeom_Direction, tempAxis,
|
||||
TC.Transferred(another->Axis()));
|
||||
tempRadius = another->Radius();
|
||||
if (another->IsParametrised())
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Direction, tempRefdir,
|
||||
TC.Transferred(another->ReferenceDir()));
|
||||
ent->Init (tempLocation, tempAxis, tempRadius, tempRefdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(IGESGeom_Direction) tempRefdir;
|
||||
ent->Init (tempLocation, tempAxis, tempRadius, tempRefdir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolCylindricalSurface::DirChecker
|
||||
(const Handle(IGESSolid_CylindricalSurface)& /*ent*/) const
|
||||
{
|
||||
IGESData_DirChecker DC(192, 0, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.BlankStatusIgnored ();
|
||||
DC.SubordinateStatusRequired (1);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylindricalSurface::OwnCheck
|
||||
(const Handle(IGESSolid_CylindricalSurface)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->Radius() <= 0.0)
|
||||
ach->AddFail("Radius : Value <= 0.0");
|
||||
Standard_Integer fn = 0;
|
||||
if (ent->IsParametrised()) fn = 1;
|
||||
if (fn != ent->FormNumber()) ach->AddFail
|
||||
("Parametrised Status Mismatches with Form Number");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolCylindricalSurface::OwnDump
|
||||
(const Handle(IGESSolid_CylindricalSurface)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_CylindricalSurface" << endl;
|
||||
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
S << "Point on axis : ";
|
||||
dumper.Dump(ent->LocationPoint(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Axis direction : ";
|
||||
dumper.Dump(ent->Axis(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Radius : " << ent->Radius() << endl;
|
||||
if (ent->IsParametrised())
|
||||
{
|
||||
S << "Surface is Parametrised - Reference direction : ";
|
||||
dumper.Dump(ent->ReferenceDir(),S, sublevel);
|
||||
S << endl;
|
||||
}
|
||||
else S << "Surface is UnParametrised" << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolEdgeList.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolEdgeList.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolEdgeList.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolEdgeList from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a EdgeList. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses EdgeList from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolEdgeList;
|
||||
---Purpose : Returns a ToolEdgeList, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable EdgeList;
|
||||
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 : EdgeList;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : EdgeList;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a EdgeList <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : EdgeList) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : EdgeList;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : EdgeList; entto : mutable EdgeList;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : EdgeList;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolEdgeList;
|
371
src/IGESSolid/IGESSolid_ToolEdgeList.cxx
Executable file
371
src/IGESSolid/IGESSolid_ToolEdgeList.cxx
Executable file
@@ -0,0 +1,371 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_EdgeList.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolEdgeList.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <IGESSolid_VertexList.hxx>
|
||||
#include <IGESData_HArray1OfIGESEntity.hxx>
|
||||
#include <IGESSolid_HArray1OfVertexList.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
// MGE 03/08/98
|
||||
#include <Message_Msg.hxx>
|
||||
#include <IGESData_Status.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IGESSolid_ToolEdgeList
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESSolid_ToolEdgeList::IGESSolid_ToolEdgeList ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolEdgeList::ReadOwnParams(const Handle(IGESSolid_EdgeList)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const
|
||||
{
|
||||
// MGE 03/08/98
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
|
||||
Standard_Integer length, anint;
|
||||
Handle(IGESData_IGESEntity) anent;
|
||||
Handle(IGESSolid_VertexList) avert;
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempCurves;
|
||||
Handle(IGESSolid_HArray1OfVertexList) tempStartVertexList;
|
||||
Handle(TColStd_HArray1OfInteger) tempStartVertexIndex;
|
||||
Handle(IGESSolid_HArray1OfVertexList) tempEndVertexList;
|
||||
Handle(TColStd_HArray1OfInteger) tempEndVertexIndex;
|
||||
IGESData_Status aStatus;
|
||||
|
||||
Standard_Boolean st = PR.ReadInteger(PR.Current(), length);
|
||||
if(!st){
|
||||
Message_Msg Msg184("XSTEP_184");
|
||||
PR.SendFail(Msg184);
|
||||
}
|
||||
//st = PR.ReadInteger(PR.Current(), "Number of edges", length);
|
||||
if (st && length > 0)
|
||||
{
|
||||
tempCurves = new IGESData_HArray1OfIGESEntity(1, length);
|
||||
tempStartVertexList = new IGESSolid_HArray1OfVertexList(1, length);
|
||||
tempStartVertexIndex = new TColStd_HArray1OfInteger(1, length);
|
||||
tempEndVertexList = new IGESSolid_HArray1OfVertexList(1, length);
|
||||
tempEndVertexIndex = new TColStd_HArray1OfInteger(1, length);
|
||||
for (Standard_Integer i=1 ; i<=length ; i++)
|
||||
{
|
||||
// Curves
|
||||
//st = PR.ReadEntity(IR, PR.Current(), Msg185, anent); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadEntity(IR, PR.Current(), "Model space curve", anent);
|
||||
if (PR.ReadEntity(IR, PR.Current(), aStatus, anent))
|
||||
tempCurves->SetValue(i, anent);
|
||||
else{
|
||||
Message_Msg Msg185("XSTEP_185");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg185.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg185);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg185.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg185);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
// Start vertex list
|
||||
//st = PR.ReadEntity(IR, PR.Current(), Msg188,
|
||||
//STANDARD_TYPE(IGESSolid_VertexList), avert); //szv#4:S4163:12Mar99 moved in if
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "Start vertex list",
|
||||
STANDARD_TYPE(IGESSolid_VertexList), avert);
|
||||
*/
|
||||
if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_VertexList), avert))
|
||||
tempStartVertexList->SetValue(i, avert);
|
||||
else{
|
||||
Message_Msg Msg188("XSTEP_188");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg188.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg188);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg188.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg188);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg188.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg188);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start vertex index
|
||||
//st = PR.ReadInteger(PR.Current(), Msg186, anint); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadInteger(PR.Current(), "Start vertex index", anint);
|
||||
if (PR.ReadInteger(PR.Current(), anint))
|
||||
tempStartVertexIndex->SetValue(i, anint);
|
||||
else{
|
||||
Message_Msg Msg186("XSTEP_186");
|
||||
PR.SendFail(Msg186);
|
||||
}
|
||||
|
||||
// End vertex list
|
||||
//st = PR.ReadEntity(IR, PR.Current(),Msg189 ,
|
||||
//STANDARD_TYPE(IGESSolid_VertexList), avert); //szv#4:S4163:12Mar99 moved in if
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "End vertex list",
|
||||
STANDARD_TYPE(IGESSolid_VertexList), avert);
|
||||
*/
|
||||
if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_VertexList), avert))
|
||||
tempEndVertexList->SetValue(i, avert);
|
||||
else{
|
||||
Message_Msg Msg189("XSTEP_189");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg189.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg189);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg189.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg189);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg189.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg189);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
// End vertex index
|
||||
//st = PR.ReadInteger(PR.Current(), Msg187, anint); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadInteger(PR.Current(), "End vertex index", anint);
|
||||
if (PR.ReadInteger(PR.Current(), anint))
|
||||
tempEndVertexIndex->SetValue(i, anint);
|
||||
else {
|
||||
Message_Msg Msg187("XSTEP_187");
|
||||
PR.SendFail(Msg187);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (st && length <= 0){
|
||||
Message_Msg Msg184("XSTEP_184");
|
||||
PR.SendFail(Msg184);
|
||||
}
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
if (length > 0) ent->Init
|
||||
(tempCurves, tempStartVertexList, tempStartVertexIndex,
|
||||
tempEndVertexList, tempEndVertexIndex);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolEdgeList::WriteOwnParams(const Handle(IGESSolid_EdgeList)& ent,
|
||||
IGESData_IGESWriter& IW) const
|
||||
{
|
||||
Standard_Integer length = ent->NbEdges();
|
||||
|
||||
IW.Send(length);
|
||||
for (Standard_Integer i = 1; i <= length; i ++)
|
||||
{
|
||||
IW.Send(ent->Curve(i));
|
||||
IW.Send(ent->StartVertexList(i));
|
||||
IW.Send(ent->StartVertexIndex(i));
|
||||
IW.Send(ent->EndVertexList(i));
|
||||
IW.Send(ent->EndVertexIndex(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnShared
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolEdgeList::OwnShared(const Handle(IGESSolid_EdgeList)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer length = ent->NbEdges();
|
||||
for (Standard_Integer i = 1; i <= length; i ++)
|
||||
{
|
||||
iter.GetOneItem(ent->Curve(i));
|
||||
iter.GetOneItem(ent->StartVertexList(i));
|
||||
iter.GetOneItem(ent->EndVertexList(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolEdgeList::OwnCopy(const Handle(IGESSolid_EdgeList)& another,
|
||||
const Handle(IGESSolid_EdgeList)& ent,
|
||||
Interface_CopyTool& TC) const
|
||||
{
|
||||
Standard_Integer length;
|
||||
|
||||
length = another->NbEdges();
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempCurves =
|
||||
new IGESData_HArray1OfIGESEntity(1, length);
|
||||
Handle(IGESSolid_HArray1OfVertexList) tempStartVertexList =
|
||||
new IGESSolid_HArray1OfVertexList(1, length);
|
||||
Handle(TColStd_HArray1OfInteger) tempStartVertexIndex =
|
||||
new TColStd_HArray1OfInteger(1, length);
|
||||
Handle(IGESSolid_HArray1OfVertexList) tempEndVertexList =
|
||||
new IGESSolid_HArray1OfVertexList(1, length);
|
||||
Handle(TColStd_HArray1OfInteger) tempEndVertexIndex =
|
||||
new TColStd_HArray1OfInteger(1, length);
|
||||
|
||||
for (Standard_Integer i=1 ; i<=length ; i++)
|
||||
{
|
||||
// Curves
|
||||
DeclareAndCast(IGESData_IGESEntity, curve,
|
||||
TC.Transferred(another->Curve(i)));
|
||||
tempCurves->SetValue(i, curve);
|
||||
|
||||
// Start vertex list
|
||||
DeclareAndCast(IGESSolid_VertexList, start,
|
||||
TC.Transferred(another->StartVertexList(i)));
|
||||
tempStartVertexList->SetValue(i, start);
|
||||
|
||||
// Start vertex index
|
||||
tempStartVertexIndex->SetValue(i, another->StartVertexIndex(i));
|
||||
|
||||
// End vertex list
|
||||
DeclareAndCast(IGESSolid_VertexList, end,
|
||||
TC.Transferred(another->EndVertexList(i)));
|
||||
tempEndVertexList->SetValue(i, end);
|
||||
|
||||
// End vertex index
|
||||
tempEndVertexIndex->SetValue(i, another->EndVertexIndex(i));
|
||||
}
|
||||
|
||||
ent->Init (tempCurves, tempStartVertexList, tempStartVertexIndex,
|
||||
tempEndVertexList, tempEndVertexIndex);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DirChecker
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolEdgeList::DirChecker
|
||||
(const Handle(IGESSolid_EdgeList)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(504, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefVoid);
|
||||
DC.LineWeight (IGESData_DefVoid);
|
||||
DC.Color (IGESData_DefVoid);
|
||||
|
||||
DC.SubordinateStatusRequired (1);
|
||||
DC.HierarchyStatusRequired (1);
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCheck
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolEdgeList::OwnCheck(const Handle(IGESSolid_EdgeList)& ent,
|
||||
const Interface_ShareTool&,
|
||||
Handle(Interface_Check)& ach) const
|
||||
{
|
||||
// MGE 03/08/98
|
||||
// Building of messages
|
||||
//========================================
|
||||
//Message_Msg Msg184("XSTEP_184");
|
||||
//========================================
|
||||
|
||||
if (ent->NbEdges() <= 0) {
|
||||
Message_Msg Msg184("XSTEP_184");
|
||||
ach->SendFail(Msg184);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnDump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolEdgeList::OwnDump(const Handle(IGESSolid_EdgeList)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
Standard_Integer i, length = ent->NbEdges();
|
||||
|
||||
S << "IGESSolid_EdgeList" << endl;
|
||||
S << "Number of edge tuples : " << length << endl;
|
||||
switch (level)
|
||||
{
|
||||
case 4 :
|
||||
S << "Curves : ";
|
||||
S << "Start Vertex List : ";
|
||||
S << "Start Vertex Index : ";
|
||||
IGESData_DumpVals(S ,level,1, length,ent->StartVertexIndex);
|
||||
S << endl;
|
||||
S << "End Vertex List : ";
|
||||
S << "End Vertex Index : ";
|
||||
IGESData_DumpVals(S ,level,1, length,ent->EndVertexIndex);
|
||||
S << endl;
|
||||
break;
|
||||
case 5 :
|
||||
case 6 :
|
||||
S<<" Curve - Vertices. Start : (VertexList,Index) End : (VertexList,Index)"<<endl;
|
||||
for (i = 1; i <= length; i ++)
|
||||
{
|
||||
//[123]:Curve : #1234 - Vertices. Start = (#5678 , 3467) End = (#1234 , 4664)
|
||||
S << "[" << i << "]:Curve : ";
|
||||
dumper.Dump (ent->Curve(i),S, level-5);
|
||||
S <<" - Vertices. Start : (";
|
||||
dumper.Dump (ent->StartVertexList(i),S, 0);
|
||||
S << " , " << ent->StartVertexIndex(i);
|
||||
S << ") End : (";
|
||||
dumper.Dump (ent->EndVertexList(i),S, 0);
|
||||
S << " , " << ent->EndVertexIndex(i);
|
||||
S << ")" << endl;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolEllipsoid.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolEllipsoid.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolEllipsoid.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolEllipsoid from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Ellipsoid. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Ellipsoid from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolEllipsoid;
|
||||
---Purpose : Returns a ToolEllipsoid, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Ellipsoid;
|
||||
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 : Ellipsoid;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Ellipsoid;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Ellipsoid <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Ellipsoid) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Ellipsoid;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Ellipsoid; entto : mutable Ellipsoid;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Ellipsoid;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolEllipsoid;
|
184
src/IGESSolid/IGESSolid_ToolEllipsoid.cxx
Executable file
184
src/IGESSolid/IGESSolid_ToolEllipsoid.cxx
Executable file
@@ -0,0 +1,184 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Ellipsoid.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolEllipsoid.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolEllipsoid::IGESSolid_ToolEllipsoid () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolEllipsoid::ReadOwnParams
|
||||
(const Handle(IGESSolid_Ellipsoid)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
{
|
||||
gp_XYZ tempSize, tempCenter, tempXAxis, tempZAxis;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
Standard_Real tempreal;
|
||||
|
||||
PR.ReadXYZ(PR.CurrentList(1, 3), "Size", tempSize); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center Point (X)", tempreal))
|
||||
tempCenter.SetX(tempreal);
|
||||
}
|
||||
else tempCenter.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal))
|
||||
tempCenter.SetY(tempreal);
|
||||
}
|
||||
else tempCenter.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal))
|
||||
tempCenter.SetZ(tempreal);
|
||||
}
|
||||
else tempCenter.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal))
|
||||
tempXAxis.SetX(tempreal);
|
||||
}
|
||||
else tempXAxis.SetX(1.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal))
|
||||
tempXAxis.SetY(tempreal);
|
||||
}
|
||||
else tempXAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal))
|
||||
tempXAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempXAxis.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal))
|
||||
tempZAxis.SetX(tempreal);
|
||||
}
|
||||
else tempZAxis.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal))
|
||||
tempZAxis.SetY(tempreal);
|
||||
}
|
||||
else tempZAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal))
|
||||
tempZAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempZAxis.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init(tempSize, tempCenter, tempXAxis, tempZAxis);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempXAxis.IsEqual(ent->XAxis().XYZ(),eps)) PR.AddWarning
|
||||
("XAxis poorly unitary, normalized");
|
||||
if (!tempZAxis.IsEqual(ent->ZAxis().XYZ(),eps)) PR.AddWarning
|
||||
("ZAxis poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolEllipsoid::WriteOwnParams
|
||||
(const Handle(IGESSolid_Ellipsoid)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Size().X());
|
||||
IW.Send(ent->Size().Y());
|
||||
IW.Send(ent->Size().Z());
|
||||
IW.Send(ent->Center().X());
|
||||
IW.Send(ent->Center().Y());
|
||||
IW.Send(ent->Center().Z());
|
||||
IW.Send(ent->XAxis().X());
|
||||
IW.Send(ent->XAxis().Y());
|
||||
IW.Send(ent->XAxis().Z());
|
||||
IW.Send(ent->ZAxis().X());
|
||||
IW.Send(ent->ZAxis().Y());
|
||||
IW.Send(ent->ZAxis().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolEllipsoid::OwnShared
|
||||
(const Handle(IGESSolid_Ellipsoid)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolEllipsoid::OwnCopy
|
||||
(const Handle(IGESSolid_Ellipsoid)& another,
|
||||
const Handle(IGESSolid_Ellipsoid)& ent, Interface_CopyTool& /* TC */) const
|
||||
{
|
||||
ent->Init(another->Size(), another->Center().XYZ(),
|
||||
another->XAxis().XYZ(), another->ZAxis().XYZ());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolEllipsoid::DirChecker
|
||||
(const Handle(IGESSolid_Ellipsoid)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(168, 0);
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolEllipsoid::OwnCheck
|
||||
(const Handle(IGESSolid_Ellipsoid)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
Standard_Real eps = 1.E-04;
|
||||
Standard_Real prosca = ent->XAxis().Dot(ent->ZAxis());
|
||||
if (prosca < -eps || prosca > eps)
|
||||
ach->AddFail("Local Z axis : Not orthogonal to X axis");
|
||||
if (! (ent->Size().X() >= ent->Size().Y()
|
||||
&& ent->Size().Y() >= ent->Size().Z()
|
||||
&& ent->Size().Z() > 0))
|
||||
ach->AddFail("Size : The values does not satisfy LX >= LY >= LZ > 0");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolEllipsoid::OwnDump
|
||||
(const Handle(IGESSolid_Ellipsoid)& ent, const IGESData_IGESDumper& /* dumper */,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_Ellipsoid" << endl;
|
||||
|
||||
S << "Size : ";
|
||||
IGESData_DumpXYZ(S, ent->Size());
|
||||
S << endl << "Center : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Center(), ent->Location());
|
||||
S << endl << "XAxis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->XAxis(), ent->VectorLocation());
|
||||
S << endl << "ZAxis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->ZAxis(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolFace.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolFace.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolFace.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolFace from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Face. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Face from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolFace;
|
||||
---Purpose : Returns a ToolFace, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Face;
|
||||
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 : Face;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Face;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Face <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Face) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Face;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Face; entto : mutable Face;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Face;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolFace;
|
245
src/IGESSolid/IGESSolid_ToolFace.cxx
Executable file
245
src/IGESSolid/IGESSolid_ToolFace.cxx
Executable file
@@ -0,0 +1,245 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Face.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolFace.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <IGESSolid_Loop.hxx>
|
||||
#include <IGESSolid_HArray1OfLoop.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
// MGE 03/08/98
|
||||
#include <Message_Msg.hxx>
|
||||
#include <IGESData_Status.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IGESSolid_ToolFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESSolid_ToolFace::IGESSolid_ToolFace ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolFace::ReadOwnParams(const Handle(IGESSolid_Face)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const
|
||||
{
|
||||
// MGE 03/08/98
|
||||
// Building of messages
|
||||
//========================================
|
||||
Message_Msg Msg197("XSTEP_197");
|
||||
Message_Msg Msg198("XSTEP_198");
|
||||
//========================================
|
||||
|
||||
Standard_Boolean outerLoopFlag; //szv#4:S4163:12Mar99 `st` moved down
|
||||
Handle(IGESData_IGESEntity) anent;
|
||||
Handle(IGESSolid_Loop) aloop;
|
||||
Handle(IGESData_IGESEntity) tempSurface;
|
||||
Standard_Integer nbloops;
|
||||
Handle(IGESSolid_HArray1OfLoop) tempLoops;
|
||||
IGESData_Status aStatus;
|
||||
|
||||
if (!PR.ReadEntity(IR, PR.Current(), aStatus, tempSurface)){ //szv#4:S4163:12Mar99 `st=` not needed
|
||||
Message_Msg Msg196("XSTEP_196");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg196.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg196);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg196.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg196);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
Standard_Boolean st = PR.ReadInteger(PR.Current(), nbloops);
|
||||
if(!st){
|
||||
PR.SendFail(Msg197);
|
||||
}
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "Surface", tempSurface);
|
||||
st = PR.ReadInteger(PR.Current(), "Number of loops", nbloops);
|
||||
*/
|
||||
if (st && nbloops > 0) tempLoops = new IGESSolid_HArray1OfLoop(1, nbloops);
|
||||
else PR.SendFail(Msg197);
|
||||
|
||||
PR.ReadBoolean(PR.Current(), Msg198, outerLoopFlag); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
//st = PR.ReadBoolean(PR.Current(), "Outer loop flag", outerLoopFlag);
|
||||
|
||||
if (!tempLoops.IsNull()) {
|
||||
for (Standard_Integer i=1; i<=nbloops; i++) {
|
||||
//st = PR.ReadEntity(IR, PR.Current(), Msg199, STANDARD_TYPE(IGESSolid_Loop), aloop); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadEntity(IR, PR.Current(), "Loops", STANDARD_TYPE(IGESSolid_Loop), aloop);
|
||||
if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_Loop), aloop))
|
||||
tempLoops->SetValue(i, aloop);
|
||||
else{
|
||||
Message_Msg Msg199("XSTEP_199");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg199.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg199);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg199.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg199);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg199.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg199);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempSurface, outerLoopFlag, tempLoops);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolFace::WriteOwnParams(const Handle(IGESSolid_Face)& ent,
|
||||
IGESData_IGESWriter& IW) const
|
||||
{
|
||||
Standard_Integer upper = ent->NbLoops();
|
||||
IW.Send(ent->Surface());
|
||||
IW.Send(upper);
|
||||
IW.SendBoolean(ent->HasOuterLoop());
|
||||
for (Standard_Integer i = 1; i <= upper; i ++)
|
||||
IW.Send(ent->Loop(i));
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnShared
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolFace::OwnShared(const Handle(IGESSolid_Face)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer upper = ent->NbLoops();
|
||||
iter.GetOneItem(ent->Surface());
|
||||
for (Standard_Integer i = 1; i <= upper; i ++)
|
||||
iter.GetOneItem(ent->Loop(i));
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolFace::OwnCopy(const Handle(IGESSolid_Face)& another,
|
||||
const Handle(IGESSolid_Face)& ent,
|
||||
Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESData_IGESEntity, tempSurface,
|
||||
TC.Transferred(another->Surface()));
|
||||
Standard_Integer nbloops = another->NbLoops();
|
||||
Standard_Boolean outerLoopFlag = another->HasOuterLoop();
|
||||
|
||||
Handle(IGESSolid_HArray1OfLoop) tempLoops =
|
||||
new IGESSolid_HArray1OfLoop(1, nbloops);
|
||||
for (Standard_Integer i=1; i<=nbloops; i++)
|
||||
{
|
||||
DeclareAndCast(IGESSolid_Loop, anent,
|
||||
TC.Transferred(another->Loop(i)));
|
||||
tempLoops->SetValue(i, anent);
|
||||
}
|
||||
|
||||
ent->Init (tempSurface, outerLoopFlag, tempLoops);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DirChecker
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolFace::DirChecker
|
||||
(const Handle(IGESSolid_Face)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(510, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefVoid);
|
||||
DC.LineWeight (IGESData_DefVoid);
|
||||
DC.Color (IGESData_DefVoid);
|
||||
|
||||
DC.SubordinateStatusRequired(1);
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCheck
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolFace::OwnCheck(const Handle(IGESSolid_Face)& ent,
|
||||
const Interface_ShareTool&,
|
||||
Handle(Interface_Check)& ach) const
|
||||
{
|
||||
// MGE 03/08/98
|
||||
// Building of messages
|
||||
//========================================
|
||||
//Message_Msg Msg197("XSTEP_197");
|
||||
//========================================
|
||||
|
||||
if (ent->NbLoops() <= 0) {
|
||||
Message_Msg Msg197("XSTEP_197");
|
||||
ach->SendFail(Msg197);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnDump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolFace::OwnDump(const Handle(IGESSolid_Face)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_Face" << endl;
|
||||
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
S << "Surface : ";
|
||||
dumper.Dump(ent->Surface(),S, sublevel);
|
||||
S << endl;
|
||||
if (ent->HasOuterLoop()) S << "Outer loop is present (First one)" << endl;
|
||||
else S << "Outer loop is not present" << endl;
|
||||
S << "Loops : ";
|
||||
IGESData_DumpEntities(S,dumper ,level,1, ent->NbLoops(),ent->Loop);
|
||||
S << endl;
|
||||
}
|
||||
|
59
src/IGESSolid/IGESSolid_ToolLoop.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolLoop.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolLoop.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolLoop from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Loop. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Loop from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolLoop;
|
||||
---Purpose : Returns a ToolLoop, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Loop;
|
||||
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 : Loop;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Loop;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Loop <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Loop) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Loop;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Loop; entto : mutable Loop;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Loop;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolLoop;
|
403
src/IGESSolid/IGESSolid_ToolLoop.cxx
Executable file
403
src/IGESSolid/IGESSolid_ToolLoop.cxx
Executable file
@@ -0,0 +1,403 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Loop.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
//pdn 20.04.99 STC22655 avoid of exceptions on empty loops
|
||||
|
||||
#include <IGESSolid_ToolLoop.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <IGESData_HArray1OfIGESEntity.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <IGESBasic_HArray1OfHArray1OfInteger.hxx>
|
||||
#include <IGESBasic_HArray1OfHArray1OfIGESEntity.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <IGESSolid_EdgeList.hxx>
|
||||
#include <IGESSolid_VertexList.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <stdio.h>
|
||||
|
||||
// MGE 03/08/98
|
||||
#include <Message_Msg.hxx>
|
||||
#include <IGESData_Status.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IGESSolid_ToolLoop
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESSolid_ToolLoop::IGESSolid_ToolLoop ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolLoop::ReadOwnParams (const Handle(IGESSolid_Loop)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const
|
||||
{
|
||||
// MGE 03/08/98
|
||||
|
||||
Standard_Boolean abool; //szv#4:S4163:12Mar99 `st` moved down
|
||||
Standard_Integer nbedges = 0;
|
||||
Standard_Integer i, j;
|
||||
Standard_Integer anint;
|
||||
Handle(IGESData_IGESEntity) anent;
|
||||
Handle(TColStd_HArray1OfInteger) tempTypes;
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempEdges;
|
||||
Handle(TColStd_HArray1OfInteger) tempIndex;
|
||||
Handle(TColStd_HArray1OfInteger) tempOrientation;
|
||||
Handle(TColStd_HArray1OfInteger) nbParameterCurves;
|
||||
Handle(IGESBasic_HArray1OfHArray1OfInteger) isoparametricFlags;
|
||||
Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) tempCurves;
|
||||
IGESData_Status aStatus;
|
||||
|
||||
//st = PR.ReadInteger(PR.Current(),Msg184, nbedges); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadInteger(PR.Current(), "Number of edges", nbedges);
|
||||
Standard_Boolean sb = PR.ReadInteger(PR.Current(), nbedges);
|
||||
if (sb && (nbedges > 0)) {
|
||||
|
||||
Message_Msg Msg180("XSTEP_180");
|
||||
Message_Msg Msg190("XSTEP_190");
|
||||
|
||||
tempTypes = new TColStd_HArray1OfInteger(1, nbedges);
|
||||
tempEdges = new IGESData_HArray1OfIGESEntity(1, nbedges);
|
||||
tempIndex = new TColStd_HArray1OfInteger(1, nbedges);
|
||||
tempOrientation = new TColStd_HArray1OfInteger(1, nbedges);
|
||||
nbParameterCurves = new TColStd_HArray1OfInteger(1, nbedges);
|
||||
isoparametricFlags =
|
||||
new IGESBasic_HArray1OfHArray1OfInteger(1, nbedges);
|
||||
tempCurves =
|
||||
new IGESBasic_HArray1OfHArray1OfIGESEntity(1, nbedges);
|
||||
|
||||
for (i=1; i<= nbedges; i++)
|
||||
{
|
||||
//st = PR.ReadInteger(PR.Current(), Msg190, anint); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadInteger(PR.Current(), "Edge types", anint);
|
||||
if (PR.ReadInteger(PR.Current(), anint))
|
||||
tempTypes->SetValue(i, anint);
|
||||
else PR.SendFail(Msg190);
|
||||
|
||||
if (!PR.ReadEntity(IR, PR.Current(), aStatus, anent)){ //szv#4:S4163:12Mar99 `st=` not needed
|
||||
Message_Msg Msg193("XSTEP_193");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg193.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg193);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg193.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg193);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
//st = PR.ReadEntity(IR, PR.Current(), "Edges", anent);
|
||||
//if (!st) { } // WARNING : Two possible Types : //szv#4:S4163:12Mar99 not needed
|
||||
if (!anent->IsKind(STANDARD_TYPE(IGESSolid_VertexList))
|
||||
&& !anent->IsKind(STANDARD_TYPE(IGESSolid_EdgeList)) )
|
||||
PR.SendFail(Msg190);
|
||||
else tempEdges->SetValue(i, anent);
|
||||
|
||||
//st = PR.ReadInteger(PR.Current(), Msg191, anint); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadInteger(PR.Current(), "List index", anint);
|
||||
if (PR.ReadInteger(PR.Current(), anint))
|
||||
tempIndex->SetValue(i, anint);
|
||||
else{
|
||||
Message_Msg Msg191("XSTEP_191");
|
||||
PR.SendFail(Msg191);
|
||||
}
|
||||
|
||||
//st = PR.ReadBoolean(PR.Current(), Msg180, abool); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadBoolean(PR.Current(), "Orientation flags", abool);
|
||||
if (PR.ReadBoolean(PR.Current(), Msg180, abool))
|
||||
tempOrientation->SetValue(i, (abool ? 1 : 0)); // bool;
|
||||
|
||||
Standard_Boolean st = PR.ReadInteger(PR.Current(),anint);
|
||||
if(!st){
|
||||
Message_Msg Msg192("XSTEP_192");
|
||||
PR.SendFail(Msg192);
|
||||
}
|
||||
//st = PR.ReadInteger(PR.Current(), "Number of parameter curves", anint);
|
||||
if (st && anint > 0)
|
||||
{
|
||||
Message_Msg Msg195("XSTEP_195");
|
||||
nbParameterCurves->SetValue(i, anint);
|
||||
Handle(IGESData_HArray1OfIGESEntity) tmpents =
|
||||
new IGESData_HArray1OfIGESEntity(1, anint);
|
||||
Handle(TColStd_HArray1OfInteger) tmpints =
|
||||
new TColStd_HArray1OfInteger(1, anint);
|
||||
for (j = 1; j <= anint; j ++)
|
||||
{
|
||||
//st = PR.ReadBoolean(PR.Current(), Msg195, abool); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadBoolean(PR.Current(), "Isoparametric flags", abool);
|
||||
if (PR.ReadBoolean(PR.Current(), Msg195, abool))
|
||||
tmpints->SetValue(j, (abool ? 1 : 0)); // bool;
|
||||
|
||||
//st = PR.ReadEntity(IR, PR.Current(), Msg194, anent); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadEntity(IR, PR.Current(), "Curves", anent);
|
||||
if (PR.ReadEntity(IR, PR.Current(), aStatus, anent))
|
||||
tmpents->SetValue(j, anent);
|
||||
else {
|
||||
Message_Msg Msg194("XSTEP_194");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg194.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg194);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg194.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg194);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
isoparametricFlags->SetValue(i, tmpints);
|
||||
tempCurves->SetValue(i, tmpents);
|
||||
}
|
||||
else nbParameterCurves->SetValue(i, anint);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//pdn 20.04.99 STC22655 avoid of exceptions on empty loops
|
||||
Message_Msg Msg184("XSTEP_184");
|
||||
PR.SendFail(Msg184);
|
||||
return;
|
||||
}
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init
|
||||
(tempTypes, tempEdges, tempIndex, tempOrientation,
|
||||
nbParameterCurves, isoparametricFlags, tempCurves);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolLoop::WriteOwnParams(const Handle(IGESSolid_Loop)& ent,
|
||||
IGESData_IGESWriter& IW) const
|
||||
{
|
||||
Standard_Integer i, j;
|
||||
Standard_Integer length = ent->NbEdges();
|
||||
|
||||
IW.Send(length);
|
||||
for (i = 1; i <= length; i ++)
|
||||
{
|
||||
IW.Send(ent->EdgeType(i));
|
||||
IW.Send(ent->Edge(i));
|
||||
IW.Send(ent->ListIndex(i));
|
||||
IW.SendBoolean(ent->Orientation(i));
|
||||
IW.Send(ent->NbParameterCurves(i));
|
||||
for (j = 1; j <= ent->NbParameterCurves(i); j ++)
|
||||
{
|
||||
IW.SendBoolean(ent->IsIsoparametric(i,j));
|
||||
IW.Send(ent->ParametricCurve(i,j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnShared
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolLoop::OwnShared(const Handle(IGESSolid_Loop)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer i, j;
|
||||
Standard_Integer length = ent->NbEdges();
|
||||
|
||||
for (i = 1; i <= length; i ++)
|
||||
{
|
||||
iter.GetOneItem(ent->Edge(i));
|
||||
for (j = 1; j <= ent->NbParameterCurves(i); j ++)
|
||||
iter.GetOneItem(ent->ParametricCurve(i,j));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolLoop::OwnCopy(const Handle(IGESSolid_Loop)& another,
|
||||
const Handle(IGESSolid_Loop)& ent,
|
||||
Interface_CopyTool& TC) const
|
||||
{
|
||||
Standard_Integer nbedges = another->NbEdges();
|
||||
Standard_Integer i, j;
|
||||
Standard_Integer anint;
|
||||
|
||||
Handle(TColStd_HArray1OfInteger) tempTypes =
|
||||
new TColStd_HArray1OfInteger(1, nbedges);
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempEdges =
|
||||
new IGESData_HArray1OfIGESEntity(1, nbedges);
|
||||
Handle(TColStd_HArray1OfInteger) tempIndex =
|
||||
new TColStd_HArray1OfInteger(1, nbedges);
|
||||
Handle(TColStd_HArray1OfInteger) tempOrientation =
|
||||
new TColStd_HArray1OfInteger(1, nbedges);
|
||||
Handle(TColStd_HArray1OfInteger) nbParameterCurves =
|
||||
new TColStd_HArray1OfInteger(1, nbedges);
|
||||
Handle(IGESBasic_HArray1OfHArray1OfInteger) isoparametricFlags =
|
||||
new IGESBasic_HArray1OfHArray1OfInteger(1, nbedges);
|
||||
Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) tempCurves =
|
||||
new IGESBasic_HArray1OfHArray1OfIGESEntity(1, nbedges);
|
||||
|
||||
for (i = 1; i <= nbedges; i ++)
|
||||
{
|
||||
tempTypes->SetValue(i, another->EdgeType(i));
|
||||
|
||||
DeclareAndCast(IGESData_IGESEntity, anent,
|
||||
TC.Transferred(another->Edge(i)));
|
||||
tempEdges->SetValue(i, anent);
|
||||
|
||||
tempIndex->SetValue(i, another->ListIndex(i));
|
||||
|
||||
tempOrientation->SetValue(i, (another->Orientation(i) ? 1 : 0) );
|
||||
|
||||
anint = another->NbParameterCurves(i);
|
||||
nbParameterCurves->SetValue(i, anint);
|
||||
|
||||
Handle(IGESData_HArray1OfIGESEntity) tmpents;
|
||||
if (anint > 0) tmpents = new IGESData_HArray1OfIGESEntity(1, anint);
|
||||
Handle(TColStd_HArray1OfInteger) tmpints;
|
||||
if (anint > 0) tmpints = new TColStd_HArray1OfInteger(1, anint);
|
||||
for (j = 1; j <= anint; j ++)
|
||||
{
|
||||
tmpints->SetValue(j, (another->IsIsoparametric(i, j) ? 1 : 0) );
|
||||
|
||||
DeclareAndCast(IGESData_IGESEntity, localent,
|
||||
TC.Transferred(another->ParametricCurve(i, j)));
|
||||
tmpents->SetValue(j, localent);
|
||||
}
|
||||
isoparametricFlags->SetValue(i, tmpints);
|
||||
tempCurves->SetValue(i, tmpents);
|
||||
}
|
||||
ent->Init(tempTypes, tempEdges, tempIndex, tempOrientation,
|
||||
nbParameterCurves, isoparametricFlags, tempCurves);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DirChecker
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolLoop::DirChecker
|
||||
(const Handle(IGESSolid_Loop)& /* ent */) const
|
||||
{
|
||||
IGESData_DirChecker DC(508, 0,1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefVoid);
|
||||
DC.LineWeight (IGESData_DefVoid);
|
||||
DC.Color (IGESData_DefVoid);
|
||||
|
||||
DC.SubordinateStatusRequired(1);
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCheck
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolLoop::OwnCheck(const Handle(IGESSolid_Loop)& ent,
|
||||
const Interface_ShareTool&,
|
||||
Handle(Interface_Check)& ach) const
|
||||
{
|
||||
// MGE 03/08/98
|
||||
// Building of messages
|
||||
//========================================
|
||||
//Message_Msg Msg190("XSTEP_190");
|
||||
//========================================
|
||||
|
||||
Standard_Integer upper = ent->NbEdges();
|
||||
for (Standard_Integer i = 1; i <= upper; i ++)
|
||||
if (ent->EdgeType(i) != 0 && ent->EdgeType(i) != 1) {
|
||||
Message_Msg Msg190("XSTEP_190");
|
||||
ach->SendFail(Msg190);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnDump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolLoop::OwnDump(const Handle(IGESSolid_Loop)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
Standard_Integer i, j;
|
||||
Standard_Integer nbedges = ent->NbEdges();
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
|
||||
S << "IGESSolid_Loop" << endl;
|
||||
|
||||
S << "Edge types : " << endl;
|
||||
S << "Edges : " << endl;
|
||||
S << "List index : " << endl;
|
||||
S << "Orientation flags : " << endl;
|
||||
S << "Parametric flags : ";
|
||||
IGESData_DumpEntities(S,dumper,-level,1, nbedges,ent->Edge);
|
||||
S << endl;
|
||||
if (level > 4)
|
||||
{
|
||||
S << "[ ";
|
||||
for (i = 1; i <= nbedges; i ++)
|
||||
{
|
||||
Standard_Integer nbc = ent->NbParameterCurves(i);
|
||||
S << "[" << i << "]: ";
|
||||
S << "Edge type : " << ent->EdgeType(i) << " ";
|
||||
S << "Edge : ";
|
||||
dumper.Dump (ent->Edge(i),S, sublevel);
|
||||
S << " - Index : " << ent->ListIndex(i)
|
||||
<< ", Orientation flag : " << ( ent->Orientation(i) ? "Positive" : "Negative" )
|
||||
<< ", Number of parametric curves : " << nbc;
|
||||
if (nbc != 0)
|
||||
{
|
||||
if (level <= 5) S << "[ ask level > 5 for content ]";
|
||||
else {
|
||||
S << ":\n [ ";
|
||||
for (j = 1; j <= nbc; j ++)
|
||||
{
|
||||
S << "[" << j << "]: ";
|
||||
S << "Isoparametric flag : "
|
||||
<< ( ent->IsIsoparametric(i,j) ? "True" : "False" ) << " ";
|
||||
S << "Parametric curve : ";
|
||||
dumper.Dump (ent->ParametricCurve(i,j),S, sublevel);
|
||||
S << endl;
|
||||
}
|
||||
S << " ]";
|
||||
}
|
||||
}
|
||||
S << endl;
|
||||
}
|
||||
S << " ]";
|
||||
}
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolManifoldSolid.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolManifoldSolid.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolManifoldSolid.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolManifoldSolid from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a ManifoldSolid. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses ManifoldSolid from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolManifoldSolid;
|
||||
---Purpose : Returns a ToolManifoldSolid, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable ManifoldSolid;
|
||||
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 : ManifoldSolid;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : ManifoldSolid;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a ManifoldSolid <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : ManifoldSolid) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : ManifoldSolid;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : ManifoldSolid; entto : mutable ManifoldSolid;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : ManifoldSolid;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolManifoldSolid;
|
225
src/IGESSolid/IGESSolid_ToolManifoldSolid.cxx
Executable file
225
src/IGESSolid/IGESSolid_ToolManifoldSolid.cxx
Executable file
@@ -0,0 +1,225 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_ManifoldSolid.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolManifoldSolid.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <IGESSolid_Shell.hxx>
|
||||
#include <IGESSolid_HArray1OfShell.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
// MGE 31/07/98
|
||||
#include <Message_Msg.hxx>
|
||||
#include <IGESData_Status.hxx>
|
||||
|
||||
IGESSolid_ToolManifoldSolid::IGESSolid_ToolManifoldSolid () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolManifoldSolid::ReadOwnParams
|
||||
(const Handle(IGESSolid_ManifoldSolid)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
|
||||
// MGE 31/07/98
|
||||
// Building of messages
|
||||
//========================================
|
||||
Message_Msg Msg180("XSTEP_180");
|
||||
//========================================
|
||||
|
||||
Standard_Boolean abool, shellFlag; //szv#4:S4163:12Mar99 `st` moved down
|
||||
Standard_Integer nbshells, i;
|
||||
Handle(TColStd_HArray1OfInteger) voidShellFlags;
|
||||
Handle(IGESSolid_Shell) shell;
|
||||
Handle(IGESSolid_Shell) ashell;
|
||||
Handle(IGESSolid_HArray1OfShell) voidShells;
|
||||
IGESData_Status aStatus;
|
||||
|
||||
if (!PR.ReadEntity(IR, PR.Current(), aStatus, shell)){ //szv#4:S4163:12Mar99 `st=` not needed
|
||||
Message_Msg Msg178("XSTEP_178");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg178.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg178);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg178.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg178);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PR.ReadBoolean(PR.Current(), Msg180, shellFlag); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
Standard_Boolean st = PR.ReadInteger(PR.Current(), nbshells);
|
||||
if(!st){
|
||||
Message_Msg Msg181("XSTEP_181");
|
||||
PR.SendFail(Msg181);
|
||||
}
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "Shell", shell);
|
||||
st = PR.ReadBoolean(PR.Current(), "Shell orientation", shellFlag);
|
||||
st = PR.ReadInteger(PR.Current(), "Number of shells", nbshells);
|
||||
*/
|
||||
if (st && nbshells > 0)
|
||||
{
|
||||
voidShells = new IGESSolid_HArray1OfShell(1, nbshells);
|
||||
voidShellFlags = new TColStd_HArray1OfInteger(1, nbshells); voidShellFlags->Init(0);
|
||||
for (i=1; i<=nbshells; i++)
|
||||
{
|
||||
//st = PR.ReadEntity(IR, PR.Current(), Msg179,
|
||||
//STANDARD_TYPE(IGESSolid_Shell), ashell); //szv#4:S4163:12Mar99 moved in if
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "Void shells",
|
||||
STANDARD_TYPE(IGESSolid_Shell), ashell);
|
||||
*/
|
||||
if (PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESSolid_Shell), ashell))
|
||||
voidShells->SetValue(i, ashell);
|
||||
else {
|
||||
Message_Msg Msg179("XSTEP_179");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg179.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg179);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg179.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg179);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg179.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg179);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PR.ReadBoolean(PR.Current(), Msg180, abool); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
if (abool) voidShellFlags->SetValue(i, 1);
|
||||
}
|
||||
}
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (shell, shellFlag, voidShells, voidShellFlags);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolManifoldSolid::WriteOwnParams
|
||||
(const Handle(IGESSolid_ManifoldSolid)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
Standard_Integer i;
|
||||
Standard_Integer nbshells = ent->NbVoidShells();
|
||||
|
||||
IW.Send(ent->Shell());
|
||||
IW.SendBoolean(ent->OrientationFlag());
|
||||
IW.Send(nbshells);
|
||||
for (i = 1; i <= nbshells; i ++)
|
||||
{
|
||||
IW.Send(ent->VoidShell(i));
|
||||
IW.SendBoolean(ent->VoidOrientationFlag(i));
|
||||
}
|
||||
}
|
||||
|
||||
void IGESSolid_ToolManifoldSolid::OwnShared
|
||||
(const Handle(IGESSolid_ManifoldSolid)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer i;
|
||||
Standard_Integer nbshells = ent->NbVoidShells();
|
||||
|
||||
iter.GetOneItem(ent->Shell());
|
||||
for (i = 1; i <= nbshells; i ++) iter.GetOneItem(ent->VoidShell(i));
|
||||
}
|
||||
|
||||
void IGESSolid_ToolManifoldSolid::OwnCopy
|
||||
(const Handle(IGESSolid_ManifoldSolid)& another,
|
||||
const Handle(IGESSolid_ManifoldSolid)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESSolid_Shell, shell, TC.Transferred(another->Shell()));
|
||||
Standard_Boolean shellFlag = another->OrientationFlag();
|
||||
|
||||
Standard_Integer nbshells = another->NbVoidShells();
|
||||
Handle(IGESSolid_HArray1OfShell) voidShells;
|
||||
Handle(TColStd_HArray1OfInteger) voidFlags;
|
||||
if (nbshells > 0)
|
||||
{
|
||||
voidShells = new IGESSolid_HArray1OfShell(1, nbshells);
|
||||
voidFlags = new TColStd_HArray1OfInteger(1, nbshells);
|
||||
for (Standard_Integer i = 1; i <= nbshells; i ++)
|
||||
{
|
||||
DeclareAndCast(IGESSolid_Shell, voidshell,
|
||||
TC.Transferred(another->VoidShell(i)));
|
||||
voidShells->SetValue(i, voidshell);
|
||||
voidFlags->SetValue(i, (another->VoidOrientationFlag(i) ? 1 : 0));
|
||||
}
|
||||
}
|
||||
ent->Init (shell, shellFlag, voidShells, voidFlags);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolManifoldSolid::DirChecker
|
||||
(const Handle(IGESSolid_ManifoldSolid)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(186, 0);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefVoid);
|
||||
DC.LineWeight (IGESData_DefVoid);
|
||||
DC.Color (IGESData_DefVoid);
|
||||
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolManifoldSolid::OwnCheck
|
||||
(const Handle(IGESSolid_ManifoldSolid)& /* ent */,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolManifoldSolid::OwnDump
|
||||
(const Handle(IGESSolid_ManifoldSolid)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_ManifoldSolid" << endl;
|
||||
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
S << "Shell : ";
|
||||
dumper.Dump(ent->Shell(),S, sublevel);
|
||||
S << endl;
|
||||
if (ent->OrientationFlag())
|
||||
S << "Orientation agrees with the underlying surface" << endl;
|
||||
else
|
||||
S << "Orientation does not agrees with the underlying surface" << endl;
|
||||
S << "Void shells :" << endl << "Orientation flags : ";
|
||||
IGESData_DumpEntities(S,dumper,-level,1, ent->NbVoidShells(),ent->VoidShell);
|
||||
S << endl;
|
||||
if (level > 4)
|
||||
{
|
||||
S << "[ " << endl;
|
||||
if (ent->NbVoidShells() > 0)
|
||||
{
|
||||
Standard_Integer upper = ent->NbVoidShells();
|
||||
for (Standard_Integer i = 1; i <= upper; i ++)
|
||||
{
|
||||
S << "[" << i << "]: ";
|
||||
S << "Void shell : ";
|
||||
dumper.Dump (ent->VoidShell(i),S, sublevel);
|
||||
S << " - Orientation flag : ";
|
||||
if (ent->VoidOrientationFlag(i)) S << "True" << endl;
|
||||
else S << "False" << endl;
|
||||
}
|
||||
}
|
||||
S << " ]" << endl;
|
||||
}
|
||||
S << endl;
|
||||
}
|
||||
|
59
src/IGESSolid/IGESSolid_ToolPlaneSurface.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolPlaneSurface.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolPlaneSurface.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolPlaneSurface from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a PlaneSurface. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses PlaneSurface from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolPlaneSurface;
|
||||
---Purpose : Returns a ToolPlaneSurface, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable PlaneSurface;
|
||||
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 : PlaneSurface;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : PlaneSurface;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a PlaneSurface <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : PlaneSurface) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : PlaneSurface;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : PlaneSurface; entto : mutable PlaneSurface;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : PlaneSurface;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolPlaneSurface;
|
258
src/IGESSolid/IGESSolid_ToolPlaneSurface.cxx
Executable file
258
src/IGESSolid/IGESSolid_ToolPlaneSurface.cxx
Executable file
@@ -0,0 +1,258 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_PlaneSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolPlaneSurface.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESGeom_Point.hxx>
|
||||
#include <IGESGeom_Direction.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
// MGE 31/07/98
|
||||
#include <Message_Msg.hxx>
|
||||
#include <IGESData_Status.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IGESSolid_ToolPlaneSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESSolid_ToolPlaneSurface::IGESSolid_ToolPlaneSurface ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolPlaneSurface::ReadOwnParams(const Handle(IGESSolid_PlaneSurface)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESGeom_Point) tempLocation;
|
||||
Handle(IGESGeom_Direction) tempNormal;
|
||||
Handle(IGESGeom_Direction) tempRefdir; // default Unparametrised
|
||||
IGESData_Status aStatus;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
if (!PR.ReadEntity(IR, PR.Current(),aStatus,STANDARD_TYPE(IGESGeom_Point), tempLocation)){ //szv#4:S4163:12Mar99 `st=` not needed
|
||||
Message_Msg Msg174("XSTEP_174");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg174.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg174);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg174.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg174);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg174.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg174);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "Point on axis",
|
||||
STANDARD_TYPE(IGESGeom_Point), tempLocation);
|
||||
*/
|
||||
if (!PR.ReadEntity(IR, PR.Current(),aStatus,STANDARD_TYPE(IGESGeom_Direction), tempNormal)){ //szv#4:S4163:12Mar99 `st=` not needed
|
||||
Message_Msg Msg175("XSTEP_175");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg175.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg175);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg175.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg175);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg175.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg175);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "Normal direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempNormal);
|
||||
*/
|
||||
if (ent->FormNumber() == 1){
|
||||
// Parametrised surface
|
||||
if (!PR.ReadEntity(IR, PR.Current(), aStatus, STANDARD_TYPE(IGESGeom_Direction), tempRefdir)){ //szv#4:S4163:12Mar99 `st=` not needed
|
||||
Message_Msg Msg176("XSTEP_176");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg176.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg176);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg176.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg176);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg176.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg176);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
st = PR.ReadEntity(IR, PR.Current(), "Reference direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempRefdir);
|
||||
*/
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempLocation, tempNormal, tempRefdir);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolPlaneSurface::WriteOwnParams
|
||||
(const Handle(IGESSolid_PlaneSurface)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->LocationPoint());
|
||||
IW.Send(ent->Normal());
|
||||
if (ent->IsParametrised()) IW.Send(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnShared
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolPlaneSurface::OwnShared(const Handle(IGESSolid_PlaneSurface)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->LocationPoint());
|
||||
iter.GetOneItem(ent->Normal());
|
||||
iter.GetOneItem(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolPlaneSurface::OwnCopy
|
||||
(const Handle(IGESSolid_PlaneSurface)& another,
|
||||
const Handle(IGESSolid_PlaneSurface)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Point, tempLocation,
|
||||
TC.Transferred(another->LocationPoint()));
|
||||
DeclareAndCast(IGESGeom_Direction, tempNormal,
|
||||
TC.Transferred(another->Normal()));
|
||||
if (another->IsParametrised())
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Direction, tempRefdir,
|
||||
TC.Transferred(another->ReferenceDir()));
|
||||
ent->Init (tempLocation, tempNormal, tempRefdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(IGESGeom_Direction) tempRefdir;
|
||||
ent->Init (tempLocation, tempNormal, tempRefdir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DirChecker
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolPlaneSurface::DirChecker
|
||||
(const Handle(IGESSolid_PlaneSurface)& /*ent*/) const
|
||||
{
|
||||
IGESData_DirChecker DC(190, 0, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.BlankStatusIgnored ();
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCheck
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolPlaneSurface::OwnCheck(const Handle(IGESSolid_PlaneSurface)& ent,
|
||||
const Interface_ShareTool&,
|
||||
Handle(Interface_Check)& ach) const
|
||||
{
|
||||
|
||||
// MGE 31/07/98
|
||||
// Building of messages
|
||||
//========================================
|
||||
//Message_Msg Msg177("XSTEP_177");
|
||||
//========================================
|
||||
|
||||
Standard_Integer fn = 0;
|
||||
if (ent->IsParametrised()) fn = 1;
|
||||
if (fn != ent->FormNumber()) {
|
||||
Message_Msg Msg177("XSTEP_177");
|
||||
ach->SendFail (Msg177);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnDump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolPlaneSurface::OwnDump(const Handle(IGESSolid_PlaneSurface)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_PlaneSurface" << endl;
|
||||
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
S << "Point on axis : ";
|
||||
dumper.Dump(ent->LocationPoint(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Normal direction : ";
|
||||
dumper.Dump(ent->Normal(),S, sublevel);
|
||||
S << endl;
|
||||
if (ent->IsParametrised())
|
||||
{
|
||||
S << "Surface is Parametrised - Reference direction : ";
|
||||
dumper.Dump(ent->ReferenceDir(),S, sublevel);
|
||||
S << endl;
|
||||
}
|
||||
else S << "Surface is UnParametrised" << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolRightAngularWedge.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolRightAngularWedge.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolRightAngularWedge.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolRightAngularWedge from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a RightAngularWedge. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses RightAngularWedge from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolRightAngularWedge;
|
||||
---Purpose : Returns a ToolRightAngularWedge, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable RightAngularWedge;
|
||||
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 : RightAngularWedge;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : RightAngularWedge;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a RightAngularWedge <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : RightAngularWedge) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : RightAngularWedge;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : RightAngularWedge; entto : mutable RightAngularWedge;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : RightAngularWedge;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolRightAngularWedge;
|
191
src/IGESSolid/IGESSolid_ToolRightAngularWedge.cxx
Executable file
191
src/IGESSolid/IGESSolid_ToolRightAngularWedge.cxx
Executable file
@@ -0,0 +1,191 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_RightAngularWedge.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolRightAngularWedge.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolRightAngularWedge::IGESSolid_ToolRightAngularWedge () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolRightAngularWedge::ReadOwnParams
|
||||
(const Handle(IGESSolid_RightAngularWedge)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
{
|
||||
gp_XYZ tempSize, tempCorner, tempXAxis, tempZAxis;
|
||||
Standard_Real lowX;
|
||||
Standard_Real tempreal;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadXYZ(PR.CurrentList(1, 3), "Size of RightAngularWedge", tempSize); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Small X length", lowX); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Corner Point (X)", tempreal))
|
||||
tempCorner.SetX(tempreal);
|
||||
}
|
||||
else tempCorner.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Corner Point (Y)", tempreal))
|
||||
tempCorner.SetY(tempreal);
|
||||
}
|
||||
else tempCorner.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Corner Point (Z)", tempreal))
|
||||
tempCorner.SetZ(tempreal);
|
||||
}
|
||||
else tempCorner.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (I)", tempreal))
|
||||
tempXAxis.SetX(tempreal);
|
||||
}
|
||||
else tempXAxis.SetX(1.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (J)", tempreal))
|
||||
tempXAxis.SetY(tempreal);
|
||||
}
|
||||
else tempXAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local X axis (K)", tempreal))
|
||||
tempXAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempXAxis.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (I)", tempreal))
|
||||
tempZAxis.SetX(tempreal);
|
||||
}
|
||||
else tempZAxis.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (J)", tempreal))
|
||||
tempZAxis.SetY(tempreal);
|
||||
}
|
||||
else tempZAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Local Z axis (K)", tempreal))
|
||||
tempZAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempZAxis.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempSize, lowX, tempCorner, tempXAxis, tempZAxis);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempXAxis.IsEqual(ent->XAxis().XYZ(),eps)) PR.AddWarning
|
||||
("XAxis poorly unitary, normalized");
|
||||
if (!tempZAxis.IsEqual(ent->ZAxis().XYZ(),eps)) PR.AddWarning
|
||||
("ZAxis poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolRightAngularWedge::WriteOwnParams
|
||||
(const Handle(IGESSolid_RightAngularWedge)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Size().X());
|
||||
IW.Send(ent->Size().Y());
|
||||
IW.Send(ent->Size().Z());
|
||||
IW.Send(ent->XSmallLength());
|
||||
IW.Send(ent->Corner().X());
|
||||
IW.Send(ent->Corner().Y());
|
||||
IW.Send(ent->Corner().Z());
|
||||
IW.Send(ent->XAxis().X());
|
||||
IW.Send(ent->XAxis().Y());
|
||||
IW.Send(ent->XAxis().Z());
|
||||
IW.Send(ent->ZAxis().X());
|
||||
IW.Send(ent->ZAxis().Y());
|
||||
IW.Send(ent->ZAxis().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolRightAngularWedge::OwnShared
|
||||
(const Handle(IGESSolid_RightAngularWedge)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolRightAngularWedge::OwnCopy
|
||||
(const Handle(IGESSolid_RightAngularWedge)& another,
|
||||
const Handle(IGESSolid_RightAngularWedge)& ent, Interface_CopyTool& /* TC */) const
|
||||
{
|
||||
ent->Init(another->Size(), another->XSmallLength(), another->Corner().XYZ(),
|
||||
another->XAxis().XYZ(), another->ZAxis().XYZ());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolRightAngularWedge::DirChecker
|
||||
(const Handle(IGESSolid_RightAngularWedge)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(152, 0);
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolRightAngularWedge::OwnCheck
|
||||
(const Handle(IGESSolid_RightAngularWedge)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
Standard_Real eps = 1.E-04;
|
||||
Standard_Real prosca = ent->XAxis() * ent->ZAxis();
|
||||
if (prosca < -eps || prosca > eps)
|
||||
ach->AddFail("Local Z axis : Not orthogonal to X axis");
|
||||
if (ent->Size().X() <= 0. || ent->Size().Y() <= 0. || ent->Size().Z() <= 0.)
|
||||
ach->AddFail("Size : Values are not positive");
|
||||
if (ent->XSmallLength() <= 0.0)
|
||||
ach->AddFail("Small X Length : Not Positive");
|
||||
if (ent->XSmallLength() >= ent->Size().X())
|
||||
ach->AddFail("Small X Length : Value not < LX");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolRightAngularWedge::OwnDump
|
||||
(const Handle(IGESSolid_RightAngularWedge)& ent, const IGESData_IGESDumper& /* dumper */,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_RightAngularWedge" << endl;
|
||||
|
||||
S << "Size : ";
|
||||
IGESData_DumpXYZ(S, ent->Size()); S << " ";
|
||||
S << "XSmall : " << ent->XSmallLength() << endl;
|
||||
S << "Corner : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Corner(), ent->Location());
|
||||
S << endl << "XAxis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->XAxis(), ent->VectorLocation());
|
||||
S << endl << "ZAxis : ";
|
||||
IGESData_DumpXYZL(S,level, ent->ZAxis(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolSelectedComponent.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolSelectedComponent.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolSelectedComponent.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolSelectedComponent from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a SelectedComponent. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses SelectedComponent from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolSelectedComponent;
|
||||
---Purpose : Returns a ToolSelectedComponent, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable SelectedComponent;
|
||||
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 : SelectedComponent;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : SelectedComponent;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a SelectedComponent <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : SelectedComponent) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : SelectedComponent;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : SelectedComponent; entto : mutable SelectedComponent;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : SelectedComponent;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolSelectedComponent;
|
98
src/IGESSolid/IGESSolid_ToolSelectedComponent.cxx
Executable file
98
src/IGESSolid/IGESSolid_ToolSelectedComponent.cxx
Executable file
@@ -0,0 +1,98 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SelectedComponent.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolSelectedComponent.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESSolid_BooleanTree.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolSelectedComponent::IGESSolid_ToolSelectedComponent () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolSelectedComponent::ReadOwnParams
|
||||
(const Handle(IGESSolid_SelectedComponent)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESSolid_BooleanTree) tempEntity;
|
||||
gp_XYZ tempSelectPoint;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Boolean Tree Entity",
|
||||
STANDARD_TYPE(IGESSolid_BooleanTree), tempEntity); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadXYZ(PR.CurrentList(1, 3), "Select Point", tempSelectPoint); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init(tempEntity, tempSelectPoint);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSelectedComponent::WriteOwnParams
|
||||
(const Handle(IGESSolid_SelectedComponent)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Component());
|
||||
IW.Send(ent->SelectPoint().X());
|
||||
IW.Send(ent->SelectPoint().Y());
|
||||
IW.Send(ent->SelectPoint().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSelectedComponent::OwnShared
|
||||
(const Handle(IGESSolid_SelectedComponent)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->Component());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSelectedComponent::OwnCopy
|
||||
(const Handle(IGESSolid_SelectedComponent)& another,
|
||||
const Handle(IGESSolid_SelectedComponent)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESSolid_BooleanTree, tempEntity,
|
||||
TC.Transferred(another->Component()));
|
||||
gp_XYZ tempSelectPoint = another->SelectPoint().XYZ();
|
||||
ent->Init (tempEntity, tempSelectPoint);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolSelectedComponent::DirChecker
|
||||
(const Handle(IGESSolid_SelectedComponent)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(182, 0);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefVoid);
|
||||
DC.LineWeight (IGESData_DefVoid);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.BlankStatusIgnored ();
|
||||
DC.UseFlagRequired (3);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSelectedComponent::OwnCheck
|
||||
(const Handle(IGESSolid_SelectedComponent)& /* ent */,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSelectedComponent::OwnDump
|
||||
(const Handle(IGESSolid_SelectedComponent)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_SelectedComponent" << endl;
|
||||
|
||||
// the heading for boolean tree is in BooleanTree OwnDump
|
||||
S << "Boolean Tree Entity : " << endl;
|
||||
dumper.Dump(ent->Component(),S, (level <= 4) ? 0 : 1);
|
||||
S << "Seleted Point : ";
|
||||
IGESData_DumpXYZL(S,level, ent->SelectPoint(), ent->Location());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolShell.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolShell.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolShell.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolShell from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Shell. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Shell from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolShell;
|
||||
---Purpose : Returns a ToolShell, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Shell;
|
||||
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 : Shell;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Shell;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Shell <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Shell) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Shell;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Shell; entto : mutable Shell;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Shell;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolShell;
|
237
src/IGESSolid/IGESSolid_ToolShell.cxx
Executable file
237
src/IGESSolid/IGESSolid_ToolShell.cxx
Executable file
@@ -0,0 +1,237 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Shell.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolShell.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESSolid_Face.hxx>
|
||||
#include <IGESSolid_HArray1OfFace.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <IGESSolid.hxx>
|
||||
|
||||
// MGE 03/08/98
|
||||
#include <Message_Msg.hxx>
|
||||
#include <IGESData_Status.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IGESSolid_ToolShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESSolid_ToolShell::IGESSolid_ToolShell ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolShell::ReadOwnParams(const Handle(IGESSolid_Shell)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const
|
||||
{
|
||||
|
||||
// MGE 03/08/98
|
||||
|
||||
//Standard_Boolean abool; //szv#4:S4163:12Mar99 moved down
|
||||
Standard_Integer nbfaces=0;; //szv#4:S4163:12Mar99 `i` moved in for
|
||||
//Handle(IGESSolid_Face) aface; //szv#4:S4163:12Mar99 moved down
|
||||
Handle(IGESSolid_HArray1OfFace) tempFaces;
|
||||
Handle(TColStd_HArray1OfInteger) tempOrientation;
|
||||
|
||||
//st = PR.ReadInteger(PR.Current(), Msg200, nbfaces); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadInteger(PR.Current(), "Number of faces", nbfaces);
|
||||
Standard_Boolean sb = PR.ReadInteger(PR.Current(), nbfaces);
|
||||
if (sb && nbfaces > 0 ) {
|
||||
Message_Msg Msg180("XSTEP_180");
|
||||
|
||||
Standard_Boolean abool;
|
||||
Handle(IGESSolid_Face) aface;
|
||||
tempFaces = new IGESSolid_HArray1OfFace(1, nbfaces);
|
||||
tempOrientation = new TColStd_HArray1OfInteger(1, nbfaces);
|
||||
IGESData_Status aStatus;
|
||||
for (Standard_Integer i=1; i<=nbfaces; i++) {
|
||||
//st = PR.ReadEntity(IR, PR.Current(),Msg201, STANDARD_TYPE(IGESSolid_Face), aface); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadEntity(IR, PR.Current(), "Faces", STANDARD_TYPE(IGESSolid_Face), aface);
|
||||
if (PR.ReadEntity(IR, PR.Current(),aStatus, STANDARD_TYPE(IGESSolid_Face), aface))
|
||||
tempFaces->SetValue(i, aface);
|
||||
else{
|
||||
Message_Msg Msg201("XSTEP_201");
|
||||
switch(aStatus) {
|
||||
case IGESData_ReferenceError: {
|
||||
Message_Msg Msg216 ("IGES_216");
|
||||
Msg201.Arg(Msg216.Value());
|
||||
PR.SendFail(Msg201);
|
||||
break; }
|
||||
case IGESData_EntityError: {
|
||||
Message_Msg Msg217 ("IGES_217");
|
||||
Msg201.Arg(Msg217.Value());
|
||||
PR.SendFail(Msg201);
|
||||
break; }
|
||||
case IGESData_TypeError: {
|
||||
Message_Msg Msg218 ("IGES_218");
|
||||
Msg201.Arg(Msg218.Value());
|
||||
PR.SendFail(Msg201);
|
||||
break; }
|
||||
default:{
|
||||
}
|
||||
}
|
||||
}
|
||||
//st = PR.ReadBoolean(PR.Current(), Msg180, abool); //szv#4:S4163:12Mar99 moved in if
|
||||
//st = PR.ReadBoolean(PR.Current(), "Orientation flags", abool);
|
||||
if (PR.ReadBoolean(PR.Current(), Msg180, abool))
|
||||
tempOrientation->SetValue(i, (abool ? 1 : 0) );
|
||||
}
|
||||
}
|
||||
else {
|
||||
Message_Msg Msg200("XSTEP_200");
|
||||
PR.SendFail(Msg200);
|
||||
}
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempFaces, tempOrientation);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteOwnParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolShell::WriteOwnParams(const Handle(IGESSolid_Shell)& ent,
|
||||
IGESData_IGESWriter& IW) const
|
||||
{
|
||||
Standard_Integer i, nbfaces = ent->NbFaces();
|
||||
|
||||
IW.Send(nbfaces);
|
||||
for (i = 1; i <= nbfaces; i ++)
|
||||
{
|
||||
IW.Send(ent->Face(i));
|
||||
IW.SendBoolean(ent->Orientation(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnShared
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolShell::OwnShared(const Handle(IGESSolid_Shell)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer nbfaces = ent->NbFaces();
|
||||
for (Standard_Integer i = 1; i <= nbfaces; i ++)
|
||||
iter.GetOneItem(ent->Face(i));
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolShell::OwnCopy(const Handle(IGESSolid_Shell)& another,
|
||||
const Handle(IGESSolid_Shell)& ent,
|
||||
Interface_CopyTool& TC) const
|
||||
{
|
||||
Standard_Integer nbfaces = another->NbFaces();
|
||||
|
||||
Handle(IGESSolid_HArray1OfFace) tempFaces = new
|
||||
IGESSolid_HArray1OfFace(1, nbfaces);
|
||||
Handle(TColStd_HArray1OfInteger) tempOrientation = new
|
||||
TColStd_HArray1OfInteger(1, nbfaces);
|
||||
for (Standard_Integer i=1; i<=nbfaces; i++)
|
||||
{
|
||||
DeclareAndCast(IGESSolid_Face, face,
|
||||
TC.Transferred(another->Face(i)));
|
||||
tempFaces->SetValue(i, face);
|
||||
tempOrientation->SetValue(i, (another->Orientation(i) ? 1 : 0) );
|
||||
}
|
||||
ent->Init (tempFaces, tempOrientation);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DirChecker
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolShell::DirChecker
|
||||
(const Handle(IGESSolid_Shell)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(514, 1,2);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefVoid);
|
||||
DC.LineWeight (IGESData_DefVoid);
|
||||
DC.Color (IGESData_DefVoid);
|
||||
|
||||
DC.SubordinateStatusRequired(1);
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnCheck
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolShell::OwnCheck(const Handle(IGESSolid_Shell)& ent,
|
||||
const Interface_ShareTool&,
|
||||
Handle(Interface_Check)& ach) const
|
||||
{
|
||||
// MGE 03/08/98
|
||||
// Building of messages
|
||||
//========================================
|
||||
//Message_Msg Msg200("XSTEP_200");
|
||||
//========================================
|
||||
|
||||
if (ent->NbFaces() <= 0) {
|
||||
Message_Msg Msg200("XSTEP_200");
|
||||
ach->SendFail(Msg200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : OwnDump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void IGESSolid_ToolShell::OwnDump(const Handle(IGESSolid_Shell)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_Shell" << endl;
|
||||
Standard_Integer upper = ent->NbFaces();
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
|
||||
S << "Faces : " << endl << "Orientation flags : ";
|
||||
IGESData_DumpEntities(S,dumper,-level,1, ent->NbFaces(),ent->Face);
|
||||
S << endl;
|
||||
if (level > 4)
|
||||
{
|
||||
S << "[" << endl;
|
||||
for (Standard_Integer i = 1; i <= upper; i ++)
|
||||
{
|
||||
S << "[" << i << "]: ";
|
||||
S << "Face : ";
|
||||
dumper.Dump (ent->Face(i),S, sublevel);
|
||||
S << " - Orientation flag : ";
|
||||
if (ent->Orientation(i)) S << "True" << endl;
|
||||
else S << "False" << endl;
|
||||
}
|
||||
}
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolSolidAssembly.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolSolidAssembly.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolSolidAssembly.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolSolidAssembly from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a SolidAssembly. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses SolidAssembly from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolSolidAssembly;
|
||||
---Purpose : Returns a ToolSolidAssembly, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable SolidAssembly;
|
||||
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 : SolidAssembly;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : SolidAssembly;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a SolidAssembly <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : SolidAssembly) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : SolidAssembly;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : SolidAssembly; entto : mutable SolidAssembly;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : SolidAssembly;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolSolidAssembly;
|
151
src/IGESSolid/IGESSolid_ToolSolidAssembly.cxx
Executable file
151
src/IGESSolid/IGESSolid_ToolSolidAssembly.cxx
Executable file
@@ -0,0 +1,151 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidAssembly.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolSolidAssembly.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <IGESGeom_TransformationMatrix.hxx>
|
||||
#include <IGESData_HArray1OfIGESEntity.hxx>
|
||||
#include <IGESGeom_HArray1OfTransformationMatrix.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolSolidAssembly::IGESSolid_ToolSolidAssembly () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolSolidAssembly::ReadOwnParams
|
||||
(const Handle(IGESSolid_SolidAssembly)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
|
||||
Standard_Integer nbitems; //szv#4:S4163:12Mar99 `i` moved in for
|
||||
//Handle(IGESData_IGESEntity) anent; //szv#4:S4163:12Mar99 moved down
|
||||
//Handle(IGESGeom_TransformationMatrix) amatr; //szv#4:S4163:12Mar99 moved down
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempItems;
|
||||
Handle(IGESGeom_HArray1OfTransformationMatrix) tempMatrices;
|
||||
|
||||
Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Items", nbitems);
|
||||
if (st && nbitems > 0)
|
||||
{
|
||||
tempItems = new IGESData_HArray1OfIGESEntity(1, nbitems);
|
||||
tempMatrices = new IGESGeom_HArray1OfTransformationMatrix(1, nbitems);
|
||||
|
||||
Handle(IGESData_IGESEntity) anent;
|
||||
Standard_Integer i; // svv Jan 10 2000 : porting on DEC
|
||||
for (i = 1; i <= nbitems; i++)
|
||||
{
|
||||
//st = PR.ReadEntity(IR,PR.Current(), "Solid assembly items", anent); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadEntity(IR,PR.Current(), "Solid assembly items", anent))
|
||||
tempItems->SetValue(i, anent);
|
||||
}
|
||||
|
||||
Handle(IGESGeom_TransformationMatrix) amatr;
|
||||
for (i = 1; i <= nbitems; i++)
|
||||
{
|
||||
//st = PR.ReadEntity(IR,PR.Current(), "Matrices",
|
||||
//STANDARD_TYPE(IGESGeom_TransformationMatrix),
|
||||
//amatr, Standard_True); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadEntity(IR,PR.Current(), "Matrices",
|
||||
STANDARD_TYPE(IGESGeom_TransformationMatrix), amatr, Standard_True))
|
||||
tempMatrices->SetValue(i, amatr);
|
||||
}
|
||||
}
|
||||
else PR.AddFail("Number of Items : Not Positive");
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempItems, tempMatrices);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidAssembly::WriteOwnParams
|
||||
(const Handle(IGESSolid_SolidAssembly)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
Standard_Integer nbitems = ent->NbItems();
|
||||
Standard_Integer i;
|
||||
|
||||
IW.Send(nbitems);
|
||||
for (i = 1; i <= nbitems; i ++)
|
||||
IW.Send(ent->Item(i));
|
||||
for (i = 1; i <= nbitems; i ++)
|
||||
IW.Send(ent->TransfMatrix(i));
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidAssembly::OwnShared
|
||||
(const Handle(IGESSolid_SolidAssembly)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer nbitems = ent->NbItems();
|
||||
Standard_Integer i;
|
||||
for (i = 1; i <= nbitems; i ++) iter.GetOneItem(ent->Item(i));
|
||||
for (i = 1; i <= nbitems; i ++) iter.GetOneItem(ent->TransfMatrix(i));
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidAssembly::OwnCopy
|
||||
(const Handle(IGESSolid_SolidAssembly)& another,
|
||||
const Handle(IGESSolid_SolidAssembly)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
Standard_Integer nbitems, i;
|
||||
Handle(IGESData_IGESEntity) anent;
|
||||
|
||||
nbitems = another->NbItems();
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempItems = new
|
||||
IGESData_HArray1OfIGESEntity(1, nbitems);
|
||||
Handle(IGESGeom_HArray1OfTransformationMatrix) tempMatrices = new
|
||||
IGESGeom_HArray1OfTransformationMatrix(1, nbitems);
|
||||
|
||||
for (i=1; i<=nbitems; i++)
|
||||
{
|
||||
DeclareAndCast(IGESData_IGESEntity, localent,
|
||||
TC.Transferred(another->Item(i)));
|
||||
tempItems->SetValue(i, localent);
|
||||
}
|
||||
for (i=1; i<=nbitems; i++)
|
||||
{
|
||||
DeclareAndCast(IGESGeom_TransformationMatrix, newlocalent,
|
||||
TC.Transferred(another->TransfMatrix(i)));
|
||||
tempMatrices->SetValue(i, newlocalent);
|
||||
}
|
||||
|
||||
ent->Init(tempItems, tempMatrices);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolSolidAssembly::DirChecker
|
||||
(const Handle(IGESSolid_SolidAssembly)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(184, 0,1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (2);
|
||||
DC.GraphicsIgnored (1);
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidAssembly::OwnCheck
|
||||
(const Handle(IGESSolid_SolidAssembly)& /* ent */,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidAssembly::OwnDump
|
||||
(const Handle(IGESSolid_SolidAssembly)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
// Standard_Integer upper = ent->NbItems();
|
||||
|
||||
S << "IGESSolid_SolidAssembly" << endl;
|
||||
|
||||
S << "Items : ";
|
||||
IGESData_DumpEntities(S,dumper ,level,1, ent->NbItems(),ent->Item);
|
||||
S << endl;
|
||||
S << "Matrices : ";
|
||||
IGESData_DumpEntities(S,dumper ,level,1, ent->NbItems(),ent->TransfMatrix);
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolSolidInstance.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolSolidInstance.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolSolidInstance.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolSolidInstance from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a SolidInstance. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses SolidInstance from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolSolidInstance;
|
||||
---Purpose : Returns a ToolSolidInstance, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable SolidInstance;
|
||||
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 : SolidInstance;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : SolidInstance;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a SolidInstance <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : SolidInstance) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : SolidInstance;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : SolidInstance; entto : mutable SolidInstance;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : SolidInstance;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolSolidInstance;
|
81
src/IGESSolid/IGESSolid_ToolSolidInstance.cxx
Executable file
81
src/IGESSolid/IGESSolid_ToolSolidInstance.cxx
Executable file
@@ -0,0 +1,81 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidInstance.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolSolidInstance.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
|
||||
IGESSolid_ToolSolidInstance::IGESSolid_ToolSolidInstance () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolSolidInstance::ReadOwnParams
|
||||
(const Handle(IGESSolid_SolidInstance)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESData_IGESEntity) tempEntity;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Solid Entity", tempEntity); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init(tempEntity);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidInstance::WriteOwnParams
|
||||
(const Handle(IGESSolid_SolidInstance)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Entity());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidInstance::OwnShared
|
||||
(const Handle(IGESSolid_SolidInstance)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->Entity());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidInstance::OwnCopy
|
||||
(const Handle(IGESSolid_SolidInstance)& another,
|
||||
const Handle(IGESSolid_SolidInstance)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESData_IGESEntity, tempEntity,
|
||||
TC.Transferred(another->Entity()));
|
||||
ent->Init (tempEntity);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolSolidInstance::DirChecker
|
||||
(const Handle(IGESSolid_SolidInstance)& /*ent*/) const
|
||||
{
|
||||
IGESData_DirChecker DC(430, 0,1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.GraphicsIgnored (1);
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidInstance::OwnCheck
|
||||
(const Handle(IGESSolid_SolidInstance)& /*ent*/,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidInstance::OwnDump
|
||||
(const Handle(IGESSolid_SolidInstance)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_SolidInstance" << endl;
|
||||
|
||||
S << "Solid entity : ";
|
||||
dumper.Dump(ent->Entity(),S, (level <= 4) ? 0 : 1);
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolSolidOfLinearExtrusion.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolSolidOfLinearExtrusion from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a SolidOfLinearExtrusion. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses SolidOfLinearExtrusion from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolSolidOfLinearExtrusion;
|
||||
---Purpose : Returns a ToolSolidOfLinearExtrusion, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable SolidOfLinearExtrusion;
|
||||
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 : SolidOfLinearExtrusion;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : SolidOfLinearExtrusion;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a SolidOfLinearExtrusion <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : SolidOfLinearExtrusion) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : SolidOfLinearExtrusion;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : SolidOfLinearExtrusion; entto : mutable SolidOfLinearExtrusion;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : SolidOfLinearExtrusion;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolSolidOfLinearExtrusion;
|
129
src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cxx
Executable file
129
src/IGESSolid/IGESSolid_ToolSolidOfLinearExtrusion.cxx
Executable file
@@ -0,0 +1,129 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidOfLinearExtrusion.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolSolidOfLinearExtrusion.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolSolidOfLinearExtrusion::IGESSolid_ToolSolidOfLinearExtrusion ()
|
||||
{ }
|
||||
|
||||
|
||||
void IGESSolid_ToolSolidOfLinearExtrusion::ReadOwnParams
|
||||
(const Handle(IGESSolid_SolidOfLinearExtrusion)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESData_IGESEntity) tempEntity;
|
||||
gp_XYZ tempDirection;
|
||||
Standard_Real tempLength;
|
||||
Standard_Real tempreal;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Curve Entity", tempEntity); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Length of extrusion", tempLength); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Extrusion direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Extrusion direction (I)", tempreal))
|
||||
tempDirection.SetX(tempreal);
|
||||
}
|
||||
else tempDirection.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Extrusion direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Extrusion direction (J)", tempreal))
|
||||
tempDirection.SetY(tempreal);
|
||||
}
|
||||
else tempDirection.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Extrusion direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Extrusion direction (K)", tempreal))
|
||||
tempDirection.SetZ(tempreal);
|
||||
}
|
||||
else tempDirection.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init(tempEntity, tempLength, tempDirection);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempDirection.IsEqual(ent->ExtrusionDirection().XYZ(),eps))
|
||||
PR.AddWarning("Extrusion Direction poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfLinearExtrusion::WriteOwnParams
|
||||
(const Handle(IGESSolid_SolidOfLinearExtrusion)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Curve());
|
||||
IW.Send(ent->ExtrusionLength());
|
||||
IW.Send(ent->ExtrusionDirection().X());
|
||||
IW.Send(ent->ExtrusionDirection().Y());
|
||||
IW.Send(ent->ExtrusionDirection().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfLinearExtrusion::OwnShared
|
||||
(const Handle(IGESSolid_SolidOfLinearExtrusion)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->Curve());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfLinearExtrusion::OwnCopy
|
||||
(const Handle(IGESSolid_SolidOfLinearExtrusion)& another,
|
||||
const Handle(IGESSolid_SolidOfLinearExtrusion)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESData_IGESEntity, tempEntity,
|
||||
TC.Transferred(another->Curve()));
|
||||
Standard_Real tempLength = another->ExtrusionLength();
|
||||
gp_XYZ tempDirection = another->ExtrusionDirection().XYZ();
|
||||
ent->Init(tempEntity, tempLength, tempDirection);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolSolidOfLinearExtrusion::DirChecker
|
||||
(const Handle(IGESSolid_SolidOfLinearExtrusion)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(164, 0);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfLinearExtrusion::OwnCheck
|
||||
(const Handle(IGESSolid_SolidOfLinearExtrusion)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->ExtrusionLength() <= 0.0)
|
||||
ach->AddFail("Length of extrusion : Not Positive");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfLinearExtrusion::OwnDump
|
||||
(const Handle(IGESSolid_SolidOfLinearExtrusion)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_SolidOfLinearExtrusion" << endl;
|
||||
|
||||
S << "Curve entity : ";
|
||||
dumper.Dump(ent->Curve(),S, (level <= 4) ? 0 : 1);
|
||||
S << endl;
|
||||
S << "Extrusion length : " << ent->ExtrusionLength() << endl;
|
||||
S << "Extrusion direction : ";
|
||||
IGESData_DumpXYZL(S,level, ent->ExtrusionDirection(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolSolidOfRevolution.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolSolidOfRevolution from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a SolidOfRevolution. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses SolidOfRevolution from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolSolidOfRevolution;
|
||||
---Purpose : Returns a ToolSolidOfRevolution, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable SolidOfRevolution;
|
||||
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 : SolidOfRevolution;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : SolidOfRevolution;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a SolidOfRevolution <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : SolidOfRevolution) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : SolidOfRevolution;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : SolidOfRevolution; entto : mutable SolidOfRevolution;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : SolidOfRevolution;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolSolidOfRevolution;
|
163
src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cxx
Executable file
163
src/IGESSolid/IGESSolid_ToolSolidOfRevolution.cxx
Executable file
@@ -0,0 +1,163 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SolidOfRevolution.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolSolidOfRevolution.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolSolidOfRevolution::IGESSolid_ToolSolidOfRevolution () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolSolidOfRevolution::ReadOwnParams
|
||||
(const Handle(IGESSolid_SolidOfRevolution)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESData_IGESEntity) tempEntity;
|
||||
gp_XYZ tempAxisPoint;
|
||||
gp_XYZ tempAxis;
|
||||
Standard_Real tempFraction;
|
||||
Standard_Real tempreal;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Curve Entity", tempEntity); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
PR.ReadReal(PR.Current(), "Fraction of rotation", tempFraction); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
else
|
||||
tempFraction = 1.0;
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis Point (X)", tempreal))
|
||||
tempAxisPoint.SetX(tempreal);
|
||||
}
|
||||
else tempAxisPoint.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis Point (Y)", tempreal))
|
||||
tempAxisPoint.SetY(tempreal);
|
||||
}
|
||||
else tempAxisPoint.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis Point (Z)", tempreal))
|
||||
tempAxisPoint.SetZ(tempreal);
|
||||
}
|
||||
else tempAxisPoint.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal))
|
||||
tempAxis.SetX(tempreal);
|
||||
}
|
||||
else tempAxis.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal))
|
||||
tempAxis.SetY(tempreal);
|
||||
}
|
||||
else tempAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal))
|
||||
tempAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempAxis.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempEntity, tempFraction, tempAxisPoint, tempAxis);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempAxis.IsEqual(ent->Axis().XYZ(),eps))
|
||||
PR.AddWarning("Axis poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfRevolution::WriteOwnParams
|
||||
(const Handle(IGESSolid_SolidOfRevolution)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Curve());
|
||||
IW.Send(ent->Fraction());
|
||||
IW.Send(ent->AxisPoint().X());
|
||||
IW.Send(ent->AxisPoint().Y());
|
||||
IW.Send(ent->AxisPoint().Z());
|
||||
IW.Send(ent->Axis().X());
|
||||
IW.Send(ent->Axis().Y());
|
||||
IW.Send(ent->Axis().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfRevolution::OwnShared
|
||||
(const Handle(IGESSolid_SolidOfRevolution)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->Curve());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfRevolution::OwnCopy
|
||||
(const Handle(IGESSolid_SolidOfRevolution)& another,
|
||||
const Handle(IGESSolid_SolidOfRevolution)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESData_IGESEntity, tempEntity,
|
||||
TC.Transferred(another->Curve()));
|
||||
Standard_Real tempFraction = another->Fraction();
|
||||
gp_XYZ tempAxisPoint = another->AxisPoint().XYZ();
|
||||
gp_XYZ tempAxis= another->Axis().XYZ();
|
||||
ent->Init(tempEntity, tempFraction, tempAxisPoint, tempAxis);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolSolidOfRevolution::DirChecker
|
||||
(const Handle(IGESSolid_SolidOfRevolution)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(162, 0, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfRevolution::OwnCheck
|
||||
(const Handle(IGESSolid_SolidOfRevolution)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->Fraction() <= 0 || ent->Fraction() > 1.0)
|
||||
ach->AddFail("Fraction of rotation : Incorrect value");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSolidOfRevolution::OwnDump
|
||||
(const Handle(IGESSolid_SolidOfRevolution)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_SolidOfRevolution" << endl;
|
||||
|
||||
S << "Curve entity :";
|
||||
dumper.Dump(ent->Curve(),S, (level <= 4) ? 0 : 1);
|
||||
S << endl;
|
||||
S << "Fraction of rotation : " << ent->Fraction() << endl;
|
||||
S << "Axis Point : ";
|
||||
IGESData_DumpXYZL(S,level, ent->AxisPoint(), ent->Location());
|
||||
S << endl << "Axis direction : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Axis(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolSphere.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolSphere.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolSphere.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolSphere from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Sphere. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Sphere from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolSphere;
|
||||
---Purpose : Returns a ToolSphere, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Sphere;
|
||||
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 : Sphere;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Sphere;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Sphere <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Sphere) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Sphere;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Sphere; entto : mutable Sphere;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Sphere;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolSphere;
|
111
src/IGESSolid/IGESSolid_ToolSphere.cxx
Executable file
111
src/IGESSolid/IGESSolid_ToolSphere.cxx
Executable file
@@ -0,0 +1,111 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Sphere.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolSphere.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolSphere::IGESSolid_ToolSphere () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolSphere::ReadOwnParams
|
||||
(const Handle(IGESSolid_Sphere)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Standard_Real tempRadius, tempreal;
|
||||
gp_XYZ tempCenter;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center (X)", tempreal))
|
||||
tempCenter.SetX(tempreal);
|
||||
}
|
||||
else tempCenter.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center (Y)", tempreal))
|
||||
tempCenter.SetY(tempreal);
|
||||
}
|
||||
else tempCenter.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center (Z)", tempreal))
|
||||
tempCenter.SetZ(tempreal);
|
||||
}
|
||||
else tempCenter.SetZ(0.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempRadius, tempCenter);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphere::WriteOwnParams
|
||||
(const Handle(IGESSolid_Sphere)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Radius());
|
||||
IW.Send(ent->Center().X());
|
||||
IW.Send(ent->Center().Y());
|
||||
IW.Send(ent->Center().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphere::OwnShared
|
||||
(const Handle(IGESSolid_Sphere)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphere::OwnCopy
|
||||
(const Handle(IGESSolid_Sphere)& another,
|
||||
const Handle(IGESSolid_Sphere)& ent, Interface_CopyTool& /* TC */) const
|
||||
{
|
||||
ent->Init (another->Radius(), another->Center().XYZ());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolSphere::DirChecker
|
||||
(const Handle(IGESSolid_Sphere)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(158, 0);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphere::OwnCheck
|
||||
(const Handle(IGESSolid_Sphere)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->Radius() <= 0.0)
|
||||
ach->AddFail("Radius : Not Positive");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphere::OwnDump
|
||||
(const Handle(IGESSolid_Sphere)& ent, const IGESData_IGESDumper& /* dumper */,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_Sphere" << endl;
|
||||
|
||||
S << "Radius : " << ent->Radius() << endl;
|
||||
S << "Center : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Center(), ent->Location());
|
||||
S << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolSphericalSurface.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolSphericalSurface.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolSphericalSurface.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolSphericalSurface from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a SphericalSurface. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses SphericalSurface from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolSphericalSurface;
|
||||
---Purpose : Returns a ToolSphericalSurface, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable SphericalSurface;
|
||||
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 : SphericalSurface;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : SphericalSurface;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a SphericalSurface <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : SphericalSurface) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : SphericalSurface;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : SphericalSurface; entto : mutable SphericalSurface;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : SphericalSurface;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolSphericalSurface;
|
144
src/IGESSolid/IGESSolid_ToolSphericalSurface.cxx
Executable file
144
src/IGESSolid/IGESSolid_ToolSphericalSurface.cxx
Executable file
@@ -0,0 +1,144 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_SphericalSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolSphericalSurface.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESGeom_Point.hxx>
|
||||
#include <IGESGeom_Direction.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolSphericalSurface::IGESSolid_ToolSphericalSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolSphericalSurface::ReadOwnParams
|
||||
(const Handle(IGESSolid_SphericalSurface)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESGeom_Point) tempCenter;
|
||||
Standard_Real tempRadius;
|
||||
Handle(IGESGeom_Direction) tempAxis; // default Unparameterised
|
||||
Handle(IGESGeom_Direction) tempRefdir; // default Unparameterised
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Center point",
|
||||
STANDARD_TYPE(IGESGeom_Point), tempCenter); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Radius", tempRadius); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (ent->FormNumber() == 1) // Parametrised surface
|
||||
{
|
||||
PR.ReadEntity(IR, PR.Current(), "Axis direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Reference direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
}
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempCenter, tempRadius, tempAxis, tempRefdir);
|
||||
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphericalSurface::WriteOwnParams
|
||||
(const Handle(IGESSolid_SphericalSurface)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Center());
|
||||
IW.Send(ent->Radius());
|
||||
if (ent->IsParametrised())
|
||||
{
|
||||
IW.Send(ent->Axis());
|
||||
IW.Send(ent->ReferenceDir());
|
||||
}
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphericalSurface::OwnShared
|
||||
(const Handle(IGESSolid_SphericalSurface)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->Center());
|
||||
iter.GetOneItem(ent->Axis());
|
||||
iter.GetOneItem(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphericalSurface::OwnCopy
|
||||
(const Handle(IGESSolid_SphericalSurface)& another,
|
||||
const Handle(IGESSolid_SphericalSurface)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Point, tempCenter,
|
||||
TC.Transferred(another->Center()));
|
||||
Standard_Real tempRadius = another->Radius();
|
||||
if (another->IsParametrised())
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Direction, tempAxis,
|
||||
TC.Transferred(another->Axis()));
|
||||
DeclareAndCast(IGESGeom_Direction, tempRefdir,
|
||||
TC.Transferred(another->ReferenceDir()));
|
||||
ent->Init (tempCenter, tempRadius, tempAxis, tempRefdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(IGESGeom_Direction) tempAxis;
|
||||
Handle(IGESGeom_Direction) tempRefdir;
|
||||
ent->Init (tempCenter, tempRadius, tempAxis, tempRefdir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolSphericalSurface::DirChecker
|
||||
(const Handle(IGESSolid_SphericalSurface)& /*ent*/) const
|
||||
{
|
||||
IGESData_DirChecker DC(196, 0, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.BlankStatusIgnored ();
|
||||
DC.SubordinateStatusRequired (1);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphericalSurface::OwnCheck
|
||||
(const Handle(IGESSolid_SphericalSurface)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->Radius() <= 0.0)
|
||||
ach->AddFail("Radius : Not Positive");
|
||||
Standard_Integer fn = 0;
|
||||
if (ent->IsParametrised()) fn = 1;
|
||||
if (fn != ent->FormNumber()) ach->AddFail
|
||||
("Parametrised Status Mismatches with Form Number");
|
||||
if (ent->Axis().IsNull()) if (ent->IsParametrised()) ach->AddFail
|
||||
("Parametrised Spherical Surface : no Axis is defined");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolSphericalSurface::OwnDump
|
||||
(const Handle(IGESSolid_SphericalSurface)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_SphericalSurface" << endl;
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
|
||||
S << "Center : ";
|
||||
dumper.Dump(ent->Center(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Radius : " << ent->Radius() << endl;
|
||||
if (ent->IsParametrised())
|
||||
{
|
||||
S << "Surface is Parametrised" << endl;
|
||||
S << "Axis direction : ";
|
||||
dumper.Dump(ent->Axis(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Reference direction : ";
|
||||
dumper.Dump(ent->ReferenceDir(),S, sublevel);
|
||||
S << endl;
|
||||
}
|
||||
else S << "Surface is UnParametrised" << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolToroidalSurface.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolToroidalSurface.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolToroidalSurface.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolToroidalSurface from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a ToroidalSurface. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses ToroidalSurface from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolToroidalSurface;
|
||||
---Purpose : Returns a ToolToroidalSurface, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable ToroidalSurface;
|
||||
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 : ToroidalSurface;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : ToroidalSurface;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a ToroidalSurface <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : ToroidalSurface) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : ToroidalSurface;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : ToroidalSurface; entto : mutable ToroidalSurface;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : ToroidalSurface;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolToroidalSurface;
|
141
src/IGESSolid/IGESSolid_ToolToroidalSurface.cxx
Executable file
141
src/IGESSolid/IGESSolid_ToolToroidalSurface.cxx
Executable file
@@ -0,0 +1,141 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_ToroidalSurface.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolToroidalSurface.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <IGESGeom_Point.hxx>
|
||||
#include <IGESGeom_Direction.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
|
||||
IGESSolid_ToolToroidalSurface::IGESSolid_ToolToroidalSurface () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolToroidalSurface::ReadOwnParams
|
||||
(const Handle(IGESSolid_ToroidalSurface)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Handle(IGESGeom_Point) tempCenter;
|
||||
Standard_Real majRad, minRad;
|
||||
Handle(IGESGeom_Direction) tempAxis; // default Unparametrised
|
||||
Handle(IGESGeom_Direction) tempRefdir; // default Unparametrised
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Center point",
|
||||
STANDARD_TYPE(IGESGeom_Point), tempCenter); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadEntity(IR, PR.Current(), "Axis direction",
|
||||
STANDARD_TYPE(IGESGeom_Direction), tempAxis); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Major Radius", majRad); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Minor Radius", minRad); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (ent->FormNumber() == 1) // Parametrised surface
|
||||
PR.ReadEntity(IR, PR.Current(), "Reference direction", tempRefdir); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempCenter, tempAxis, majRad, minRad, tempRefdir);
|
||||
}
|
||||
|
||||
void IGESSolid_ToolToroidalSurface::WriteOwnParams
|
||||
(const Handle(IGESSolid_ToroidalSurface)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->Center());
|
||||
IW.Send(ent->Axis());
|
||||
IW.Send(ent->MajorRadius());
|
||||
IW.Send(ent->MinorRadius());
|
||||
if (ent->IsParametrised()) IW.Send(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolToroidalSurface::OwnShared
|
||||
(const Handle(IGESSolid_ToroidalSurface)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->Center());
|
||||
iter.GetOneItem(ent->Axis());
|
||||
iter.GetOneItem(ent->ReferenceDir());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolToroidalSurface::OwnCopy
|
||||
(const Handle(IGESSolid_ToroidalSurface)& another,
|
||||
const Handle(IGESSolid_ToroidalSurface)& ent, Interface_CopyTool& TC) const
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Point, tempCenter,
|
||||
TC.Transferred(another->Center()));
|
||||
DeclareAndCast(IGESGeom_Direction, tempAxis,
|
||||
TC.Transferred(another->Axis()));
|
||||
Standard_Real majRad = another->MajorRadius();
|
||||
Standard_Real minRad = another->MinorRadius();
|
||||
if (another->IsParametrised())
|
||||
{
|
||||
DeclareAndCast(IGESGeom_Direction, tempRefdir,
|
||||
TC.Transferred(another->ReferenceDir()));
|
||||
ent->Init (tempCenter, tempAxis, majRad, minRad, tempRefdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(IGESGeom_Direction) tempRefdir;
|
||||
ent->Init (tempCenter, tempAxis, majRad, minRad, tempRefdir);
|
||||
}
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolToroidalSurface::DirChecker
|
||||
(const Handle(IGESSolid_ToroidalSurface)& /*ent*/) const
|
||||
{
|
||||
IGESData_DirChecker DC(198, 0, 1);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.BlankStatusIgnored ();
|
||||
DC.SubordinateStatusRequired (1);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolToroidalSurface::OwnCheck
|
||||
(const Handle(IGESSolid_ToroidalSurface)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->MajorRadius() <= 0.0)
|
||||
ach->AddFail("Major Radius : Not Positive");
|
||||
if (ent->MinorRadius() <= 0.0)
|
||||
ach->AddFail("Minor Radius : Not Positive");
|
||||
if (ent->MinorRadius() >= ent->MajorRadius())
|
||||
ach->AddFail("Minor Radius : Value not < Major radius");
|
||||
Standard_Integer fn = 0;
|
||||
if (ent->IsParametrised()) fn = 1;
|
||||
if (fn != ent->FormNumber()) ach->AddFail
|
||||
("Parametrised Status Mismatches with Form Number");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolToroidalSurface::OwnDump
|
||||
(const Handle(IGESSolid_ToroidalSurface)& ent, const IGESData_IGESDumper& dumper,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_ToroidalSurface" << endl;
|
||||
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
|
||||
|
||||
S << "Center : ";
|
||||
dumper.Dump(ent->Center(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Axis direction : ";
|
||||
dumper.Dump(ent->Axis(),S, sublevel);
|
||||
S << endl;
|
||||
S << "Major Radius : " << ent->MajorRadius() << " ";
|
||||
S << "Minor Radius : " << ent->MinorRadius() << endl;
|
||||
if (ent->IsParametrised())
|
||||
{
|
||||
S << "Surface is Parametrised - Reference direction : ";
|
||||
dumper.Dump(ent->ReferenceDir(),S, sublevel);
|
||||
S << endl;
|
||||
}
|
||||
else S << "Surface is UnParametrised" << endl;
|
||||
}
|
59
src/IGESSolid/IGESSolid_ToolTorus.cdl
Executable file
59
src/IGESSolid/IGESSolid_ToolTorus.cdl
Executable file
@@ -0,0 +1,59 @@
|
||||
-- File: IGESSolid_ToolTorus.cdl
|
||||
-- Created: Thu Oct 14 19:16:58 1993
|
||||
-- Author: Christian CAILLET
|
||||
-- <cky@bravox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ToolTorus from IGESSolid
|
||||
|
||||
---Purpose : Tool to work on a Torus. Called by various Modules
|
||||
-- (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
|
||||
uses Torus from IGESSolid,
|
||||
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
|
||||
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create returns ToolTorus;
|
||||
---Purpose : Returns a ToolTorus, ready to work
|
||||
|
||||
|
||||
ReadOwnParams (me; ent : mutable Torus;
|
||||
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 : Torus;
|
||||
IW : in out IGESWriter) is static;
|
||||
---Purpose : Writes own parameters to IGESWriter
|
||||
|
||||
|
||||
OwnShared (me; ent : Torus;
|
||||
iter : in out EntityIterator) is static;
|
||||
---Purpose : Lists the Entities shared by a Torus <ent>, from
|
||||
-- its specific (own) parameters
|
||||
|
||||
DirChecker (me; ent : Torus) returns DirChecker is static;
|
||||
---Purpose : Returns specific DirChecker
|
||||
|
||||
OwnCheck (me; ent : Torus;
|
||||
shares : ShareTool; ach : in out Check) is static;
|
||||
---Purpose : Performs Specific Semantic Check
|
||||
|
||||
|
||||
OwnCopy (me; entfrom : Torus; entto : mutable Torus;
|
||||
TC : in out CopyTool) is static;
|
||||
---Purpose : Copies Specific Parameters
|
||||
|
||||
|
||||
OwnDump (me; ent : Torus;
|
||||
dumper : IGESDumper; S : Messenger from Message; own : Integer)
|
||||
is static;
|
||||
---Purpose : Dump of Specific Parameters
|
||||
|
||||
end ToolTorus;
|
153
src/IGESSolid/IGESSolid_ToolTorus.cxx
Executable file
153
src/IGESSolid/IGESSolid_ToolTorus.cxx
Executable file
@@ -0,0 +1,153 @@
|
||||
//--------------------------------------------------------------------
|
||||
//
|
||||
// File Name : IGESSolid_Torus.cxx
|
||||
// Date :
|
||||
// Author : CKY / Contract Toubro-Larsen
|
||||
// Copyright : MATRA-DATAVISION 1993
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#include <IGESSolid_ToolTorus.ixx>
|
||||
#include <IGESData_ParamCursor.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <IGESData_Dump.hxx>
|
||||
|
||||
|
||||
IGESSolid_ToolTorus::IGESSolid_ToolTorus () { }
|
||||
|
||||
|
||||
void IGESSolid_ToolTorus::ReadOwnParams
|
||||
(const Handle(IGESSolid_Torus)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
{
|
||||
Standard_Real r1, r2;
|
||||
Standard_Real tempreal;
|
||||
gp_XYZ tempPoint, tempAxis;
|
||||
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
|
||||
|
||||
PR.ReadReal(PR.Current(), "Radius of revolution", r1); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
PR.ReadReal(PR.Current(), "Radius of disc", r2); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center Point (X)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center Point (X)", tempreal))
|
||||
tempPoint.SetX(tempreal);
|
||||
}
|
||||
else tempPoint.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center Point (Y)", tempreal))
|
||||
tempPoint.SetY(tempreal);
|
||||
}
|
||||
else tempPoint.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Center Point (Z)", tempreal))
|
||||
tempPoint.SetZ(tempreal);
|
||||
}
|
||||
else tempPoint.SetZ(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (I)", tempreal))
|
||||
tempAxis.SetX(tempreal);
|
||||
}
|
||||
else tempAxis.SetX(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (J)", tempreal))
|
||||
tempAxis.SetY(tempreal);
|
||||
}
|
||||
else tempAxis.SetY(0.0);
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
{
|
||||
//st = PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal); //szv#4:S4163:12Mar99 moved in if
|
||||
if (PR.ReadReal(PR.Current(), "Axis direction (K)", tempreal))
|
||||
tempAxis.SetZ(tempreal);
|
||||
}
|
||||
else tempAxis.SetZ(1.0);
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (r1, r2, tempPoint, tempAxis);
|
||||
Standard_Real eps = 1.E-05;
|
||||
if (!tempAxis.IsEqual(ent->Axis().XYZ(),eps))
|
||||
PR.AddWarning("Axis poorly unitary, normalized");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolTorus::WriteOwnParams
|
||||
(const Handle(IGESSolid_Torus)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
IW.Send(ent->MajorRadius());
|
||||
IW.Send(ent->DiscRadius());
|
||||
IW.Send(ent->AxisPoint().X());
|
||||
IW.Send(ent->AxisPoint().Y());
|
||||
IW.Send(ent->AxisPoint().Z());
|
||||
IW.Send(ent->Axis().X());
|
||||
IW.Send(ent->Axis().Y());
|
||||
IW.Send(ent->Axis().Z());
|
||||
}
|
||||
|
||||
void IGESSolid_ToolTorus::OwnShared
|
||||
(const Handle(IGESSolid_Torus)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
{
|
||||
}
|
||||
|
||||
void IGESSolid_ToolTorus::OwnCopy
|
||||
(const Handle(IGESSolid_Torus)& another,
|
||||
const Handle(IGESSolid_Torus)& ent, Interface_CopyTool& /* TC */) const
|
||||
{
|
||||
ent->Init (another->MajorRadius(), another->DiscRadius(),
|
||||
another->AxisPoint().XYZ(), another->Axis().XYZ());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESSolid_ToolTorus::DirChecker
|
||||
(const Handle(IGESSolid_Torus)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC(160, 0);
|
||||
|
||||
DC.Structure (IGESData_DefVoid);
|
||||
DC.LineFont (IGESData_DefAny);
|
||||
DC.Color (IGESData_DefAny);
|
||||
|
||||
DC.UseFlagRequired (0);
|
||||
DC.HierarchyStatusIgnored ();
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESSolid_ToolTorus::OwnCheck
|
||||
(const Handle(IGESSolid_Torus)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->MajorRadius() <= 0.0)
|
||||
ach->AddFail("Radius of revolution : Not Positive");
|
||||
if (ent->DiscRadius() <= 0.0)
|
||||
ach->AddFail("Radius of disc : Not Positive");
|
||||
if (ent->DiscRadius() >= ent->MajorRadius())
|
||||
ach->AddFail("Radius of disc : is not Less than Radius of revolution");
|
||||
}
|
||||
|
||||
void IGESSolid_ToolTorus::OwnDump
|
||||
(const Handle(IGESSolid_Torus)& ent, const IGESData_IGESDumper& /* dumper */,
|
||||
const Handle(Message_Messenger)& S, const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESSolid_Torus" << endl;
|
||||
|
||||
S << "Radius of revolution : " << ent->MajorRadius() << " ";
|
||||
S << "Radius of the disc : " << ent->DiscRadius() << endl;
|
||||
S << "Center Point : ";
|
||||
IGESData_DumpXYZL(S,level, ent->AxisPoint(), ent->Location());
|
||||
S << endl << "Axis direction : ";
|
||||
IGESData_DumpXYZL(S,level, ent->Axis(), ent->VectorLocation());
|
||||
S << endl;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user