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

Integration of OCCT 6.5.0 from SVN

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

167
src/IGESDraw/IGESDraw.cdl Executable file
View File

@@ -0,0 +1,167 @@
--
-- File : IGESDraw.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen (Niraj RANGWALA)
--
---Copyright : MATRA-DATAVISION 1993
--
package IGESDraw
---Purpose : This package contains the group of classes necessary for
-- Structure Entities implied in Drawings and Structured
-- Graphics (Sets for drawing, Drawings and Views).
uses
Standard,
TCollection,
gp,
TColgp,
TColStd,
Message,
Interface,
IGESData,
IGESDimen,
IGESBasic,
IGESGraph,
IGESGeom
is
class ConnectPoint;
-- type <132> form <0>
---Purpose : Connect Point Entity describes a point of connection for
-- zero, one or more entities. It is referenced from Composite
-- curve, or Network Subfigure Definition/Instance, or the Flow
-- Associative Instance, or it may stand alone.
class NetworkSubfigureDef;
-- type <320> form <0>
---Purpose : This class differs from the ordinary subfigure definition
-- in that it defines a specialized subfigure, one whose
-- instances may participate in networks.
class ViewsVisible;
-- type <402> form <3>
---Purpose : If an entity is to be displayed in more than one views,
-- this class instance is used, which contains the Visible
-- views and the associated entity Displays.
class ViewsVisibleWithAttr;
-- type <402> form <4>
---Purpose : This class is extension of Class ViewsVisible. It is used
-- for those entities that are visible in multiple views, but
-- must have a different line font, color number, or
-- line weight in each view.
class LabelDisplay;
-- type <402> form <5>
---Purpose : Permits one or more displays for the
-- entity labels of an entity
class Planar;
-- type <402> form <16>
---Purpose : Indicates that a collection of entities is coplanar. The
-- entities may be geometric, annotative, and/or structural.
class SegmentedViewsVisible;
-- type <402> form <19>
---Purpose : Permits the association of display parameters with the
-- segments of curves in a given view
class Drawing;
-- type <404> form <0>
---Purpose : Specifies a drawing as a collection of annotation entities
-- defined in drawing space, and views which together
-- constitute a single representation of a part
class DrawingWithRotation;
-- type <404> form <1>
---Purpose : Permits rotation, in addition to transformation and
-- scaling, between the view and drawing coordinate systems
class View;
-- type <410> form <0>
---Purpose : Used to define a framework for specifying a viewing
-- orientation of an object in three dimensional model
-- space (X,Y,Z). The framework is also used to support
-- the projection of all or part of model space onto a
-- view volume.
class RectArraySubfigure;
-- type <412> form 0
---Purpose : Used to produce copies of an object called the base entity,
-- arranging them in equally spaced rows and columns
class CircArraySubfigure;
-- type <414> form <0>
---Purpose : Used to produce copies of an object called the base entity,
-- arranging them around the edge of an imaginary circle
-- whose center and radius are specified
class NetworkSubfigure;
-- type <420> form <0>
---Purpose : Used to specify each instance of Network Subfigure
-- definition Entity (Type <320>).
class PerspectiveView;
-- type <410> form <1>
---Purpose : Supports a perspective view.
-- Any geometric projection is defined by a view plane
-- and the projectors that pass through the view plane.
-- Projectors can be visualized as rays of light that
-- form an image by passing through the viewed object
-- and striking the view plane.
-- The projectors are defined via a point called the
-- Center-of-Projection or the eye-point.
-- A perspective view is formed by all projectors that
-- emanate from the Center-of-Projection and pass
-- through the view plane.
-- Tools for Entities --
class ToolConnectPoint;
class ToolNetworkSubfigureDef;
class ToolViewsVisible;
class ToolViewsVisibleWithAttr;
class ToolLabelDisplay;
class ToolPlanar;
class ToolSegmentedViewsVisible;
class ToolDrawing;
class ToolDrawingWithRotation;
class ToolView;
class ToolRectArraySubfigure;
class ToolCircArraySubfigure;
class ToolNetworkSubfigure;
class ToolPerspectiveView;
-- Definition and Exploitation of Entities defined in this Package
class Protocol;
class ReadWriteModule;
class GeneralModule;
class SpecificModule;
-- The class instantiations :
class Array1OfConnectPoint instantiates
Array1 from TCollection (ConnectPoint);
class Array1OfViewKindEntity instantiates
Array1 from TCollection (ViewKindEntity from IGESData);
class HArray1OfConnectPoint instantiates HArray1 from TCollection
(ConnectPoint,Array1OfConnectPoint);
class HArray1OfViewKindEntity instantiates HArray1 from TCollection
(ViewKindEntity from IGESData,Array1OfViewKindEntity);
-- Package Methods :
Init;
---Purpose : Prepares dynamic data (Protocol, Modules) for this package
Protocol returns Protocol from IGESDraw;
---Purpose : Returns the Protocol for this Package
end IGESDraw;

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

@@ -0,0 +1,33 @@
#include <IGESDraw.ixx>
#include <IGESDraw_Protocol.hxx>
#include <IGESDraw_GeneralModule.hxx>
#include <IGESDraw_ReadWriteModule.hxx>
#include <IGESDraw_SpecificModule.hxx>
#include <Interface_GeneralLib.hxx>
#include <Interface_ReaderLib.hxx>
#include <IGESData_WriterLib.hxx>
#include <IGESData_SpecificLib.hxx>
#include <IGESDimen.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(IGESDraw_Protocol) protocol;
void IGESDraw::Init ()
{
IGESDimen::Init();
if (protocol.IsNull()) {
protocol = new IGESDraw_Protocol;
Interface_GeneralLib::SetGlobal (new IGESDraw_GeneralModule, protocol);
Interface_ReaderLib::SetGlobal (new IGESDraw_ReadWriteModule,protocol);
IGESData_WriterLib::SetGlobal (new IGESDraw_ReadWriteModule,protocol);
IGESData_SpecificLib::SetGlobal (new IGESDraw_SpecificModule, protocol);
}
}
Handle(IGESDraw_Protocol) IGESDraw::Protocol ()
{
return protocol;
}

View File

@@ -0,0 +1,131 @@
--
-- File : CircArraySubfigure.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class CircArraySubfigure from IGESDraw
inherits IGESEntity
---Purpose: Defines IGES Circular Array Subfigure Instance Entity,
-- Type <414> Form Number <0> in package IGESDraw
--
-- Used to produce copies of object called the base entity,
-- arranging them around the edge of an imaginary circle
-- whose center and radius are specified
uses
HArray1OfInteger from TColStd,
XYZ from gp,
Pnt from gp
raises OutOfRange
is
Create returns mutable CircArraySubfigure;
-- Specific Methods pertaining to the class
Init (me : mutable;
aBase : IGESEntity;
aNumLocs : Integer;
aCenter : XYZ;
aRadius : Real;
aStAngle : Real;
aDelAngle : Real;
aFlag : Integer;
allNumPos : HArray1OfInteger);
---Purpose : This method is used to set the fields of the class
-- CircArraySubfigure
-- - aBase : Base entity
-- - aNumLocs : Total number of possible instance locations
-- - aCenter : Coordinates of Center of imaginary circle
-- - aRadius : Radius of imaginary circle
-- - aStAngle : Start angle in radians
-- - aDelAngle : Delta angle in radians
-- - aFlag : DO-DON'T flag to control which portion to
-- display
-- - allNumPos : All position to be or not to be processed
BaseEntity (me) returns IGESEntity;
---Purpose : returns the base entity, copies of which are produced
NbLocations (me) returns Integer;
---Purpose : returns total number of possible instance locations
CenterPoint (me) returns Pnt;
---Purpose : returns the center of the imaginary circle
TransformedCenterPoint (me) returns Pnt;
---Purpose : returns the Transformed center of the imaginary circle
CircleRadius (me) returns Real;
---Purpose : returns the radius of the imaginary circle
StartAngle (me) returns Real;
---Purpose : returns the start angle in radians
DeltaAngle (me) returns Real;
---Purpose : returns the delta angle in radians
ListCount (me) returns Integer;
---Purpose : returns 0 if all elements to be displayed
DisplayFlag (me) returns Boolean;
---Purpose : returns True if (ListCount = 0) all elements are to be displayed
DoDontFlag (me) returns Boolean;
---Purpose : returns 0 if half or fewer of the elements of the array are defined
-- 1 if half or more of the elements are defined
PositionNum (me; Index : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns whether Index is to be processed (DO)
-- or not to be processed(DON'T)
-- if (ListCount = 0) return theDoDontFlag
-- raises exception if Index <= 0 or Index > ListCount().
ListPosition (me; Index : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Index'th value position
-- raises exception if Index <= 0 or Index > ListCount().
fields
--
-- Class : IGESDraw_CircArraySubfigure
--
-- Purpose : Declaration of the variables specific to a CircArraySubfigure.
--
-- Reminder : A Circular Array Subfigure Instance is defined by :
-- - a base entity which is replicated
-- - total number of possible instance locations
-- - coordinates of Center of imaginary circle
-- - radius of imaginary circle
-- - start angle to govern the location of first instance
-- - delta angle to govern successive instances' distribution
-- - a DO-DON'T flag to control which portion to display
--
theBaseEntity : IGESEntity;
theNbLocations : Integer;
theCenter : XYZ;
theRadius : Real;
theStartAngle : Real;
theDeltaAngle : Real;
theDoDontFlag : Integer;
thePositions : HArray1OfInteger;
end CircArraySubfigure;

View File

@@ -0,0 +1,125 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_CircArraySubfigure.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_CircArraySubfigure.ixx>
#include <Standard_DimensionMismatch.hxx>
#include <gp_GTrsf.hxx>
IGESDraw_CircArraySubfigure::IGESDraw_CircArraySubfigure () { }
void IGESDraw_CircArraySubfigure::Init
(const Handle(IGESData_IGESEntity)& aBase,
const Standard_Integer aNumLocs,
const gp_XYZ& aCenter,
const Standard_Real aRadius,
const Standard_Real aStAngle,
const Standard_Real aDelAngle,
const Standard_Integer aFlag,
const Handle(TColStd_HArray1OfInteger)& allNumPos)
{
if (!allNumPos.IsNull())
if (allNumPos->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_CircArraySubfigure : Init");
theBaseEntity = aBase;
theNbLocations = aNumLocs;
theCenter = aCenter;
theRadius = aRadius;
theStartAngle = aStAngle;
theDeltaAngle = aDelAngle;
theDoDontFlag = aFlag;
thePositions = allNumPos;
InitTypeAndForm(414,0);
}
Handle(IGESData_IGESEntity) IGESDraw_CircArraySubfigure::BaseEntity () const
{
return theBaseEntity;
}
Standard_Integer IGESDraw_CircArraySubfigure::NbLocations () const
{
return theNbLocations;
}
gp_Pnt IGESDraw_CircArraySubfigure::CenterPoint () const
{
gp_Pnt tempCenterPoint(theCenter);
return tempCenterPoint;
}
gp_Pnt IGESDraw_CircArraySubfigure::TransformedCenterPoint () const
{
gp_XYZ tempCenterPoint = theCenter;
if (HasTransf()) Location().Transforms(tempCenterPoint);
gp_Pnt tempRes(tempCenterPoint);
return tempRes;
}
Standard_Real IGESDraw_CircArraySubfigure::CircleRadius () const
{
return theRadius;
}
Standard_Real IGESDraw_CircArraySubfigure::StartAngle () const
{
return theStartAngle;
}
Standard_Real IGESDraw_CircArraySubfigure::DeltaAngle () const
{
return theDeltaAngle;
}
Standard_Boolean IGESDraw_CircArraySubfigure::DisplayFlag () const
{
return (thePositions.IsNull());
// if LC == 0 then there is no allocation made for thePositions array
// i.e., thePositions == Null Handle
}
Standard_Integer IGESDraw_CircArraySubfigure::ListCount () const
{
return ( thePositions.IsNull() ? 0 : thePositions->Length() );
// Return 0 if HArray1 thePositions is NULL Handle
}
Standard_Boolean IGESDraw_CircArraySubfigure::DoDontFlag () const
{
return (theDoDontFlag == 1);
}
Standard_Boolean IGESDraw_CircArraySubfigure::PositionNum
(const Standard_Integer Index) const
{
// Method : If thePositions array length is Zero return theDoDontFlag;
// else Search Index in to the Array. If 'Index' found in the
// array return theDoDontFlag else return !theDoDontFlag.
if (thePositions.IsNull()) return theDoDontFlag;
else {
Standard_Integer I;
Standard_Integer up = thePositions->Upper();
for (I = 1; I <= up; I ++) {
if (thePositions->Value(I) == Index) return theDoDontFlag;
}
return (! theDoDontFlag);
}
}
Standard_Integer IGESDraw_CircArraySubfigure::ListPosition
(const Standard_Integer Index) const
{
return thePositions->Value(Index);
// raise OutOfRange from Standard if Index is out-of-bound
// Exception NoSuchObject will be raised if thePositions == Null Handle
}

View File

@@ -0,0 +1,182 @@
--
-- File : ConnectPoint.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class ConnectPoint from IGESDraw inherits IGESEntity
---Purpose : defines IGESConnectPoint, Type <132> Form Number <0>
-- in package IGESDraw
--
-- Connect Point Entity describes a point of connection for
-- zero, one or more entities. Its referenced from Composite
-- curve, or Network Subfigure Definition/Instance, or Flow
-- Associative Instance, or it may stand alone.
uses
HAsciiString from TCollection,
Pnt from gp,
XYZ from gp,
TextDisplayTemplate from IGESGraph
is
Create returns mutable ConnectPoint;
-- Specific Methods pertaining to the class
Init (me : mutable;
aPoint : XYZ;
aDisplaySymbol : IGESEntity;
aTypeFlag : Integer;
aFunctionFlag : Integer;
aFunctionIdentifier : HAsciiString;
anIdentifierTemplate : TextDisplayTemplate;
aFunctionName : HAsciiString;
aFunctionTemplate : TextDisplayTemplate;
aPointIdentifier : Integer;
aFunctionCode : Integer;
aSwapFlag : Integer;
anOwnerSubfigure : IGESEntity);
---Purpose : This method is used to set the fields of the class
-- ConnectPoint
-- - aPoint : A Coordinate point
-- - aDisplaySymbol : Display symbol Geometry
-- - aTypeFlag : Type of the connection
-- - aFunctionFlag : Function flag for the connection
-- - aFunctionIdentifier : Connection Point Function Identifier
-- - anIdentifierTemplate : Connection Point Function Template
-- - aFunctionName : Connection Point Function Name
-- - aFunctionTemplate : Connection Point Function Template
-- - aPointIdentifier : Unique Connect Point Identifier
-- - aFunctionCode : Connect Point Function Code
-- - aSwapFlag : Connect Point Swap Flag
-- - anOwnerSubfigure : Pointer to the "Owner" Entity
Point (me) returns Pnt;
---Purpose : returns the coordinate of the connection point
TransformedPoint (me) returns Pnt;
---Purpose : returns the Transformed coordinate of the connection point
HasDisplaySymbol (me) returns Boolean;
---Purpose : returns True if Display symbol is specified
-- else returns False
DisplaySymbol (me) returns IGESEntity;
---Purpose : if display symbol specified returns display symbol geometric entity
-- else returns NULL Handle
TypeFlag (me) returns Integer;
---Purpose : return value specifies a particular type of connection :
-- Type Flag = 0 : Not Specified(default)
-- 1 : Nonspecific logical point of connection
-- 2 : Nonspecific physical point of connection
-- 101 : Logical component pin
-- 102 : Logical part connector
-- 103 : Logical offpage connector
-- 104 : Logical global signal connector
-- 201 : Physical PWA surface mount pin
-- 202 : Physical PWA blind pin
-- 203 : Physical PWA thru-pin
-- 5001-9999 : Implementor defined.
FunctionFlag (me) returns Integer;
---Purpose : returns Function Code that specifies a particular function for the
-- ECO576 connection :
-- e.g., Function Flag = 0 : Unspecified(default)
-- = 1 : Electrical Signal
-- = 2 : Fluid flow Signal
FunctionIdentifier (me) returns HAsciiString from TCollection;
---Purpose : return HAsciiString identifying Pin Number or Nozzle Label etc.
HasIdentifierTemplate (me) returns Boolean;
---Purpose : returns True if Text Display Template is specified for Identifier
-- else returns False
IdentifierTemplate (me) returns TextDisplayTemplate;
---Purpose : if Text Display Template for the Function Identifier is defined,
-- returns TestDisplayTemplate
-- else returns NULL Handle
FunctionName (me) returns HAsciiString from TCollection;
---Purpose : returns Connection Point Function Name
HasFunctionTemplate (me) returns Boolean;
---Purpose : returns True if Text Display Template is specified for Function Name
-- else returns False
FunctionTemplate (me) returns TextDisplayTemplate;
---Purpose : if Text Display Template for the Function Name is defined,
-- returns TestDisplayTemplate
-- else returns NULL Handle
PointIdentifier (me) returns Integer;
---Purpose : returns the Unique Connect Point Identifier
FunctionCode (me) returns Integer;
---Purpose : returns the Connect Point Function Code
SwapFlag (me) returns Boolean;
---Purpose : return value = 0 : Connect point may be swapped(default)
-- = 1 : Connect point may not be swapped
HasOwnerSubfigure (me) returns Boolean;
---Purpose : returns True if Network Subfigure Instance/Definition Entity
-- is specified
-- else returns False
OwnerSubfigure (me) returns IGESEntity;
---Purpose : returns "owner" Network Subfigure Instance Entity,
-- or Network Subfigure Definition Entity, or NULL Handle.
fields
--
-- Class : IGESDraw_ConnectPoint
--
-- Purpose : Declaration of the variables specific to a ConnectPoint.
--
-- Reminder : A ConnectPoint is defined by :
-- - A Coordinate point
-- - Display symbol Geometry
-- - Type of the connection
-- - Function flag for the connection
-- - Connection Point Function Identifier and its Template
-- - Connection Point Function Name and its Template
-- - Unique Connect Point Identifier
-- - Connect Point Function Code
-- - Connect Point Swap Flag
-- - Pointer to the "Owner"
--
thePoint : XYZ;
theDisplaySymbol : IGESEntity;
theTypeFlag : Integer;
theFunctionFlag : Integer;
theFunctionIdentifier : HAsciiString;
theIdentifierTemplate : TextDisplayTemplate;
theFunctionName : HAsciiString;
theFunctionTemplate : TextDisplayTemplate;
thePointIdentifier : Integer;
theFunctionCode : Integer;
theSwapFlag : Integer;
theOwnerSubfigure : IGESEntity;
end ConnectPoint;

View File

@@ -0,0 +1,137 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_ConnectPoint.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ConnectPoint.ixx>
#include <gp_GTrsf.hxx>
IGESDraw_ConnectPoint::IGESDraw_ConnectPoint () { }
void IGESDraw_ConnectPoint::Init
(const gp_XYZ& aPoint,
const Handle(IGESData_IGESEntity)& aDisplaySymbol,
const Standard_Integer aTypeFlag,
const Standard_Integer aFunctionFlag,
const Handle(TCollection_HAsciiString)& aFunctionIdentifier,
const Handle(IGESGraph_TextDisplayTemplate)& anIdentifierTemplate,
const Handle(TCollection_HAsciiString)& aFunctionName,
const Handle(IGESGraph_TextDisplayTemplate)& aFunctionTemplate,
const Standard_Integer aPointIdentifier,
const Standard_Integer aFunctionCode,
const Standard_Integer aSwapFlag,
const Handle(IGESData_IGESEntity)& anOwnerSubfigure)
{
thePoint = aPoint;
theDisplaySymbol = aDisplaySymbol;
theTypeFlag = aTypeFlag;
theFunctionFlag = aFunctionFlag;
theFunctionIdentifier = aFunctionIdentifier;
theIdentifierTemplate = anIdentifierTemplate;
theFunctionName = aFunctionName;
theFunctionTemplate = aFunctionTemplate;
thePointIdentifier = aPointIdentifier;
theFunctionCode = aFunctionCode;
theSwapFlag = aSwapFlag;
theOwnerSubfigure = anOwnerSubfigure;
InitTypeAndForm(132,0);
}
gp_Pnt IGESDraw_ConnectPoint::Point () const
{
gp_Pnt tempPoint(thePoint);
return tempPoint;
}
gp_Pnt IGESDraw_ConnectPoint::TransformedPoint () const
{
gp_XYZ tempPoint = thePoint;
if (HasTransf()) Location().Transforms(tempPoint);
gp_Pnt tempRes(tempPoint);
return (tempRes);
}
Standard_Boolean IGESDraw_ConnectPoint::HasDisplaySymbol () const
{
return (! theDisplaySymbol.IsNull());
}
Handle(IGESData_IGESEntity) IGESDraw_ConnectPoint::DisplaySymbol () const
{
return theDisplaySymbol;
}
Standard_Integer IGESDraw_ConnectPoint::TypeFlag () const
{
return theTypeFlag;
}
Standard_Integer IGESDraw_ConnectPoint::FunctionFlag () const
{
return theFunctionFlag;
}
Handle(TCollection_HAsciiString) IGESDraw_ConnectPoint::FunctionIdentifier
() const
{
return theFunctionIdentifier;
}
Standard_Boolean IGESDraw_ConnectPoint::HasIdentifierTemplate () const
{
return (! theIdentifierTemplate.IsNull());
}
Handle(IGESGraph_TextDisplayTemplate)
IGESDraw_ConnectPoint::IdentifierTemplate () const
{
return theIdentifierTemplate;
}
Handle(TCollection_HAsciiString) IGESDraw_ConnectPoint::FunctionName () const
{
return theFunctionName;
}
Standard_Boolean IGESDraw_ConnectPoint::HasFunctionTemplate () const
{
return (! theFunctionTemplate.IsNull());
}
Handle(IGESGraph_TextDisplayTemplate)
IGESDraw_ConnectPoint::FunctionTemplate () const
{
return theFunctionTemplate;
}
Standard_Integer IGESDraw_ConnectPoint::PointIdentifier () const
{
return thePointIdentifier;
}
Standard_Integer IGESDraw_ConnectPoint::FunctionCode () const
{
return theFunctionCode;
}
Standard_Boolean IGESDraw_ConnectPoint::SwapFlag () const
{
return theSwapFlag;
}
Standard_Boolean IGESDraw_ConnectPoint::HasOwnerSubfigure () const
{
return (! theOwnerSubfigure.IsNull());
}
Handle(IGESData_IGESEntity) IGESDraw_ConnectPoint::OwnerSubfigure () const
{
return theOwnerSubfigure;
}

112
src/IGESDraw/IGESDraw_Drawing.cdl Executable file
View File

@@ -0,0 +1,112 @@
--
-- File : Drawing.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class Drawing from IGESDraw inherits IGESEntity
---Purpose: defines IGESDrawing, Type <404> Form <0>
-- in package IGESDraw
--
-- Specifies a drawing as a collection of annotation entities
-- defined in drawing space, and views which together
-- constitute a single representation of a part
uses
HArray1OfIGESEntity from IGESData,
ViewKindEntity from IGESData,
HArray1OfViewKindEntity from IGESDraw,
Pnt2d from gp,
XYZ from gp,
XY from gp,
HArray1OfXY from TColgp
raises DimensionMismatch, OutOfRange
is
Create returns mutable Drawing;
-- Specific Methods pertaining to the class
Init (me : mutable;
allViews : HArray1OfViewKindEntity;
allViewOrigins : HArray1OfXY;
allAnnotations : HArray1OfIGESEntity)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- Drawing
-- - allViews : Pointers to DEs of View entities
-- - allViewOrigins : Origin coordinates of transformed Views
-- - allAnnotations : Pointers to DEs of Annotation entities
-- raises exception if Lengths of allViews and allViewOrigins are
-- not same.
NbViews (me) returns Integer;
---Purpose : returns the number of view pointers in <me>
ViewItem (me; ViewIndex : Integer) returns ViewKindEntity
raises OutOfRange;
---Purpose : returns the ViewKindEntity indicated by ViewIndex
-- raises an exception if ViewIndex <= 0 or ViewIndex > NbViews().
ViewOrigin (me; TViewIndex : Integer) returns Pnt2d
raises OutOfRange;
---Purpose : returns the Drawing space coordinates of the origin of the
-- Transformed view indicated by TViewIndex
-- raises an exception if TViewIndex <= 0 or TViewIndex > NbViews().
NbAnnotations (me) returns Integer;
---Purpose : returns the number of Annotation entities in <me>
Annotation (me; AnnotationIndex : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns the Annotation entity in this Drawing, indicated by the
-- AnnotationIndex
-- raises an exception if AnnotationIndex <= 0 or
-- AnnotationIndex > NbAnnotations().
-- infered informations
ViewToDrawing(me; NumView : Integer; ViewCoords : XYZ)
returns XY;
-- returns the Transformation of a View from View space to
-- Drawing space.
DrawingUnit (me; value : out Real) returns Boolean;
---Purpose : Returns the Drawing Unit Value if it is specified (by a
-- specific property entity)
-- If not specified, returns False, and val as zero :
-- unit to consider is then the model unit in GlobalSection
DrawingSize (me; X,Y : out Real) returns Boolean;
---Purpose : Returns the Drawing Size if it is specified (by a
-- specific property entity)
-- If not specified, returns False, and X,Y as zero :
-- unit to consider is then the model unit in GlobalSection
fields
--
-- Class : IGESDraw_Drawing
--
-- Purpose : Declaration of the variables specific to a
-- Drawing Entity.
--
-- Reminder : A Drawing Entity is defined by :
-- - Pointers to DEs of View entities
-- - Origin coordinates of transformed views
-- - Pointers to DEs of Annotation entities
--
theViews : HArray1OfViewKindEntity;
theViewOrigins : HArray1OfXY;
theAnnotations : HArray1OfIGESEntity;
end Drawing;

123
src/IGESDraw/IGESDraw_Drawing.cxx Executable file
View File

@@ -0,0 +1,123 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_Drawing.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_Drawing.ixx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <IGESGraph_DrawingUnits.hxx>
#include <IGESGraph_DrawingSize.hxx>
#include <Interface_Macros.hxx>
IGESDraw_Drawing::IGESDraw_Drawing () { }
void IGESDraw_Drawing::Init
(const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews,
const Handle(TColgp_HArray1OfXY)& allViewOrigins,
const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations)
{
if (!allViews.IsNull()) {
Standard_Integer Len = allViews->Length();
Standard_Boolean Flag = ( allViewOrigins->Length() == Len );
if (!Flag || allViews->Lower() != 1 || allViewOrigins->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_Drawing : Init");
}
if (!allAnnotations.IsNull())
if (allAnnotations->Lower() != 1) Standard_DimensionMismatch::Raise
("IGESDraw_Drawing : Init");
theViews = allViews;
theViewOrigins = allViewOrigins;
theAnnotations = allAnnotations;
InitTypeAndForm(404,0);
}
Standard_Integer IGESDraw_Drawing::NbViews () const
{
return (theViews.IsNull() ? 0 : theViews->Length());
}
Handle(IGESData_ViewKindEntity) IGESDraw_Drawing::ViewItem
(const Standard_Integer ViewIndex) const
{
return theViews->Value(ViewIndex);
}
gp_Pnt2d IGESDraw_Drawing::ViewOrigin
(const Standard_Integer TViewIndex) const
{
return (gp_Pnt2d (theViewOrigins->Value(TViewIndex)) );
}
Standard_Integer IGESDraw_Drawing::NbAnnotations () const
{
return (theAnnotations.IsNull() ? 0 : theAnnotations->Length() );
}
Handle(IGESData_IGESEntity) IGESDraw_Drawing::Annotation
(const Standard_Integer AnnotationIndex) const
{
return ( theAnnotations->Value(AnnotationIndex) );
}
gp_XY IGESDraw_Drawing::ViewToDrawing
(const Standard_Integer NumView, const gp_XYZ& ViewCoords) const
{
gp_XY thisOrigin = theViewOrigins->Value(NumView);
Standard_Real XOrigin = thisOrigin.X();
Standard_Real YOrigin = thisOrigin.Y();
Standard_Real theScaleFactor=0.;
Handle(IGESData_ViewKindEntity) tempView = theViews->Value(NumView);
if (tempView->IsKind(STANDARD_TYPE(IGESDraw_View)))
{
DeclareAndCast(IGESDraw_View, thisView, tempView);
theScaleFactor = thisView->ScaleFactor();
}
else if (tempView->IsKind(STANDARD_TYPE(IGESDraw_PerspectiveView)))
{
DeclareAndCast(IGESDraw_PerspectiveView, thisView, tempView);
theScaleFactor = thisView->ScaleFactor();
}
Standard_Real XV = ViewCoords.X();
Standard_Real YV = ViewCoords.Y();
Standard_Real XD = XOrigin + (theScaleFactor * XV);
Standard_Real YD = YOrigin + (theScaleFactor * YV);
return ( gp_XY(XD, YD) );
}
Standard_Boolean IGESDraw_Drawing::DrawingUnit (Standard_Real& val) const
{
val = 0.;
Handle(Standard_Type) typunit = STANDARD_TYPE(IGESGraph_DrawingUnits);
if (NbTypedProperties(typunit) != 1) return Standard_False;
DeclareAndCast(IGESGraph_DrawingUnits,units,TypedProperty(typunit));
if (units.IsNull()) return Standard_False;
val = units->UnitValue();
return Standard_True;
}
Standard_Boolean IGESDraw_Drawing::DrawingSize
(Standard_Real& X, Standard_Real& Y) const
{
X = Y = 0.;
Handle(Standard_Type) typsize = STANDARD_TYPE(IGESGraph_DrawingSize);
if (NbTypedProperties(typsize) != 1) return Standard_False;
DeclareAndCast(IGESGraph_DrawingSize,size,TypedProperty(typsize));
if (size.IsNull()) return Standard_False;
X = size->XSize(); Y = size->YSize();
return Standard_True;
}

View File

@@ -0,0 +1,121 @@
--
-- File : DrawingWithRotation.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class DrawingWithRotation from IGESDraw inherits IGESEntity
---Purpose: defines IGESDrawingWithRotation, Type <404> Form <1>
-- in package IGESDraw
--
-- Permits rotation, in addition to transformation and
-- scaling, between the view and drawing coordinate systems
uses
HArray1OfIGESEntity from IGESData,
HArray1OfReal from TColStd,
ViewKindEntity from IGESData,
HArray1OfViewKindEntity from IGESDraw,
Pnt2d from gp,
XYZ from gp,
XY from gp,
HArray1OfXY from TColgp
raises DimensionMismatch, OutOfRange
is
Create returns mutable DrawingWithRotation;
-- Specific Methods pertaining to the class
Init (me : mutable;
allViews : HArray1OfViewKindEntity;
allViewOrigins : HArray1OfXY;
allOrientationAngles : HArray1OfReal;
allAnnotations : HArray1OfIGESEntity)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- DrawingWithRotation
-- - allViews : Pointers to View entities
-- - allViewOrigins : Origin coords of transformed views
-- - allOrientationAngles : Orientation angles of transformed views
-- - allAnnotations : Pointers to Annotation entities
-- raises exception if Lengths of allViews, allViewOrigins and
-- allOrientationAngles are not same.
NbViews (me) returns Integer;
---Purpose : returns the number of view pointers in <me>
ViewItem (me; Index : Integer) returns ViewKindEntity
raises OutOfRange;
---Purpose : returns the View entity indicated by Index
-- raises an exception if Index <= 0 or Index > NbViews().
ViewOrigin (me; Index : Integer) returns Pnt2d
raises OutOfRange;
---Purpose : returns the Drawing space coordinates of the origin of the
-- Transformed view indicated by Index
-- raises an exception if Index <= 0 or Index > NbViews().
OrientationAngle (me; Index : Integer) returns Real
raises OutOfRange;
---Purpose : returns the Orientation angle for the Transformed view
-- indicated by Index
-- raises an exception if Index <= 0 or Index > NbViews().
NbAnnotations (me) returns Integer;
---Purpose : returns the number of Annotation entities in <me>
Annotation (me; Index : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns the Annotation entity in this Drawing, indicated by Index
-- raises an exception if Index <= 0 or Index > NbAnnotations().
-- infered informations
ViewToDrawing(me; NumView : Integer; ViewCoords : XYZ)
returns XY;
-- returns the Transformation of a View from View space to Drawing
-- space.
DrawingUnit (me; value : out Real) returns Boolean;
---Purpose : Returns the Drawing Unit Value if it is specified (by a
-- specific property entity)
-- If not specified, returns False, and val as zero :
-- unit to consider is then the model unit in GlobalSection
DrawingSize (me; X,Y : out Real) returns Boolean;
---Purpose : Returns the Drawing Size if it is specified (by a
-- specific property entity)
-- If not specified, returns False, and X,Y as zero :
-- unit to consider is then the model unit in GlobalSection
fields
--
-- Class : IGESDraw_DrawingWithRotation
--
-- Purpose : Declaration of the variables specific to a
-- DrawingWithRotation Entity.
--
-- Reminder : A DrawingWithRotation Entity is defined by :
-- - Pointers to View entities
-- - Origin coordinates of transformed views
-- - Orientation angles of transformed views
-- - Pointers to Annotation entities
--
theViews : HArray1OfViewKindEntity;
theViewOrigins : HArray1OfXY;
theOrientationAngles : HArray1OfReal;
theAnnotations : HArray1OfIGESEntity;
end DrawingWithRotation;

View File

@@ -0,0 +1,136 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_DrawingWithRotation.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_DrawingWithRotation.ixx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <IGESGraph_DrawingUnits.hxx>
#include <IGESGraph_DrawingSize.hxx>
#include <Interface_Macros.hxx>
IGESDraw_DrawingWithRotation::IGESDraw_DrawingWithRotation () { }
void IGESDraw_DrawingWithRotation::Init
(const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews,
const Handle(TColgp_HArray1OfXY)& allViewOrigins,
const Handle(TColStd_HArray1OfReal)& allOrientationAngles,
const Handle(IGESData_HArray1OfIGESEntity)& allAnnotations)
{
Standard_Integer Len = allViews->Length();
if ( allViews->Lower() != 1 ||
(allViewOrigins->Lower() != 1 || allViewOrigins->Length() != Len) ||
(allOrientationAngles->Lower() != 1 || allOrientationAngles->Length() != Len) )
Standard_DimensionMismatch::Raise
("IGESDraw_DrawingWithRotation : Init");
if (!allAnnotations.IsNull())
if (allAnnotations->Lower() != 1) Standard_DimensionMismatch::Raise
("IGESDraw_DrawingWithRotation : Init");
theViews = allViews;
theViewOrigins = allViewOrigins;
theOrientationAngles = allOrientationAngles;
theAnnotations = allAnnotations;
InitTypeAndForm(404,1);
}
Standard_Integer IGESDraw_DrawingWithRotation::NbViews () const
{
return (theViews->Length());
}
Handle(IGESData_ViewKindEntity) IGESDraw_DrawingWithRotation::ViewItem
(const Standard_Integer Index) const
{
return (theViews->Value(Index));
}
gp_Pnt2d IGESDraw_DrawingWithRotation::ViewOrigin
(const Standard_Integer Index) const
{
return ( gp_Pnt2d (theViewOrigins->Value(Index)) );
}
Standard_Real IGESDraw_DrawingWithRotation::OrientationAngle
(const Standard_Integer Index) const
{
return ( theOrientationAngles->Value(Index) );
}
Standard_Integer IGESDraw_DrawingWithRotation::NbAnnotations () const
{
return (theAnnotations.IsNull() ? 0 : theAnnotations->Length() );
}
Handle(IGESData_IGESEntity) IGESDraw_DrawingWithRotation::Annotation
(const Standard_Integer Index) const
{
return ( theAnnotations->Value(Index) );
}
gp_XY IGESDraw_DrawingWithRotation::ViewToDrawing
(const Standard_Integer NumView, const gp_XYZ& ViewCoords) const
{
gp_XY thisOrigin = theViewOrigins->Value(NumView);
Standard_Real XOrigin = thisOrigin.X();
Standard_Real YOrigin = thisOrigin.Y();
Standard_Real theScaleFactor=0.;
Handle(IGESData_ViewKindEntity) tempView = theViews->Value(NumView);
if (tempView->IsKind(STANDARD_TYPE(IGESDraw_View)))
{
DeclareAndCast(IGESDraw_View, thisView, tempView);
theScaleFactor = thisView->ScaleFactor();
}
else if (tempView->IsKind(STANDARD_TYPE(IGESDraw_PerspectiveView)))
{
DeclareAndCast(IGESDraw_PerspectiveView, thisView, tempView);
theScaleFactor = thisView->ScaleFactor();
}
Standard_Real XV = ViewCoords.X();
Standard_Real YV = ViewCoords.Y();
Standard_Real theta = theOrientationAngles->Value(NumView);
Standard_Real XD =
XOrigin + theScaleFactor * ( XV * Cos(theta) - YV * Sin(theta) );
Standard_Real YD =
YOrigin + theScaleFactor * ( XV * Sin(theta) + YV * Cos(theta) );
return ( gp_XY(XD, YD) );
}
Standard_Boolean IGESDraw_DrawingWithRotation::DrawingUnit
(Standard_Real& val) const
{
val = 0.;
Handle(Standard_Type) typunit = STANDARD_TYPE(IGESGraph_DrawingUnits);
if (NbTypedProperties(typunit) != 1) return Standard_False;
DeclareAndCast(IGESGraph_DrawingUnits,units,TypedProperty(typunit));
if (units.IsNull()) return Standard_False;
val = units->UnitValue();
return Standard_True;
}
Standard_Boolean IGESDraw_DrawingWithRotation::DrawingSize
(Standard_Real& X, Standard_Real& Y) const
{
X = Y = 0.;
Handle(Standard_Type) typsize = STANDARD_TYPE(IGESGraph_DrawingSize);
if (NbTypedProperties(typsize) != 1) return Standard_False;
DeclareAndCast(IGESGraph_DrawingSize,size,TypedProperty(typsize));
if (size.IsNull()) return Standard_False;
X = size->XSize(); Y = size->YSize();
return Standard_True;
}

View File

@@ -0,0 +1,70 @@
-- File: IGESDraw_GeneralModule.cdl
-- Created: Mon May 10 15:00:51 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class GeneralModule from IGESDraw inherits GeneralModule from IGESData
---Purpose : Definition of General Services for IGESDraw (specific part)
-- This Services comprise : Shared & Implied Lists, Copy, Check
uses OStream,
Check, ShareTool, EntityIterator, CopyTool,
IGESEntity, DirChecker
is
Create returns mutable GeneralModule from IGESDraw;
---Purpose : Creates a GeneralModule from IGESDraw 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
OwnImpliedCase (me; CN : Integer; ent : IGESEntity;
iter : in out EntityIterator) is redefined;
---Purpose : Specific list of Entities implied by an IGESEntity <ent> (in
-- addition to Associativities). Redefined for ViewsVisible ...
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
OwnRenewCase (me; CN : Integer;
entfrom : IGESEntity; entto : mutable IGESEntity;
TC : CopyTool) is redefined;
---Purpose : Renews parameters which are specific of each Type of Entity :
-- redefined for ViewsVisible ... (takes only the implied ref.s
-- which have also been copied)
OwnDeleteCase (me; CN : Integer;
ent : mutable IGESEntity) is redefined;
---Purpose : Clears parameters with can cause looping structures :
-- redefined for ViewsVisible ... (clears the implied ref.s)
CategoryNumber (me; CN : Integer; ent : Transient; shares : ShareTool)
returns Integer is redefined;
---Purpose : Returns a category number which characterizes an entity
-- Planar : Auxiliary
-- Subfigures and ConnectPoint : Structure
-- others : Drawing
end GeneralModule;

View File

@@ -0,0 +1,565 @@
#include <IGESDraw_GeneralModule.ixx>
#include <Interface_Macros.hxx>
#include <Interface_Category.hxx>
#include <IGESDraw_CircArraySubfigure.hxx>
#include <IGESDraw_ConnectPoint.hxx>
#include <IGESDraw_Drawing.hxx>
#include <IGESDraw_DrawingWithRotation.hxx>
#include <IGESDraw_LabelDisplay.hxx>
#include <IGESDraw_NetworkSubfigure.hxx>
#include <IGESDraw_NetworkSubfigureDef.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <IGESDraw_Planar.hxx>
#include <IGESDraw_RectArraySubfigure.hxx>
#include <IGESDraw_SegmentedViewsVisible.hxx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_ViewsVisible.hxx>
#include <IGESDraw_ViewsVisibleWithAttr.hxx>
#include <IGESDraw_ToolCircArraySubfigure.hxx>
#include <IGESDraw_ToolConnectPoint.hxx>
#include <IGESDraw_ToolDrawing.hxx>
#include <IGESDraw_ToolDrawingWithRotation.hxx>
#include <IGESDraw_ToolLabelDisplay.hxx>
#include <IGESDraw_ToolNetworkSubfigure.hxx>
#include <IGESDraw_ToolNetworkSubfigureDef.hxx>
#include <IGESDraw_ToolPerspectiveView.hxx>
#include <IGESDraw_ToolPlanar.hxx>
#include <IGESDraw_ToolRectArraySubfigure.hxx>
#include <IGESDraw_ToolSegmentedViewsVisible.hxx>
#include <IGESDraw_ToolView.hxx>
#include <IGESDraw_ToolViewsVisible.hxx>
#include <IGESDraw_ToolViewsVisibleWithAttr.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
IGESDraw_GeneralModule::IGESDraw_GeneralModule () { }
void IGESDraw_GeneralModule::OwnSharedCase
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
Interface_EntityIterator& iter) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolCircArraySubfigure tool;
tool.OwnShared(anent,iter);
}
break;
case 2 : {
DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolConnectPoint tool;
tool.OwnShared(anent,iter);
}
break;
case 3 : {
DeclareAndCast(IGESDraw_Drawing,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawing tool;
tool.OwnShared(anent,iter);
}
break;
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawingWithRotation tool;
tool.OwnShared(anent,iter);
}
break;
case 5 : {
DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolLabelDisplay tool;
tool.OwnShared(anent,iter);
}
break;
case 6 : {
DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigure tool;
tool.OwnShared(anent,iter);
}
break;
case 7 : {
DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigureDef tool;
tool.OwnShared(anent,iter);
}
break;
case 8 : {
DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPerspectiveView tool;
tool.OwnShared(anent,iter);
}
break;
case 9 : {
DeclareAndCast(IGESDraw_Planar,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPlanar tool;
tool.OwnShared(anent,iter);
}
break;
case 10 : {
DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolRectArraySubfigure tool;
tool.OwnShared(anent,iter);
}
break;
case 11 : {
DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolSegmentedViewsVisible tool;
tool.OwnShared(anent,iter);
}
break;
case 12 : {
DeclareAndCast(IGESDraw_View,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolView tool;
tool.OwnShared(anent,iter);
}
break;
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisible tool;
tool.OwnShared(anent,iter);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnShared(anent,iter);
}
break;
default : break;
}
}
void IGESDraw_GeneralModule::OwnImpliedCase
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
Interface_EntityIterator& iter) const
{
switch (CN ) {
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolViewsVisible tool;
tool.OwnImplied(anent,iter);
}
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnImplied(anent,iter);
}
default : break;
}
}
IGESData_DirChecker IGESDraw_GeneralModule::DirChecker
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolCircArraySubfigure tool;
return tool.DirChecker(anent);
}
case 2 : {
DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolConnectPoint tool;
return tool.DirChecker(anent);
}
case 3 : {
DeclareAndCast(IGESDraw_Drawing,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolDrawing tool;
return tool.DirChecker(anent);
}
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolDrawingWithRotation tool;
return tool.DirChecker(anent);
}
case 5 : {
DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolLabelDisplay tool;
return tool.DirChecker(anent);
}
case 6 : {
DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolNetworkSubfigure tool;
return tool.DirChecker(anent);
}
case 7 : {
DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolNetworkSubfigureDef tool;
return tool.DirChecker(anent);
}
case 8 : {
DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolPerspectiveView tool;
return tool.DirChecker(anent);
}
case 9 : {
DeclareAndCast(IGESDraw_Planar,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolPlanar tool;
return tool.DirChecker(anent);
}
case 10 : {
DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolRectArraySubfigure tool;
return tool.DirChecker(anent);
}
case 11 : {
DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolSegmentedViewsVisible tool;
return tool.DirChecker(anent);
}
case 12 : {
DeclareAndCast(IGESDraw_View,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolView tool;
return tool.DirChecker(anent);
}
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolViewsVisible tool;
return tool.DirChecker(anent);
}
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolViewsVisibleWithAttr tool;
return tool.DirChecker(anent);
}
default : break;
}
return IGESData_DirChecker(); // by default, no specific criterium
}
void IGESDraw_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(IGESDraw_CircArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolCircArraySubfigure tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 2 : {
DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolConnectPoint tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 3 : {
DeclareAndCast(IGESDraw_Drawing,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawing tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawingWithRotation tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 5 : {
DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolLabelDisplay tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 6 : {
DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigure tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 7 : {
DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigureDef tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 8 : {
DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPerspectiveView tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 9 : {
DeclareAndCast(IGESDraw_Planar,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPlanar tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 10 : {
DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolRectArraySubfigure tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 11 : {
DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolSegmentedViewsVisible tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 12 : {
DeclareAndCast(IGESDraw_View,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolView tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisible tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnCheck(anent,shares,ach);
}
break;
default : break;
}
}
Standard_Boolean IGESDraw_GeneralModule::NewVoid
(const Standard_Integer CN, Handle(Standard_Transient)& ent) const
{
switch (CN) {
case 1 : ent = new IGESDraw_CircArraySubfigure; break;
case 2 : ent = new IGESDraw_ConnectPoint; break;
case 3 : ent = new IGESDraw_Drawing; break;
case 4 : ent = new IGESDraw_DrawingWithRotation; break;
case 5 : ent = new IGESDraw_LabelDisplay; break;
case 6 : ent = new IGESDraw_NetworkSubfigure; break;
case 7 : ent = new IGESDraw_NetworkSubfigureDef; break;
case 8 : ent = new IGESDraw_PerspectiveView; break;
case 9 : ent = new IGESDraw_Planar; break;
case 10 : ent = new IGESDraw_RectArraySubfigure; break;
case 11 : ent = new IGESDraw_SegmentedViewsVisible; break;
case 12 : ent = new IGESDraw_View; break;
case 13 : ent = new IGESDraw_ViewsVisible; break;
case 14 : ent = new IGESDraw_ViewsVisibleWithAttr; break;
default : return Standard_False; // by default, Failure on Recognize
}
return Standard_True;
}
void IGESDraw_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(IGESDraw_CircArraySubfigure,enfr,entfrom);
DeclareAndCast(IGESDraw_CircArraySubfigure,ento,entto);
IGESDraw_ToolCircArraySubfigure tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 2 : {
DeclareAndCast(IGESDraw_ConnectPoint,enfr,entfrom);
DeclareAndCast(IGESDraw_ConnectPoint,ento,entto);
IGESDraw_ToolConnectPoint tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 3 : {
DeclareAndCast(IGESDraw_Drawing,enfr,entfrom);
DeclareAndCast(IGESDraw_Drawing,ento,entto);
IGESDraw_ToolDrawing tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,enfr,entfrom);
DeclareAndCast(IGESDraw_DrawingWithRotation,ento,entto);
IGESDraw_ToolDrawingWithRotation tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 5 : {
DeclareAndCast(IGESDraw_LabelDisplay,enfr,entfrom);
DeclareAndCast(IGESDraw_LabelDisplay,ento,entto);
IGESDraw_ToolLabelDisplay tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 6 : {
DeclareAndCast(IGESDraw_NetworkSubfigure,enfr,entfrom);
DeclareAndCast(IGESDraw_NetworkSubfigure,ento,entto);
IGESDraw_ToolNetworkSubfigure tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 7 : {
DeclareAndCast(IGESDraw_NetworkSubfigureDef,enfr,entfrom);
DeclareAndCast(IGESDraw_NetworkSubfigureDef,ento,entto);
IGESDraw_ToolNetworkSubfigureDef tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 8 : {
DeclareAndCast(IGESDraw_PerspectiveView,enfr,entfrom);
DeclareAndCast(IGESDraw_PerspectiveView,ento,entto);
IGESDraw_ToolPerspectiveView tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 9 : {
DeclareAndCast(IGESDraw_Planar,enfr,entfrom);
DeclareAndCast(IGESDraw_Planar,ento,entto);
IGESDraw_ToolPlanar tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 10 : {
DeclareAndCast(IGESDraw_RectArraySubfigure,enfr,entfrom);
DeclareAndCast(IGESDraw_RectArraySubfigure,ento,entto);
IGESDraw_ToolRectArraySubfigure tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 11 : {
DeclareAndCast(IGESDraw_SegmentedViewsVisible,enfr,entfrom);
DeclareAndCast(IGESDraw_SegmentedViewsVisible,ento,entto);
IGESDraw_ToolSegmentedViewsVisible tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 12 : {
DeclareAndCast(IGESDraw_View,enfr,entfrom);
DeclareAndCast(IGESDraw_View,ento,entto);
IGESDraw_ToolView tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,enfr,entfrom);
DeclareAndCast(IGESDraw_ViewsVisible,ento,entto);
IGESDraw_ToolViewsVisible tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,enfr,entfrom);
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,ento,entto);
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
default : break;
}
}
void IGESDraw_GeneralModule::OwnRenewCase
(const Standard_Integer CN,
const Handle(IGESData_IGESEntity)& entfrom,
const Handle(IGESData_IGESEntity)& entto,
const Interface_CopyTool& TC) const
{
switch (CN) {
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,enfr,entfrom);
DeclareAndCast(IGESDraw_ViewsVisible,ento,entto);
IGESDraw_ToolViewsVisible tool;
tool.OwnRenew(enfr,ento,TC);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,enfr,entfrom);
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,ento,entto);
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnRenew(enfr,ento,TC);
}
break;
default : break;
}
}
void IGESDraw_GeneralModule::OwnDeleteCase
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
switch (CN) {
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
IGESDraw_ToolViewsVisible tool;
tool.OwnWhenDelete(anent);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnWhenDelete(anent);
}
break;
default : break;
}
}
Standard_Integer IGESDraw_GeneralModule::CategoryNumber
(const Standard_Integer CN, const Handle(Standard_Transient)& ,
const Interface_ShareTool& ) const
{
if (CN == 9) return Interface_Category::Number("Auxiliary");
if (CN == 1 || CN == 2 || CN == 10) return Interface_Category::Number("Structure");
return Interface_Category::Number("Drawing");
}

View File

@@ -0,0 +1,116 @@
--
-- File : LabelDisplay.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class LabelDisplay from IGESDraw inherits LabelDisplayEntity
---Purpose: defines IGESLabelDisplay, Type <402> Form <5>
-- in package IGESDraw
--
-- Permits one or more displays for the
-- entity labels of an entity
uses
IGESEntity from IGESData,
HArray1OfIGESEntity from IGESData,
LeaderArrow from IGESDimen,
HArray1OfLeaderArrow from IGESDimen,
HArray1OfInteger from TColStd,
ViewKindEntity from IGESData,
HArray1OfViewKindEntity from IGESDraw,
Pnt from gp,
HArray1OfXYZ from TColgp
raises DimensionMismatch, OutOfRange
is
Create returns mutable LabelDisplay;
-- Specific Methods pertaining to the class
Init (me : mutable;
allViews : HArray1OfViewKindEntity;
allTextLocations : HArray1OfXYZ;
allLeaderEntities : HArray1OfLeaderArrow;
allLabelLevels : HArray1OfInteger;
allDisplayedEntities : HArray1OfIGESEntity)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- LabelDisplay
-- - allViews : Pointers to View Entities
-- - allTextLocations : Coordinates of text locations in the views
-- - allLeaderEntities : Pointers to Leader Entities in the views
-- - allLabelLevels : Entity label level numbers in the views
-- - allDisplayedEntities : Pointers to the entities being displayed
-- raises exception if Lengths of allViews, allTextLocations,
-- allLeaderEntities, allLabelLevels and allDisplayedEntities are
-- not same.
NbLabels (me) returns Integer;
---Purpose : returns the number of label placements in <me>
ViewItem (me; ViewIndex : Integer) returns ViewKindEntity
raises OutOfRange;
---Purpose : returns the View entity indicated by ViewIndex
-- raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
TextLocation (me; ViewIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the 3d-Point coordinates of the text location, in the
-- view indicated by ViewIndex
-- raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
LeaderEntity (me; ViewIndex : Integer) returns LeaderArrow
raises OutOfRange;
---Purpose : returns the Leader entity in the view indicated by ViewIndex
-- raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
LabelLevel (me; ViewIndex : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Entity label level number in the view indicated
-- by ViewIndex
-- raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
DisplayedEntity (me; EntityIndex : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns the entity indicated by EntityIndex
-- raises an exception if EntityIndex <= 0 or EntityIndex > NbLabels().
TransformedTextLocation (me; ViewIndex : Integer) returns Pnt
raises OutOfRange;
---Purpose : returns the transformed 3d-Point coordinates of the text
-- location, in the view indicated by ViewIndex
-- raises an exception if ViewIndex <= 0 or ViewIndex > NbLabels().
fields
--
-- Class : IGESDraw_LabelDisplay
--
-- Purpose : Declaration of the variables specific to a Label Display.
--
-- Reminder : A Label Display is defined by :
-- - Pointers to View Entities
-- - Coordinates of text locations in the views
-- - Pointers to Leader Entities in the views
-- - Entity label level numbers in the views
-- - Pointers to the entities being displayed
--
theViews : HArray1OfViewKindEntity;
theTextLocations : HArray1OfXYZ;
theLeaderEntities : HArray1OfLeaderArrow;
theLabelLevels : HArray1OfInteger;
theDisplayedEntities : HArray1OfIGESEntity;
end LabelDisplay;

View File

@@ -0,0 +1,94 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_LabelDisplay.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_LabelDisplay.ixx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <Interface_Macros.hxx>
IGESDraw_LabelDisplay::IGESDraw_LabelDisplay () { }
void IGESDraw_LabelDisplay::Init
(const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews,
const Handle(TColgp_HArray1OfXYZ)& allTextLocations,
const Handle(IGESDimen_HArray1OfLeaderArrow)& allLeaderEntities,
const Handle(TColStd_HArray1OfInteger)& allLabelLevels,
const Handle(IGESData_HArray1OfIGESEntity)& allDisplayedEntities)
{
Standard_Integer Ln = allViews->Length();
if ( allViews->Lower() != 1 ||
(allTextLocations->Lower() != 1 || allTextLocations->Length() != Ln) ||
(allLeaderEntities->Lower() != 1 || allLeaderEntities->Length() != Ln) ||
(allLabelLevels->Lower() != 1 || allLabelLevels->Length() != Ln) ||
(allDisplayedEntities->Lower() != 1 || allDisplayedEntities->Length() != Ln))
Standard_DimensionMismatch::Raise("IGESDraw_LabelDisplay : Init");
theViews = allViews;
theTextLocations = allTextLocations;
theLeaderEntities = allLeaderEntities;
theLabelLevels = allLabelLevels;
theDisplayedEntities = allDisplayedEntities;
InitTypeAndForm(402,5);
}
Standard_Integer IGESDraw_LabelDisplay::NbLabels () const
{
return (theViews->Length());
}
Handle(IGESData_ViewKindEntity) IGESDraw_LabelDisplay::ViewItem
(const Standard_Integer ViewIndex) const
{
return (theViews->Value(ViewIndex));
}
gp_Pnt IGESDraw_LabelDisplay::TextLocation
(const Standard_Integer ViewIndex) const
{
return ( gp_Pnt (theTextLocations->Value(ViewIndex)) );
}
Handle(IGESDimen_LeaderArrow) IGESDraw_LabelDisplay::LeaderEntity
(const Standard_Integer ViewIndex) const
{
return (theLeaderEntities->Value(ViewIndex));
}
Standard_Integer IGESDraw_LabelDisplay::LabelLevel
(const Standard_Integer ViewIndex) const
{
return (theLabelLevels->Value(ViewIndex));
}
Handle(IGESData_IGESEntity) IGESDraw_LabelDisplay::DisplayedEntity
(const Standard_Integer EntityIndex) const
{
return (theDisplayedEntities->Value(EntityIndex));
}
gp_Pnt IGESDraw_LabelDisplay::TransformedTextLocation
(const Standard_Integer ViewIndex) const
{
gp_XYZ retXYZ;
gp_XYZ tempXYZ = theTextLocations->Value(ViewIndex);
Handle(IGESData_ViewKindEntity) tempView = theViews->Value(ViewIndex);
if (tempView->IsKind(STANDARD_TYPE(IGESDraw_View)))
{
DeclareAndCast(IGESDraw_View, thisView, tempView);
retXYZ = thisView->ModelToView( tempXYZ );
}
else if (tempView->IsKind(STANDARD_TYPE(IGESDraw_PerspectiveView)))
{
DeclareAndCast(IGESDraw_PerspectiveView, thisView, tempView);
retXYZ = thisView->ModelToView( tempXYZ );
}
return ( gp_Pnt(retXYZ) );
}

View File

@@ -0,0 +1,128 @@
--
-- File : NetworkSubfigure.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class NetworkSubfigure from IGESDraw inherits IGESEntity
---Purpose : defines IGES Network Subfigure Instance Entity,
-- Type <420> Form Number <0> in package IGESDraw
--
-- Used to specify each instance of Network Subfigure
-- Definition Entity (Type 320, Form 0).
uses
XYZ from gp,
HAsciiString from TCollection,
NetworkSubfigureDef from IGESDraw,
TextDisplayTemplate from IGESGraph,
ConnectPoint from IGESDraw,
HArray1OfConnectPoint from IGESDraw
raises OutOfRange
is
Create returns mutable NetworkSubfigure;
-- specific for the entity
Init (me : mutable;
aDefinition : NetworkSubfigureDef;
aTranslation : XYZ;
aScaleFactor : XYZ;
aTypeFlag : Integer;
aDesignator : HAsciiString;
aTemplate : TextDisplayTemplate;
allConnectPoints : HArray1OfConnectPoint);
---Purpose : This method is used to set the fields of the class
-- NetworkSubfigure
-- - aDefinition : Network Subfigure Definition Entity
-- - aTranslation : Translation data relative to the model
-- space or the definition space
-- - aScaleFactor : Scale factors in the definition space
-- - aTypeFlag : Type flag
-- - aDesignator : Primary reference designator
-- - aTemplate : Primary reference designator Text
-- display Template Entity
-- - allConnectPoints : Associated Connect Point Entities
SubfigureDefinition (me) returns NetworkSubfigureDef;
---Purpose : returns Network Subfigure Definition Entity specified by this entity
Translation (me) returns XYZ from gp;
---Purpose : returns Translation Data relative to either model space or to
-- the definition space of a referring entity
TransformedTranslation (me) returns XYZ from gp;
---Purpose : returns the Transformed Translation Data relative to either model
-- space or to the definition space of a referring entity
ScaleFactors (me) returns XYZ from gp;
---Purpose : returns Scale factor in definition space(x, y, z axes)
TypeFlag (me) returns Integer;
---Purpose : returns Type Flag which implements the distinction between Logical
-- design and Physical design data,and is required if both are present.
-- Type Flag = 0 : Not specified (default)
-- = 1 : Logical
-- = 2 : Physical
ReferenceDesignator (me) returns HAsciiString from TCollection;
---Purpose : returns the primary reference designator
HasDesignatorTemplate (me) returns Boolean;
---Purpose : returns True if Text Display Template Entity is specified,
-- else False
DesignatorTemplate (me) returns TextDisplayTemplate;
---Purpose : returns primary reference designator Text Display Template Entity,
-- or null. If null, no Text Display Template Entity specified
NbConnectPoints (me) returns Integer;
---Purpose : returns the number of associated Connect Point Entities
ConnectPoint (me; Index : Integer) returns ConnectPoint
raises OutOfRange;
---Purpose : returns the Index'th associated Connect point Entity
-- raises exception if Index <= 0 or Index > NbConnectPoints()
fields
--
-- Class : IGESDraw_NetworkSubfigure
--
-- Purpose : Declaration of the variables specific to a NetworkSubfigure.
--
-- Reminder : A Network Subfigure Instance Entity is defined by :
-- - a Network Subfigure Definition
-- - translation data relative to referring entity's
-- model or definition space
-- - the scale factors in x,y and z directions
-- - a type flag to distinguish logical design data
-- from physical data
-- Type flag : 0 = not specified (default)
-- 1 = logical
-- 2 = physical
-- - the pointers to associated Connect Point Entities
--
theSubfigureDefinition : NetworkSubfigureDef;
theTranslation : XYZ;
theScaleFactor : XYZ;
theTypeFlag : Integer;
theDesignator : HAsciiString;
theDesignatorTemplate : TextDisplayTemplate;
theConnectPoints : HArray1OfConnectPoint;
end NetworkSubfigure;

View File

@@ -0,0 +1,93 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_NetworkSubfigure.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_NetworkSubfigure.ixx>
#include <Standard_DimensionMismatch.hxx>
#include <gp_GTrsf.hxx>
IGESDraw_NetworkSubfigure::IGESDraw_NetworkSubfigure () { }
void IGESDraw_NetworkSubfigure::Init
(const Handle(IGESDraw_NetworkSubfigureDef)& aDefinition,
const gp_XYZ& aTranslation,
const gp_XYZ& aScaleFactor,
const Standard_Integer aTypeFlag,
const Handle(TCollection_HAsciiString)& aDesignator,
const Handle(IGESGraph_TextDisplayTemplate)& aTemplate,
const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints)
{
if (!allConnectPoints.IsNull())
if (allConnectPoints->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigure : Init");
theSubfigureDefinition = aDefinition;
theTranslation = aTranslation;
theScaleFactor = aScaleFactor;
theTypeFlag = aTypeFlag;
theDesignator = aDesignator;
theDesignatorTemplate = aTemplate;
theConnectPoints = allConnectPoints;
InitTypeAndForm(420,0);
}
Handle(IGESDraw_NetworkSubfigureDef)
IGESDraw_NetworkSubfigure::SubfigureDefinition () const
{
return theSubfigureDefinition;
}
gp_XYZ IGESDraw_NetworkSubfigure::Translation () const
{
return theTranslation;
}
gp_XYZ IGESDraw_NetworkSubfigure::TransformedTranslation () const
{
gp_XYZ TempXYZ = theTranslation;
if (HasTransf()) Location().Transforms(TempXYZ);
return ( TempXYZ );
}
gp_XYZ IGESDraw_NetworkSubfigure::ScaleFactors () const
{
return theScaleFactor;
}
Standard_Integer IGESDraw_NetworkSubfigure::TypeFlag () const
{
return theTypeFlag;
}
Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigure::ReferenceDesignator
() const
{
return theDesignator;
}
Standard_Boolean IGESDraw_NetworkSubfigure::HasDesignatorTemplate () const
{
return (! theDesignatorTemplate.IsNull() );
}
Handle(IGESGraph_TextDisplayTemplate)
IGESDraw_NetworkSubfigure::DesignatorTemplate () const
{
return theDesignatorTemplate;
}
Standard_Integer IGESDraw_NetworkSubfigure::NbConnectPoints () const
{
return (theConnectPoints.IsNull() ? 0 : theConnectPoints->Length() );
}
Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigure::ConnectPoint
(const Standard_Integer Index) const
{
return ( theConnectPoints->Value(Index) );
}

View File

@@ -0,0 +1,144 @@
--
-- File : NetworkSubfigureDef.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class NetworkSubfigureDef from IGESDraw inherits IGESEntity
---Purpose : defines IGESNetworkSubfigureDef,
-- Type <320> Form Number <0> in package IGESDraw
--
-- This class differs from the ordinary subfigure definition
-- in that it defines a specialized subfigure, one whose
-- instances may participate in networks.
--
-- The Number of associated(child) Connect Point Entities
-- in the Network Subfigure Instance must match the number
-- in the Network Subfigure Definition, their order must
-- be identical, and any unused points of connection in
-- the instance must be indicated by a null(zero) pointer.
--
uses
HArray1OfIGESEntity from IGESData,
ConnectPoint from IGESDraw,
HArray1OfConnectPoint from IGESDraw,
TextDisplayTemplate from IGESGraph,
HAsciiString from TCollection
raises OutOfRange
is
Create returns mutable NetworkSubfigureDef;
-- Specific Methods pertaining to the class
Init (me : mutable;
aDepth : Integer;
aName : HAsciiString;
allEntities : HArray1OfIGESEntity;
aTypeFlag : Integer;
aDesignator : HAsciiString;
aTemplate : TextDisplayTemplate;
allPointEntities : HArray1OfConnectPoint);
---Purpose : This method is used to set fields of the class
-- NetworkSubfigureDef
-- - aDepth : Depth of Subfigure
-- (indicating the amount of nesting)
-- - aName : Subfigure Name
-- - allEntities : Associated subfigures Entities exclusive
-- of primary reference designator and
-- Control Points.
-- - aTypeFlag : Type flag determines which Entity
-- belongs in which design
-- (Logical design or Physical design)
-- - aDesignator : Designator HAsciiString and its Template
-- - allPointEntities : Associated Connect Point Entities
Depth (me) returns Integer;
---Purpose : returns Depth of Subfigure(indication the amount of nesting)
-- Note : The Depth is inclusive of both Network Subfigure Definition
-- Entity and the Ordinary Subfigure Definition Entity.
-- Thus, the two may be nested.
Name (me) returns HAsciiString from TCollection;
---Purpose : returns the Subfigure Name
NbEntities (me) returns Integer;
---Purpose : returns Number of Associated(child) entries in subfigure exclusive
-- of primary reference designator and Control Points
Entity (me; Index : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns the Index'th IGESEntity in subfigure exclusive of primary
-- reference designator and Control Points
-- raises exception if Index <=0 or Index > NbEntities()
TypeFlag (me) returns Integer;
---Purpose : return value = 0 : Not Specified
-- = 1 : Logical design
-- = 2 : Physical design
Designator (me) returns HAsciiString from TCollection;
---Purpose : returns Primary Reference Designator
HasDesignatorTemplate (me) returns Boolean;
---Purpose : returns True if Text Display Template is specified for
-- primary designator else returns False
DesignatorTemplate (me) returns TextDisplayTemplate;
---Purpose : if Text Display Template specified then return TextDisplayTemplate
-- else return NULL Handle
NbPointEntities (me) returns Integer;
---Purpose : returns the Number Of Associated(child) Connect Point Entities
HasPointEntity (me; Index : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns True is Index'th Associated Connect Point Entity is present
-- else returns False
-- raises exception if Index is out of bound
PointEntity (me; Index : Integer) returns ConnectPoint
raises OutOfRange;
---Purpose : returns the Index'th Associated Connect Point Entity
-- raises exception if Index <= 0 or Index > NbPointEntities()
fields
--
-- Class : IGESDraw_NetworkSubfigureDef
--
-- Purpose : Declaration of the variables specific to a NetworkSubfigureDef.
--
-- Reminder : A NetworkSubfigureDef is defined by :
-- - Depth of Subfigure(indicating the amount of nesting)
-- - Subfigure Name
-- - Associated subfigures Entities exclusive
-- of primary reference designator and Control Points.
-- - Type flag determines which Entity belongs in which design
-- (Logical design or Physical design)
-- - Designator HAsciiString and its Template
-- - Associated Connect Point Entities
--
theDepth : Integer;
theName : HAsciiString;
theEntities : HArray1OfIGESEntity;
theTypeFlag : Integer;
theDesignator : HAsciiString;
theDesignatorTemplate : TextDisplayTemplate;
thePointEntities : HArray1OfConnectPoint;
end NetworkSubfigureDef;

View File

@@ -0,0 +1,101 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_NetworkSubfigureDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_NetworkSubfigureDef.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESDraw_NetworkSubfigureDef::IGESDraw_NetworkSubfigureDef () { }
void IGESDraw_NetworkSubfigureDef::Init
(const Standard_Integer aDepth,
const Handle(TCollection_HAsciiString)& aName,
const Handle(IGESData_HArray1OfIGESEntity)& allEntities,
const Standard_Integer aTypeFlag,
const Handle(TCollection_HAsciiString)& aDesignator,
const Handle(IGESGraph_TextDisplayTemplate)& aTemplate,
const Handle(IGESDraw_HArray1OfConnectPoint)& allPointEntities)
{
if (!allPointEntities.IsNull())
if (allPointEntities->Lower() != 1 || allEntities->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigureDef : Init");
theDepth = aDepth;
theName = aName;
theEntities = allEntities;
theTypeFlag = aTypeFlag;
theDesignator = aDesignator;
theDesignatorTemplate = aTemplate;
thePointEntities = allPointEntities;
InitTypeAndForm(320,0);
}
Standard_Integer IGESDraw_NetworkSubfigureDef::Depth () const
{
return theDepth;
}
Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Name () const
{
return theName;
}
Standard_Integer IGESDraw_NetworkSubfigureDef::NbEntities () const
{
return theEntities->Length();
}
Handle(IGESData_IGESEntity) IGESDraw_NetworkSubfigureDef::Entity
(const Standard_Integer Index) const
{
return theEntities->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Standard_Integer IGESDraw_NetworkSubfigureDef::TypeFlag () const
{
return theTypeFlag;
}
Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Designator
() const
{
return theDesignator;
}
Standard_Boolean IGESDraw_NetworkSubfigureDef::HasDesignatorTemplate () const
{
return (! theDesignatorTemplate.IsNull());
}
Handle(IGESGraph_TextDisplayTemplate)
IGESDraw_NetworkSubfigureDef::DesignatorTemplate () const
{
return theDesignatorTemplate;
}
Standard_Integer IGESDraw_NetworkSubfigureDef::NbPointEntities () const
{
return (thePointEntities.IsNull() ? 0 : thePointEntities->Length());
}
Standard_Boolean IGESDraw_NetworkSubfigureDef::HasPointEntity
(const Standard_Integer Index) const
{
if (thePointEntities.IsNull()) return Standard_False;
return (! thePointEntities->Value(Index).IsNull());
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigureDef::PointEntity
(const Standard_Integer Index) const
{
return thePointEntities->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}

View File

@@ -0,0 +1,180 @@
--
-- File : PerspectiveView.cdl
-- Created : Wed 3 Feb 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class PerspectiveView from IGESDraw inherits ViewKindEntity
---Purpose: defines IGESPerspectiveView, Type <410> Form <1>
-- in package IGESDraw
--
-- Supports a perspective view.
-- Any geometric projection is defined by a view plane
-- and the projectors that pass through the view plane.
-- Projectors can be visualized as rays of light that
-- form an image by passing through the viewed object
-- and striking the view plane.
-- The projectors are defined via a point called the
-- Centre-of-Projection or the eye-point.
-- A perspective view is formed by all projectors that
-- emanate from the Centre-of-Projection and pass
-- through the view plane.
uses
TransfEntity from IGESData,
Vec from gp,
XY from gp,
XYZ from gp,
Pnt2d from gp,
Pnt from gp
raises OutOfRange
is
Create returns mutable PerspectiveView;
-- Specific Methods pertaining to the class
Init (me : mutable;
aViewNumber : Integer;
aScaleFactor : Real;
aViewNormalVector : XYZ;
aViewReferencePoint : XYZ;
aCenterOfProjection : XYZ;
aViewUpVector : XYZ;
aViewPlaneDistance : Real;
aTopLeft : XY;
aBottomRight : XY;
aDepthClip : Integer;
aBackPlaneDistance : Real;
aFrontPlaneDistance : Real);
---Purpose : This method is used to set the fields of the class
-- PerspectiveView
-- - aViewNumber : The desired view
-- - aScaleFactor : Scale factor
-- - aViewNormalVector : View plane normal vector (model space)
-- - aViewReferencePoint : View reference point (model space)
-- - aCenterOfProjection : Center Of Projection (model space)
-- - aViewUpVector : View up vector (model space)
-- - aViewPlaneDistance : View plane distance (model space)
-- - aTopLeft : Top-left point of clipping window
-- - aBottomRight : Bottom-right point of clipping window
-- - aDepthClip : Depth clipping indicator
-- - aBackPlaneDistance : Distance of back clipping plane
-- - aFrontPlaneDistance : Distance of front clipping plane
IsSingle (me) returns Boolean;
---Purpose : Returns True (for a single view)
NbViews (me) returns Integer;
---Purpose : Returns 1 (single view)
ViewItem (me; num : Integer) returns ViewKindEntity raises OutOfRange;
---Purpose : For a single view, returns <me> whatever <num>
ViewNumber (me) returns Integer;
---Purpose : returns the view number associated with <me>
ScaleFactor (me) returns Real;
---Purpose : returns the scale factor associated with <me>
ViewNormalVector (me) returns Vec;
---Purpose : returns the View plane normal vector (model space)
ViewReferencePoint (me) returns Pnt;
---Purpose : returns the View reference point (model space)
CenterOfProjection (me) returns Pnt;
---Purpose : returns the Center Of Projection (model space)
ViewUpVector (me) returns Vec;
---Purpose : returns the View up vector (model space)
ViewPlaneDistance (me) returns Real;
---Purpose : returns the View plane distance (model space)
TopLeft (me) returns Pnt2d;
---Purpose : returns the top left point of the clipping window
BottomRight (me) returns Pnt2d;
---Purpose : returns the bottom right point of the clipping window
DepthClip (me) returns Integer;
---Purpose : returns the Depth clipping indicator
-- 0 = No depth clipping
-- 1 = Back clipping plane ON
-- 2 = Front clipping plane ON
-- 3 = Back and front clipping planes ON
BackPlaneDistance (me) returns Real;
---Purpose : returns the View coordinate denoting the location of
-- the back clipping plane
FrontPlaneDistance (me) returns Real;
---Purpose : returns the View coordinate denoting the location of
-- the front clipping plane
ViewMatrix (me) returns TransfEntity;
---Purpose : returns the Transformation Matrix
ModelToView (me; coords : XYZ) returns XYZ;
---Purpose : returns XYX from the Model space to the View space by
-- applying the View Matrix
fields
--
-- Class : IGESDraw_PerspectiveView
--
-- Purpose : Declaration of the variables specific to a
-- PerspectiveView Entity.
--
-- Reminder : A PerspectiveView Entity is defined by :
-- - The desired view
-- - Scale factor
-- - View plane normal vector (model space)
-- - View reference point (model space)
-- - Center Of Projection (model space)
-- - View up vector (model space)
-- - View plane distance (model space)
-- - Top-left point of clipping window
-- - Bottom-right point of clipping window
-- - Depth clipping indicator
-- 0 = No depth clipping
-- 1 = Back clipping plane ON
-- 2 = Front clipping plane ON
-- 3 = Back and front clipping planes ON
-- - Distance of back clipping plane
-- - Distance of front clipping plane
--
theViewNumber : Integer;
theScaleFactor : Real;
theViewNormalVector : XYZ;
theViewReferencePoint : XYZ;
theCenterOfProjection : XYZ;
theViewUpVector : XYZ;
theViewPlaneDistance : Real;
theTopLeft : XY;
theBottomRight : XY;
theDepthClip : Integer;
theBackPlaneDistance : Real;
theFrontPlaneDistance : Real;
end PerspectiveView;

View File

@@ -0,0 +1,138 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_PerspectiveView.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_PerspectiveView.ixx>
#include <gp_GTrsf.hxx>
IGESDraw_PerspectiveView::IGESDraw_PerspectiveView () { }
// This class inherits from IGESData_ViewKindEntity
void IGESDraw_PerspectiveView::Init
(const Standard_Integer aViewNumber,
const Standard_Real aScaleFactor,
const gp_XYZ& aViewNormalVector,
const gp_XYZ& aViewReferencePoint,
const gp_XYZ& aCenterOfProjection,
const gp_XYZ& aViewUpVector,
const Standard_Real aViewPlaneDistance,
const gp_XY& aTopLeft,
const gp_XY& aBottomRight,
const Standard_Integer aDepthClip,
const Standard_Real aBackPlaneDistance,
const Standard_Real aFrontPlaneDistance)
{
theViewNumber = aViewNumber;
theScaleFactor = aScaleFactor;
theViewNormalVector = aViewNormalVector;
theViewReferencePoint = aViewReferencePoint;
theCenterOfProjection = aCenterOfProjection;
theViewUpVector = aViewUpVector;
theViewPlaneDistance = aViewPlaneDistance;
theTopLeft = aTopLeft;
theBottomRight = aBottomRight;
theDepthClip = aDepthClip;
theBackPlaneDistance = aBackPlaneDistance;
theFrontPlaneDistance = aFrontPlaneDistance;
InitTypeAndForm(410,1);
}
Standard_Boolean IGESDraw_PerspectiveView::IsSingle () const
{
return Standard_True;
}
Standard_Integer IGESDraw_PerspectiveView::NbViews () const
{ return 1; }
Handle(IGESData_ViewKindEntity) IGESDraw_PerspectiveView::ViewItem
(const Standard_Integer) const
{ return Handle(IGESData_ViewKindEntity)::DownCast (This()); }
Standard_Integer IGESDraw_PerspectiveView::ViewNumber () const
{
return theViewNumber;
}
Standard_Real IGESDraw_PerspectiveView::ScaleFactor () const
{
return theScaleFactor;
}
gp_Vec IGESDraw_PerspectiveView::ViewNormalVector () const
{
gp_Vec tempRes(theViewNormalVector);
return tempRes;
}
gp_Pnt IGESDraw_PerspectiveView::ViewReferencePoint () const
{
gp_Pnt tempRes(theViewReferencePoint);
return tempRes;
}
gp_Pnt IGESDraw_PerspectiveView::CenterOfProjection () const
{
gp_Pnt tempRes(theCenterOfProjection);
return tempRes;
}
gp_Vec IGESDraw_PerspectiveView::ViewUpVector () const
{
gp_Vec tempRes(theViewUpVector);
return tempRes;
}
Standard_Real IGESDraw_PerspectiveView::ViewPlaneDistance () const
{
return theViewPlaneDistance;
}
gp_Pnt2d IGESDraw_PerspectiveView::TopLeft () const
{
gp_Pnt2d tempRes(theTopLeft);
return tempRes;
}
gp_Pnt2d IGESDraw_PerspectiveView::BottomRight () const
{
gp_Pnt2d tempRes(theBottomRight);
return tempRes;
}
Standard_Integer IGESDraw_PerspectiveView::DepthClip () const
{
return theDepthClip;
}
Standard_Real IGESDraw_PerspectiveView::BackPlaneDistance () const
{
return theBackPlaneDistance;
}
Standard_Real IGESDraw_PerspectiveView::FrontPlaneDistance () const
{
return theFrontPlaneDistance;
}
Handle(IGESData_TransfEntity) IGESDraw_PerspectiveView::ViewMatrix () const
{
return (Transf());
}
gp_XYZ IGESDraw_PerspectiveView::ModelToView
(const gp_XYZ& coords) const
{
gp_XYZ tempCoords = coords;
Location().Transforms(tempCoords);
return (tempCoords);
}

View File

@@ -0,0 +1,79 @@
--
-- File : Planar.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class Planar from IGESDraw inherits IGESEntity
---Purpose: defines IGESPlanar, Type <402> Form <16>
-- in package IGESDraw
--
-- Indicates that a collection of entities is coplanar.The
-- entities may be geometric, annotative, and/or structural.
uses
TransformationMatrix from IGESGeom,
HArray1OfIGESEntity from IGESData
raises OutOfRange
is
Create returns mutable Planar;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbMats : Integer;
aTransformationMatrix : TransformationMatrix;
allEntities : HArray1OfIGESEntity);
---Purpose : This method is used to set the fields of the class Planar
-- - nbMats : Number of Transformation matrices
-- - aTransformationMatrix : Pointer to the Transformation matrix
-- - allEntities : Pointers to the entities specified
NbMatrices (me) returns Integer;
---Purpose : returns the number of Transformation matrices in <me>
NbEntities (me) returns Integer;
---Purpose : returns the number of Entities in the plane pointed to by this
-- associativity
IsIdentityMatrix (me) returns Boolean;
---Purpose : returns True if TransformationMatrix is Identity Matrix,
-- i.e:- No Matrix defined.
TransformMatrix (me) returns TransformationMatrix;
---Purpose : returns the Transformation matrix moving data from the XY plane
-- into space or zero
Entity (me; EntityIndex : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns the Entity on the specified plane, indicated by EntityIndex
-- raises an exception if EntityIndex <= 0 or
-- EntityIndex > NbEntities()
fields
--
-- Class : IGESDraw_Planar
--
-- Purpose : Declaration of the variables specific to a Planar Entity.
--
-- Reminder : A Planar Entity is defined by :
-- - Number of Transformation matrices
-- - Pointer to the Transformation matrix
-- - Pointers to the entities specified
--
theNbMatrices : Integer;
theTransformationMatrix : TransformationMatrix;
theEntities : HArray1OfIGESEntity;
end Planar;

View File

@@ -0,0 +1,56 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_Planar.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_Planar.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESDraw_Planar::IGESDraw_Planar () { }
void IGESDraw_Planar::Init
(const Standard_Integer nbMats,
const Handle(IGESGeom_TransformationMatrix)& aTransformationMatrix,
const Handle(IGESData_HArray1OfIGESEntity)& allEntities)
{
if (!allEntities.IsNull())
if (allEntities->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_Planar : Init");
theNbMatrices = nbMats;
theTransformationMatrix = aTransformationMatrix;
theEntities = allEntities;
InitTypeAndForm(402,16);
}
Standard_Integer IGESDraw_Planar::NbMatrices () const
{
return theNbMatrices;
}
Standard_Integer IGESDraw_Planar::NbEntities () const
{
return ( theEntities.IsNull()? 0 : theEntities->Length() );
}
Standard_Boolean IGESDraw_Planar::IsIdentityMatrix () const
{
return ( theTransformationMatrix.IsNull() );
}
Handle(IGESGeom_TransformationMatrix) IGESDraw_Planar::TransformMatrix () const
{
return theTransformationMatrix;
}
Handle(IGESData_IGESEntity) IGESDraw_Planar::Entity
(const Standard_Integer EntityIndex) const
{
return (theEntities->Value(EntityIndex));
}

View File

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

View File

@@ -0,0 +1,73 @@
#include <IGESDraw_Protocol.ixx>
#include <IGESDraw_CircArraySubfigure.hxx>
#include <IGESDraw_ConnectPoint.hxx>
#include <IGESDraw_Drawing.hxx>
#include <IGESDraw_DrawingWithRotation.hxx>
#include <IGESDraw_Protocol.hxx>
#include <IGESDraw_LabelDisplay.hxx>
#include <IGESDraw_NetworkSubfigure.hxx>
#include <IGESDraw_NetworkSubfigureDef.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <IGESDraw_Planar.hxx>
#include <IGESDraw_RectArraySubfigure.hxx>
#include <IGESDraw_SegmentedViewsVisible.hxx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_ViewsVisible.hxx>
#include <IGESDraw_ViewsVisibleWithAttr.hxx>
#include <IGESDimen.hxx>
#include <IGESDimen_Protocol.hxx>
static int deja = 0;
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14;
IGESDraw_Protocol::IGESDraw_Protocol ()
{
if (deja) return; deja = 1;
atype01 = STANDARD_TYPE(IGESDraw_CircArraySubfigure);
atype02 = STANDARD_TYPE(IGESDraw_ConnectPoint);
atype03 = STANDARD_TYPE(IGESDraw_Drawing);
atype04 = STANDARD_TYPE(IGESDraw_DrawingWithRotation);
atype05 = STANDARD_TYPE(IGESDraw_LabelDisplay);
atype06 = STANDARD_TYPE(IGESDraw_NetworkSubfigure);
atype07 = STANDARD_TYPE(IGESDraw_NetworkSubfigureDef);
atype08 = STANDARD_TYPE(IGESDraw_PerspectiveView);
atype09 = STANDARD_TYPE(IGESDraw_Planar);
atype10 = STANDARD_TYPE(IGESDraw_RectArraySubfigure);
atype11 = STANDARD_TYPE(IGESDraw_SegmentedViewsVisible);
atype12 = STANDARD_TYPE(IGESDraw_View);
atype13 = STANDARD_TYPE(IGESDraw_ViewsVisible);
atype14 = STANDARD_TYPE(IGESDraw_ViewsVisibleWithAttr);
}
Standard_Integer IGESDraw_Protocol::NbResources () const
{ return 1; }
Handle(Interface_Protocol) IGESDraw_Protocol::Resource
(const Standard_Integer num) const
{
Handle(Interface_Protocol) res = IGESDimen::Protocol();;
return res;
}
Standard_Integer IGESDraw_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;
return 0;
}

View File

@@ -0,0 +1,37 @@
-- File: IGESDraw_ReadWriteModule.cdl
-- Created: Mon Sep 6 19:22:12 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ReadWriteModule from IGESDraw inherits ReadWriteModule from IGESData
---Purpose : Defines Draw File Access Module for IGESDraw (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 IGESDraw;
---Purpose : Creates a ReadWriteModule & puts it into ReaderLib & WriterLib
CaseIGES (me; typenum, formnum : Integer) returns Integer;
---Purpose : Defines Case Numbers for Entities of IGESDraw
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 IGESDraw
WriteOwnParams (me; CN : Integer; ent : IGESEntity;
IW : in out IGESWriter);
---Purpose : Writes own parameters to IGESWriter
end ReadWriteModule;

View File

@@ -0,0 +1,287 @@
#include <IGESDraw_ReadWriteModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESDraw_CircArraySubfigure.hxx>
#include <IGESDraw_ConnectPoint.hxx>
#include <IGESDraw_Drawing.hxx>
#include <IGESDraw_DrawingWithRotation.hxx>
#include <IGESDraw_LabelDisplay.hxx>
#include <IGESDraw_NetworkSubfigure.hxx>
#include <IGESDraw_NetworkSubfigureDef.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <IGESDraw_Planar.hxx>
#include <IGESDraw_RectArraySubfigure.hxx>
#include <IGESDraw_SegmentedViewsVisible.hxx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_ViewsVisible.hxx>
#include <IGESDraw_ViewsVisibleWithAttr.hxx>
#include <IGESDraw_ToolCircArraySubfigure.hxx>
#include <IGESDraw_ToolConnectPoint.hxx>
#include <IGESDraw_ToolDrawing.hxx>
#include <IGESDraw_ToolDrawingWithRotation.hxx>
#include <IGESDraw_ToolLabelDisplay.hxx>
#include <IGESDraw_ToolNetworkSubfigure.hxx>
#include <IGESDraw_ToolNetworkSubfigureDef.hxx>
#include <IGESDraw_ToolPerspectiveView.hxx>
#include <IGESDraw_ToolPlanar.hxx>
#include <IGESDraw_ToolRectArraySubfigure.hxx>
#include <IGESDraw_ToolSegmentedViewsVisible.hxx>
#include <IGESDraw_ToolView.hxx>
#include <IGESDraw_ToolViewsVisible.hxx>
#include <IGESDraw_ToolViewsVisibleWithAttr.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
IGESDraw_ReadWriteModule::IGESDraw_ReadWriteModule () { }
Standard_Integer IGESDraw_ReadWriteModule::CaseIGES
(const Standard_Integer typenum, const Standard_Integer formnum) const
{
switch (typenum) {
case 132 : return 2;
case 320 : return 7;
case 402 :
switch (formnum) {
case 3 : return 13;
case 4 : return 14;
case 5 : return 5;
case 16 : return 9;
case 19 : return 11;
default : break;
}
break;
case 404 : return formnum+3; // 0->3 1->4
case 410 :
if (formnum == 0) return 12;
else if (formnum == 1) return 8;
break;
case 412 : return 10;
case 414 : return 1;
case 420 : return 6;
default : break;
}
return 0;
}
void IGESDraw_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(IGESDraw_CircArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolCircArraySubfigure tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 2 : {
DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolConnectPoint tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 3 : {
DeclareAndCast(IGESDraw_Drawing,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawing tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawingWithRotation tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 5 : {
DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolLabelDisplay tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 6 : {
DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigure tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 7 : {
DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigureDef tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 8 : {
DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPerspectiveView tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 9 : {
DeclareAndCast(IGESDraw_Planar,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPlanar tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 10 : {
DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolRectArraySubfigure tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 11 : {
DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolSegmentedViewsVisible tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 12 : {
DeclareAndCast(IGESDraw_View,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolView tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisible tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
default : break;
}
}
void IGESDraw_ReadWriteModule::WriteOwnParams
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
IGESData_IGESWriter& IW) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESDraw_CircArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolCircArraySubfigure tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 2 : {
DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolConnectPoint tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 3 : {
DeclareAndCast(IGESDraw_Drawing,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawing tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawingWithRotation tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 5 : {
DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolLabelDisplay tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 6 : {
DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigure tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 7 : {
DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigureDef tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 8 : {
DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPerspectiveView tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 9 : {
DeclareAndCast(IGESDraw_Planar,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPlanar tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 10 : {
DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolRectArraySubfigure tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 11 : {
DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolSegmentedViewsVisible tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 12 : {
DeclareAndCast(IGESDraw_View,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolView tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisible tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.WriteOwnParams(anent,IW);
}
break;
default : break;
}
}

View File

@@ -0,0 +1,142 @@
--
-- File : RectArraySubfigure.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class RectArraySubfigure from IGESDraw
inherits IGESEntity
--- Purpose : Defines IGES Rectangular Array Subfigure Instance Entity,
-- Type <412> Form Number <0> in package IGESDraw
-- Used to produce copies of object called the base entity,
-- arranging them in equally spaced rows and columns
uses
HArray1OfInteger from TColStd,
XYZ from gp,
Pnt from gp
raises OutOfRange
is
Create returns mutable RectArraySubfigure;
-- Specific Methods pertaining to the class
Init (me : mutable;
aBase : IGESEntity;
aScale : Real;
aCorner : XYZ;
nbCols : Integer;
nbRows : Integer;
hDisp : Real;
vtDisp : Real;
rotationAngle : Real;
doDont : Integer;
allNumPos : HArray1OfInteger);
---Purpose : This method is used to set the fields of the class
-- RectArraySubfigure
-- - aBase : a base entity which is replicated
-- - aScale : Scale Factor
-- - aCorner : lower left hand corner for the entire array
-- - nbCols : Number of columns of the array
-- - nbRows : Number of rows of the array
-- - hDisp : Column separations
-- - vtDisp : Row separation
-- - rotationAngle : Rotation angle specified in radians
-- - allDont : DO-DON'T flag to control which portion
-- to display
-- - allNumPos : List of positions to be or not to be
-- displayed
BaseEntity (me) returns IGESEntity;
---Purpose : returns the base entity, copies of which are produced
ScaleFactor (me) returns Real;
---Purpose : returns the scale factor
LowerLeftCorner (me) returns Pnt;
---Purpose : returns coordinates of lower left hand corner for the entire array
TransformedLowerLeftCorner (me) returns Pnt;
---Purpose : returns Transformed coordinates of lower left corner for the array
NbColumns (me) returns Integer;
---Purpose : returns number of columns in the array
NbRows (me) returns Integer;
---Purpose : returns number of rows in the array
ColumnSeparation (me) returns Real;
---Purpose : returns horizontal distance between columns
RowSeparation (me) returns Real;
---Purpose : returns vertical distance between rows
RotationAngle (me) returns Real;
---Purpose : returns rotation angle in radians
DisplayFlag (me) returns Boolean;
---Purpose : returns True if (ListCount = 0) i.e., all elements to be displayed
ListCount (me) returns Integer;
---Purpose : returns 0 if all replicated entities to be displayed
DoDontFlag (me) returns Boolean;
---Purpose : returns 0 if half or fewer of the elements of the array are defined
-- 1 if half or more of the elements are defined
PositionNum (me; Index : Integer) returns Boolean;
---Purpose : returns whether Index is to be processed (DO)
-- or not to be processed(DON'T)
-- if (ListCount = 0) return theDoDontFlag
ListPosition (me; Index : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Index'th value position
-- raises exception if Index <= 0 or Index > ListCount()
fields
--
-- Class : IGESDraw_RectArraySubfigure
--
-- Purpose : Declaration of the variables specific to a RectArraySubfigure.
--
-- Reminder : A Rectangular Array Subfigure Instance is defined by :
-- - a base entity which is replicated
-- - Number of columns and rows of the array
-- - Column and row separations
-- - lower left hand corner for the entire array
-- - angle of rotation specified in radians
-- - a DO-DON'T flag to control which portion to display
-- - List of positions.
--
theBaseEntity : IGESEntity;
theScaleFactor : Real;
theLowerLeftCorner : XYZ;
theNbColumns : Integer;
theNbRows : Integer;
theColumnSeparation : Real;
theRowSeparation : Real;
theRotationAngle : Real;
theDoDontFlag : Integer;
thePositions : HArray1OfInteger;
end RectArraySubfigure;

View File

@@ -0,0 +1,135 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_RectArraySubfigure.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_RectArraySubfigure.ixx>
#include <Standard_DimensionMismatch.hxx>
#include <gp_GTrsf.hxx>
IGESDraw_RectArraySubfigure::IGESDraw_RectArraySubfigure () { }
void IGESDraw_RectArraySubfigure::Init
(const Handle(IGESData_IGESEntity)& aBase,
const Standard_Real aScale,
const gp_XYZ& aCorner,
const Standard_Integer nbCols,
const Standard_Integer nbRows,
const Standard_Real hDisp,
const Standard_Real vtDisp,
const Standard_Real rotationAngle,
const Standard_Integer doDont,
const Handle(TColStd_HArray1OfInteger)& allNumPos)
{
if (!allNumPos.IsNull())
if (allNumPos->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_RectArraySubfigure : Init");
theBaseEntity = aBase;
theScaleFactor = aScale;
theLowerLeftCorner = aCorner;
theNbColumns = nbCols;
theNbRows = nbRows;
theColumnSeparation = hDisp;
theRowSeparation = vtDisp;
theRotationAngle = rotationAngle;
theDoDontFlag = doDont;
thePositions = allNumPos;
InitTypeAndForm(412,0);
}
Handle(IGESData_IGESEntity) IGESDraw_RectArraySubfigure::BaseEntity () const
{
return theBaseEntity;
}
Standard_Real IGESDraw_RectArraySubfigure::ScaleFactor () const
{
return theScaleFactor;
}
gp_Pnt IGESDraw_RectArraySubfigure::LowerLeftCorner () const
{
gp_Pnt tempLowerLeftCorner(theLowerLeftCorner);
return tempLowerLeftCorner;
}
gp_Pnt IGESDraw_RectArraySubfigure::TransformedLowerLeftCorner () const
{
gp_XYZ tempLowerLeftCorner = theLowerLeftCorner;
if (HasTransf()) Location().Transforms(tempLowerLeftCorner);
gp_Pnt tempRes(tempLowerLeftCorner);
return (tempRes);
}
Standard_Integer IGESDraw_RectArraySubfigure::NbColumns () const
{
return theNbColumns;
}
Standard_Integer IGESDraw_RectArraySubfigure::NbRows () const
{
return theNbRows;
}
Standard_Real IGESDraw_RectArraySubfigure::ColumnSeparation () const
{
return theColumnSeparation;
}
Standard_Real IGESDraw_RectArraySubfigure::RowSeparation () const
{
return theRowSeparation;
}
Standard_Real IGESDraw_RectArraySubfigure::RotationAngle () const
{
return theRotationAngle;
}
Standard_Boolean IGESDraw_RectArraySubfigure::DisplayFlag () const
{
return (thePositions.IsNull());
}
Standard_Integer IGESDraw_RectArraySubfigure::ListCount () const
{
return ( thePositions.IsNull() ? 0 : thePositions->Length() );
// Return 0 if HArray1 thePositions is NULL Handle
}
Standard_Boolean IGESDraw_RectArraySubfigure::DoDontFlag () const
{
return (theDoDontFlag);
}
Standard_Boolean IGESDraw_RectArraySubfigure::PositionNum
(const Standard_Integer Index) const
{
// Method : If thePositions array length is Zero return theDoDontFlag;
// else Search Index in to the Array. If 'Index' found in the
// array return theDoDontFlag else return !theDoDontFlag.
if (thePositions.IsNull()) return theDoDontFlag;
Standard_Integer I;
Standard_Integer up = thePositions->Upper();
for (I = 1; I <= up; I++) {
if (thePositions->Value(I) == Index) return theDoDontFlag;
}
return (! theDoDontFlag);
}
Standard_Integer IGESDraw_RectArraySubfigure::ListPosition
(const Standard_Integer Index) const
{
return thePositions->Value(Index);
// raise OutOfRange from Standard if Index is out-of-bound
// Exception NoSuchObject will be raised if thePositions == Null Handle
}

View File

@@ -0,0 +1,168 @@
--
-- File : SegmentedViewsVisible.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class SegmentedViewsVisible from IGESDraw inherits ViewKindEntity
---Purpose: defines IGESSegmentedViewsVisible, Type <402> Form <19>
-- in package IGESDraw
--
-- Permits the association of display parameters with the
-- segments of curves in a given view
uses
HArray1OfInteger from TColStd,
HArray1OfReal from TColStd,
Color from IGESGraph,
LineFontEntity from IGESData,
HArray1OfViewKindEntity from IGESDraw,
HArray1OfLineFontEntity from IGESBasic,
HArray1OfColor from IGESGraph
raises DimensionMismatch, OutOfRange
is
Create returns mutable SegmentedViewsVisible;
-- Specific Methods pertaining to the class
Init (me : mutable;
allViews : HArray1OfViewKindEntity;
allBreakpointParameters : HArray1OfReal;
allDisplayFlags : HArray1OfInteger;
allColorValues : HArray1OfInteger;
allColorDefinitions : HArray1OfColor;
allLineFontValues : HArray1OfInteger;
allLineFontDefinitions : HArray1OfLineFontEntity;
allLineWeights : HArray1OfInteger)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- SegmentedViewsVisible
-- - allViews : Pointers to View Entities
-- - allBreakpointParameters : Parameters of breakpoints
-- - allDisplayFlags : Display flags
-- - allColorValues : Color Values
-- - allColorDefinitions : Color Definitions
-- - allLineFontValues : LineFont values
-- - allLineFontDefinitions : LineFont Definitions
-- - allLineWeights : Line weights
-- raises exception if Lengths of allViews, allBreakpointParameters,
-- allDisplayFlags, allColorValues, allColorDefinitions,
-- allLineFontValues, allLineFontDefinitions and allLineWeights
-- are not same.
IsSingle (me) returns Boolean;
---Purpose : Returns False (for a complex view)
NbViews (me) returns Integer;
---Purpose : Returns the count of Views referenced by <me> (inherited)
NbSegmentBlocks (me) returns Integer;
---Purpose : returns the number of view/segment blocks in <me>
-- Similar to NbViews but has a more general significance
ViewItem (me; ViewIndex : Integer) returns ViewKindEntity
raises OutOfRange;
---Purpose : returns the View entity indicated by ViewIndex
-- raises an exception if ViewIndex <= 0 or
-- ViewIndex > NbSegmentBlocks()
BreakpointParameter (me; BreakpointIndex : Integer) returns Real
raises OutOfRange;
---Purpose : returns the parameter of the breakpoint indicated by
-- BreakpointIndex
-- raises an exception if BreakpointIndex <= 0 or
-- BreakpointIndex > NbSegmentBlocks().
DisplayFlag (me; FlagIndex : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Display flag indicated by FlagIndex
-- raises an exception if FlagIndex <= 0 or
-- FlagIndex > NbSegmentBlocks().
IsColorDefinition (me; ColorIndex : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns True if the ColorIndex'th value of the
-- "theColorDefinitions" field of <me> is a pointer
-- raises an exception if ColorIndex <= 0 or
-- ColorIndex > NbSegmentBlocks().
ColorValue (me; ColorIndex : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Color value indicated by ColorIndex
-- raises an exception if ColorIndex <= 0 or
-- ColorIndex > NbSegmentBlocks().
ColorDefinition (me; ColorIndex : Integer) returns Color
raises OutOfRange;
---Purpose : returns the Color definition entity indicated by ColorIndex
-- raises an exception if ColorIndex <= 0 or
-- ColorIndex > NbSegmentBlocks().
IsFontDefinition (me; FontIndex : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns True if the FontIndex'th value of the
-- "theLineFontDefinitions" field of <me> is a pointer
-- raises an exception if FontIndex <= 0 or
-- FontIndex > NbSegmentBlocks().
LineFontValue (me; FontIndex : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the LineFont value indicated by FontIndex
-- raises an exception if FontIndex <= 0 or
-- FontIndex > NbSegmentBlocks().
LineFontDefinition (me; FontIndex : Integer) returns LineFontEntity
raises OutOfRange;
---Purpose : returns the LineFont definition entity indicated by FontIndex
-- raises an exception if FontIndex <= 0 or
-- FontIndex > NbSegmentBlocks().
LineWeightItem (me; WeightIndex : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the LineWeight value indicated by WeightIndex
-- raises an exception if WeightIndex <= 0 or
-- WeightIndex > NbSegmentBlocks().
fields
--
-- Class : IGESDraw_SegmentedViewsVisible
--
-- Purpose : Declaration of the variables specific to a
-- SegmentedViewsVisible Entity.
--
-- Reminder : A SegmentedViewsVisible Entity is defined by :
-- - Pointers to View Entities
-- - Parameters of breakpoints
-- - Display flags
-- - Color values
-- - Color Definitions
-- - LineFont values
-- - LineFont Definitions
-- - Line weights
--
theViews : HArray1OfViewKindEntity;
theBreakpointParameters : HArray1OfReal;
theDisplayFlags : HArray1OfInteger;
theColorValues : HArray1OfInteger;
theColorDefinitions : HArray1OfColor;
theLineFontValues : HArray1OfInteger;
theLineFontDefinitions : HArray1OfLineFontEntity;
theLineWeights : HArray1OfInteger;
end SegmentedViewsVisible;

View File

@@ -0,0 +1,122 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_SegmentedViewsVisible.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_SegmentedViewsVisible.ixx>
IGESDraw_SegmentedViewsVisible::IGESDraw_SegmentedViewsVisible () { }
void IGESDraw_SegmentedViewsVisible::Init
(const Handle(IGESDraw_HArray1OfViewKindEntity)& allViews,
const Handle(TColStd_HArray1OfReal)& allBreakpointParameters,
const Handle(TColStd_HArray1OfInteger)& allDisplayFlags,
const Handle(TColStd_HArray1OfInteger)& allColorValues,
const Handle(IGESGraph_HArray1OfColor)& allColorDefinitions,
const Handle(TColStd_HArray1OfInteger)& allLineFontValues,
const Handle(IGESBasic_HArray1OfLineFontEntity)& allLineFontDefinitions,
const Handle(TColStd_HArray1OfInteger)& allLineWeights)
{
Standard_Integer Len = allViews->Length();
if ( allViews->Lower() != 1 ||
(allBreakpointParameters->Lower() != 1 || allBreakpointParameters->Length() != Len) ||
(allDisplayFlags->Lower() != 1 || allDisplayFlags->Length() != Len) ||
(allColorValues->Lower() != 1 || allColorValues->Length() != Len) ||
(allColorDefinitions->Lower() != 1 || allColorDefinitions->Length() != Len) ||
(allLineFontValues->Lower() != 1 || allLineFontValues->Length() != Len) ||
(allLineFontDefinitions->Lower() != 1 || allLineFontDefinitions->Length() != Len) ||
(allLineWeights->Lower() != 1 || allLineWeights->Length() != Len) )
Standard_DimensionMismatch::Raise("IGESDraw_SegmentedViewsVisible : Init");
theViews = allViews;
theBreakpointParameters = allBreakpointParameters;
theDisplayFlags = allDisplayFlags;
theColorValues = allColorValues;
theColorDefinitions = allColorDefinitions;
theLineFontValues = allLineFontValues;
theLineFontDefinitions = allLineFontDefinitions;
theLineWeights = allLineWeights;
InitTypeAndForm(402,19);
}
Standard_Boolean IGESDraw_SegmentedViewsVisible::IsSingle () const
{
return Standard_False;
}
Standard_Integer IGESDraw_SegmentedViewsVisible::NbViews () const
{
return theViews->Length();
}
Standard_Integer IGESDraw_SegmentedViewsVisible::NbSegmentBlocks () const
{
return theViews->Length();
}
Handle(IGESData_ViewKindEntity) IGESDraw_SegmentedViewsVisible::ViewItem
(const Standard_Integer ViewIndex) const
{
return theViews->Value(ViewIndex);
}
Standard_Real IGESDraw_SegmentedViewsVisible::BreakpointParameter
(const Standard_Integer BreakpointIndex) const
{
return theBreakpointParameters->Value(BreakpointIndex);
}
Standard_Integer IGESDraw_SegmentedViewsVisible::DisplayFlag
(const Standard_Integer FlagIndex) const
{
return theDisplayFlags->Value(FlagIndex);
}
Standard_Boolean IGESDraw_SegmentedViewsVisible::IsColorDefinition
(const Standard_Integer ColorIndex) const
{
return ( !theColorDefinitions->Value(ColorIndex).IsNull() );
}
Standard_Integer IGESDraw_SegmentedViewsVisible::ColorValue
(const Standard_Integer ColorIndex) const
{
return theColorValues->Value(ColorIndex);
}
Handle(IGESGraph_Color) IGESDraw_SegmentedViewsVisible::ColorDefinition
(const Standard_Integer ColorIndex) const
{
return theColorDefinitions->Value(ColorIndex);
}
Standard_Boolean IGESDraw_SegmentedViewsVisible::IsFontDefinition
(const Standard_Integer FontIndex) const
{
return ( !theLineFontDefinitions->Value(FontIndex).IsNull() );
}
Standard_Integer IGESDraw_SegmentedViewsVisible::LineFontValue
(const Standard_Integer FontIndex) const
{
return theLineFontValues->Value(FontIndex);
}
Handle(IGESData_LineFontEntity)
IGESDraw_SegmentedViewsVisible::LineFontDefinition
(const Standard_Integer FontIndex) const
{
return theLineFontDefinitions->Value(FontIndex);
}
Standard_Integer IGESDraw_SegmentedViewsVisible::LineWeightItem
(const Standard_Integer WeightIndex) const
{
return theLineWeights->Value(WeightIndex);
}

View File

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

View File

@@ -0,0 +1,191 @@
#include <IGESDraw_SpecificModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESDraw_CircArraySubfigure.hxx>
#include <IGESDraw_ConnectPoint.hxx>
#include <IGESDraw_Drawing.hxx>
#include <IGESDraw_DrawingWithRotation.hxx>
#include <IGESDraw_LabelDisplay.hxx>
#include <IGESDraw_NetworkSubfigure.hxx>
#include <IGESDraw_NetworkSubfigureDef.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <IGESDraw_Planar.hxx>
#include <IGESDraw_RectArraySubfigure.hxx>
#include <IGESDraw_SegmentedViewsVisible.hxx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_ViewsVisible.hxx>
#include <IGESDraw_ViewsVisibleWithAttr.hxx>
#include <IGESDraw_ToolCircArraySubfigure.hxx>
#include <IGESDraw_ToolConnectPoint.hxx>
#include <IGESDraw_ToolDrawing.hxx>
#include <IGESDraw_ToolDrawingWithRotation.hxx>
#include <IGESDraw_ToolLabelDisplay.hxx>
#include <IGESDraw_ToolNetworkSubfigure.hxx>
#include <IGESDraw_ToolNetworkSubfigureDef.hxx>
#include <IGESDraw_ToolPerspectiveView.hxx>
#include <IGESDraw_ToolPlanar.hxx>
#include <IGESDraw_ToolRectArraySubfigure.hxx>
#include <IGESDraw_ToolSegmentedViewsVisible.hxx>
#include <IGESDraw_ToolView.hxx>
#include <IGESDraw_ToolViewsVisible.hxx>
#include <IGESDraw_ToolViewsVisibleWithAttr.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
IGESDraw_SpecificModule::IGESDraw_SpecificModule() { }
void IGESDraw_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(IGESDraw_CircArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolCircArraySubfigure tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 2 : {
DeclareAndCast(IGESDraw_ConnectPoint,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolConnectPoint tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 3 : {
DeclareAndCast(IGESDraw_Drawing,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawing tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolDrawingWithRotation tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 5 : {
DeclareAndCast(IGESDraw_LabelDisplay,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolLabelDisplay tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 6 : {
DeclareAndCast(IGESDraw_NetworkSubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigure tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 7 : {
DeclareAndCast(IGESDraw_NetworkSubfigureDef,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolNetworkSubfigureDef tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 8 : {
DeclareAndCast(IGESDraw_PerspectiveView,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPerspectiveView tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 9 : {
DeclareAndCast(IGESDraw_Planar,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolPlanar tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 10 : {
DeclareAndCast(IGESDraw_RectArraySubfigure,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolRectArraySubfigure tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 11 : {
DeclareAndCast(IGESDraw_SegmentedViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolSegmentedViewsVisible tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 12 : {
DeclareAndCast(IGESDraw_View,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolView tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisible tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) return;
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
default : break;
}
}
Standard_Boolean IGESDraw_SpecificModule::OwnCorrect
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
// Applies only on some types
switch (CN) {
case 3 : {
DeclareAndCast(IGESDraw_Drawing,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolDrawing tool;
return tool.OwnCorrect(anent);
}
case 4 : {
DeclareAndCast(IGESDraw_DrawingWithRotation,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolDrawingWithRotation tool;
return tool.OwnCorrect(anent);
}
case 9 : {
DeclareAndCast(IGESDraw_Planar,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolPlanar tool;
return tool.OwnCorrect(anent);
}
case 13 : {
DeclareAndCast(IGESDraw_ViewsVisible,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolViewsVisible tool;
return tool.OwnCorrect(anent);
}
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolViewsVisibleWithAttr tool;
return tool.OwnCorrect(anent);
}
default : break;
}
return Standard_False;
}

View File

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

View File

@@ -0,0 +1,165 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_CircArraySubfigure.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolCircArraySubfigure.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <IGESData_IGESEntity.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolCircArraySubfigure::IGESDraw_ToolCircArraySubfigure () { }
void IGESDraw_ToolCircArraySubfigure::ReadOwnParams
(const Handle(IGESDraw_CircArraySubfigure)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
gp_XYZ tempCenter;
Handle(IGESData_IGESEntity) tempBase;
Standard_Real tempRadius, tempStAngle, tempDelAngle;
Standard_Integer tempNumLocs, tempFlag, tempListCount;
Handle(TColStd_HArray1OfInteger) tempNumPos;
//szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Base Entity", tempBase);
PR.ReadInteger(PR.Current(), "Number Of Instance Locations", tempNumLocs);
PR.ReadXYZ(PR.CurrentList(1, 3), "Imaginary Circle Center Coordinate", tempCenter);
PR.ReadReal(PR.Current(), "Radius Of Imaginary Circle", tempRadius);
PR.ReadReal(PR.Current(), "Start Angle in Radians", tempStAngle);
PR.ReadReal(PR.Current(), "Delta Angle in Radians", tempDelAngle);
//st = PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount)) {
// Initialise HArray1 only if there is no error reading its Length
if (tempListCount > 0)
tempNumPos = new TColStd_HArray1OfInteger(1, tempListCount);
else if (tempListCount < 0)
PR.AddFail("DO-DONT List Count : Less than Zero");
}
PR.ReadInteger(PR.Current(), "DO-DONT Flag", tempFlag); //szv#4:S4163:12Mar99 `st=` not needed
// Read the HArray1 only if its Length was read without any Error
if (! tempNumPos.IsNull()) {
Standard_Integer I;
for (I = 1; I <= tempListCount; I++) {
Standard_Integer tempPosition;
//st = PR.ReadInteger(PR.Current(), "Number Of Position To Process",
//tempPosition); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Number Of Position To Process", tempPosition))
tempNumPos->SetValue(I, tempPosition);
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempBase, tempNumLocs, tempCenter, tempRadius,
tempStAngle,tempDelAngle, tempFlag, tempNumPos);
}
void IGESDraw_ToolCircArraySubfigure::WriteOwnParams
(const Handle(IGESDraw_CircArraySubfigure)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->BaseEntity());
IW.Send(ent->NbLocations());
IW.Send(ent->CenterPoint().X());
IW.Send(ent->CenterPoint().Y());
IW.Send(ent->CenterPoint().Z());
IW.Send(ent->CircleRadius());
IW.Send(ent->StartAngle());
IW.Send(ent->DeltaAngle());
IW.Send(ent->ListCount());
IW.SendBoolean(ent->DoDontFlag());
// Send the HArray1 only if it is not empty (i.e. Null)
Standard_Integer I;
Standard_Integer up = ent->ListCount();
for (I = 1; I <= up; I++)
IW.Send(ent->ListPosition(I));
}
void IGESDraw_ToolCircArraySubfigure::OwnShared
(const Handle(IGESDraw_CircArraySubfigure)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESDraw_ToolCircArraySubfigure::OwnCopy
(const Handle(IGESDraw_CircArraySubfigure)& another,
const Handle(IGESDraw_CircArraySubfigure)& ent, Interface_CopyTool& TC) const
{
DeclareAndCast(IGESData_IGESEntity, tempBase,
TC.Transferred(another->BaseEntity()));
Standard_Integer tempNumLocs = another->NbLocations();
gp_XYZ tempCenter = (another->CenterPoint()).XYZ();
Standard_Real tempRadius = another->CircleRadius();
Standard_Real tempStAngle = another->StartAngle();
Standard_Real tempDelAngle = another->DeltaAngle();
Standard_Integer tempListCount = another->ListCount();
Standard_Integer tempFlag = another->DoDontFlag();
Handle(TColStd_HArray1OfInteger) tempNumPos;
if (! another->DisplayFlag()) {
tempNumPos = new TColStd_HArray1OfInteger(1, tempListCount);
Standard_Integer I;
for (I = 1; I <= tempListCount; I++) {
Standard_Integer tempPosition = another->ListPosition(I);
tempNumPos->SetValue(I, tempPosition);
}
}
ent->Init(tempBase, tempNumLocs, tempCenter, tempRadius,
tempStAngle, tempDelAngle, tempFlag, tempNumPos);
}
IGESData_DirChecker IGESDraw_ToolCircArraySubfigure::DirChecker
(const Handle(IGESDraw_CircArraySubfigure)& /*ent*/) const
{
IGESData_DirChecker DC(414, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.GraphicsIgnored(1);
return DC;
}
void IGESDraw_ToolCircArraySubfigure::OwnCheck
(const Handle(IGESDraw_CircArraySubfigure)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESDraw_ToolCircArraySubfigure::OwnDump
(const Handle(IGESDraw_CircArraySubfigure)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_CircArraySubfigure" << endl;
S << "Base Entity : ";
dumper.Dump(ent->BaseEntity(),S, tempSubLevel);
S << endl;
S << "Total Number Of Possible Instance Locations : " << ent->NbLocations()
<< endl;
S << "Imaginary Circle. Radius : " << ent->CircleRadius() << " Center : ";
IGESData_DumpXYZL(S, level, ent->CenterPoint(), ent->Location()); S << endl;
S << "Start Angle (in radians) : " << ent->StartAngle() << " ";
S << "Delta Angle (in radians) : " << ent->DeltaAngle() << endl;
S << "Do-Dont Flag : ";
if (ent->DoDontFlag()) S << "Dont" << endl;
else S << "Do" << endl;
S << "The Do-Dont List : ";
IGESData_DumpVals(S ,level,1, ent->ListCount(),ent->ListPosition);
S << endl;
}

View File

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

View File

@@ -0,0 +1,214 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_ConnectPoint.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolConnectPoint.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <TCollection_HAsciiString.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolConnectPoint::IGESDraw_ToolConnectPoint () { }
void IGESDraw_ToolConnectPoint::ReadOwnParams
(const Handle(IGESDraw_ConnectPoint)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
gp_XYZ tempPoint;
Standard_Integer tempTypeFlag, tempFunctionFlag;
Standard_Integer tempPointIdentifier, tempFunctionCode, tempSwapFlag;
Handle(IGESData_IGESEntity) tempDisplaySymbol, tempOwnerSubfigure;
Handle(TCollection_HAsciiString) tempFunctionIdentifier, tempFunctionName;
Handle(IGESGraph_TextDisplayTemplate) tempFunctionTemplate;
Handle(IGESGraph_TextDisplayTemplate) tempIdentifierTemplate;
PR.ReadXYZ(PR.CurrentList(1, 3), "Connect Point Coordinate", tempPoint); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Display Symbol Geometry Entity",
tempDisplaySymbol,Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Type Flag", tempTypeFlag); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Function Flag", tempFunctionFlag); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadText(PR.Current(), "Function Identifier",
tempFunctionIdentifier); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Text Display Identifier Template",
STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempIdentifierTemplate,
Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadText(PR.Current(), "Connect Point Function Name",
tempFunctionName); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Text Display Function Template",
STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempFunctionTemplate,
Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Unique Connect Point Identifier",
tempPointIdentifier); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Connect Point Function Code",
tempFunctionCode); //szv#4:S4163:12Mar99 `st=` not needed
if (PR.DefinedElseSkip())
PR.ReadInteger(PR.Current(), "Swap Flag", tempSwapFlag); //szv#4:S4163:12Mar99 `st=` not needed
else tempSwapFlag = 0; // default
PR.ReadEntity(IR, PR.Current(), "Owner Network Subfigure Entity",
tempOwnerSubfigure,Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempPoint, tempDisplaySymbol, tempTypeFlag, tempFunctionFlag,
tempFunctionIdentifier, tempIdentifierTemplate, tempFunctionName,
tempFunctionTemplate, tempPointIdentifier, tempFunctionCode,
tempSwapFlag, tempOwnerSubfigure);
}
void IGESDraw_ToolConnectPoint::WriteOwnParams
(const Handle(IGESDraw_ConnectPoint)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->Point().X());
IW.Send(ent->Point().Y());
IW.Send(ent->Point().Z());
IW.Send(ent->DisplaySymbol());
IW.Send(ent->TypeFlag());
IW.Send(ent->FunctionFlag());
IW.Send(ent->FunctionIdentifier());
IW.Send(ent->IdentifierTemplate());
IW.Send(ent->FunctionName());
IW.Send(ent->FunctionTemplate());
IW.Send(ent->PointIdentifier());
IW.Send(ent->FunctionCode());
IW.SendBoolean(ent->SwapFlag());
IW.Send(ent->OwnerSubfigure());
}
void IGESDraw_ToolConnectPoint::OwnShared
(const Handle(IGESDraw_ConnectPoint)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->DisplaySymbol());
iter.GetOneItem(ent->IdentifierTemplate());
iter.GetOneItem(ent->FunctionTemplate());
iter.GetOneItem(ent->OwnerSubfigure());
}
void IGESDraw_ToolConnectPoint::OwnCopy
(const Handle(IGESDraw_ConnectPoint)& another,
const Handle(IGESDraw_ConnectPoint)& ent, Interface_CopyTool& TC) const
{
gp_XYZ tempPoint = (another->Point()).XYZ();
DeclareAndCast(IGESData_IGESEntity, tempDisplaySymbol,
TC.Transferred(another->DisplaySymbol()));
Standard_Integer tempTypeFlag = another->TypeFlag();
Standard_Integer tempFunctionFlag = another->FunctionFlag();
Handle(TCollection_HAsciiString) tempFunctionIdentifier =
new TCollection_HAsciiString(another->FunctionIdentifier());
DeclareAndCast(IGESGraph_TextDisplayTemplate, tempIdentifierTemplate,
TC.Transferred(another->FunctionTemplate()));
Handle(TCollection_HAsciiString) tempFunctionName =
new TCollection_HAsciiString(another->FunctionName());
DeclareAndCast(IGESGraph_TextDisplayTemplate, tempFunctionTemplate,
TC.Transferred(another->FunctionTemplate()));
Standard_Integer tempPointIdentifier = another->PointIdentifier();
Standard_Integer tempFunctionCode = another->FunctionCode();
Standard_Integer tempSwapFlag = (another->SwapFlag() ? 1 : 0);
DeclareAndCast(IGESData_IGESEntity, tempOwnerSubfigure,
TC.Transferred(another->OwnerSubfigure()));
ent->Init(tempPoint, tempDisplaySymbol, tempTypeFlag, tempFunctionFlag,
tempFunctionIdentifier, tempIdentifierTemplate, tempFunctionName,
tempFunctionTemplate, tempPointIdentifier, tempFunctionCode,
tempSwapFlag, tempOwnerSubfigure);
}
IGESData_DirChecker IGESDraw_ToolConnectPoint::DirChecker
(const Handle(IGESDraw_ConnectPoint)& ent ) const
{
IGESData_DirChecker DC(132, 0);
DC.Structure(IGESData_DefVoid);
DC.Color(IGESData_DefAny);
DC.UseFlagRequired(4);
if (!ent->DisplaySymbol().IsNull()) {
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefAny);
}
else {
// Note : If ent->DisplaySymbol() is NULL Handle; ignore Line Font, Weight
// and Hierarchy Status
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.HierarchyStatusIgnored();
}
return DC;
}
void IGESDraw_ToolConnectPoint::OwnCheck
(const Handle(IGESDraw_ConnectPoint)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if ((ent->TypeFlag() < 0) || (ent->TypeFlag() > 9999) ||
((ent->TypeFlag() > 2) && (ent->TypeFlag() < 101)) ||
((ent->TypeFlag() > 104) && (ent->TypeFlag() < 201)) ||
((ent->TypeFlag() > 203) && (ent->TypeFlag() < 5001)))
ach->AddFail("TypeFlag has Invalid value");
if ((ent->FunctionFlag() < 0) || (ent->FunctionFlag() > 2))
ach->AddFail("FunctionFlag has Invalid value");
if ((ent->FunctionCode() < 0) || (ent->FunctionCode() > 9999) ||
((ent->FunctionCode() > 49) && (ent->FunctionCode() < 98)) ||
((ent->FunctionCode() > 99) && (ent->FunctionCode() < 5001)))
ach->AddFail("FunctionCode has Invalid value");
//if ((ent->SwapFlag() < 0) || (ent->SwapFlag() > 1)) //szv#4:S4163:12Mar99 SGI warns
if ((ent->SwapFlag() != 0) && (ent->SwapFlag() != 1))
ach->AddFail("SwapFlag has Invalid value");
}
void IGESDraw_ToolConnectPoint::OwnDump
(const Handle(IGESDraw_ConnectPoint)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_ConnectPoint" << endl;
S << "Connection Point Coordinate : ";
IGESData_DumpXYZL(S, level, ent->Point(), ent->Location());
S << "Display Symbol Geometry Entity : ";
dumper.Dump(ent->DisplaySymbol(),S, tempSubLevel);
S << endl;
S << "Type Flag : " << ent->TypeFlag() << " "
<< "Function Flag : " << ent->FunctionFlag() << endl;
S << "Function Identifier : ";
IGESData_DumpString(S,ent->FunctionIdentifier());
S << endl << "Text Display Template Entity for CID : ";
dumper.Dump(ent->IdentifierTemplate(),S, tempSubLevel);
S << endl << "Function Name : ";
IGESData_DumpString(S,ent->FunctionName());
S << endl << "Text Display Template Entity for CFN : ";
dumper.Dump(ent->FunctionTemplate(),S, tempSubLevel);
S << endl;
S << "Point Identifier : " << ent->PointIdentifier() << endl
<< "Function Code : " << ent->FunctionCode()
<< "Swap Flag : " << ( ent->SwapFlag() ? "True" : "False" ) << endl;
S << "Owner Subfigure Entity : ";
dumper.Dump(ent->OwnerSubfigure(),S, tempSubLevel);
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESDraw_ToolDrawing.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolDrawing from IGESDraw
---Purpose : Tool to work on a Drawing. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Drawing from IGESDraw,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolDrawing;
---Purpose : Returns a ToolDrawing, ready to work
ReadOwnParams (me; ent : mutable Drawing;
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 : Drawing;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Drawing;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Drawing <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable Drawing) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a Drawing
-- (Null Views are removed from list)
DirChecker (me; ent : Drawing) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Drawing;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Drawing; entto : mutable Drawing;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Drawing;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolDrawing;

View File

@@ -0,0 +1,280 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_Drawing.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolDrawing.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_ViewKindEntity.hxx>
#include <IGESData_IGESEntity.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt2d.hxx>
#include <IGESData_ViewKindEntity.hxx>
#include <TColgp_HArray1OfXY.hxx>
#include <IGESDraw_HArray1OfViewKindEntity.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <Interface_Macros.hxx>
#include <IGESData_Dump.hxx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_PerspectiveView.hxx>
IGESDraw_ToolDrawing::IGESDraw_ToolDrawing () { }
void IGESDraw_ToolDrawing::ReadOwnParams
(const Handle(IGESDraw_Drawing)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXY) viewOrigins;
Handle(IGESData_HArray1OfIGESEntity) annotations;
// Reading nbval(No. of View pointers)
Standard_Boolean st = PR.ReadInteger(PR.Current(), "Count of array of view entities", nbval);
if (st && nbval > 0)
{
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
viewOrigins = new TColgp_HArray1OfXY(1, nbval);
Handle(IGESData_ViewKindEntity) tempView;
gp_XY tempXY;
for (Standard_Integer i = 1; i <= nbval; i++)
{
// Reading views(HArray1OfView)
//st = PR.ReadEntity (IR, PR.Current(), "View Entity",
//STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity (IR, PR.Current(), "View Entity",
STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True))
views->SetValue(i, tempView);
// Reading viewOrigins(HArray1OfXY)
//st = PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY))
viewOrigins->SetValue(i, tempXY);
}
}
else if (nbval < 0) PR.AddFail("Count of view entities : Less than zero");
// Reading nbval(No. of Annotation Entities)
//st = PR.ReadInteger(PR.Current(),"Count of array of Annotation entities", nbval); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(),"Count of array of Annotation entities", nbval)) {
if ( nbval > 0 )
PR.ReadEnts (IR,PR.CurrentList(nbval), "Annotation Entities", annotations); //szv#4:S4163:12Mar99 `st=` not needed
/*
{
// Reading annotations(HArray1OfIGESEntity)
annotations = new IGESData_HArray1OfIGESEntity(1, nbval);
Handle(IGESData_IGESEntity) tempAnnotation;
for (Standard_Integer i = 1; i <= nbval; i++)
{
st = PR.ReadEntity
(IR, PR.Current(), "annotation entity", tempAnnotation,Standard_True);
if (st) annotations->SetValue(i, tempAnnotation);
}
}
*/
else if (nbval < 0) PR.AddFail
("Count of Annotation entities : Less than zero");
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(views, viewOrigins, annotations);
}
void IGESDraw_ToolDrawing::WriteOwnParams
(const Handle(IGESDraw_Drawing)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer Up = ent->NbViews();
IW.Send( Up );
Standard_Integer i; // svv Jan 10 2000 : porting on DEC
for ( i = 1; i <= Up; i++)
{
IW.Send( ent->ViewItem(i) );
IW.Send( (ent->ViewOrigin(i)).X() );
IW.Send( (ent->ViewOrigin(i)).Y() );
}
Up = ent->NbAnnotations();
IW.Send( Up );
for ( i = 1; i <= Up; i++)
IW.Send( ent->Annotation(i) );
}
void IGESDraw_ToolDrawing::OwnShared
(const Handle(IGESDraw_Drawing)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer Up = ent->NbViews();
Standard_Integer i; // svv Jan 10 2000 : porting on DEC
for ( i = 1; i <= Up; i++)
iter.GetOneItem( ent->ViewItem(i) );
Up = ent->NbAnnotations();
for ( i = 1; i <= Up; i++)
iter.GetOneItem( ent->Annotation(i) );
}
void IGESDraw_ToolDrawing::OwnCopy
(const Handle(IGESDraw_Drawing)& another,
const Handle(IGESDraw_Drawing)& ent, Interface_CopyTool& TC) const
{
Standard_Integer nbanot;
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXY) viewOrigins;
Handle(IGESData_HArray1OfIGESEntity) annotations;
nbanot = another->NbAnnotations();
nbval = another->NbViews();
if (nbval > 0) {
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
viewOrigins = new TColgp_HArray1OfXY(1, nbval);
}
if ( nbanot > 0 )
{
annotations = new IGESData_HArray1OfIGESEntity(1, nbanot);
for (Standard_Integer i = 1; i <= nbanot; i++)
{
DeclareAndCast(IGESData_IGESEntity, tempAnnotation,
TC.Transferred(another->Annotation(i)));
annotations->SetValue( i, tempAnnotation );
}
}
for (Standard_Integer i = 1; i <= nbval; i++)
{
DeclareAndCast(IGESData_ViewKindEntity, tempView,
TC.Transferred(another->ViewItem(i)) );
views->SetValue( i, tempView );
viewOrigins->SetValue( i, (another->ViewOrigin(i)).XY() );
}
ent->Init(views, viewOrigins, annotations);
}
Standard_Boolean IGESDraw_ToolDrawing::OwnCorrect
(const Handle(IGESDraw_Drawing)& ent ) const
{
// Vues vides : les supprimer
Standard_Integer i, nb = ent->NbViews();
Standard_Integer nbtrue = nb;
for (i = 1; i <= nb; i ++) {
Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i);
if (val.IsNull()) nbtrue --;
else if (val->TypeNumber() == 0) nbtrue --;
}
if (nbtrue == nb) return Standard_False;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXY) viewOrigins;
if (nbtrue > 0) {
views = new IGESDraw_HArray1OfViewKindEntity (1, nbtrue);
viewOrigins = new TColgp_HArray1OfXY(1, nbtrue);
}
nbtrue = 0;
for (i = 1; i <= nb; i ++) {
Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i);
if (val.IsNull()) continue;
else if (val->TypeNumber() == 0) continue;
nbtrue ++;
views->SetValue (nbtrue,val);
viewOrigins->SetValue(nbtrue, ent->ViewOrigin(i).XY() );
}
// Ne pas oublier les annotations ...
Standard_Integer nbanot = ent->NbAnnotations();
Handle(IGESData_HArray1OfIGESEntity) annotations =
new IGESData_HArray1OfIGESEntity(1, nbanot);
for (i = 1; i <= nbanot; i ++) annotations->SetValue (i,ent->Annotation(i));
ent->Init(views, viewOrigins, annotations);
return Standard_True;
}
IGESData_DirChecker IGESDraw_ToolDrawing::DirChecker
(const Handle(IGESDraw_Drawing)& /*ent*/) const
{
IGESData_DirChecker DC (404, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(1);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolDrawing::OwnCheck
(const Handle(IGESDraw_Drawing)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Boolean ianul = Standard_False;
Standard_Integer i, nb = ent->NbViews();
for (i = 1; i <= nb; i ++) {
Handle(IGESData_ViewKindEntity) tempView = ent->ViewItem(i);
if (tempView.IsNull()) ianul = Standard_True;
else if (tempView->TypeNumber() == 0) ianul = Standard_True;
if (ianul) {
ach->AddWarning ("At least one View is Null");
break;
}
}
nb = ent->NbAnnotations();
for (i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) ann = ent->Annotation(i);
if (ann.IsNull()) ianul = Standard_True;
else if (ann->TypeNumber() == 0) ianul = Standard_True;
if (ianul) {
ach->AddWarning ("At least one Annotation is Null");
break;
}
}
}
void IGESDraw_ToolDrawing::OwnDump
(const Handle(IGESDraw_Drawing)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_Drawing" << endl;
S << "View Entities : " << endl
<< "Transformed View Origins : ";
S << "Count = " << ent->NbViews();
switch (level)
{
case 4 : S << " [ ask level > 4 for content ]" << endl;
break; // Nothing to be dumped here
case 5 : // Presently level 5 and 6 have the same Dump
S << endl;
case 6 :
{
Standard_Integer I;
Standard_Integer up = ent->NbViews();
for (I = 1; I <= up; I++)
{
S << endl << "[" << I << "] ";
S << "View Entity : ";
dumper.Dump (ent->ViewItem(I),S, sublevel);
S << endl;
S << "Transformed View Origin : ";
IGESData_DumpXY(S, ent->ViewOrigin(I));
}
}
break;
}
S << endl << "Annotation Entities : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbAnnotations(),ent->Annotation);
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESDraw_ToolDrawingWithRotation.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolDrawingWithRotation from IGESDraw
---Purpose : Tool to work on a DrawingWithRotation. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses DrawingWithRotation from IGESDraw,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolDrawingWithRotation;
---Purpose : Returns a ToolDrawingWithRotation, ready to work
ReadOwnParams (me; ent : mutable DrawingWithRotation;
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 : DrawingWithRotation;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : DrawingWithRotation;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a DrawingWithRotation <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable DrawingWithRotation) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a DrawingWithRotation
-- (Null Views are removed from list)
DirChecker (me; ent : DrawingWithRotation) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : DrawingWithRotation;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : DrawingWithRotation; entto : mutable DrawingWithRotation;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : DrawingWithRotation;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolDrawingWithRotation;

View File

@@ -0,0 +1,294 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_DrawingWithRotation.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolDrawingWithRotation.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_ViewKindEntity.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt2d.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColgp_HArray1OfXY.hxx>
#include <IGESDraw_HArray1OfViewKindEntity.hxx>
#include <IGESData_Dump.hxx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolDrawingWithRotation::IGESDraw_ToolDrawingWithRotation () { }
void IGESDraw_ToolDrawingWithRotation::ReadOwnParams
(const Handle(IGESDraw_DrawingWithRotation)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXY) viewOrigins;
Handle(TColStd_HArray1OfReal) orientationAngles;
Handle(IGESData_HArray1OfIGESEntity) annotations;
// Reading nbval(Count of Array Views)
Standard_Boolean st = PR.ReadInteger(PR.Current(), "count of array views", nbval);
if (st && nbval > 0)
{
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
viewOrigins = new TColgp_HArray1OfXY(1, nbval);
orientationAngles = new TColStd_HArray1OfReal(1, nbval);
Handle(IGESData_ViewKindEntity) tempView;
gp_XY tempXY;
Standard_Real tempOrient;
for (Standard_Integer i = 1; i <= nbval; i++)
{
// Reading views(HArray1OfView)
//st = PR.ReadEntity (IR, PR.Current(), "Instance of views",
//STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity (IR, PR.Current(), "Instance of views",
STANDARD_TYPE(IGESData_ViewKindEntity), tempView,Standard_True))
views->SetValue(i, tempView);
// Reading viewOrigins(HArray1OfXY)
//st = PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadXY(PR.CurrentList(1, 2), "array viewOrigins", tempXY))
viewOrigins->SetValue(i, tempXY);
if (PR.DefinedElseSkip())
{
// Reading orientationAngles(HArray1OfReal)
//st = PR.ReadReal(PR.Current(), "array viewOrigins", tempOrient); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "array viewOrigins", tempOrient))
orientationAngles->SetValue(i, tempOrient);
}
else orientationAngles->SetValue(i, 0.0); // Default Value
}
}
else if (nbval <= 0)
PR.AddFail("Count of view entities : Not Positive");
// Reading nbval(No. of Annotation Entities)
//st = PR.ReadInteger(PR.Current(), "Count of array of Annotation entities", nbval); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Count of array of Annotation entities", nbval)) {
if ( nbval > 0 )
PR.ReadEnts (IR,PR.CurrentList(nbval), "Annotation Entities", annotations); //szv#4:S4163:12Mar99 `st=` not needed
/*
{
// Reading annotations(HArray1OfIGESEntity)
annotations = new IGESData_HArray1OfIGESEntity(1, nbval);
Handle(IGESData_IGESEntity) tempAnnotation;
for (Standard_Integer i = 1; i <= nbval; i++)
{
st = PR.ReadEntity
(IR, PR.Current(), "annotation entity", tempAnnotation,Standard_True);
if (st) annotations->SetValue(i, tempAnnotation);
}
}
*/
else if (nbval < 0)
PR.AddFail("Count of Annotation entities : Less than zero");
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init (views, viewOrigins, orientationAngles, annotations);
}
void IGESDraw_ToolDrawingWithRotation::WriteOwnParams
(const Handle(IGESDraw_DrawingWithRotation)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer Up = ent->NbViews();
IW.Send( Up );
Standard_Integer i; // svv Jan 10 2000 : porting on DEC
for ( i = 1; i <= Up; i++)
{
IW.Send( ent->ViewItem(i) );
IW.Send( (ent->ViewOrigin(i)).X() );
IW.Send( (ent->ViewOrigin(i)).Y() );
IW.Send( ent->OrientationAngle(i) );
}
Up = ent->NbAnnotations();
IW.Send( Up );
for ( i = 1; i <= Up; i++)
IW.Send( ent->Annotation(i) );
}
void IGESDraw_ToolDrawingWithRotation::OwnShared
(const Handle(IGESDraw_DrawingWithRotation)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer Up = ent->NbViews();
Standard_Integer i; // svv Jan 10 2000 : porting on DEC
for ( i = 1; i <= Up; i++)
iter.GetOneItem( ent->ViewItem(i) );
Up = ent->NbAnnotations();
for ( i = 1; i <= Up; i++)
iter.GetOneItem( ent->Annotation(i) );
}
void IGESDraw_ToolDrawingWithRotation::OwnCopy
(const Handle(IGESDraw_DrawingWithRotation)& another,
const Handle(IGESDraw_DrawingWithRotation)& ent, Interface_CopyTool& TC) const
{
Standard_Integer nbanot;
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXY) viewOrigins;
Handle(TColStd_HArray1OfReal) orientationAngles;
Handle(IGESData_HArray1OfIGESEntity) annotations;
nbanot = another->NbAnnotations();
nbval = another->NbViews();
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
viewOrigins = new TColgp_HArray1OfXY(1, nbval);
orientationAngles = new TColStd_HArray1OfReal(1, nbval);
if ( nbanot > 0 )
{
annotations = new IGESData_HArray1OfIGESEntity(1, nbanot);
for (Standard_Integer i = 1; i <= nbanot; i++)
{
DeclareAndCast(IGESData_IGESEntity, tempAnnotation,
TC.Transferred(another->Annotation(i)));
annotations->SetValue( i, tempAnnotation );
}
}
for (Standard_Integer i = 1; i <= nbval; i++)
{
DeclareAndCast(IGESData_ViewKindEntity, tempView,
TC.Transferred(another->ViewItem(i)));
views->SetValue( i, tempView );
viewOrigins->SetValue( i, (another->ViewOrigin(i)).XY() );
orientationAngles->SetValue( i, another->OrientationAngle(i) );
}
ent->Init(views, viewOrigins,orientationAngles, annotations);
}
Standard_Boolean IGESDraw_ToolDrawingWithRotation::OwnCorrect
(const Handle(IGESDraw_DrawingWithRotation)& ent ) const
{
// Vues vides : les supprimer
Standard_Integer i, nb = ent->NbViews();
Standard_Integer nbtrue = nb;
for (i = 1; i <= nb; i ++) {
Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i);
if (val.IsNull()) nbtrue --;
else if (val->TypeNumber() == 0) nbtrue --;
}
if (nbtrue == nb) return Standard_False;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXY) viewOrigins;
Handle(TColStd_HArray1OfReal) orientationAngles;
if (nbtrue > 0) {
views = new IGESDraw_HArray1OfViewKindEntity (1, nbtrue);
viewOrigins = new TColgp_HArray1OfXY(1, nbtrue);
orientationAngles = new TColStd_HArray1OfReal(1, nbtrue);
}
nbtrue = 0;
for (i = 1; i <= nb; i ++) {
Handle(IGESData_ViewKindEntity) val = ent->ViewItem(i);
if (val.IsNull()) continue;
else if (val->TypeNumber() == 0) continue;
nbtrue ++;
views->SetValue (nbtrue,val);
viewOrigins->SetValue (nbtrue, ent->ViewOrigin(i).XY() );
orientationAngles->SetValue (nbtrue,ent->OrientationAngle(i));
}
// Ne pas oublier les annotations ...
Standard_Integer nbanot = ent->NbAnnotations();
Handle(IGESData_HArray1OfIGESEntity) annotations =
new IGESData_HArray1OfIGESEntity(1, nbanot);
for (i = 1; i <= nbanot; i ++) annotations->SetValue (i,ent->Annotation(i));
ent->Init(views, viewOrigins,orientationAngles, annotations);
return Standard_True;
}
IGESData_DirChecker IGESDraw_ToolDrawingWithRotation::DirChecker
(const Handle(IGESDraw_DrawingWithRotation)& /*ent*/) const
{
IGESData_DirChecker DC (404, 1);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(1);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolDrawingWithRotation::OwnCheck
(const Handle(IGESDraw_DrawingWithRotation)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Boolean ianul = Standard_False;
Standard_Integer i, nb = ent->NbViews();
for (i = 1; i <= nb; i ++) {
Handle(IGESData_ViewKindEntity) tempView = ent->ViewItem(i);
if (tempView.IsNull()) ianul = Standard_True;
else if (tempView->TypeNumber() == 0) ianul = Standard_True;
if (ianul) {
ach->AddWarning ("At least one View is Null");
break;
}
}
nb = ent->NbAnnotations();
for (i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) ann = ent->Annotation(i);
if (ann.IsNull()) ianul = Standard_True;
else if (ann->TypeNumber() == 0) ianul = Standard_True;
if (ianul) {
ach->AddWarning ("At least one Annotation is Null");
break;
}
}
}
void IGESDraw_ToolDrawingWithRotation::OwnDump
(const Handle(IGESDraw_DrawingWithRotation)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_DrawingWithRotation" << endl;
S << "View Entities : " << endl
<< "Transformed View Origins : " << endl
<< "Orientation Angles : ";
S << "Count = " << ent->NbViews() << endl;
if (level > 4) // Level = 4 : no Dump. Level = 5 & 6 have same Dump
{
Standard_Integer I;
Standard_Integer up = ent->NbViews();
for (I = 1; I <= up; I++)
{
S << "[" << I << "]:" << endl;
S << "View Entity : ";
dumper.Dump (ent->ViewItem(I),S, sublevel);
S << endl;
S << "Transformed View Origin : ";
IGESData_DumpXY(S, ent->ViewOrigin(I));
S << " Orientation Angle : " << ent->OrientationAngle(I) << endl;
}
}
S << "Annotation Entities : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbAnnotations(),ent->Annotation);
S << endl;
}

View File

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

View File

@@ -0,0 +1,222 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_LabelDisplay.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolLabelDisplay.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_ViewKindEntity.hxx>
#include <IGESDimen_LeaderArrow.hxx>
#include <IGESDraw_HArray1OfViewKindEntity.hxx>
#include <TColgp_HArray1OfXYZ.hxx>
#include <IGESDimen_HArray1OfLeaderArrow.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <IGESDraw_View.hxx>
#include <IGESDraw_PerspectiveView.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolLabelDisplay::IGESDraw_ToolLabelDisplay () { }
void IGESDraw_ToolLabelDisplay::ReadOwnParams
(const Handle(IGESDraw_LabelDisplay)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXYZ) textLocations;
Handle(IGESDimen_HArray1OfLeaderArrow) leaderEntities;
Handle(TColStd_HArray1OfInteger) labelLevels;
Handle(IGESData_HArray1OfIGESEntity) displayedEntities;
// Reading nbval(No. of Label placements)
Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of Label placements", nbval);
if (st && nbval > 0)
{
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
textLocations = new TColgp_HArray1OfXYZ(1, nbval);
leaderEntities = new IGESDimen_HArray1OfLeaderArrow(1, nbval);
labelLevels = new TColStd_HArray1OfInteger(1, nbval);
displayedEntities = new IGESData_HArray1OfIGESEntity(1, nbval);
Handle(IGESData_ViewKindEntity) tempView;
gp_XYZ tempXYZ;
Handle(IGESDimen_LeaderArrow) tempLeaderArrow;
Standard_Integer tempLabel;
Handle(IGESData_IGESEntity) tempDisplayedEntity;
for (Standard_Integer i = 1; i <= nbval; i++)
{
// Reading views(HArray1OfView)
//st = PR.ReadEntity (IR, PR.Current(), "Instance of views",
//STANDARD_TYPE(IGESData_ViewKindEntity), tempView); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity (IR, PR.Current(), "Instance of views",
STANDARD_TYPE(IGESData_ViewKindEntity), tempView))
views->SetValue(i, tempView);
// Reading textLocations(HArray1OfXYZ)
//st = PR.ReadXYZ(PR.CurrentList(1, 3), "array textLocations", tempXYZ); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadXYZ(PR.CurrentList(1, 3), "array textLocations", tempXYZ))
textLocations->SetValue(i, tempXYZ);
// Reading leaderEntities(HArray1OfLeaderArrow)
//st = PR.ReadEntity (IR, PR.Current(), "Instance of LeaderArrow",
//STANDARD_TYPE(IGESDimen_LeaderArrow), tempLeaderArrow); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity (IR, PR.Current(), "Instance of LeaderArrow",
STANDARD_TYPE(IGESDimen_LeaderArrow), tempLeaderArrow))
leaderEntities->SetValue(i, tempLeaderArrow);
// Reading labelLevels(HArray1OfInteger)
//st = PR.ReadInteger(PR.Current(), "array labelLevels", tempLabel); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "array labelLevels", tempLabel))
labelLevels->SetValue(i, tempLabel);
// Reading displayedEntities(HArray1OfIGESEntity)
//st = PR.ReadEntity (IR, PR.Current(), "displayedEntities entity",
//tempDisplayedEntity); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity (IR, PR.Current(), "displayedEntities entity", tempDisplayedEntity))
displayedEntities->SetValue(i, tempDisplayedEntity);
}
}
else PR.AddFail("No. of Label placements : Not Positive");
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(views, textLocations, leaderEntities, labelLevels, displayedEntities);
}
void IGESDraw_ToolLabelDisplay::WriteOwnParams
(const Handle(IGESDraw_LabelDisplay)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer Up = ent->NbLabels();
IW.Send( Up );
for ( Standard_Integer i = 1; i <= Up; i++)
{
IW.Send( ent->ViewItem(i) );
IW.Send( (ent->TextLocation(i)).X() );
IW.Send( (ent->TextLocation(i)).Y() );
IW.Send( (ent->TextLocation(i)).Z() );
IW.Send( ent->LeaderEntity(i) );
IW.Send( ent->LabelLevel(i) );
IW.Send( ent->DisplayedEntity(i) );
}
}
void IGESDraw_ToolLabelDisplay::OwnShared
(const Handle(IGESDraw_LabelDisplay)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer Up = ent->NbLabels();
for ( Standard_Integer i = 1; i <= Up; i++)
{
iter.GetOneItem( ent->ViewItem(i) );
iter.GetOneItem( ent->LeaderEntity(i) );
iter.GetOneItem( ent->DisplayedEntity(i) );
}
}
void IGESDraw_ToolLabelDisplay::OwnCopy
(const Handle(IGESDraw_LabelDisplay)& another,
const Handle(IGESDraw_LabelDisplay)& ent, Interface_CopyTool& TC) const
{
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColgp_HArray1OfXYZ) textLocations;
Handle(IGESDimen_HArray1OfLeaderArrow) leaderEntities;
Handle(TColStd_HArray1OfInteger) labelLevels;
Handle(IGESData_HArray1OfIGESEntity) displayedEntities;
nbval = another->NbLabels();
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
textLocations = new TColgp_HArray1OfXYZ(1, nbval);
leaderEntities = new IGESDimen_HArray1OfLeaderArrow(1, nbval);
labelLevels = new TColStd_HArray1OfInteger(1, nbval);
displayedEntities = new IGESData_HArray1OfIGESEntity(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
DeclareAndCast(IGESData_ViewKindEntity, tempView,
TC.Transferred(another->ViewItem(i)));
views->SetValue( i, tempView );
textLocations->SetValue( i, (another->TextLocation(i)).XYZ() );
DeclareAndCast(IGESDimen_LeaderArrow, tempArrow,
TC.Transferred(another->LeaderEntity(i)));
leaderEntities->SetValue( i, tempArrow );
labelLevels->SetValue( i, another->LabelLevel(i) );
DeclareAndCast(IGESData_IGESEntity, tempEntity,
TC.Transferred(another->DisplayedEntity(i)));
displayedEntities->SetValue( i, tempEntity );
}
ent->Init(views, textLocations, leaderEntities,
labelLevels, displayedEntities);
}
IGESData_DirChecker IGESDraw_ToolLabelDisplay::DirChecker
(const Handle(IGESDraw_LabelDisplay)& /*ent*/) const
{
IGESData_DirChecker DC (402, 5);
DC.Structure(IGESData_DefVoid);
DC.HierarchyStatusIgnored();
DC.BlankStatusIgnored();
return DC;
}
void IGESDraw_ToolLabelDisplay::OwnCheck
(const Handle(IGESDraw_LabelDisplay)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESDraw_ToolLabelDisplay::OwnDump
(const Handle(IGESDraw_LabelDisplay)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_LabelDisplay" << endl;
S << "View Entities : " << endl
<< "Text Locations : " << endl
<< "Leader Entities : " << endl
<< "Label Level Numbers : " << endl
<< "Displayed Entities : ";
S << "Count = " << ent->NbLabels() << endl;
if (level > 4) // Level = 4 : no Dump. Level = 5 & 6 : same Dump
{
Standard_Integer I;
Standard_Integer up = ent->NbLabels();
for (I = 1; I <= up; I ++)
{
S << "[" << I << "]:" << endl;
S << "View Entity : ";
dumper.Dump (ent->ViewItem(I),S, sublevel);
S << endl;
S << "Text Location in View : ";
IGESData_DumpXYZL(S,level, ent->TextLocation(I), ent->Location());
S << " Leader Entity in View : ";
dumper.Dump (ent->LeaderEntity(I),S, sublevel);
S << endl;
S << "Entity Label Level Number : ";
S << ent->LabelLevel(I) << " ";
S << "Displayed Entity : ";
dumper.Dump (ent->DisplayedEntity(I),S, sublevel);
S << endl;
}
}
S << endl;
}

View File

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

View File

@@ -0,0 +1,229 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_NetworkSubfigure.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolNetworkSubfigure.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESDraw_ConnectPoint.hxx>
#include <gp_XYZ.hxx>
#include <IGESDraw_HArray1OfConnectPoint.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <TCollection_HAsciiString.hxx>
#include <IGESDraw_NetworkSubfigureDef.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolNetworkSubfigure::IGESDraw_ToolNetworkSubfigure () { }
void IGESDraw_ToolNetworkSubfigure::ReadOwnParams
(const Handle(IGESDraw_NetworkSubfigure)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbval;
Handle(IGESDraw_NetworkSubfigureDef) definition;
gp_XYZ translation;
gp_XYZ scale;
Standard_Integer typeflag;
Handle(TCollection_HAsciiString) designator;
Handle(IGESGraph_TextDisplayTemplate) textTemplate;
Handle(IGESDraw_HArray1OfConnectPoint) connectPoints;
Standard_Real scaleX;
Standard_Real scaleY;
Standard_Real scaleZ;
// Reading definition(Instance of NetworkSubfigureDef)
PR.ReadEntity(IR, PR.Current(), "Instance of NetworkSubfigureDef",
STANDARD_TYPE(IGESDraw_NetworkSubfigureDef), definition); //szv#4:S4163:12Mar99 `st=` not needed
// Reading translation(XYZ)
PR.ReadXYZ( PR.CurrentList(1, 3), "Translation data", translation); //szv#4:S4163:12Mar99 `st=` not needed
// Reading scale(XYZ)
if (PR.DefinedElseSkip()) // Reading scale(X)
PR.ReadReal(PR.Current(), "Scale factors(X)", scaleX); //szv#4:S4163:12Mar99 `st=` not needed
else
scaleX = 1.0; // Default Value
if (PR.DefinedElseSkip()) // Reading scale(Y)
PR.ReadReal(PR.Current(), "Scale factors(Y)", scaleY); //szv#4:S4163:12Mar99 `st=` not needed
else
scaleY = scaleX; // Default Value
if (PR.DefinedElseSkip()) // Reading scale(Z)
PR.ReadReal(PR.Current(), "Scale factors(Z)", scaleZ); //szv#4:S4163:12Mar99 `st=` not needed
else
scaleZ = scaleX; // Default Value
scale.SetCoord(scaleX, scaleY, scaleZ);
if (PR.DefinedElseSkip()) // Reading typeflag(Integer)
PR.ReadInteger(PR.Current(), "Type flag", typeflag); //szv#4:S4163:12Mar99 `st=` not needed
else
typeflag = 0; // Default Value
// Reading designator(String)
if (PR.DefinedElseSkip())
PR.ReadText(PR.Current(), "Primary reference designator", designator); //szv#4:S4163:12Mar99 `st=` not needed
else PR.AddWarning("Primary reference designator : Null definition");
// Reading textTemplate(Instance of TextDisplayTemplate or Null)
Standard_Boolean st = PR.ReadEntity(IR, PR.Current(), "Instance of TextDisplayTemplate",
STANDARD_TYPE(IGESGraph_TextDisplayTemplate), textTemplate,
Standard_True);
// Reading nbval(Integer)
if (PR.DefinedElseSkip())
st = PR.ReadInteger(PR.Current(),"Count of Connect Points", nbval); //szv#4:S4163:12Mar99 `st=` not needed
else nbval = 0;
if (st && nbval > 0)
{
// Reading connectPoints(HArray1OfConnectPoint)
connectPoints = new IGESDraw_HArray1OfConnectPoint(1, nbval);
Handle(IGESDraw_ConnectPoint) tempConnectPoint;
for (Standard_Integer i = 1; i <= nbval; i++)
{
//st = PR.ReadEntity(IR, PR.Current(), "ConnectPoint entity",
//STANDARD_TYPE(IGESDraw_ConnectPoint),tempConnectPoint,
//Standard_True); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR, PR.Current(), "ConnectPoint entity",
STANDARD_TYPE(IGESDraw_ConnectPoint),tempConnectPoint, Standard_True))
connectPoints->SetValue(i, tempConnectPoint);
}
}
else if (nbval < 0)
PR.AddFail ("Count of Connect point entities : Less than Zero");
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(definition, translation, scale, typeflag,
designator, textTemplate, connectPoints);
}
void IGESDraw_ToolNetworkSubfigure::WriteOwnParams
(const Handle(IGESDraw_NetworkSubfigure)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->SubfigureDefinition() );
IW.Send( ent->Translation().X() );
IW.Send( ent->Translation().Y() );
IW.Send( ent->Translation().Z() );
IW.Send( ent->ScaleFactors().X() );
IW.Send( ent->ScaleFactors().Y() );
IW.Send( ent->ScaleFactors().Z() );
IW.Send( ent->TypeFlag() );
IW.Send( ent->ReferenceDesignator() );
IW.Send( ent->DesignatorTemplate() );
IW.Send( ent->NbConnectPoints() );
Standard_Integer Up = ent->NbConnectPoints();
for ( Standard_Integer i = 1; i <= Up; i++)
IW.Send( ent->ConnectPoint(i) );
}
void IGESDraw_ToolNetworkSubfigure::OwnShared
(const Handle(IGESDraw_NetworkSubfigure)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem( ent->SubfigureDefinition() );
iter.GetOneItem( ent->DesignatorTemplate() );
Standard_Integer Up = ent->NbConnectPoints();
for ( Standard_Integer i = 1; i <= Up; i++)
iter.GetOneItem( ent->ConnectPoint(i) );
}
void IGESDraw_ToolNetworkSubfigure::OwnCopy
(const Handle(IGESDraw_NetworkSubfigure)& another,
const Handle(IGESDraw_NetworkSubfigure)& ent, Interface_CopyTool& TC) const
{
Standard_Integer nbval;
gp_XYZ translation;
gp_XYZ scale;
Standard_Integer typeflag;
Handle(TCollection_HAsciiString) designator;
Handle(IGESDraw_HArray1OfConnectPoint) connectPoints;
nbval = another->NbConnectPoints();
DeclareAndCast(IGESDraw_NetworkSubfigureDef, definition,
TC.Transferred(another->SubfigureDefinition()));
translation = another->Translation();
scale = another->ScaleFactors();
typeflag = another->TypeFlag();
if (!another->ReferenceDesignator().IsNull())
designator = new TCollection_HAsciiString
(another->ReferenceDesignator());
DeclareAndCast(IGESGraph_TextDisplayTemplate, textTemplate,
TC.Transferred(another->DesignatorTemplate()));
if (nbval > 0) connectPoints = new IGESDraw_HArray1OfConnectPoint(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
DeclareAndCast(IGESDraw_ConnectPoint, tempconnectPoint,
TC.Transferred(another->ConnectPoint(i)) );
connectPoints->SetValue( i, tempconnectPoint );
}
ent->Init(definition, translation, scale, typeflag,
designator, textTemplate, connectPoints);
}
IGESData_DirChecker IGESDraw_ToolNetworkSubfigure::DirChecker
(const Handle(IGESDraw_NetworkSubfigure)& /*ent*/) const
{
IGESData_DirChecker DC (420, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
return DC;
}
void IGESDraw_ToolNetworkSubfigure::OwnCheck
(const Handle(IGESDraw_NetworkSubfigure)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if ( ent->TypeFlag() != 0 &&
ent->TypeFlag() != 1 &&
ent->TypeFlag() != 2 )
ach->AddFail("Type Flag : Value != 0/1/2");
if (ent->NbConnectPoints() != ent->SubfigureDefinition()->NbPointEntities())
ach->AddFail("Count of associated Connect Points inconsistent with Definition");
if (ent->ReferenceDesignator().IsNull())
ach->AddFail("Primary Reference Designator : not defined");
}
void IGESDraw_ToolNetworkSubfigure::OwnDump
(const Handle(IGESDraw_NetworkSubfigure)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_NetworkSubfigure" << endl;
S << "Network Subfigure Definition Entity : ";
dumper.Dump(ent->SubfigureDefinition(),S, sublevel);
S << endl << "Translation Data : ";
IGESData_DumpXYZL(S,level, ent->Translation(), ent->Location());
S << endl << "Scale Factors : ";
IGESData_DumpXYZ(S, ent->ScaleFactors());
S << endl << "Type Flag : " << ent->TypeFlag() << endl;
S << "Primary Reference Designator : ";
IGESData_DumpString(S,ent->ReferenceDesignator());
S << endl << "Text Display Template Entity : ";
dumper.Dump(ent->DesignatorTemplate(),S, sublevel);
S << endl << "Connect Points : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbConnectPoints(),ent->ConnectPoint);
S << endl;
}

View File

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

View File

@@ -0,0 +1,225 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_NetworkSubfigureDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolNetworkSubfigureDef.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESDraw_ConnectPoint.hxx>
#include <IGESData_IGESEntity.hxx>
#include <TCollection_HAsciiString.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESDraw_HArray1OfConnectPoint.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolNetworkSubfigureDef::IGESDraw_ToolNetworkSubfigureDef () { }
void IGESDraw_ToolNetworkSubfigureDef::ReadOwnParams
(const Handle(IGESDraw_NetworkSubfigureDef)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer tempDepth, tempNbEntities1, tempTypeFlag, tempNbEntities2;
Handle(TCollection_HAsciiString) tempName, tempDesignator;
Handle(IGESGraph_TextDisplayTemplate) tempTemplate;
Handle(IGESData_HArray1OfIGESEntity) tempEntities;
Handle(IGESDraw_HArray1OfConnectPoint) tempPointEntities;
//szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Depth Of Subfigure", tempDepth);
PR.ReadText(PR.Current(), "Subfigure Name", tempName);
//st = PR.ReadInteger(PR.Current(), "Number Of Child Entities", tempNbEntities1); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Number Of Child Entities", tempNbEntities1)) {
// Initialize HArray1 only if there is no error reading its Length
if (tempNbEntities1 < 0)
PR.AddFail("Number Of Child Entities : Not Positive");
else if (tempNbEntities1 > 0)
PR.ReadEnts(IR,PR.CurrentList(tempNbEntities1),"Child Entities",tempEntities); //szv#4:S4163:12Mar99 `st=` not needed
// tempEntities = new IGESData_HArray1OfIGESEntity (1,tempNbEntities1);
}
// Read the HArray1 only if its Length was read without any Error
/*
if (! tempEntities.IsNull()) {
Handle(IGESData_IGESEntity) tempEntity1;
Standard_Integer I;
for (I = 1; I <= tempNbEntities1; I++) {
st = PR.ReadEntity(IR, PR.Current(), "Associated Entity",
tempEntity1);
if (st) tempEntities->SetValue(I, tempEntity1);
}
}
*/
PR.ReadInteger(PR.Current(), "Type Flag", tempTypeFlag); //szv#4:S4163:12Mar99 `st=` not needed
if (PR.DefinedElseSkip())
PR.ReadText(PR.Current(), "Primary Reference Designator", tempDesignator); //szv#4:S4163:12Mar99 `st=` not needed
else PR.AddWarning("Primary Reference Designator : Null");
Standard_Boolean st = PR.ReadEntity(IR, PR.Current(), "Primary Reference Designator",
STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempTemplate,
Standard_True);
if (PR.DefinedElseSkip())
st = PR.ReadInteger(PR.Current(), "Number Of Connect Points", tempNbEntities2);
else tempNbEntities2 = 0;
if (st) {
// Initialise HArray1 only if there is no error reading its Length
if (tempNbEntities2 < 0)
PR.AddFail("Number Of Connect Points : Less Than Zero");
else if (tempNbEntities2 > 0) tempPointEntities =
new IGESDraw_HArray1OfConnectPoint (1, tempNbEntities2);
}
// Read the HArray1 only if its Length was read without any Error
if (! tempPointEntities.IsNull()) {
Handle(IGESDraw_ConnectPoint) tempConnectPoint;
Standard_Integer I;
for (I = 1; I <= tempNbEntities2; I++) {
//st = PR.ReadEntity(IR, PR.Current(),"Associated Connect Point Entity",
//STANDARD_TYPE(IGESDraw_ConnectPoint), tempConnectPoint,
//Standard_True); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR, PR.Current(),"Associated Connect Point Entity",
STANDARD_TYPE(IGESDraw_ConnectPoint), tempConnectPoint, Standard_True))
tempPointEntities->SetValue(I, tempConnectPoint);
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempDepth, tempName, tempEntities, tempTypeFlag, tempDesignator,
tempTemplate, tempPointEntities);
}
void IGESDraw_ToolNetworkSubfigureDef::WriteOwnParams
(const Handle(IGESDraw_NetworkSubfigureDef)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer up = ent->NbEntities();
IW.Send(ent->Depth());
IW.Send(ent->Name());
IW.Send(up);
Standard_Integer I;
for (I = 1; I <= up; I++)
IW.Send(ent->Entity(I));
IW.Send(ent->TypeFlag());
IW.Send(ent->Designator());
IW.Send(ent->DesignatorTemplate());
up = ent->NbPointEntities();
IW.Send(up);
for (I = 1; I <= up; I++)
IW.Send(ent->PointEntity(I));
}
void IGESDraw_ToolNetworkSubfigureDef::OwnShared
(const Handle(IGESDraw_NetworkSubfigureDef)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer I;
Standard_Integer up = ent->NbEntities();
for (I = 1; I <= up; I++)
iter.GetOneItem(ent->Entity(I));
up = ent->NbPointEntities();
for (I = 1; I <= up; I++)
iter.GetOneItem(ent->PointEntity(I));
}
void IGESDraw_ToolNetworkSubfigureDef::OwnCopy
(const Handle(IGESDraw_NetworkSubfigureDef)& another,
const Handle(IGESDraw_NetworkSubfigureDef)& ent, Interface_CopyTool& TC) const
{
Standard_Integer tempDepth = another->Depth();
Handle(TCollection_HAsciiString) tempName =
new TCollection_HAsciiString(another->Name());
Handle(IGESData_HArray1OfIGESEntity) tempEntities;
Standard_Integer up = another->NbEntities();
if (up > 0) tempEntities = new IGESData_HArray1OfIGESEntity (1,up);
Standard_Integer I;
for (I = 1; I <= up; I++) {
DeclareAndCast(IGESData_IGESEntity, tempEntity,
TC.Transferred(another->Entity(I)));
tempEntities->SetValue(I, tempEntity);
}
Standard_Integer tempTypeFlag = another->TypeFlag();
Handle(TCollection_HAsciiString) tempDesignator;
if (!another->Designator().IsNull()) tempDesignator =
new TCollection_HAsciiString(another->Designator());
up = another->NbPointEntities();
Handle(IGESDraw_HArray1OfConnectPoint) tempPointEntities;
if (up > 0) tempPointEntities = new IGESDraw_HArray1OfConnectPoint (1,up);
for (I = 1; I <= up; I++) {
if (another->HasPointEntity(I)) {
DeclareAndCast(IGESDraw_ConnectPoint, tempPointEntity,
TC.Transferred(another->PointEntity(I)));
tempPointEntities->SetValue(I, tempPointEntity);
}
}
if (another->HasDesignatorTemplate()) {
DeclareAndCast(IGESGraph_TextDisplayTemplate, tempDesignatorTemplate,
TC.Transferred(another->DesignatorTemplate()));
ent->Init(tempDepth, tempName, tempEntities, tempTypeFlag,
tempDesignator, tempDesignatorTemplate, tempPointEntities);
}
else {
Handle(IGESGraph_TextDisplayTemplate) tempDesignatorTemplate;
ent->Init(tempDepth, tempName, tempEntities, tempTypeFlag,
tempDesignator, tempDesignatorTemplate, tempPointEntities);
}
}
IGESData_DirChecker IGESDraw_ToolNetworkSubfigureDef::DirChecker
(const Handle(IGESDraw_NetworkSubfigureDef)& /*ent*/) const
{
IGESData_DirChecker DC(320, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefValue);
DC.BlankStatusIgnored();
DC.UseFlagRequired(2);
DC.GraphicsIgnored(1);
return DC;
}
void IGESDraw_ToolNetworkSubfigureDef::OwnCheck
(const Handle(IGESDraw_NetworkSubfigureDef)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if ((ent->TypeFlag() < 0) || (ent->TypeFlag() > 2))
ach->AddFail("TypeFlag has Invalid value");
if (ent->Designator().IsNull())
ach->AddFail("Primary Reference Designator : not defined");
}
void IGESDraw_ToolNetworkSubfigureDef::OwnDump
(const Handle(IGESDraw_NetworkSubfigureDef)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_NetworkSubfigureDef" << endl;
S << "Depth Of Subfigure(Nesting) : " << ent->Depth() << endl;
S << "Name Of Subfigure : ";
IGESData_DumpString(S,ent->Name());
S << endl << "Associated Entities : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbEntities(),ent->Entity);
S << endl << "Type Flag : " << ent->TypeFlag() << endl;
S << "Primary Reference Designator : ";
IGESData_DumpString(S,ent->Designator());
S << endl << "Text Display Template Entity : ";
dumper.Dump(ent->DesignatorTemplate(),S, tempSubLevel);
S << endl << "Connect Point Entities : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbPointEntities(),ent->PointEntity);
S << endl;
}

View File

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

View File

@@ -0,0 +1,181 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_PerspectiveView.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolPerspectiveView.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_TransfEntity.hxx>
#include <gp_XY.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolPerspectiveView::IGESDraw_ToolPerspectiveView () { }
void IGESDraw_ToolPerspectiveView::ReadOwnParams
(const Handle(IGESDraw_PerspectiveView)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
gp_XY tempTopLeft, tempBottomRight;
Standard_Real tempLeft, tempRight, tempTop, tempBottom;
gp_XYZ tempCenterOfProjection, tempViewUpVector;
gp_XYZ tempViewNormalVector, tempViewReferencePoint;
Standard_Integer tempViewNumber, tempDepthClip;
Standard_Real tempScaleFactor, tempViewPlaneDistance;
Standard_Real tempBackPlaneDistance, tempFrontPlaneDistance;
//szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "View Number", tempViewNumber);
PR.ReadReal(PR.Current(), "Scale Number", tempScaleFactor);
PR.ReadXYZ(PR.CurrentList(1, 3), "View Plane Normal Vector", tempViewNormalVector);
PR.ReadXYZ(PR.CurrentList(1, 3), "View Reference Point", tempViewReferencePoint);
PR.ReadXYZ(PR.CurrentList(1, 3), "Center Of Projection", tempCenterOfProjection);
PR.ReadXYZ(PR.CurrentList(1, 3), "View Up Vector", tempViewUpVector);
PR.ReadReal(PR.Current(), "View Plane Distance", tempViewPlaneDistance);
//st = PR.ReadReal(PR.Current(), "Left Side Of Clipping Window", tempLeft); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Left Side Of Clipping Window", tempLeft))
tempTopLeft.SetX(tempLeft);
//st = PR.ReadReal(PR.Current(), "Right Side Of Clipping Window", tempRight); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Right Side Of Clipping Window", tempRight))
tempBottomRight.SetX(tempRight);
//st = PR.ReadReal(PR.Current(), "Bottom Of Clipping Window", tempBottom); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Bottom Of Clipping Window", tempBottom))
tempBottomRight.SetY(tempBottom);
//st = PR.ReadReal(PR.Current(), "Top Of Clipping Window", tempTop); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Top Of Clipping Window", tempTop))
tempTopLeft.SetY(tempTop);
//szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Depth Clipping Indicator", tempDepthClip);
PR.ReadReal(PR.Current(), "Back Plane Distance", tempBackPlaneDistance);
PR.ReadReal(PR.Current(), "Front Plane Distance", tempFrontPlaneDistance);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempViewNumber, tempScaleFactor, tempViewNormalVector,
tempViewReferencePoint, tempCenterOfProjection, tempViewUpVector,
tempViewPlaneDistance, tempTopLeft, tempBottomRight, tempDepthClip,
tempBackPlaneDistance, tempFrontPlaneDistance);
}
void IGESDraw_ToolPerspectiveView::WriteOwnParams
(const Handle(IGESDraw_PerspectiveView)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->ViewNumber());
IW.Send(ent->ScaleFactor());
IW.Send(ent->ViewNormalVector().X());
IW.Send(ent->ViewNormalVector().Y());
IW.Send(ent->ViewNormalVector().Z());
IW.Send(ent->ViewReferencePoint().X());
IW.Send(ent->ViewReferencePoint().Y());
IW.Send(ent->ViewReferencePoint().Z());
IW.Send(ent->CenterOfProjection().X());
IW.Send(ent->CenterOfProjection().Y());
IW.Send(ent->CenterOfProjection().Z());
IW.Send(ent->ViewUpVector().X());
IW.Send(ent->ViewUpVector().Y());
IW.Send(ent->ViewUpVector().Z());
IW.Send(ent->ViewPlaneDistance());
IW.Send(ent->TopLeft().X());
IW.Send(ent->BottomRight().X());
IW.Send(ent->BottomRight().Y());
IW.Send(ent->TopLeft().Y());
IW.Send(ent->DepthClip());
IW.Send(ent->BackPlaneDistance());
IW.Send(ent->FrontPlaneDistance());
}
void IGESDraw_ToolPerspectiveView::OwnShared
(const Handle(IGESDraw_PerspectiveView)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESDraw_ToolPerspectiveView::OwnCopy
(const Handle(IGESDraw_PerspectiveView)& another,
const Handle(IGESDraw_PerspectiveView)& ent, Interface_CopyTool& /*TC*/) const
{
ent->Init
(another->ViewNumber(), another->ScaleFactor(),
another->ViewNormalVector().XYZ(), another->ViewReferencePoint().XYZ(),
another->CenterOfProjection().XYZ(), another->ViewUpVector().XYZ(),
another->ViewPlaneDistance(),
another->TopLeft().XY(),another->BottomRight().XY(), another->DepthClip(),
another->BackPlaneDistance(), another->FrontPlaneDistance());
}
IGESData_DirChecker IGESDraw_ToolPerspectiveView::DirChecker
(const Handle(IGESDraw_PerspectiveView)& /*ent*/) const
{
IGESData_DirChecker DC(410, 1);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagRequired(1);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolPerspectiveView::OwnCheck
(const Handle(IGESDraw_PerspectiveView)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if ((ent->DepthClip() < 0) || (ent->DepthClip() > 3))
ach->AddFail("DepthClip has invalid value");
if (ent->HasTransf()) {
if (ent->Transf()->FormNumber() != 0)
ach->AddFail("Associated Matrix has not Form Number 0");
}
}
void IGESDraw_ToolPerspectiveView::OwnDump
(const Handle(IGESDraw_PerspectiveView)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESDraw_PerspectiveView" << endl;
S << "View Number : " << ent->ViewNumber() << " ";
S << "Scale Factor : " << ent->ScaleFactor() << endl;
S << "View Plane Normal Vector : ";
IGESData_DumpXYZL(S,level, ent->ViewNormalVector(), ent->Location());
S << endl << "View Reference Point : ";
IGESData_DumpXYZL(S,level, ent->ViewReferencePoint() , ent->Location());
S << endl << "Center Of Projection : ";
IGESData_DumpXYZL(S,level, ent->CenterOfProjection() , ent->Location());
S << endl << "View Up Vector : ";
IGESData_DumpXYZL(S,level, ent->ViewUpVector() , ent->Location());
S << endl << "View Plane Distance : " << ent->ViewPlaneDistance()<<endl;
S << "Left Side Of Clipping Window : " << ent->TopLeft().X() << endl;
S << "Right Side Of Clipping Window : " << ent->BottomRight().X() << endl;
S << "Bottom Side Of Clipping Window : " << ent->BottomRight().Y() << endl;
S << "Top Side Of Clipping Window : " << ent->TopLeft().Y() << endl;
S << "Depth Clipping : " << ent->DepthClip();
switch (ent->DepthClip()) {
case 0 : S << " (No Depth Clipping)" << endl; break;
case 1 : S << " (Back Clipping Plane ON)" << endl; break;
case 2 : S << " (Front Clipping Plane ON)" << endl; break;
case 3 : S << " (Front and Back Clipping Planes ON)" << endl; break;
default : S << " (Invalid Value)" << endl; break;
}
S << "Back Plane Distance : " << ent->BackPlaneDistance() << " ";
S << "Front Plane Distance : " << ent->FrontPlaneDistance() << endl;
S << endl;
}

View File

@@ -0,0 +1,63 @@
-- File: IGESDraw_ToolPlanar.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolPlanar from IGESDraw
---Purpose : Tool to work on a Planar. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses Planar from IGESDraw,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolPlanar;
---Purpose : Returns a ToolPlanar, ready to work
ReadOwnParams (me; ent : mutable Planar;
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 : Planar;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : Planar;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a Planar <ent>, from
-- its specific (own) parameters
OwnCorrect (me; ent : mutable Planar) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a Planar
-- (NbMatrices forced to 1)
DirChecker (me; ent : Planar) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : Planar;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : Planar; entto : mutable Planar;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters
OwnDump (me; ent : Planar;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
end ToolPlanar;

View File

@@ -0,0 +1,167 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_Planar.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolPlanar.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESGeom_TransformationMatrix.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolPlanar::IGESDraw_ToolPlanar () { }
void IGESDraw_ToolPlanar::ReadOwnParams
(const Handle(IGESDraw_Planar)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
Standard_Boolean st;
Standard_Integer nbval;
Standard_Integer nbMatrices;
Handle(IGESGeom_TransformationMatrix) transformationMatrix;
Handle(IGESData_HArray1OfIGESEntity) entities;
// Reading nbMatrices(Integer)
st = PR.ReadInteger(PR.Current(), "No. of Transformation matrices", nbMatrices);
if ( nbMatrices != 1 )
PR.AddFail("No. of Transformation matrices != 1");
// Reading nbval(Integer)
st = PR.ReadInteger(PR.Current(), "No. of Entities in this plane", nbval);
if (!st) nbval = 0; //szv#4:S4163:12Mar99 was bug: `nbval == 0`
if (nbval <= 0) PR.AddFail ("No. of Entities in this plane : Not Positive");
// Reading transformationMatrix(Instance of TransformationMatrix or Null)
st = PR.ReadEntity(IR,PR.Current(), "Instance of TransformationMatrix",
STANDARD_TYPE(IGESGeom_TransformationMatrix), transformationMatrix,
Standard_True);
if (nbval > 0)
st = PR.ReadEnts (IR, PR.CurrentList(nbval), "Planar Entities", entities);
/*
{
entities = new IGESData_HArray1OfIGESEntity(1, nbval);
// Reading entities(HArray1OfIGESEntity)
Handle(IGESData_IGESEntity) tempEntity;
for (Standard_Integer i = 1; i <= nbval; i++)
{
st = PR.ReadEntity(IR, PR.Current(), "Plane entity", tempEntity);
if (st) entities->SetValue(i, tempEntity);
}
}
*/
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(nbMatrices,transformationMatrix, entities);
}
void IGESDraw_ToolPlanar::WriteOwnParams
(const Handle(IGESDraw_Planar)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer Up = ent->NbEntities();
IW.Send( ent->NbMatrices() );
IW.Send( Up );
IW.Send( ent->TransformMatrix() );
for ( Standard_Integer i = 1; i <= Up; i++)
IW.Send( ent->Entity(i) );
}
void IGESDraw_ToolPlanar::OwnShared
(const Handle(IGESDraw_Planar)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer Up = ent->NbEntities();
iter.GetOneItem( ent->TransformMatrix() );
for ( Standard_Integer i = 1; i <= Up; i++)
iter.GetOneItem( ent->Entity(i) );
}
void IGESDraw_ToolPlanar::OwnCopy
(const Handle(IGESDraw_Planar)& another,
const Handle(IGESDraw_Planar)& ent, Interface_CopyTool& TC) const
{
Standard_Integer nbval;
Standard_Integer nbMatrices;
Handle(IGESData_HArray1OfIGESEntity) entities;
nbval = another->NbEntities();
nbMatrices = another->NbMatrices();
DeclareAndCast(IGESGeom_TransformationMatrix, transformationMatrix,
TC.Transferred(another->TransformMatrix()));
entities = new IGESData_HArray1OfIGESEntity(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
DeclareAndCast(IGESData_IGESEntity, tempEntity,
TC.Transferred(another->Entity(i)));
entities->SetValue( i, tempEntity );
}
ent->Init(nbMatrices, transformationMatrix, entities);
}
Standard_Boolean IGESDraw_ToolPlanar::OwnCorrect
(const Handle(IGESDraw_Planar)& ent) const
{
if (ent->NbMatrices() == 1) return Standard_False;
// Forcer NbMNatrices a 1 -> Reconstruire
Standard_Integer nb = ent->NbEntities();
Handle(IGESData_HArray1OfIGESEntity) ents =
new IGESData_HArray1OfIGESEntity(1,nb);
for (Standard_Integer i = 1; i <= nb; i ++)
ents->SetValue(i,ent->Entity(i));
ent->Init (1,ent->TransformMatrix(),ents);
return Standard_True;
}
IGESData_DirChecker IGESDraw_ToolPlanar::DirChecker
(const Handle(IGESDraw_Planar)& /*ent*/) const
{
IGESData_DirChecker DC (402, 16);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagRequired(5);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolPlanar::OwnCheck
(const Handle(IGESDraw_Planar)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if ( ent->NbMatrices() != 1 )
ach->AddFail("No. of Transformation matrices : Value != 1");
}
void IGESDraw_ToolPlanar::OwnDump
(const Handle(IGESDraw_Planar)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_Planar" << endl;
S << "No. of Transformation Matrices : " << ent->NbMatrices() << " ";
S << "i.e. : ";
if ( ent->TransformMatrix().IsNull() )
S << "Null Handle";
else
dumper.OwnDump (ent->TransformMatrix(),S, sublevel);
S << endl;
S << "Array of Entities on the specified plane : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbEntities(),ent->Entity);
S << endl;
}

View File

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

View File

@@ -0,0 +1,180 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_RectArraySubfigure.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolRectArraySubfigure.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <IGESData_IGESEntity.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolRectArraySubfigure::IGESDraw_ToolRectArraySubfigure () { }
void IGESDraw_ToolRectArraySubfigure::ReadOwnParams
(const Handle(IGESDraw_RectArraySubfigure)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
gp_XYZ tempLowerLeftCorner;
Standard_Real tempScaleFactor;
Handle(IGESData_IGESEntity) tempBaseEntity;
Handle(TColStd_HArray1OfInteger) tempPositions;
Standard_Real tempColumnSeparation, tempRowSeparation, tempRotationAngle;
Standard_Integer tempNbColumns, tempNbRows, tempDoDontFlag, tempListCount;
PR.ReadEntity(IR, PR.Current(), "Base Entity", tempBaseEntity); //szv#4:S4163:12Mar99 `st=` not needed
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(), "Scale Factor", tempScaleFactor); //szv#4:S4163:12Mar99 `st=` not needed
else
tempScaleFactor = 1.0; // Setting to default value of 1.0
//szv#4:S4163:12Mar99 `st=` not needed
PR.ReadXYZ(PR.CurrentList(1, 3), "Lower Left Coordinate Of Array", tempLowerLeftCorner);
PR.ReadInteger(PR.Current(), "Number Of Columns", tempNbColumns);
PR.ReadInteger(PR.Current(), "Number Of Rows", tempNbRows);
PR.ReadReal(PR.Current(), "Horizontal Distance Between Columns", tempColumnSeparation);
PR.ReadReal(PR.Current(), "Vertical Distance Between Rows", tempRowSeparation);
PR.ReadReal(PR.Current(), "Rotation Angle", tempRotationAngle);
//st = PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "DO-DONT List Count", tempListCount)) {
// Initialise HArray1 only if there is no error reading its Length
if (tempListCount > 0)
tempPositions = new TColStd_HArray1OfInteger (1, tempListCount);
else if (tempListCount < 0)
PR.AddFail("DO-DONT List Count : Less than Zero");
}
PR.ReadInteger(PR.Current(), "DO-DONT Flag", tempDoDontFlag); //szv#4:S4163:12Mar99 `st=` not needed
// Read the HArray1 only if its Length was read without any Error
if (! tempPositions.IsNull()) {
Standard_Integer I;
for (I = 1; I <= tempListCount; I++) {
Standard_Integer tempPos;
//st = PR.ReadInteger(PR.Current(), "Number Of Position To Process",
//tempPos); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Number Of Position To Process", tempPos))
tempPositions->SetValue(I, tempPos);
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempBaseEntity, tempScaleFactor, tempLowerLeftCorner,
tempNbColumns, tempNbRows, tempColumnSeparation, tempRowSeparation,
tempRotationAngle, tempDoDontFlag, tempPositions);
}
void IGESDraw_ToolRectArraySubfigure::WriteOwnParams
(const Handle(IGESDraw_RectArraySubfigure)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->BaseEntity());
IW.Send(ent->ScaleFactor());
IW.Send(ent->LowerLeftCorner().X());
IW.Send(ent->LowerLeftCorner().Y());
IW.Send(ent->LowerLeftCorner().Z());
IW.Send(ent->NbColumns());
IW.Send(ent->NbRows());
IW.Send(ent->ColumnSeparation());
IW.Send(ent->RowSeparation());
IW.Send(ent->RotationAngle());
IW.Send(ent->ListCount());
IW.SendBoolean(ent->DoDontFlag());
Standard_Integer I;
Standard_Integer up = ent->ListCount();
for (I = 1; I <= up; I++)
IW.Send(ent->ListPosition(I));
}
void IGESDraw_ToolRectArraySubfigure::OwnShared
(const Handle(IGESDraw_RectArraySubfigure)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->BaseEntity());
}
void IGESDraw_ToolRectArraySubfigure::OwnCopy
(const Handle(IGESDraw_RectArraySubfigure)& another,
const Handle(IGESDraw_RectArraySubfigure)& ent, Interface_CopyTool& TC) const
{
DeclareAndCast(IGESData_IGESEntity, tempBaseEntity,
TC.Transferred(another->BaseEntity()));
Standard_Real tempScaleFactor = another->ScaleFactor();
gp_XYZ tempLowerLeftCorner = (another->LowerLeftCorner()).XYZ();
Standard_Integer tempNbColumns = another->NbColumns();
Standard_Integer tempNbRows = another->NbRows();
Standard_Real tempColumnSeparation = another->ColumnSeparation();
Standard_Real tempRowSeparation = another->RowSeparation();
Standard_Real tempRotationAngle = another->RotationAngle();
Standard_Integer tempListCount = another->ListCount();
Standard_Integer tempDoDontFlag = (another->DoDontFlag() ? 1 : 0);
Handle(TColStd_HArray1OfInteger) tempPositions;
if (tempListCount != 0) {
tempPositions = new TColStd_HArray1OfInteger (1,tempListCount);
Standard_Integer I;
for (I = 1; I <= tempListCount; I++)
tempPositions->SetValue(I, another->ListPosition(I));
}
ent->Init(tempBaseEntity, tempScaleFactor, tempLowerLeftCorner,
tempNbColumns, tempNbRows, tempColumnSeparation, tempRowSeparation,
tempRotationAngle, tempDoDontFlag, tempPositions);
}
IGESData_DirChecker IGESDraw_ToolRectArraySubfigure::DirChecker
(const Handle(IGESDraw_RectArraySubfigure)& /*ent*/) const
{
IGESData_DirChecker DC(412, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.GraphicsIgnored(1);
return DC;
}
void IGESDraw_ToolRectArraySubfigure::OwnCheck
(const Handle(IGESDraw_RectArraySubfigure)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESDraw_ToolRectArraySubfigure::OwnDump
(const Handle(IGESDraw_RectArraySubfigure)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_RectArraySubfigure" << endl;
S << "Base Entity : ";
dumper.Dump(ent->BaseEntity(),S, tempSubLevel);
S << endl;
S << "Scale Factor : " << ent->ScaleFactor() << " ";
S << "Lower Left Corner Of Array : ";
IGESData_DumpXYZL(S,level, ent->LowerLeftCorner(),gp_GTrsf()); // no location
S << "Number Of Columns : " << ent->NbColumns() << " ";
S << "Number Of Rows : " << ent->NbRows() << endl;
S << "Horizontal Distance Between Columns : " << ent->ColumnSeparation()<<endl;
S << "Vertical Distance Between Rows : " << ent->RowSeparation() <<endl;
S << "Rotation Angle (in radians) : " << ent->RotationAngle() <<endl;
S << "Do-Dont Flag : ";
if (ent->DoDontFlag()) S << "(1)Dont ";
else S << "(0)Do ";
S << "Do-Dont List : ";
IGESData_DumpVals(S ,level,1, ent->ListCount(),ent->ListPosition);
S << endl;
}

View File

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

View File

@@ -0,0 +1,319 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_SegmentedViewsVisible.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolSegmentedViewsVisible.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_ViewKindEntity.hxx>
#include <IGESGraph_Color.hxx>
#include <IGESGraph_HArray1OfColor.hxx>
#include <IGESData_LineFontEntity.hxx>
#include <IGESDraw_HArray1OfViewKindEntity.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESBasic_HArray1OfLineFontEntity.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolSegmentedViewsVisible::IGESDraw_ToolSegmentedViewsVisible () { }
void IGESDraw_ToolSegmentedViewsVisible::ReadOwnParams
(const Handle(IGESDraw_SegmentedViewsVisible)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColStd_HArray1OfReal) breakpointParameters;
Handle(TColStd_HArray1OfInteger) displayFlags;
Handle(TColStd_HArray1OfInteger) colorValues;
Handle(IGESGraph_HArray1OfColor) colorDefinitions;
Handle(TColStd_HArray1OfInteger) lineFontValues;
Handle(IGESBasic_HArray1OfLineFontEntity) lineFontDefinitions;
Handle(TColStd_HArray1OfInteger) lineWeights;
// Reading nbval(Integer)
Standard_Boolean st = PR.ReadInteger( PR.Current(), "No. of View/segment blocks", nbval );
if (st && nbval > 0) {
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
breakpointParameters = new TColStd_HArray1OfReal(1, nbval);
displayFlags = new TColStd_HArray1OfInteger(1, nbval);
colorValues = new TColStd_HArray1OfInteger(1, nbval);
colorDefinitions = new IGESGraph_HArray1OfColor(1, nbval);
lineFontValues = new TColStd_HArray1OfInteger(1, nbval);
lineFontDefinitions = new IGESBasic_HArray1OfLineFontEntity(1, nbval);
lineWeights = new TColStd_HArray1OfInteger(1, nbval);
Handle(IGESData_ViewKindEntity) tempView;
Standard_Real tempBreak;
Standard_Integer tempDisplay;
Standard_Integer tempColorValue;
Handle(IGESGraph_Color) tempColorDef;
Standard_Integer tempLineFontValue;
Handle(IGESData_LineFontEntity) tempLineFontDef;
Standard_Integer tempLine;
for (Standard_Integer i = 1; i <= nbval; i++)
{
// Reading views(HArray1OfView)
//st = PR.ReadEntity( IR, PR.Current(), "Instance of views",
//STANDARD_TYPE(IGESData_ViewKindEntity), tempView ); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR, PR.Current(), "Instance of views",
STANDARD_TYPE(IGESData_ViewKindEntity), tempView))
views->SetValue(i, tempView);
// Reading breakpointParameters(HArray1OfReal)
//st = PR.ReadReal(PR.Current(), "array breakpointParameters", tempBreak ); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "array breakpointParameters", tempBreak ))
breakpointParameters->SetValue(i, tempBreak);
// Reading displayFlags(HArray1OfInteger)
//st = PR.ReadInteger( PR.Current(), "array displayFlags", tempDisplay ); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger( PR.Current(), "array displayFlags", tempDisplay ))
displayFlags->SetValue(i, tempDisplay);
Standard_Integer curnum = PR.CurrentNumber();
// Reading Color : Value (>0) or Definition (<0 = D.E. Pointer)
PR.ReadInteger( PR.Current(), "array colorValues", tempColorValue); //szv#4:S4163:12Mar99 `st=` not needed
if (tempColorValue < 0) {
colorValues->SetValue(i, -1);
tempColorDef = GetCasted(IGESGraph_Color,PR.ParamEntity(IR,curnum));
if (tempColorDef.IsNull()) PR.AddFail
("A Color Definition Entity is incorrect");
else colorDefinitions->SetValue(i, tempColorDef);
}
else
colorValues->SetValue(i, tempColorValue);
curnum = PR.CurrentNumber();
// Reading Line Font : Value (>0) or Definition (<0 = D.E. Pointer)
PR.ReadInteger( PR.Current(), "array lineFontValues", tempLineFontValue ); //szv#4:S4163:12Mar99 `st=` not needed
if (tempLineFontValue < 0 ) {
lineFontValues->SetValue(i, -1);
tempLineFontDef = GetCasted(IGESData_LineFontEntity,
PR.ParamEntity(IR,curnum));
if (tempLineFontDef.IsNull()) PR.AddFail
("A Line Font Definition Entity is incorrect");
lineFontDefinitions->SetValue(i,tempLineFontDef);
}
else
lineFontValues->SetValue(i, tempLineFontValue);
// Reading lineWeights(HArray1OfInteger)
//st = PR.ReadInteger( PR.Current(), "array lineWeights", tempLine ); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger( PR.Current(), "array lineWeights", tempLine ))
lineWeights->SetValue(i, tempLine);
}
}
else
PR.AddFail("No. of View/segment blocks : Not Positive");
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(views, breakpointParameters, displayFlags,colorValues, colorDefinitions,
lineFontValues, lineFontDefinitions, lineWeights);
}
void IGESDraw_ToolSegmentedViewsVisible::WriteOwnParams
(const Handle(IGESDraw_SegmentedViewsVisible)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer Up = ent->NbSegmentBlocks();
IW.Send( Up );
for ( Standard_Integer i = 1; i <= Up; i++)
{
IW.Send( ent->ViewItem(i) );
IW.Send( ent->BreakpointParameter(i) );
IW.Send( ent->DisplayFlag(i) );
if (ent->IsColorDefinition(i))
IW.Send( ent->ColorDefinition(i), Standard_True ); // negative
else
IW.Send( ent->ColorValue(i) );
if (ent->IsFontDefinition(i))
IW.Send( ent->LineFontDefinition(i), Standard_True ); // negative
else
IW.Send( ent->LineFontValue(i) );
IW.Send( ent->LineWeightItem(i) );
}
}
void IGESDraw_ToolSegmentedViewsVisible::OwnShared
(const Handle(IGESDraw_SegmentedViewsVisible)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer Up = ent->NbSegmentBlocks();
for ( Standard_Integer i = 1; i <= Up; i++)
{
iter.GetOneItem( ent->ViewItem(i) );
if (ent->IsColorDefinition(i))
iter.GetOneItem( ent->ColorDefinition(i) );
if (!ent->IsFontDefinition(i))
iter.GetOneItem( ent->LineFontDefinition(i) );
}
}
void IGESDraw_ToolSegmentedViewsVisible::OwnCopy
(const Handle(IGESDraw_SegmentedViewsVisible)& another,
const Handle(IGESDraw_SegmentedViewsVisible)& ent, Interface_CopyTool& TC) const
{
Standard_Integer nbval;
Handle(IGESDraw_HArray1OfViewKindEntity) views;
Handle(TColStd_HArray1OfReal) breakpointParameters;
Handle(TColStd_HArray1OfInteger) displayFlags;
Handle(TColStd_HArray1OfInteger) colorValues;
Handle(IGESGraph_HArray1OfColor) colorDefinitions;
Handle(TColStd_HArray1OfInteger) lineFontValues;
Handle(IGESBasic_HArray1OfLineFontEntity) lineFontDefinitions;
Handle(TColStd_HArray1OfInteger) lineWeights;
Handle(IGESData_ViewKindEntity) retView;
Handle(IGESGraph_Color) retColorDef;
Handle(IGESData_LineFontEntity) retLineFontDef;
nbval = another->NbSegmentBlocks();
views = new IGESDraw_HArray1OfViewKindEntity(1, nbval);
breakpointParameters = new TColStd_HArray1OfReal(1, nbval);
displayFlags = new TColStd_HArray1OfInteger(1, nbval);
colorValues = new TColStd_HArray1OfInteger(1, nbval);
lineFontValues = new TColStd_HArray1OfInteger(1, nbval);
colorDefinitions = new IGESGraph_HArray1OfColor(1, nbval);
lineFontDefinitions = new IGESBasic_HArray1OfLineFontEntity(1, nbval);
lineWeights = new TColStd_HArray1OfInteger(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
retView = another->ViewItem(i);
DeclareAndCast(IGESData_ViewKindEntity,
tempView, TC.Transferred(retView));
views->SetValue( i, tempView );
breakpointParameters->SetValue( i, another->BreakpointParameter(i) );
displayFlags->SetValue( i, another->DisplayFlag(i) );
if ( another->IsColorDefinition(i) )
{
retColorDef = another->ColorDefinition(i);
DeclareAndCast(IGESGraph_Color, tempColorDef,
TC.Transferred(retColorDef));
colorDefinitions->SetValue( i, tempColorDef );
}
else
{
colorValues->SetValue( i, another->ColorValue(i) );
//// colorDefinitions->SetValue( i, NULL ); par defaut
}
if ( another->IsFontDefinition(i) )
{
retLineFontDef = another->LineFontDefinition(i);
DeclareAndCast(IGESData_LineFontEntity, tempLineFontDef,
TC.Transferred(retLineFontDef));
lineFontDefinitions->SetValue( i, tempLineFontDef );
}
else
{
lineFontValues->SetValue( i, another->LineFontValue(i) );
//// lineFontDefinitions->SetValue( i, NULL ); par defaut
}
lineWeights->SetValue( i, another->LineWeightItem(i) );
}
ent->Init(views, breakpointParameters, displayFlags,
colorValues, colorDefinitions,
lineFontValues, lineFontDefinitions, lineWeights);
}
IGESData_DirChecker IGESDraw_ToolSegmentedViewsVisible::DirChecker
(const Handle(IGESDraw_SegmentedViewsVisible)& /*ent*/) const
{
IGESData_DirChecker DC (402, 19);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(1);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolSegmentedViewsVisible::OwnCheck
(const Handle(IGESDraw_SegmentedViewsVisible)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESDraw_ToolSegmentedViewsVisible::OwnDump
(const Handle(IGESDraw_SegmentedViewsVisible)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_SegmentedViewsVisible" << endl;
S << "View Entities : " << endl
<< "Breakpoint parameters : " << endl
<< "Display flags : " << endl
<< "Color Values : " << endl
<< "Color Definitions : " << endl
<< "LineFont Values : " << endl
<< "LineFont Definitions : " << endl
<< "Line Weights : " << endl;
S << "Count Of Blocks = " << ent->NbSegmentBlocks() << endl;
switch (level)
{
case 4 : S << " [ for content, ask level > 4 ]" << endl;
break; // Nothing to be dumped here
case 5 : // Presently level 5 and 6 have the same Dump
case 6 :
{
Standard_Integer I;
Standard_Integer up = ent->NbSegmentBlocks();
for (I = 1; I <= up; I++)
{
S << "[" << I << "]:" << endl;
S << "View Entity : ";
dumper.Dump (ent->ViewItem(I),S, sublevel);
S << endl;
S << "Breakpoint parameter : " <<ent->BreakpointParameter(I)<<endl;
S << "Display Flag : " << ent->DisplayFlag(I) << endl;
if ( (ent->ColorDefinition(I)).IsNull() )
{
S << "Color Value : ";
S << ent->ColorValue(I);
}
else
{
S << "Color Definition : ";
dumper.Dump (ent->ColorDefinition(I),S, sublevel);
}
S << endl;
if ( (ent->LineFontDefinition(I)).IsNull() )
{
S << "LineFont Value : " << ent->LineFontValue(I);
}
else
{
S << "LineFont Definition : ";
dumper.Dump (ent->LineFontDefinition(I),S, sublevel);
}
S << endl;
S << "Line Weight : " << ent->LineWeightItem(I) << endl;
}
}
break;
}
S << endl;
}

View File

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

View File

@@ -0,0 +1,156 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_View.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolView.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_TransfEntity.hxx>
#include <IGESGeom_Plane.hxx>
#include <Interface_Macros.hxx>
IGESDraw_ToolView::IGESDraw_ToolView () { }
void IGESDraw_ToolView::ReadOwnParams
(const Handle(IGESDraw_View)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer tempViewNumber;
Standard_Real tempScaleFactor;
Handle(IGESGeom_Plane) tempLeftPlane, tempTopPlane, tempRightPlane;
Handle(IGESGeom_Plane) tempBottomPlane, tempBackPlane, tempFrontPlane;
PR.ReadInteger(PR.Current(), "View Number", tempViewNumber); //szv#4:S4163:12Mar99 `st=` not needed
if (PR.DefinedElseSkip())
PR.ReadReal(PR.Current(), "Scale Factor", tempScaleFactor); //szv#4:S4163:12Mar99 `st=` not needed
else
tempScaleFactor = 1.0; // Setting to default value of 1.0
PR.ReadEntity(IR, PR.Current(), "Left Side Of View Volume",
STANDARD_TYPE(IGESGeom_Plane), tempLeftPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Top Side Of View Volume",
STANDARD_TYPE(IGESGeom_Plane), tempTopPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Right Side Of View Volume",
STANDARD_TYPE(IGESGeom_Plane), tempRightPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Bottom Side Of View Volume",
STANDARD_TYPE(IGESGeom_Plane), tempBottomPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Back Side Of View Volume",
STANDARD_TYPE(IGESGeom_Plane), tempBackPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(), "Front Side Of View Volume",
STANDARD_TYPE(IGESGeom_Plane), tempFrontPlane, Standard_True); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempViewNumber, tempScaleFactor, tempLeftPlane, tempTopPlane,
tempRightPlane, tempBottomPlane, tempBackPlane, tempFrontPlane);
}
void IGESDraw_ToolView::WriteOwnParams
(const Handle(IGESDraw_View)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->ViewNumber());
IW.Send(ent->ScaleFactor());
IW.Send(ent->LeftPlane());
IW.Send(ent->TopPlane());
IW.Send(ent->RightPlane());
IW.Send(ent->BottomPlane());
IW.Send(ent->BackPlane());
IW.Send(ent->FrontPlane());
}
void IGESDraw_ToolView::OwnShared
(const Handle(IGESDraw_View)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->LeftPlane());
iter.GetOneItem(ent->TopPlane());
iter.GetOneItem(ent->RightPlane());
iter.GetOneItem(ent->BottomPlane());
iter.GetOneItem(ent->BackPlane());
iter.GetOneItem(ent->FrontPlane());
}
void IGESDraw_ToolView::OwnCopy
(const Handle(IGESDraw_View)& another,
const Handle(IGESDraw_View)& ent, Interface_CopyTool& TC) const
{
Standard_Integer tempViewNumber = another->ViewNumber();
Standard_Real tempScaleFactor = another->ScaleFactor();
DeclareAndCast(IGESGeom_Plane, tempLeftPlane,
TC.Transferred(another->LeftPlane()));
DeclareAndCast(IGESGeom_Plane, tempTopPlane,
TC.Transferred(another->TopPlane()));
DeclareAndCast(IGESGeom_Plane, tempRightPlane,
TC.Transferred(another->RightPlane()));
DeclareAndCast(IGESGeom_Plane, tempBottomPlane,
TC.Transferred(another->BottomPlane()));
DeclareAndCast(IGESGeom_Plane, tempBackPlane,
TC.Transferred(another->BackPlane()));
DeclareAndCast(IGESGeom_Plane, tempFrontPlane,
TC.Transferred(another->FrontPlane()));
ent->Init(tempViewNumber, tempScaleFactor, tempLeftPlane, tempTopPlane,
tempRightPlane, tempBottomPlane, tempBackPlane, tempFrontPlane);
}
IGESData_DirChecker IGESDraw_ToolView::DirChecker
(const Handle(IGESDraw_View)& /*ent*/) const
{
IGESData_DirChecker DC(410, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagRequired(1);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolView::OwnCheck
(const Handle(IGESDraw_View)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->HasTransf()) {
if (ent->Transf()->FormNumber() != 0)
ach->AddFail("Associated Matrix has not Form Number 0");
}
}
void IGESDraw_ToolView::OwnDump
(const Handle(IGESDraw_View)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_View" << endl;
S << "View Number : " << ent->ViewNumber() << endl;
S << "Scale Factor : " << ent->ScaleFactor() << endl;
S << "Left Plane Of View Volume : ";
dumper.Dump(ent->LeftPlane(),S, tempSubLevel); S << endl;
S << "Top Plane Of View Volume : ";
dumper.Dump(ent->TopPlane(),S, tempSubLevel); S << endl;
S << "Right Plane Of View Volume : ";
dumper.Dump(ent->RightPlane(),S, tempSubLevel); S << endl;
S << "Bottom Plane Of View Volume : ";
dumper.Dump(ent->BottomPlane(),S, tempSubLevel); S << endl;
S << "Back Plane Of View Volume : ";
dumper.Dump(ent->BackPlane(),S, tempSubLevel); S << endl;
S << "Front Plane Of View Volume : ";
dumper.Dump(ent->FrontPlane(),S, tempSubLevel); S << endl;
}

View File

@@ -0,0 +1,80 @@
-- File: IGESDraw_ToolViewsVisible.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolViewsVisible from IGESDraw
---Purpose : Tool to work on a ViewsVisible. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses ViewsVisible from IGESDraw,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolViewsVisible;
---Purpose : Returns a ToolViewsVisible, ready to work
ReadOwnParams (me; ent : mutable ViewsVisible;
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 : ViewsVisible;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : ViewsVisible;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a ViewsVisible <ent>, from
-- its specific (own) parameters shared not implied (the Views)
OwnImplied (me; ent : ViewsVisible;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a ViewsVisible <ent>, from
-- its specific (own) implied parameters : the Displayed Entities
DirChecker (me; ent : ViewsVisible) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : ViewsVisible;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : ViewsVisible; entto : mutable ViewsVisible;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters shared not implied, i.e. all but
-- the Displayed Entities
OwnRenew (me; entfrom : ViewsVisible; entto : mutable ViewsVisible;
TC : CopyTool) is static;
---Purpose : Copies Specific implied Parameters : the Displayed Entities
-- which have already been copied
OwnWhenDelete (me; ent : ViewsVisible) is static;
---Purpose : Clears specific implied parameters, which cause looping
-- structures; required for deletion
OwnDump (me; ent : ViewsVisible;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
OwnCorrect (me; ent : mutable ViewsVisible) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a ViewsVisible
-- (all displayed entities must refer to <ent> in directory part,
-- else the list is cleared)
end ToolViewsVisible;

View File

@@ -0,0 +1,238 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_ViewsVisible.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolViewsVisible.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_ViewKindEntity.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESDraw_HArray1OfViewKindEntity.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
IGESDraw_ToolViewsVisible::IGESDraw_ToolViewsVisible () { }
void IGESDraw_ToolViewsVisible::ReadOwnParams
(const Handle(IGESDraw_ViewsVisible)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer tempNbViewsVisible, tempNbDisplayedEntities;
Handle(IGESDraw_HArray1OfViewKindEntity) tempViewEntities;
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntity;
//st = PR.ReadInteger(PR.Current(), "Number Of Views Visible",
//tempNbViewsVisible); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Number Of Views Visible", tempNbViewsVisible)) {
// Initialise HArray1 only if there is no error reading its Length
if (tempNbViewsVisible <= 0)
PR.AddFail("Number Of Views Visible : Not Positive");
else tempViewEntities = new IGESDraw_HArray1OfViewKindEntity (1, tempNbViewsVisible);
}
if (PR.DefinedElseSkip())
PR.ReadInteger(PR.Current(), "Number of Entities Displayed",
tempNbDisplayedEntities); //szv#4:S4163:12Mar99 `st=` not needed
else {
tempNbDisplayedEntities = 0;
PR.AddWarning("Number of Entities Displayed : undefined, set to Zero");
}
// Initialise HArray1 only if there is no error reading its Length
if (tempNbDisplayedEntities < 0)
PR.AddFail ("Number Of Entities Displayed : Less than Zero");
// else if (tempNbDisplayedEntities > 0) {
if (! tempViewEntities.IsNull()) {
// Read the HArray1 only if its Length was read without any Error
Standard_Integer I;
for (I = 1; I <= tempNbViewsVisible; I++) {
Handle(IGESData_ViewKindEntity) tempViewEntity1;
//st = PR.ReadEntity(IR, PR.Current(), "View Entity",
//STANDARD_TYPE(IGESData_ViewKindEntity), tempViewEntity1); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR, PR.Current(), "View Entity",
STANDARD_TYPE(IGESData_ViewKindEntity), tempViewEntity1))
tempViewEntities->SetValue(I, tempViewEntity1);
}
}
// Read the HArray1 only if its Length was read without any Error
if (tempNbDisplayedEntities > 0) {
PR.ReadEnts (IR,PR.CurrentList(tempNbDisplayedEntities),
"Displayed Entities",tempDisplayEntity); //szv#4:S4163:12Mar99 `st=` not needed
/*
tempDisplayEntity =
new IGESData_HArray1OfIGESEntity (1, tempNbDisplayedEntities);
Handle(IGESData_IGESEntity) tempEntity2;
Standard_Integer I;
for (I = 1; I <= tempNbDisplayedEntities; I++) {
st = PR.ReadEntity(IR, PR.Current(), "Displayed Entity",
tempEntity2);
if (st) tempDisplayEntity->SetValue(I, tempEntity2);
}
*/
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(tempViewEntities, tempDisplayEntity);
}
void IGESDraw_ToolViewsVisible::WriteOwnParams
(const Handle(IGESDraw_ViewsVisible)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->NbViews());
IW.Send(ent->NbDisplayedEntities());
Standard_Integer I;
Standard_Integer up = ent->NbViews();
for (I = 1; I <= up; I++)
IW.Send(ent->ViewItem(I));
up = ent->NbDisplayedEntities();
for (I = 1; I <= up; I++)
IW.Send(ent->DisplayedEntity(I));
}
void IGESDraw_ToolViewsVisible::OwnShared
(const Handle(IGESDraw_ViewsVisible)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer I,up;
up = ent->NbViews();
for (I = 1; I <= up; I++)
iter.GetOneItem(ent->ViewItem(I));
// Displayed -> Implied
}
void IGESDraw_ToolViewsVisible::OwnImplied
(const Handle(IGESDraw_ViewsVisible)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer I,up;
up = ent->NbDisplayedEntities();
for (I = 1; I <= up; I++)
iter.GetOneItem(ent->DisplayedEntity(I));
}
void IGESDraw_ToolViewsVisible::OwnCopy
(const Handle(IGESDraw_ViewsVisible)& another,
const Handle(IGESDraw_ViewsVisible)& ent, Interface_CopyTool& TC) const
{
Handle(IGESDraw_HArray1OfViewKindEntity) tempViewEntities =
new IGESDraw_HArray1OfViewKindEntity(1, another->NbViews());
Standard_Integer I, up;
up = another->NbViews();
for (I = 1; I <= up; I++) {
DeclareAndCast(IGESData_ViewKindEntity, tempView,
TC.Transferred(another->ViewItem(I)));
tempViewEntities->SetValue(I, tempView);
}
// Displayed -> Implied : mettre une liste vide par defaut
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
ent->Init(tempViewEntities, tempDisplayEntities);
}
void IGESDraw_ToolViewsVisible::OwnRenew
(const Handle(IGESDraw_ViewsVisible)& another,
const Handle(IGESDraw_ViewsVisible)& ent, const Interface_CopyTool& TC) const
{
Interface_EntityIterator newdisp;
Standard_Integer I, up;
up = another->NbDisplayedEntities();
if (up == 0) return;
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
Handle(IGESData_IGESEntity) anew;
for (I = 1; I <= up; I++) {
if (TC.Search (another->DisplayedEntity(I),anew)) newdisp.GetOneItem(anew);
}
up = newdisp.NbEntities(); I = 0;
if (up > 0) tempDisplayEntities = new IGESData_HArray1OfIGESEntity(1,up);
for (newdisp.Start(); newdisp.More(); newdisp.Next()) {
I ++;
DeclareAndCast(IGESData_IGESEntity, tempEntity,newdisp.Value());
tempDisplayEntities->SetValue(I, tempEntity);
}
ent->InitImplied (tempDisplayEntities);
}
IGESData_DirChecker IGESDraw_ToolViewsVisible::DirChecker
(const Handle(IGESDraw_ViewsVisible)& /*ent*/) const
{
IGESData_DirChecker DC(402, 3);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(1);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolViewsVisible::OwnCheck
(const Handle(IGESDraw_ViewsVisible)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Integer res = 0;
Standard_Integer nb = ent->NbDisplayedEntities();
Handle(IGESData_ViewKindEntity) entcomp = ent;
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i);
if (entcomp != displayed->View()) res ++;
}
if (!res) return;
char mess[80];
sprintf(mess,"Mismatch for %d Entities displayed",res);
ach->AddFail(mess,"Mismatch for %d Entities displayed");
}
void IGESDraw_ToolViewsVisible::OwnWhenDelete
(const Handle(IGESDraw_ViewsVisible)& ent) const
{
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
ent->InitImplied (tempDisplayEntities);
}
void IGESDraw_ToolViewsVisible::OwnDump
(const Handle(IGESDraw_ViewsVisible)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESDraw_ViewsVisible" << endl;
S << "Views Visible : ";
IGESData_DumpEntities(S,dumper ,level,1, ent->NbViews(),ent->ViewItem);
S << endl;
S << "Entities Displayed : ";
IGESData_DumpEntities
(S,dumper ,level,1, ent->NbDisplayedEntities(),ent->DisplayedEntity);
S << endl;
}
Standard_Boolean IGESDraw_ToolViewsVisible::OwnCorrect
(const Handle(IGESDraw_ViewsVisible)& ent) const
{
// Les entites affichees doivent referencer <ent>. Elles ont priorite.
Standard_Boolean res = Standard_False;
Standard_Integer nb = ent->NbDisplayedEntities();
Handle(IGESData_ViewKindEntity) entcomp = ent;
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i);
if (entcomp != displayed->View()) res = Standard_True;
}
if (!res) return res;
Handle(IGESData_HArray1OfIGESEntity) nulDisplayEntities;
ent->InitImplied (nulDisplayEntities);
return res;
}

View File

@@ -0,0 +1,80 @@
-- File: IGESDraw_ToolViewsVisibleWithAttr.cdl
-- Created: Thu Oct 14 19:16:58 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ToolViewsVisibleWithAttr from IGESDraw
---Purpose : Tool to work on a ViewsVisibleWithAttr. Called by various Modules
-- (ReadWriteModule, GeneralModule, SpecificModule)
uses ViewsVisibleWithAttr from IGESDraw,
IGESReaderData, ParamReader, IGESWriter, EntityIterator,
DirChecker, ShareTool, Check, CopyTool, IGESDumper, Messenger from Message
raises DomainError
is
Create returns ToolViewsVisibleWithAttr;
---Purpose : Returns a ToolViewsVisibleWithAttr, ready to work
ReadOwnParams (me; ent : mutable ViewsVisibleWithAttr;
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 : ViewsVisibleWithAttr;
IW : in out IGESWriter) is static;
---Purpose : Writes own parameters to IGESWriter
OwnShared (me; ent : ViewsVisibleWithAttr;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a ViewsVisibleWithAttr <ent>, from
-- its specific (own) parameters shared not implied, i.e. all but
-- the Displayed Entities
OwnImplied (me; ent : ViewsVisibleWithAttr;
iter : in out EntityIterator) is static;
---Purpose : Lists the Entities shared by a ViewsVisible <ent>, from
-- its specific (own) implied parameters : the Displayed Entities
DirChecker (me; ent : ViewsVisibleWithAttr) returns DirChecker is static;
---Purpose : Returns specific DirChecker
OwnCheck (me; ent : ViewsVisibleWithAttr;
shares : ShareTool; ach : in out Check) is static;
---Purpose : Performs Specific Semantic Check
OwnCopy (me; entfrom : ViewsVisibleWithAttr; entto : mutable ViewsVisibleWithAttr;
TC : in out CopyTool) is static;
---Purpose : Copies Specific Parameters shared not implied, i.e. all but
-- the Displayed Entities
OwnRenew (me; entfrom : ViewsVisibleWithAttr; entto : mutable ViewsVisibleWithAttr;
TC : CopyTool) is static;
---Purpose : Copies Specific implied Parameters : the Displayed Entities
-- which have already been copied
OwnWhenDelete (me; ent : ViewsVisibleWithAttr) is static;
---Purpose : Clears specific implied parameters, which cause looping
-- structures; required for deletion
OwnDump (me; ent : ViewsVisibleWithAttr;
dumper : IGESDumper; S : Messenger from Message; own : Integer)
is static;
---Purpose : Dump of Specific Parameters
OwnCorrect (me; ent : mutable ViewsVisibleWithAttr) returns Boolean is static;
---Purpose : Sets automatic unambiguous Correction on a ViewsVisibleWithAttr
-- (all displayed entities must refer to <ent> in directory part,
-- else the list is cleared)
end ToolViewsVisibleWithAttr;

View File

@@ -0,0 +1,379 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_ViewsVisibleWithAttr.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ToolViewsVisibleWithAttr.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESGraph_Color.hxx>
#include <IGESData_LineFontEntity.hxx>
#include <IGESData_ViewKindEntity.hxx>
#include <IGESDraw_HArray1OfViewKindEntity.hxx>
#include <IGESGraph_HArray1OfColor.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESBasic_HArray1OfLineFontEntity.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
IGESDraw_ToolViewsVisibleWithAttr::IGESDraw_ToolViewsVisibleWithAttr () { }
void IGESDraw_ToolViewsVisibleWithAttr::ReadOwnParams
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer tempNbBlocks, tempNbEntity;
Handle(IGESDraw_HArray1OfViewKindEntity) tempViewEntities;
Handle(IGESGraph_HArray1OfColor) tempColorDefinitions;
Handle(TColStd_HArray1OfInteger) tempLineFonts;
Handle(TColStd_HArray1OfInteger) tempColorValues;
Handle(TColStd_HArray1OfInteger) tempLineWeights;
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
Handle(IGESBasic_HArray1OfLineFontEntity) tempLineDefinitions;
//st = PR.ReadInteger(PR.Current(), "Number Of Blocks", tempNbBlocks); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Number Of Blocks", tempNbBlocks)) {
// Initialise HArray1 only if there is no error reading its Length
if (tempNbBlocks <= 0)
PR.AddFail("Number Of Blocks : Not Positive");
else {
tempViewEntities = new IGESDraw_HArray1OfViewKindEntity(1, tempNbBlocks);
tempLineFonts = new TColStd_HArray1OfInteger(1, tempNbBlocks);
tempLineDefinitions = new IGESBasic_HArray1OfLineFontEntity(1, tempNbBlocks);
tempColorValues = new TColStd_HArray1OfInteger(1, tempNbBlocks);
tempColorDefinitions = new IGESGraph_HArray1OfColor(1, tempNbBlocks);
tempLineWeights = new TColStd_HArray1OfInteger(1, tempNbBlocks);
}
}
if (PR.DefinedElseSkip())
PR.ReadInteger(PR.Current(), "Number of Entities Displayed",
tempNbEntity); //szv#4:S4163:12Mar99 `st=` not needed
else {
tempNbEntity = 0;
PR.AddWarning("Number of Entities Displayed : undefined, set to Zero");
}
// Initialise HArray1 only if there is no error reading its Length
if (tempNbEntity < 0)
PR.AddFail ("Number Of Entities Displayed : Less than Zero");
// Read the HArray1 only if its Length was read without any Error
if (! (tempViewEntities.IsNull())) {
// Assumption : When tempViewEntities != NULL, all other parallel
// arrays are also non-NULL
Standard_Integer I;
for (I = 1; I <= tempNbBlocks; I++) {
Handle(IGESData_ViewKindEntity) tempView;
Standard_Integer tempLineFont;
Handle(IGESData_LineFontEntity) tempEntity1;
Standard_Integer tempColorValue;
Handle(IGESGraph_Color) tempColorDef;
Standard_Integer tempLineWeightValue;
//st = PR.ReadEntity(IR, PR.Current(), "View Entity",
//STANDARD_TYPE(IGESData_ViewKindEntity), tempView); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR, PR.Current(), "View Entity",
STANDARD_TYPE(IGESData_ViewKindEntity), tempView))
tempViewEntities->SetValue(I, tempView);
//st = PR.ReadInteger(PR.Current(), "Line Font Value", tempLineFont); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Line Font Value", tempLineFont))
tempLineFonts->SetValue(I, tempLineFont);
//st = PR.ReadEntity(IR, PR.Current(), "Line Font Definition",
//STANDARD_TYPE(IGESData_LineFontEntity),
//tempEntity1, Standard_True); //szv#4:S4163:12Mar99 moved in if
if (tempLineFont == 0 &&
PR.ReadEntity(IR, PR.Current(), "Line Font Definition",
STANDARD_TYPE(IGESData_LineFontEntity),
tempEntity1, Standard_True))
tempLineDefinitions->SetValue(I, tempEntity1);
Standard_Integer curnum = PR.CurrentNumber();
// Reading Color : Value (>0) or Definition (<0 = D.E. Pointer)
if (PR.DefinedElseSkip())
PR.ReadInteger( PR.Current(), "Color Value", tempColorValue); //szv#4:S4163:12Mar99 `st=` not needed
else {
tempColorValue = 0;
PR.AddWarning ("Color Value : undefined, set to Zero");
}
if (tempColorValue < 0) {
tempColorValues->SetValue(I, -1);
tempColorDef = GetCasted(IGESGraph_Color,PR.ParamEntity(IR,curnum));
if (tempColorDef.IsNull()) PR.AddFail
("A Color Definition Entity is incorrect");
else tempColorDefinitions->SetValue(I, tempColorDef);
}
else
tempColorValues->SetValue(I, tempColorValue);
//st = PR.ReadInteger(PR.Current(), "Line Weight Value",
//tempLineWeightValue); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Line Weight Value", tempLineWeightValue))
tempLineWeights->SetValue(I, tempLineWeightValue);
}
}
// Read the HArray1 only if its Length was read without any Error
if (tempNbEntity > 0) {
PR.ReadEnts (IR,PR.CurrentList(tempNbEntity),
"Displayed Entities",tempDisplayEntities); //szv#4:S4163:12Mar99 `st=` not needed
/*
tempDisplayEntities = new IGESData_HArray1OfIGESEntity (1, tempNbEntity);
Standard_Integer I;
for (I = 1; I <= tempNbEntity; I++) {
Handle(IGESData_IGESEntity) tempEntity3;
st = PR.ReadEntity(IR, PR.Current(), "Entity", tempEntity3);
if (st) tempDisplayEntities->SetValue(I, tempEntity3);
}
*/
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(tempViewEntities, tempLineFonts, tempLineDefinitions,
tempColorValues, tempColorDefinitions, tempLineWeights,
tempDisplayEntities);
}
void IGESDraw_ToolViewsVisibleWithAttr::WriteOwnParams
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer up = ent->NbViews();
IW.Send(up);
IW.Send(ent->NbDisplayedEntities());
Standard_Integer I;
for (I = 1; I <= up; I++) {
IW.Send(ent->ViewItem(I));
IW.Send(ent->LineFontValue(I));
IW.Send(ent->FontDefinition(I)); // controlled by LineFontValue, both sent
if (ent->IsColorDefinition(I))
IW.Send(ent->ColorDefinition(I),Standard_True); // negative
else
IW.Send(ent->ColorValue(I));
IW.Send(ent->LineWeightItem(I));
}
up = ent->NbDisplayedEntities();
for (I = 1; I <= up; I++)
IW.Send(ent->DisplayedEntity(I));
}
void IGESDraw_ToolViewsVisibleWithAttr::OwnShared
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer up = ent->NbViews();
Standard_Integer I;
for (I = 1; I <= up; I++) {
iter.GetOneItem(ent->ViewItem(I));
iter.GetOneItem(ent->FontDefinition(I));
if ( ent->IsColorDefinition(I) )
iter.GetOneItem(ent->ColorDefinition(I));
}
// Displayed -> Implied
}
void IGESDraw_ToolViewsVisibleWithAttr::OwnImplied
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer I,up;
up = ent->NbDisplayedEntities();
for (I = 1; I <= up; I++)
iter.GetOneItem(ent->DisplayedEntity(I));
}
void IGESDraw_ToolViewsVisibleWithAttr::OwnCopy
(const Handle(IGESDraw_ViewsVisibleWithAttr)& another,
const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, Interface_CopyTool& TC) const
{
Standard_Integer I;
Standard_Integer up = another->NbViews();
Handle(IGESDraw_HArray1OfViewKindEntity) tempViewEntities =
new IGESDraw_HArray1OfViewKindEntity(1, up);
Handle(TColStd_HArray1OfInteger) tempLineFonts =
new TColStd_HArray1OfInteger(1, up);
Handle(IGESBasic_HArray1OfLineFontEntity) tempLineDefinitions =
new IGESBasic_HArray1OfLineFontEntity(1, up);
Handle(TColStd_HArray1OfInteger) tempColorValues =
new TColStd_HArray1OfInteger(1, up);
Handle(IGESGraph_HArray1OfColor) tempColorDefinitions =
new IGESGraph_HArray1OfColor(1, up);
Handle(TColStd_HArray1OfInteger) tempLineWeights =
new TColStd_HArray1OfInteger(1, up);
for (I = 1; I <= up; I ++) {
DeclareAndCast(IGESData_ViewKindEntity, tempView,
TC.Transferred(another->ViewItem(I)));
tempViewEntities->SetValue(I,tempView);
Standard_Integer tempLineFont = another->LineFontValue(I);
tempLineFonts->SetValue(I,tempLineFont);
if (another->IsFontDefinition(I)) {
DeclareAndCast(IGESData_LineFontEntity, tempEntity1,
TC.Transferred(another->FontDefinition(I)));
tempLineDefinitions->SetValue(I,tempEntity1);
}
if (another->IsColorDefinition(I)) {
DeclareAndCast(IGESGraph_Color, tempEntity2,
TC.Transferred(another->ColorDefinition(I)));
tempColorDefinitions->SetValue(I,tempEntity2);
}
else {
Standard_Integer tempColorValue = another->ColorValue(I);
tempColorValues->SetValue(I,tempColorValue);
}
Standard_Integer tempLineWeight = another->LineWeightItem(I);
tempLineWeights->SetValue(I, tempLineWeight);
}
// Displayed -> Implied : mettre une liste vide par defaut
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
ent->Init(tempViewEntities, tempLineFonts, tempLineDefinitions,
tempColorValues, tempColorDefinitions, tempLineWeights,
tempDisplayEntities);
}
void IGESDraw_ToolViewsVisibleWithAttr::OwnRenew
(const Handle(IGESDraw_ViewsVisibleWithAttr)& another,
const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, const Interface_CopyTool& TC) const
{
Interface_EntityIterator newdisp;
Standard_Integer I, up;
up = another->NbDisplayedEntities();
if (up == 0) return;
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
Handle(IGESData_IGESEntity) anew;
for (I = 1; I <= up; I++) {
if (TC.Search (another->DisplayedEntity(I),anew)) newdisp.GetOneItem(anew);
}
up = newdisp.NbEntities(); I = 0;
if (up > 0) tempDisplayEntities = new IGESData_HArray1OfIGESEntity(1,up);
for (newdisp.Start(); newdisp.More(); newdisp.Next()) {
I ++;
DeclareAndCast(IGESData_IGESEntity, tempEntity,newdisp.Value());
tempDisplayEntities->SetValue(I, tempEntity);
}
ent->InitImplied (tempDisplayEntities);
}
IGESData_DirChecker IGESDraw_ToolViewsVisibleWithAttr::DirChecker
(const Handle(IGESDraw_ViewsVisibleWithAttr)& /*ent*/) const
{
IGESData_DirChecker DC(402, 4);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(1);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDraw_ToolViewsVisibleWithAttr::OwnCheck
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Integer nb = ent->NbViews();
Standard_Integer i; //svv Jan 10 2000 : porting on DEC
for (i = 1; i <= nb; i ++) {
if (ent->LineFontValue(i) != 0 && ent->IsFontDefinition(i)) ach->AddFail
("At least one Line Font Definition Mismatch (both Value and Entity");
}
Handle(IGESData_ViewKindEntity) entcomp = ent;
Standard_Integer res = 0;
nb = ent->NbDisplayedEntities();
for (i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i);
if (entcomp != displayed->View()) res ++;
}
if (!res) return;
char mess[80];
sprintf(mess,"Mismatch for %d Entities displayed",res);
ach->AddFail(mess,"Mismatch for %d Entities displayed");
}
void IGESDraw_ToolViewsVisibleWithAttr::OwnWhenDelete
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent) const
{
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
ent->InitImplied (tempDisplayEntities);
}
void IGESDraw_ToolViewsVisibleWithAttr::OwnDump
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESDraw_ViewsVisibleWithAttr" << endl;
S << "View Entities : " << endl
<< "Line Font Values : " << endl
<< "Line Font Definitions : " << endl
<< "Color Number/Definitions : " << endl
<< "Line Weights : " << endl;
S << "Count of View Blocks : " << ent->NbViews() << endl;
if (level > 4) { // Level = 4 : nothing to Dump. Level = 5 & 6 : same Dump
Standard_Integer I;
Standard_Integer upper = ent->NbViews();
for (I = 1; I <= upper; I++) {
S << "[" << I << "]: " << endl;
S << "View Entity : ";
dumper.Dump (ent->ViewItem(I),S, tempSubLevel);
S << endl;
if (ent->IsFontDefinition(I)) {
S << "Line Font Definition : ";
dumper.Dump (ent->FontDefinition(I),S, tempSubLevel);
S << endl;
}
else S << "Line Font Value : " << ent->LineFontValue(I) << endl;
if (ent->IsColorDefinition(I)) {
S << "Color Definition : ";
dumper.Dump (ent->ColorDefinition(I),S, tempSubLevel);
S << endl;
}
else S << "Color Value : " << ent->ColorValue(I) << endl;
S << "Line Weight : " << ent->LineWeightItem(I) << endl;
}
}
S << "Displayed Entities : ";
IGESData_DumpEntities
(S,dumper ,level,1, ent->NbDisplayedEntities(),ent->DisplayedEntity);
S << endl;
}
Standard_Boolean IGESDraw_ToolViewsVisibleWithAttr::OwnCorrect
(const Handle(IGESDraw_ViewsVisibleWithAttr)& ent) const
{
// Les entites affichees doivent referencer <ent>. Elles ont priorite.
Standard_Boolean res = Standard_False;
Standard_Integer nb = ent->NbDisplayedEntities();
Handle(IGESData_ViewKindEntity) entcomp = ent;
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i);
if (entcomp != displayed->View()) res = Standard_True;
}
if (!res) return res;
Handle(IGESData_HArray1OfIGESEntity) nulDisplayEntities;
ent->InitImplied (nulDisplayEntities);
return res;
}

143
src/IGESDraw/IGESDraw_View.cdl Executable file
View File

@@ -0,0 +1,143 @@
--
-- File : View.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class View from IGESDraw inherits ViewKindEntity
---Purpose : defines IGES View Entity, Type <410> Form <0>
-- in package IGESDraw
--
-- Used to define a framework for specifying a viewing
-- orientation of an object in three dimensional model
-- space (X,Y,Z). The framework is also used to support
-- the projection of all or part of model space onto a
-- view volume.
uses
TransfEntity from IGESData,
Plane from IGESGeom,
XYZ from gp
raises OutOfRange
is
Create returns mutable View;
-- Specific Methods pertaining to the class
Init (me : mutable;
aViewNum : Integer;
aScale : Real;
aLeftPlane : Plane;
aTopPlane : Plane;
aRightPlane : Plane;
aBottomPlane : Plane;
aBackPlane : Plane;
aFrontPlane : Plane);
---Purpose : This method is used to set fields of the class View
-- - aViewNum : View number
-- - aScale : Scale factor
-- - aLeftPlane : Left plane of view volume
-- - aTopPlane : Top plane of view volume
-- - aRightPlane : Right plane of view volume
-- - aBottomPlane : Bottom plane of view volume
-- - aBackPlane : Back plane of view volume
-- - aFrontPlane : Front plane of view volume
IsSingle (me) returns Boolean;
---Purpose : Returns True (for a single view)
NbViews (me) returns Integer;
---Purpose : Returns 1 (single view)
ViewItem (me; num : Integer) returns ViewKindEntity raises OutOfRange;
---Purpose : For a single view, returns <me> whatever <num>
ViewNumber (me) returns Integer;
---Purpose : returns integer number identifying view orientation
ScaleFactor (me) returns Real;
---Purpose : returns the scale factor(Default = 1.0)
HasLeftPlane (me) returns Boolean;
---Purpose : returns False if left side of view volume is not present
LeftPlane (me) returns Plane;
---Purpose : returns the left side of view volume, or null handle
HasTopPlane (me) returns Boolean;
---Purpose : returns False if top of view volume is not present
TopPlane (me) returns Plane;
---Purpose : returns the top of view volume, or null handle
HasRightPlane (me) returns Boolean;
---Purpose : returns False if right side of view volume is not present
RightPlane (me) returns Plane;
---Purpose : returns the right side of view volume, or null handle
HasBottomPlane (me) returns Boolean;
---Purpose : returns False if bottom of view volume is not present
BottomPlane (me) returns Plane;
---Purpose : returns the bottom of view volume, or null handle
HasBackPlane (me) returns Boolean;
---Purpose : returns False if back of view volume is not present
BackPlane (me) returns Plane;
---Purpose : returns the back of view volume, or null handle
HasFrontPlane (me) returns Boolean;
---Purpose : returns False if front of view volume is not present
FrontPlane (me) returns Plane;
---Purpose : returns the front of view volume, or null handle
ViewMatrix (me) returns TransfEntity;
---Purpose : returns the Transformation Matrix
ModelToView (me; coords : XYZ) returns XYZ;
---Purpose : returns XYZ from the Model space to the View space by
-- applying the View Matrix
fields
--
-- Class : IGESDraw_View
--
-- Purpose : Declaration of the variables specific to a View.
--
-- Reminder : A View Entity is defined by :
-- - a view number for identifying the view orientation
-- - a scale factor, and
-- - a view volume to control the projection of the view into
-- a 2-D drawing space specified by a Drawing Entity.
-- The view volume is a rectangular parallelepiped with
-- limits specified by Plane Entities.
--
theViewNumber : Integer;
theScaleFactor : Real;
theLeftPlane : Plane;
theTopPlane : Plane;
theRightPlane : Plane;
theBottomPlane : Plane;
theBackPlane : Plane;
theFrontPlane : Plane;
end View;

134
src/IGESDraw/IGESDraw_View.cxx Executable file
View File

@@ -0,0 +1,134 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_View.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_View.ixx>
#include <gp_GTrsf.hxx>
IGESDraw_View::IGESDraw_View () { }
// This class inherits from IGESData_ViewKindEntity
void IGESDraw_View::Init
(const Standard_Integer aViewNum,
const Standard_Real aScale,
const Handle(IGESGeom_Plane)& aLeftPlane,
const Handle(IGESGeom_Plane)& aTopPlane,
const Handle(IGESGeom_Plane)& aRightPlane,
const Handle(IGESGeom_Plane)& aBottomPlane,
const Handle(IGESGeom_Plane)& aBackPlane,
const Handle(IGESGeom_Plane)& aFrontPlane)
{
theViewNumber = aViewNum;
theScaleFactor = aScale;
theLeftPlane = aLeftPlane;
theTopPlane = aTopPlane;
theRightPlane = aRightPlane;
theBottomPlane = aBottomPlane;
theBackPlane = aBackPlane;
theFrontPlane = aFrontPlane;
InitTypeAndForm(410,0);
}
Standard_Boolean IGESDraw_View::IsSingle () const
{
return Standard_True;
// Redefined to return TRUE
}
Standard_Integer IGESDraw_View::NbViews () const
{ return 1; }
Handle(IGESData_ViewKindEntity) IGESDraw_View::ViewItem
(const Standard_Integer) const
{ return Handle(IGESData_ViewKindEntity)::DownCast (This()); }
Standard_Integer IGESDraw_View::ViewNumber () const
{
return theViewNumber;
}
Standard_Real IGESDraw_View::ScaleFactor () const
{
return theScaleFactor;
}
Standard_Boolean IGESDraw_View::HasLeftPlane () const
{
return (! theLeftPlane.IsNull());
}
Handle(IGESGeom_Plane) IGESDraw_View::LeftPlane () const
{
return theLeftPlane;
}
Standard_Boolean IGESDraw_View::HasTopPlane () const
{
return (! theTopPlane.IsNull());
}
Handle(IGESGeom_Plane) IGESDraw_View::TopPlane () const
{
return theTopPlane;
}
Standard_Boolean IGESDraw_View::HasRightPlane () const
{
return (! theRightPlane.IsNull());
}
Handle(IGESGeom_Plane) IGESDraw_View::RightPlane () const
{
return theRightPlane;
}
Standard_Boolean IGESDraw_View::HasBottomPlane () const
{
return (! theBottomPlane.IsNull());
}
Handle(IGESGeom_Plane) IGESDraw_View::BottomPlane () const
{
return theBottomPlane;
}
Standard_Boolean IGESDraw_View::HasBackPlane () const
{
return (! theBackPlane.IsNull());
}
Handle(IGESGeom_Plane) IGESDraw_View::BackPlane () const
{
return theBackPlane;
}
Standard_Boolean IGESDraw_View::HasFrontPlane () const
{
return (! theFrontPlane.IsNull());
}
Handle(IGESGeom_Plane) IGESDraw_View::FrontPlane () const
{
return theFrontPlane;
}
Handle(IGESData_TransfEntity) IGESDraw_View::ViewMatrix () const
{
return (Transf());
}
gp_XYZ IGESDraw_View::ModelToView (const gp_XYZ& coords) const
{
gp_XYZ tempCoords = coords;
Location().Transforms(tempCoords);
return (tempCoords);
}

View File

@@ -0,0 +1,83 @@
--
-- File : ViewsVisible.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class ViewsVisible from IGESDraw inherits ViewKindEntity
---Purpose : Defines IGESViewsVisible, Type <402>, Form <3>
-- in package IGESDraw
--
-- If an entity is to be displayed in more than one views,
-- this class instance is used, which contains the Visible
-- views and the associated entity Displays.
uses
IGESEntity from IGESData,
HArray1OfIGESEntity from IGESData,
HArray1OfViewKindEntity from IGESDraw
raises OutOfRange
is
Create returns mutable ViewsVisible;
-- Specific Methods pertaining to the class
Init (me : mutable;
allViewEntities : HArray1OfViewKindEntity;
allDisplayEntity : HArray1OfIGESEntity);
---Purpose : This method is used to set the fields of the class
-- ViewsVisible
-- - allViewEntities : All View kind entities
-- - allDisplayEntity : All entities whose display is specified
InitImplied (me : mutable; allDisplayEntity : HArray1OfIGESEntity);
---Purpose : Changes only the list of Displayed Entities (Null allowed)
IsSingle (me) returns Boolean;
---Purpose : Returns False (for a complex view)
NbViews (me) returns Integer;
---Purpose : returns the Number of views visible
NbDisplayedEntities (me) returns Integer;
---Purpose : returns the number of entities displayed in the Views or zero if
-- no Entities specified in these Views
ViewItem (me; Index : Integer) returns ViewKindEntity
raises OutOfRange;
---Purpose : returns the Index'th ViewKindEntity Entity
-- raises exception if Index <= 0 or Index > NbViewsVisible()
DisplayedEntity (me; Index : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns the Index'th entity whose display is being specified by
-- this associativity instance
-- raises exception if Index <= 0 or Index > NbEntityDisplayed()
fields
--
-- Class : IGESDraw_ViewsVisible
--
-- Purpose : Declaration of the variables specific to a ViewsVisible.
--
-- Reminder : A ViewsVisible is defined by :
-- - Number of View visible
-- - Pointer to each of the view entity visible
-- - Number of entities whose display is specified
-- - Pointer to each of those entities
--
theViewEntities : HArray1OfViewKindEntity;
theDisplayEntity : HArray1OfIGESEntity;
end ViewsVisible;

View File

@@ -0,0 +1,73 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_ViewsVisible.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ViewsVisible.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESDraw_ViewsVisible::IGESDraw_ViewsVisible () { }
// This class inherits from IGESData_ViewKindEntity
void IGESDraw_ViewsVisible::Init
(const Handle(IGESDraw_HArray1OfViewKindEntity)& allViewEntities,
const Handle(IGESData_HArray1OfIGESEntity)& allDisplayEntity)
{
if (!allDisplayEntity.IsNull())
if (allDisplayEntity->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisible : Init");
if (!allViewEntities.IsNull())
if (allViewEntities->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisible : Init");
theViewEntities = allViewEntities;
theDisplayEntity = allDisplayEntity;
InitTypeAndForm(402,3);
}
void IGESDraw_ViewsVisible::InitImplied
(const Handle(IGESData_HArray1OfIGESEntity)& allDisplayEntity)
{
if (!allDisplayEntity.IsNull())
if (allDisplayEntity->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisible : InitImplied");
theDisplayEntity = allDisplayEntity;
}
Standard_Boolean IGESDraw_ViewsVisible::IsSingle () const
{
return Standard_False;
// Is Redefined to return FALSE
}
Standard_Integer IGESDraw_ViewsVisible::NbViews () const
{
return (theViewEntities.IsNull() ? 0 : theViewEntities->Length());
}
Standard_Integer IGESDraw_ViewsVisible::NbDisplayedEntities () const
{
return (theDisplayEntity.IsNull() ? 0 : theDisplayEntity->Length());
// return 0 if HArray1 theDisplayEntity is NULL Handle
}
Handle(IGESData_ViewKindEntity) IGESDraw_ViewsVisible::ViewItem
(const Standard_Integer Index) const
{
return theViewEntities->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Handle(IGESData_IGESEntity) IGESDraw_ViewsVisible::DisplayedEntity
(const Standard_Integer Index) const
{
return theDisplayEntity->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
// if (theDisplayEntity.IsNull()) then NoSuchObject Exception is raised
}

View File

@@ -0,0 +1,155 @@
--
-- File : ViewsVisibleWithAttr.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class ViewsVisibleWithAttr from IGESDraw inherits ViewKindEntity
---Purpose : defines IGESViewsVisibleWithAttr, Type <402>, Form <4>
-- in package IGESDraw
--
-- This class is extension of Class ViewsVisible. It is used
-- for those entities that are visible in multiple views, but
-- must have a different line font, color number, or
-- line weight in each view.
uses
IGESEntity from IGESData,
Color from IGESGraph,
HArray1OfInteger from TColStd,
LineFontEntity from IGESData,
HArray1OfViewKindEntity from IGESDraw,
HArray1OfIGESEntity from IGESData,
HArray1OfLineFontEntity from IGESBasic,
HArray1OfColor from IGESGraph
raises DimensionMismatch, OutOfRange
is
Create returns mutable ViewsVisibleWithAttr;
-- Specific Methods pertaining to the class
Init (me : mutable;
allViewEntities : HArray1OfViewKindEntity;
allLineFonts : HArray1OfInteger;
allLineDefinitions : HArray1OfLineFontEntity;
allColorValues : HArray1OfInteger;
allColorDefinitions : HArray1OfColor;
allLineWeights : HArray1OfInteger;
allDisplayEntities : HArray1OfIGESEntity)
raises DimensionMismatch;
---Purpose : This method is used to set fields of the class
-- ViewsVisibleWithAttr
-- - allViewEntities : All View kind entities
-- - allLineFonts : All Line Font values or zero(0)
-- - allLineDefinitions : Line Font Definition
-- (if Line Font value = 0)
-- - allColorValues : All Color values
-- - allColorDefinitions : All Color Definition Entities
-- - allLineWeights : All Line Weight values
-- - allDisplayEntities : Entities which are member of
-- this associativity
-- raises exception if Lengths of allViewEntities, allLineFonts,
-- allColorValues,allColorDefinitions, allLineWeights are not same
InitImplied (me : mutable; allDisplayEntity : HArray1OfIGESEntity);
---Purpose : Changes only the list of Displayed Entities (Null allowed)
IsSingle (me) returns Boolean;
---Purpose : Returns False (for a complex view)
NbViews (me) returns Integer;
---Purpose : returns the number of Views containing the view visible, line font,
-- color number, and line weight information
NbDisplayedEntities (me) returns Integer;
---Purpose : returns the number of entities which have this particular set of
-- display characteristic, or zero if no Entities specified
ViewItem (me; Index : Integer) returns ViewKindEntity
raises OutOfRange;
---Purpose : returns the Index'th ViewKindEntity entity
-- raises exception if Index <= 0 or Index > NbViews()
LineFontValue (me; Index : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Index'th Line font value or zero
-- raises exception if Index <= 0 or Index > NbViews()
IsFontDefinition (me; Index : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns True if the Index'th Line Font Definition is specified
-- else returns False
-- raises exception if Index <= 0 or Index > NbViews()
FontDefinition (me; Index : Integer) returns LineFontEntity
raises OutOfRange;
---Purpose : returns the Index'th Line Font Definition Entity or NULL(0)
-- raises exception if Index <= 0 or Index > NbViews()
ColorValue (me; Index: Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Index'th Color number value
-- raises exception if Index <= 0 or Index > NbViews()
IsColorDefinition (me; Index : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns True if Index'th Color Definition is specified
-- else returns False
-- raises exception if Index <= 0 or Index > NbViews()
ColorDefinition (me; Index : Integer) returns Color
raises OutOfRange;
---Purpose : returns the Index'th Color Definition Entity
-- raises exception if Index <= 0 or Index > NbViews()
LineWeightItem (me; Index : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Index'th Color Line Weight
-- raises exception if Index <= 0 or Index > NbViews()
DisplayedEntity (me; Index : Integer) returns IGESEntity
raises OutOfRange;
---Purpose : returns Index'th Display entity with this particular characteristics
-- raises exception if Index <= 0 or Index > NbEntities()
fields
--
-- Class : IGESDraw_ViewsVisibleWithAttr
--
-- Purpose : Declaration of the variables specific to a ViewsVisibleWithAttr.
--
-- Reminder : A ViewsVisibleWithAttr is defined by :
-- - the number of blocks containing Views visible, line font,
-- color number, or the line weight in each view
-- - Number of Entities which have this characteristics
-- - Line Font value or zero(0)
-- - Pointer to Line Font Definition if Line Font value = 0
-- - Color value or pointer to Color Definition Entity
-- - Line Weight value
-- - Entities which are member of this associativity
--
theViewEntities : HArray1OfViewKindEntity;
theLineFonts : HArray1OfInteger;
theLineDefinitions : HArray1OfLineFontEntity;
theColorValues : HArray1OfInteger;
theColorDefinitions : HArray1OfColor;
theLineWeights : HArray1OfInteger;
theDisplayEntities : HArray1OfIGESEntity;
end ViewsVisibleWithAttr;

View File

@@ -0,0 +1,139 @@
//--------------------------------------------------------------------
//
// File Name : IGESDraw_ViewsVisibleWithAttr.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDraw_ViewsVisibleWithAttr.ixx>
IGESDraw_ViewsVisibleWithAttr::IGESDraw_ViewsVisibleWithAttr () { }
// This class inherits from IGESData_ViewKindEntity
void IGESDraw_ViewsVisibleWithAttr::Init
(const Handle(IGESDraw_HArray1OfViewKindEntity)& allViewEntities,
const Handle(TColStd_HArray1OfInteger)& allLineFonts,
const Handle(IGESBasic_HArray1OfLineFontEntity)& allLineDefinitions,
const Handle(TColStd_HArray1OfInteger)& allColorValues,
const Handle(IGESGraph_HArray1OfColor)& allColorDefinitions,
const Handle(TColStd_HArray1OfInteger)& allLineWeights,
const Handle(IGESData_HArray1OfIGESEntity)& allDisplayEntities)
{
if (!allViewEntities.IsNull()) {
Standard_Integer Exp = allViewEntities->Length();
if ( allViewEntities->Lower() != 1 ||
(allLineFonts->Lower() != 1 || allLineFonts->Length() != Exp) ||
(allColorValues->Lower() != 1 || allColorValues->Length() != Exp) ||
(allLineWeights->Lower() != 1 || allLineWeights->Length() != Exp) ||
(allLineDefinitions->Lower() != 1 || allLineDefinitions->Length() != Exp) ||
(allColorDefinitions->Lower() != 1 || allColorDefinitions->Length() != Exp))
Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisibleWithAttr : Init");
}
if (!allDisplayEntities.IsNull())
if (allDisplayEntities->Lower() != 1) Standard_DimensionMismatch::Raise
("IGESDraw_ViewsVisibleWithAttr : Init");
theViewEntities = allViewEntities;
theLineFonts = allLineFonts;
theLineDefinitions = allLineDefinitions;
theColorValues = allColorValues;
theColorDefinitions = allColorDefinitions;
theLineWeights = allLineWeights;
theDisplayEntities = allDisplayEntities;
InitTypeAndForm(402,4);
}
void IGESDraw_ViewsVisibleWithAttr::InitImplied
(const Handle(IGESData_HArray1OfIGESEntity)& allDisplayEntity)
{
if (!allDisplayEntity.IsNull())
if (allDisplayEntity->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisibleWithAttr : InitImplied");
theDisplayEntities = allDisplayEntity;
}
Standard_Boolean IGESDraw_ViewsVisibleWithAttr::IsSingle () const
{
return Standard_False;
// Is redefined to return Standard_Flase, since <me> contains list of Views
}
Standard_Integer IGESDraw_ViewsVisibleWithAttr::NbViews () const
{
return (theViewEntities.IsNull() ? 0 : theViewEntities->Length());
}
Standard_Integer IGESDraw_ViewsVisibleWithAttr::NbDisplayedEntities () const
{
return (theDisplayEntities.IsNull() ? 0 : theDisplayEntities->Length());
// Return 0 if HArray1 theDisplyEntities id NULL Handle
}
Handle(IGESData_ViewKindEntity) IGESDraw_ViewsVisibleWithAttr::ViewItem
(const Standard_Integer Index) const
{
return theViewEntities->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Standard_Integer IGESDraw_ViewsVisibleWithAttr::LineFontValue
(const Standard_Integer Index) const
{
return theLineFonts->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Standard_Boolean IGESDraw_ViewsVisibleWithAttr::IsFontDefinition
(const Standard_Integer Index) const
{
return (! (theLineDefinitions->Value(Index)).IsNull());
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Handle(IGESData_LineFontEntity) IGESDraw_ViewsVisibleWithAttr::FontDefinition
(const Standard_Integer Index) const
{
return theLineDefinitions->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Standard_Integer IGESDraw_ViewsVisibleWithAttr::ColorValue
(const Standard_Integer Index) const
{
return theColorValues->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Standard_Boolean IGESDraw_ViewsVisibleWithAttr::IsColorDefinition
(const Standard_Integer Index) const
{
return (! (theColorDefinitions->Value(Index)).IsNull());
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Handle(IGESGraph_Color) IGESDraw_ViewsVisibleWithAttr::ColorDefinition
(const Standard_Integer Index) const
{
return theColorDefinitions->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Standard_Integer IGESDraw_ViewsVisibleWithAttr::LineWeightItem
(const Standard_Integer Index) const
{
return theLineWeights->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Handle(IGESData_IGESEntity) IGESDraw_ViewsVisibleWithAttr::DisplayedEntity
(const Standard_Integer Index) const
{
return theDisplayEntities->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
// if (theDisplayEntity.IsNull()) then NoSuchObject Exception is raised
}