1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +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

157
src/IGESGraph/IGESGraph.cdl Executable file
View File

@@ -0,0 +1,157 @@
--
-- File : IGESGraph.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen (TCD)
--
---Copyright:
--
package IGESGraph
---Purpose : This package contains the group of classes necessary
-- to define Graphic data among Structure Entities.
-- (e.g., Fonts, Colors, Screen management ...)
uses
Standard,
TCollection,
gp,
TColgp,
TColStd,
Message,
Interface,
IGESData,
IGESBasic
is
class LineFontDefTemplate;
-- type <304> form <1>
---Purpose : Line Font Def can be defined as a repetition of Template
-- figure that is displayed at regularly spaced locations
-- along a planar anchoring curve. The anchoring curve
-- itself has no visual purpose.
class LineFontDefPattern;
-- type <304> form <2>
---Purpose : Line Font Def may be defined by repetition of a basic
-- pattern of visible-blank(or, on-off) segments
-- superimposed on a line or a curve. The line or curve
-- is then displayed according to the basic pattern.
class TextFontDef;
-- type <310>
---Purpose : Used to define the appearance of characters in a text
-- font. It may be used to describe a complete font or a
-- modification to a subset of characters in another font.
class TextDisplayTemplate;
-- type <312> form <0, 1>
---Purpose : Used to set parameters for display of information
-- which has been logically included in another entity
-- as a parameter value.
class Color;
-- type <314>
---Purpose : The Color Definition Entity is used to communicate the
-- relationship of primary colors to the intensity level of
-- the respective graphics devices as a percent of full
-- intensity range.
class DefinitionLevel;
-- type <406> form <1>
---Purpose : Indicates the no. of levels on which an entity is
-- defined.
class NominalSize;
-- type <406> form <13>
---Purpose : Specifies a value, a name, and optionally a
-- reference to an engineering standard.
class DrawingSize;
-- type <406> form <16>
---Purpose : Specifies the drawing size in drawing units. The
-- origin of the drawing is defined to be (0,0) in
-- drawing space.
class DrawingUnits;
-- type <406> form <17>
---Purpose : Specifies the drawing space units as outlined
-- in the Drawing entity.
class IntercharacterSpacing;
-- type <406> form <18>
---Purpose : Specifies the gap between letters when fixed-pitch
-- spacing is used.
class LineFontPredefined;
-- type <406> form <19>
---Purpose : Provides the ability to specify a line font pattern
-- from a predefined list rather than from
-- Directory Entry Field 4.
class HighLight;
-- type <406> form <20>
---Purpose : Attaches information that an entity is to be
-- displayed in some system dependent manner.
class Pick;
-- type <406> form <21>
---Purpose : Attaches information that an entity may be picked
-- by whatever pick device is used in the receiving
-- system.
class UniformRectGrid;
-- type <406> form <22>
---Purpose : Stores sufficient information for the creation of
-- a uniform rectangular grid within a drawing.
-- Tools for Entities --
class ToolLineFontDefTemplate;
class ToolLineFontDefPattern;
class ToolTextFontDef;
class ToolTextDisplayTemplate;
class ToolColor;
class ToolDefinitionLevel;
class ToolNominalSize;
class ToolDrawingSize;
class ToolDrawingUnits;
class ToolIntercharacterSpacing;
class ToolLineFontPredefined;
class ToolHighLight;
class ToolPick;
class ToolUniformRectGrid;
-- Definition and Exploitation of Entities defined in this Package
class Protocol;
class ReadWriteModule;
class GeneralModule;
class SpecificModule;
-- The class instantiations :
class Array1OfColor instantiates Array1 from TCollection (Color);
class Array1OfTextDisplayTemplate instantiates
Array1 from TCollection (TextDisplayTemplate);
class Array1OfTextFontDef instantiates
Array1 from TCollection (TextFontDef);
class HArray1OfColor instantiates HArray1 from TCollection
(Color,Array1OfColor);
class HArray1OfTextDisplayTemplate instantiates HArray1 from TCollection
(TextDisplayTemplate,Array1OfTextDisplayTemplate);
class HArray1OfTextFontDef instantiates HArray1 from TCollection
(TextFontDef,Array1OfTextFontDef);
-- Package Methods
Init;
---Purpose : Prepares dynamic data (Protocol, Modules) for this package
Protocol returns Protocol from IGESGraph;
---Purpose : Returns the Protocol for this Package
end IGESGraph;

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

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

View File

@@ -0,0 +1,98 @@
--
-- File : Color.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class Color from IGESGraph inherits ColorEntity
---Purpose : defines IGESColor, Type <314> Form <0>
-- in package IGESGraph
--
-- The Color Definition Entity is used to communicate the
-- relationship of primary colors to the intensity level of
-- the respective graphics devices as a percent of full
-- intensity range.
uses
IGESEntity from IGESData,
HAsciiString from TCollection
is
Create returns mutable Color;
-- Specific Methods pertaining to class
Init (me : mutable;
red : Real;
green : Real;
blue : Real;
aColorName : HAsciiString);
---Purpose : This method is used to set the fields of the class Color
-- - red : Red color intensity (range 0.0 to 100.0)
-- - green : Green color intensity (range 0.0 to 100.0)
-- - blue : Blue color intensity (range 0.0 to 100.0)
-- - aColorName : Name of the color (optional)
RGBIntensity (me; Red, Green, Blue : out Real);
-- returns the RGB intensities in the Red, Green, Blue
-- fields respectively
CMYIntensity (me; Cyan, Magenta, Yellow : out Real);
-- returns the CMY equivalents of RGB intensities.
--
-- The algorithm used for getting CMY from RGB is :
--
-- C = 100.0 - R where : R = red C = cyan
-- G = 100.0 - M G = green M = magenta
-- B = 100.0 - Y B = blue Y = yellow
--
HLSPercentage (me; Hue, Lightness, Saturation : out Real);
-- returns the HLS equivalents of RGB intensities.
--
-- The algorithm used for getting HLS from RGB is :
--
-- H = (1/(2*PI))*ARCTAN((2*R - G - B) / (SQUAREROOT(3)*(G - B)))
-- L = (1 / 3)*(R + G + B)
-- S = SQUAREROOT(R*R + G*G + B*B - R*G - R*B - B*G)
--
-- where H = Hue, L = Lightness, S = Saturation,
-- PI = 3.14... (constant)
--
HasColorName (me) returns Boolean;
---Purpose : returns True if optional character string is assigned,
-- False otherwise.
ColorName (me) returns HAsciiString from TCollection;
---Purpose : if HasColorName() is True returns the Verbal description of
-- the Color.
fields
--
-- Class : IGESGraph_Color
--
-- Purpose : Declaration of the variables specific to Color
--
-- Reminder : A Color is defined by :
-- - Red color intensity
-- - Green color intensity
-- - Blue color intensity
-- - Optional name of the color
--
theRed : Real;
theGreen : Real;
theBlue : Real;
theColorName : HAsciiString;
end Color;

View File

@@ -0,0 +1,70 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_Color.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_Color.ixx>
IGESGraph_Color::IGESGraph_Color () { }
// This class inherits from IGESData_ColorEntity
void IGESGraph_Color::Init
(const Standard_Real red,
const Standard_Real green,
const Standard_Real blue,
const Handle(TCollection_HAsciiString)& aColorName)
{
theRed = red;
theGreen = green;
theBlue = blue;
theColorName = aColorName;
InitTypeAndForm(314,0);
}
void IGESGraph_Color::RGBIntensity
(Standard_Real& Red, Standard_Real& Green, Standard_Real& Blue) const
{
Red = theRed;
Green = theGreen;
Blue = theBlue;
}
void IGESGraph_Color::CMYIntensity
(Standard_Real& Cyan, Standard_Real& Magenta, Standard_Real& Yellow) const
{
Cyan = 100.0 - theRed;
Magenta = 100.0 - theGreen;
Yellow = 100.0 - theBlue;
}
void IGESGraph_Color::HLSPercentage
(Standard_Real& Hue, Standard_Real& Lightness, Standard_Real& Saturation) const
{
Hue = ((1.0 / (2.0 * PI)) *
(ATan(((2 * theRed) - theGreen - theBlue) /
(Sqrt(3) * (theGreen - theBlue)))));
Lightness = ((1.0 / 3.0) * (theRed + theGreen + theBlue));
Saturation = (Sqrt((theRed * theRed ) +
(theGreen * theGreen) +
(theBlue * theBlue ) -
(theRed * theGreen) -
(theRed * theBlue ) -
(theBlue * theGreen)));
}
Standard_Boolean IGESGraph_Color::HasColorName () const
{
return (! theColorName.IsNull());
}
Handle(TCollection_HAsciiString) IGESGraph_Color::ColorName () const
{
return theColorName;
}

View File

@@ -0,0 +1,60 @@
--
-- File : DefinitionLevel.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class DefinitionLevel from IGESGraph inherits LevelListEntity
---Purpose: defines IGESDefinitionLevel, Type <406> Form <1>
-- in package IGESGraph
--
-- Indicates the no. of levels on which an entity is
-- defined
uses
IGESEntity from IGESData,
HArray1OfInteger from TColStd
raises OutOfRange
is
Create returns mutable DefinitionLevel;
-- Specific Methods pertaining to the class
Init (me : mutable;
allLevelNumbers : HArray1OfInteger);
---Purpose : This method is used to set the fields of the class
-- DefinitionLevel
-- - allLevelNumbers : Values of Level Numbers
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me>
NbLevelNumbers (me) returns Integer;
---Purpose : Must return the count of levels (== NbPropertyValues)
LevelNumber (me; LevelIndex : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Level Number of <me> indicated by <LevelIndex>
-- raises an exception if LevelIndex is <= 0 or
-- LevelIndex > NbPropertyValues
fields
--
-- Class : IGESGraph_DefinitionLevel
--
-- Purpose : Declaration of the variables specific to a Definition Level.
--
-- Reminder : A Definition Level is defined by :
-- - Level Numbers
theLevelNumbers : HArray1OfInteger;
end DefinitionLevel;

View File

@@ -0,0 +1,40 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_DefinitionLevel.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_DefinitionLevel.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESGraph_DefinitionLevel::IGESGraph_DefinitionLevel () { }
void IGESGraph_DefinitionLevel::Init
(const Handle(TColStd_HArray1OfInteger)& allLevelNumbers)
{
if (allLevelNumbers->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESGraph_DefinitionLevel : Init");
theLevelNumbers = allLevelNumbers;
InitTypeAndForm(406,1);
}
Standard_Integer IGESGraph_DefinitionLevel::NbPropertyValues () const
{
return ( theLevelNumbers->Length() );
}
Standard_Integer IGESGraph_DefinitionLevel::NbLevelNumbers () const
{
return ( theLevelNumbers->Length() );
}
Standard_Integer IGESGraph_DefinitionLevel::LevelNumber
(const Standard_Integer LevelIndex) const
{
return ( theLevelNumbers->Value(LevelIndex) );
}

View File

@@ -0,0 +1,67 @@
--
-- File : DrawingSize.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class DrawingSize from IGESGraph inherits IGESEntity
---Purpose: defines IGESDrawingSize, Type <406> Form <16>
-- in package IGESGraph
--
-- Specifies the drawing size in drawing units. The
-- origin of the drawing is defined to be (0,0) in
-- drawing space
uses Integer, Real -- no one specific type
is
Create returns mutable DrawingSize;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
aXSize : Real;
aYSize : Real);
---Purpose : This method is used to set the fields of the class
-- DrawingSize
-- - nbProps : Number of property values (NP = 2)
-- - aXSize : Extent of Drawing along positive XD axis
-- - aYSize : Extent of Drawing along positive YD axis
-- Specific Access Methods : According to each type of Entity
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me> (NP = 2)
XSize (me) returns Real;
---Purpose : returns the extent of Drawing along positive XD axis
YSize (me) returns Real;
---Purpose : returns the extent of Drawing along positive YD axis
fields
--
-- Class : IGESGraph_DrawingSize
--
-- Purpose : Declaration of the variables specific to a Drawing Size.
--
-- Reminder : A Drawing Size is defined by :
-- - Number of property values
-- - X Size
-- - Y Size
--
theNbPropertyValues : Integer;
theXSize : Real;
theYSize : Real;
end DrawingSize;

View File

@@ -0,0 +1,39 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_DrawingSize.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_DrawingSize.ixx>
IGESGraph_DrawingSize::IGESGraph_DrawingSize () { }
void IGESGraph_DrawingSize::Init
(const Standard_Integer nbProps, const Standard_Real aXSize,
const Standard_Real aYSize)
{
theNbPropertyValues = nbProps;
theXSize = aXSize;
theYSize = aYSize;
InitTypeAndForm(406,16);
}
Standard_Integer IGESGraph_DrawingSize::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Real IGESGraph_DrawingSize::XSize () const
{
return theXSize;
}
Standard_Real IGESGraph_DrawingSize::YSize () const
{
return theYSize;
}

View File

@@ -0,0 +1,71 @@
--
-- File : DrawingUnits.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class DrawingUnits from IGESGraph inherits IGESEntity
---Purpose: defines IGESDrawingUnits, Type <406> Form <17>
-- in package IGESGraph
--
-- Specifies the drawing space units as outlined
-- in the Drawing entity
uses
HAsciiString from TCollection
is
Create returns mutable DrawingUnits;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
aFlag : Integer;
aUnit : HAsciiString from TCollection);
---Purpose : This method is used to set the fields of the class
-- DrawingUnits
-- - nbProps : Number of property values (NP = 2)
-- - aFlag : DrawingUnits Flag
-- - aUnit : DrawingUnits Name
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me>
Flag (me) returns Integer;
---Purpose : returns the drawing space units of <me>
Unit (me) returns HAsciiString from TCollection;
---Purpose : returns the name of the drawing space units of <me>
-- additionnal information, deducted from Flag
UnitValue (me) returns Real;
---Purpose : Computes the value of the unit, in meters, according Flag
-- (same values as for GlobalSection from IGESData)
fields
--
-- Class : IGESGraph_DrawingUnits
--
-- Purpose : Declaration of the variables specific to a Drawing Unit.
--
-- Reminder : A Drawing Unit is defined by :
-- - Number of property values (NP = 2)
-- - Units Flag
-- - Units Name
--
theNbPropertyValues : Integer;
theFlag : Integer;
theUnit : HAsciiString from TCollection;
end DrawingUnits;

View File

@@ -0,0 +1,58 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_DrawingUnits.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_DrawingUnits.ixx>
IGESGraph_DrawingUnits::IGESGraph_DrawingUnits () { }
void IGESGraph_DrawingUnits::Init
(const Standard_Integer nbProps, const Standard_Integer aFlag,
const Handle(TCollection_HAsciiString)& anUnit)
{
theNbPropertyValues = nbProps;
theFlag = aFlag;
theUnit = anUnit;
InitTypeAndForm(406,17);
}
Standard_Integer IGESGraph_DrawingUnits::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Integer IGESGraph_DrawingUnits::Flag () const
{
return theFlag;
}
Handle(TCollection_HAsciiString) IGESGraph_DrawingUnits::Unit () const
{
return theUnit;
}
Standard_Real IGESGraph_DrawingUnits::UnitValue () const
{
switch (theFlag) {
case 1 : return 0.0254;
case 2 : return 0.001;
case 3 : return 1.;
case 4 : return 0.3048;
case 5 : return 1609.27;
case 6 : return 1.;
case 7 : return 1000.;
case 8 : return 0.0000254;
case 9 : return 0.000001;
case 10 : return 0.01;
case 11 : return 0.0000000254;
default : break;
}
return 1.;
}

View File

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

View File

@@ -0,0 +1,494 @@
#include <IGESGraph_GeneralModule.ixx>
#include <Interface_Macros.hxx>
#include <Interface_Category.hxx>
#include <IGESGraph_Color.hxx>
#include <IGESGraph_DefinitionLevel.hxx>
#include <IGESGraph_DrawingSize.hxx>
#include <IGESGraph_DrawingUnits.hxx>
#include <IGESGraph_HighLight.hxx>
#include <IGESGraph_IntercharacterSpacing.hxx>
#include <IGESGraph_LineFontDefPattern.hxx>
#include <IGESGraph_LineFontPredefined.hxx>
#include <IGESGraph_LineFontDefTemplate.hxx>
#include <IGESGraph_NominalSize.hxx>
#include <IGESGraph_Pick.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <IGESGraph_TextFontDef.hxx>
#include <IGESGraph_UniformRectGrid.hxx>
#include <IGESGraph_ToolColor.hxx>
#include <IGESGraph_ToolDefinitionLevel.hxx>
#include <IGESGraph_ToolDrawingSize.hxx>
#include <IGESGraph_ToolDrawingUnits.hxx>
#include <IGESGraph_ToolHighLight.hxx>
#include <IGESGraph_ToolIntercharacterSpacing.hxx>
#include <IGESGraph_ToolLineFontDefPattern.hxx>
#include <IGESGraph_ToolLineFontPredefined.hxx>
#include <IGESGraph_ToolLineFontDefTemplate.hxx>
#include <IGESGraph_ToolNominalSize.hxx>
#include <IGESGraph_ToolPick.hxx>
#include <IGESGraph_ToolTextDisplayTemplate.hxx>
#include <IGESGraph_ToolTextFontDef.hxx>
#include <IGESGraph_ToolUniformRectGrid.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
IGESGraph_GeneralModule::IGESGraph_GeneralModule () { }
void IGESGraph_GeneralModule::OwnSharedCase
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
Interface_EntityIterator& iter) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGraph_Color,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolColor tool;
tool.OwnShared(anent,iter);
}
break;
case 2 : {
DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDefinitionLevel tool;
tool.OwnShared(anent,iter);
}
break;
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingSize tool;
tool.OwnShared(anent,iter);
}
break;
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingUnits tool;
tool.OwnShared(anent,iter);
}
break;
case 5 : {
DeclareAndCast(IGESGraph_HighLight,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolHighLight tool;
tool.OwnShared(anent,iter);
}
break;
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolIntercharacterSpacing tool;
tool.OwnShared(anent,iter);
}
break;
case 7 : {
DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefPattern tool;
tool.OwnShared(anent,iter);
}
break;
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontPredefined tool;
tool.OwnShared(anent,iter);
}
break;
case 9 : {
DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefTemplate tool;
tool.OwnShared(anent,iter);
}
break;
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolNominalSize tool;
tool.OwnShared(anent,iter);
}
break;
case 11 : {
DeclareAndCast(IGESGraph_Pick,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolPick tool;
tool.OwnShared(anent,iter);
}
break;
case 12 : {
DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextDisplayTemplate tool;
tool.OwnShared(anent,iter);
}
break;
case 13 : {
DeclareAndCast(IGESGraph_TextFontDef,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextFontDef tool;
tool.OwnShared(anent,iter);
}
break;
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolUniformRectGrid tool;
tool.OwnShared(anent,iter);
}
break;
default : break;
}
}
IGESData_DirChecker IGESGraph_GeneralModule::DirChecker
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGraph_Color,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolColor tool;
return tool.DirChecker(anent);
}
case 2 : {
DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolDefinitionLevel tool;
return tool.DirChecker(anent);
}
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolDrawingSize tool;
return tool.DirChecker(anent);
}
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolDrawingUnits tool;
return tool.DirChecker(anent);
}
case 5 : {
DeclareAndCast(IGESGraph_HighLight,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolHighLight tool;
return tool.DirChecker(anent);
}
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolIntercharacterSpacing tool;
return tool.DirChecker(anent);
}
case 7 : {
DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolLineFontDefPattern tool;
return tool.DirChecker(anent);
}
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolLineFontPredefined tool;
return tool.DirChecker(anent);
}
case 9 : {
DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolLineFontDefTemplate tool;
return tool.DirChecker(anent);
}
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolNominalSize tool;
return tool.DirChecker(anent);
}
case 11 : {
DeclareAndCast(IGESGraph_Pick,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolPick tool;
return tool.DirChecker(anent);
}
case 12 : {
DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolTextDisplayTemplate tool;
return tool.DirChecker(anent);
}
case 13 : {
DeclareAndCast(IGESGraph_TextFontDef,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolTextFontDef tool;
return tool.DirChecker(anent);
}
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolUniformRectGrid tool;
return tool.DirChecker(anent);
}
default : break;
}
return IGESData_DirChecker(); // by default, no specific criterium
}
void IGESGraph_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(IGESGraph_Color,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolColor tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 2 : {
DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDefinitionLevel tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingSize tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingUnits tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 5 : {
DeclareAndCast(IGESGraph_HighLight,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolHighLight tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolIntercharacterSpacing tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 7 : {
DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefPattern tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontPredefined tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 9 : {
DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefTemplate tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolNominalSize tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 11 : {
DeclareAndCast(IGESGraph_Pick,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolPick tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 12 : {
DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextDisplayTemplate tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 13 : {
DeclareAndCast(IGESGraph_TextFontDef,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextFontDef tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolUniformRectGrid tool;
tool.OwnCheck(anent,shares,ach);
}
break;
default : break;
}
}
Standard_Boolean IGESGraph_GeneralModule::NewVoid
(const Standard_Integer CN, Handle(Standard_Transient)& ent) const
{
switch (CN) {
case 1 : ent = new IGESGraph_Color; break;
case 2 : ent = new IGESGraph_DefinitionLevel; break;
case 3 : ent = new IGESGraph_DrawingSize; break;
case 4 : ent = new IGESGraph_DrawingUnits; break;
case 5 : ent = new IGESGraph_HighLight; break;
case 6 : ent = new IGESGraph_IntercharacterSpacing; break;
case 7 : ent = new IGESGraph_LineFontDefPattern; break;
case 8 : ent = new IGESGraph_LineFontPredefined; break;
case 9 : ent = new IGESGraph_LineFontDefTemplate; break;
case 10 : ent = new IGESGraph_NominalSize; break;
case 11 : ent = new IGESGraph_Pick; break;
case 12 : ent = new IGESGraph_TextDisplayTemplate; break;
case 13 : ent = new IGESGraph_TextFontDef; break;
case 14 : ent = new IGESGraph_UniformRectGrid; break;
default : return Standard_False; // by default, Failure on Recognize
}
return Standard_True;
}
void IGESGraph_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(IGESGraph_Color,enfr,entfrom);
DeclareAndCast(IGESGraph_Color,ento,entto);
IGESGraph_ToolColor tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 2 : {
DeclareAndCast(IGESGraph_DefinitionLevel,enfr,entfrom);
DeclareAndCast(IGESGraph_DefinitionLevel,ento,entto);
IGESGraph_ToolDefinitionLevel tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,enfr,entfrom);
DeclareAndCast(IGESGraph_DrawingSize,ento,entto);
IGESGraph_ToolDrawingSize tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,enfr,entfrom);
DeclareAndCast(IGESGraph_DrawingUnits,ento,entto);
IGESGraph_ToolDrawingUnits tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 5 : {
DeclareAndCast(IGESGraph_HighLight,enfr,entfrom);
DeclareAndCast(IGESGraph_HighLight,ento,entto);
IGESGraph_ToolHighLight tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,enfr,entfrom);
DeclareAndCast(IGESGraph_IntercharacterSpacing,ento,entto);
IGESGraph_ToolIntercharacterSpacing tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 7 : {
DeclareAndCast(IGESGraph_LineFontDefPattern,enfr,entfrom);
DeclareAndCast(IGESGraph_LineFontDefPattern,ento,entto);
IGESGraph_ToolLineFontDefPattern tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,enfr,entfrom);
DeclareAndCast(IGESGraph_LineFontPredefined,ento,entto);
IGESGraph_ToolLineFontPredefined tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 9 : {
DeclareAndCast(IGESGraph_LineFontDefTemplate,enfr,entfrom);
DeclareAndCast(IGESGraph_LineFontDefTemplate,ento,entto);
IGESGraph_ToolLineFontDefTemplate tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,enfr,entfrom);
DeclareAndCast(IGESGraph_NominalSize,ento,entto);
IGESGraph_ToolNominalSize tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 11 : {
DeclareAndCast(IGESGraph_Pick,enfr,entfrom);
DeclareAndCast(IGESGraph_Pick,ento,entto);
IGESGraph_ToolPick tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 12 : {
DeclareAndCast(IGESGraph_TextDisplayTemplate,enfr,entfrom);
DeclareAndCast(IGESGraph_TextDisplayTemplate,ento,entto);
IGESGraph_ToolTextDisplayTemplate tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 13 : {
DeclareAndCast(IGESGraph_TextFontDef,enfr,entfrom);
DeclareAndCast(IGESGraph_TextFontDef,ento,entto);
IGESGraph_ToolTextFontDef tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,enfr,entfrom);
DeclareAndCast(IGESGraph_UniformRectGrid,ento,entto);
IGESGraph_ToolUniformRectGrid tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
default : break;
}
}
Standard_Integer IGESGraph_GeneralModule::CategoryNumber
(const Standard_Integer CN, const Handle(Standard_Transient)& ,
const Interface_ShareTool& ) const
{
return Interface_Category::Number("Drawing");
}

View File

@@ -0,0 +1,61 @@
--
-- File : HighLight.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class HighLight from IGESGraph inherits IGESEntity
---Purpose: defines IGESHighLight, Type <406> Form <20>
-- in package IGESGraph
--
-- Attaches information that an entity is to be
-- displayed in some system dependent manner
uses Integer -- no one specific type
is
Create returns mutable HighLight;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
aHighLightStatus : Integer);
---Purpose : This method is used to set the fields of the class
-- HighLight
-- - nbProps : Number of property values (NP = 1)
-- - aHighLightStatus : HighLight Flag
NbPropertyValues(me) returns Integer;
---Purpose : returns the number of property values in <me>
HighLightStatus(me) returns Integer;
---Purpose : returns 0 if <me> is not highlighted(default),
-- 1 if <me> is highlighted
IsHighLighted(me) returns Boolean;
---Purpose : returns True if entity is highlighted
fields
--
-- Class : IGESGraph_HighLight
--
-- Purpose : Declaration of the variables specific to a
-- HighLight property.
--
-- Reminder : A HighLight property is defined by :
-- - Number of property values (NP=1)
-- - Flag
--
theNbPropertyValues : Integer;
theHighLight : Integer;
end HighLight;

View File

@@ -0,0 +1,36 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_HighLight.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_HighLight.ixx>
IGESGraph_HighLight::IGESGraph_HighLight () { }
void IGESGraph_HighLight::Init
(const Standard_Integer nbProps, const Standard_Integer aHighLightStatus)
{
theNbPropertyValues = nbProps;
theHighLight = aHighLightStatus;
InitTypeAndForm(406,20);
}
Standard_Integer IGESGraph_HighLight::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Integer IGESGraph_HighLight::HighLightStatus () const
{
return theHighLight;
}
Standard_Boolean IGESGraph_HighLight::IsHighLighted () const
{
return (theHighLight != 0);
}

View File

@@ -0,0 +1,58 @@
--
-- File : IntercharacterSpacing.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class IntercharacterSpacing from IGESGraph inherits IGESEntity
---Purpose: defines IGESIntercharacterSpacing, Type <406> Form <18>
-- in package IGESGraph
--
-- Specifies the gap between letters when fixed-pitch
-- spacing is used
uses Integer, Real -- no one specific type
is
Create returns mutable IntercharacterSpacing;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
anISpace : Real);
---Purpose : This method is used to set the fields of the class
-- IntercharacterSpacing
-- - nbProps : Number of property values (NP = 1)
-- - anISpace : Intercharacter spacing percentage
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me>
ISpace (me) returns Real;
---Purpose : returns the Intercharacter Space of <me> in percentage
-- of the text height (Range = 0..100)
fields
--
-- Class : IGESGraph_IntercharacterSpacing
--
-- Purpose : Declaration of the variables specific to a
-- Intercharacter Spacing property.
--
-- Reminder : An Intercharacter spacing property is defined by :
-- - Number of property values (NP=1)
-- - ISpace
--
theNbPropertyValues : Integer;
theISpace : Real;
end IntercharacterSpacing;

View File

@@ -0,0 +1,30 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_IntercharacterSpacing.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_IntercharacterSpacing.ixx>
IGESGraph_IntercharacterSpacing::IGESGraph_IntercharacterSpacing () { }
void IGESGraph_IntercharacterSpacing::Init
(const Standard_Integer nbProps, const Standard_Real anISpace)
{
theNbPropertyValues = nbProps;
theISpace = anISpace;
InitTypeAndForm(406,18);
}
Standard_Integer IGESGraph_IntercharacterSpacing::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Real IGESGraph_IntercharacterSpacing::ISpace () const
{
return theISpace;
}

View File

@@ -0,0 +1,81 @@
--
-- File : LineFontDefPattern.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class LineFontDefPattern from IGESGraph inherits LineFontEntity
---Purpose : defines IGESLineFontDefPattern, Type <304> Form <2>
-- in package IGESGraph
--
-- Line Font may be defined by repetition of a basic pattern
-- of visible-blank(or, on-off) segments superimposed on
-- a line or a curve. The line or curve is then displayed
-- according to the basic pattern.
uses
IGESEntity from IGESData,
HAsciiString from TCollection,
HArray1OfReal from TColStd
raises OutOfRange
is
Create returns mutable LineFontDefPattern;
-- Specific Methods pertaining to class
Init (me : mutable;
allSegLength : HArray1OfReal;
aPattern : HAsciiString);
---Purpose : This method is used to set the fields of the class
-- LineFontDefPattern
-- - allSegLength : Containing lengths of respective segments
-- - aPattern : HAsciiString indicating visible-blank segments
NbSegments (me) returns Integer;
---Purpose : returns the number of segments in the visible-blank pattern
Length (me; Index : Integer) returns Real
raises OutOfRange;
---Purpose : returns the Length of Index'th segment of the basic pattern
-- raises exception if Index <= 0 or Index > NbSegments
DisplayPattern (me) returns HAsciiString from TCollection;
---Purpose : returns the string indicating which segments of the basic
-- pattern are visible and which are blanked.
-- e.g:
-- theNbSegments = 5 and if Bit Pattern = 10110, which means that
-- segments 2, 3 and 5 are visible, whereas segments 1 and 4 are
-- blank. The method returns "2H16" as the HAsciiString.
-- Note: The bits are right justified. (16h = 10110)
IsVisible (me; Index : Integer) returns Boolean;
---Purpose : The Display Pattern is decrypted to
-- return True if the Index'th basic pattern is Visible,
-- False otherwise.
-- If Index > NbSegments or Index <= 0 then return value is
-- False.
fields
--
-- Class : IGESGraph_LineFontDefPattern
--
-- Purpose : Declaration of the variables specific to Line Font Patterns.
--
-- Reminder : A Line Font Pattern is defined by :
-- - Length of each Segment
-- - Visible-Blank Pattern Bitmap
--
theSegmentLengths : HArray1OfReal;
theDisplayPattern : HAsciiString;
end LineFontDefPattern;

View File

@@ -0,0 +1,65 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_LineFontDefPattern.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_LineFontDefPattern.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESGraph_LineFontDefPattern::IGESGraph_LineFontDefPattern () { }
// This class inherits from IGESData_LineFontEntity
void IGESGraph_LineFontDefPattern::Init
(const Handle(TColStd_HArray1OfReal)& allSegLength,
const Handle(TCollection_HAsciiString)& aPattern)
{
if (allSegLength->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESGraph_LineFontDefPattern : Init");
theSegmentLengths = allSegLength;
theDisplayPattern = aPattern;
InitTypeAndForm(304,2);
}
Standard_Integer IGESGraph_LineFontDefPattern::NbSegments () const
{
return theSegmentLengths->Length();
}
Standard_Real IGESGraph_LineFontDefPattern::Length
(const Standard_Integer Index) const
{
return theSegmentLengths->Value(Index);
// if Index is out of bound HArray1 will raise OutOfRange exception
}
Handle(TCollection_HAsciiString) IGESGraph_LineFontDefPattern::DisplayPattern
() const
{
return theDisplayPattern;
}
Standard_Boolean IGESGraph_LineFontDefPattern::IsVisible
(const Standard_Integer Index) const
{
Standard_Integer nbSegs = theSegmentLengths->Length();
if (Index <= 0 || Index > nbSegs) return Standard_False;
// Get the Character out of String, which contains the required BIT
char tempStr[2];
Standard_Integer length = theDisplayPattern->Length();
tempStr[0] = theDisplayPattern->Value(length - ((nbSegs - Index) / 4));
tempStr[1] = 0;
Standard_Integer tempVal =
(Standard_Integer) strtol(tempStr, (char **)NULL, 16);
// Now get the BIT out of tempVal
Standard_Integer mask = 0x01;
mask <<= ((nbSegs - Index) % 4);
return ((tempVal & mask) != 0);
}

View File

@@ -0,0 +1,88 @@
--
-- File : LineFontDefTemplate.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
--
---Copyright : MATRA-DATAVISION 1993
--
class LineFontDefTemplate from IGESGraph inherits LineFontEntity
---Purpose : defines IGESLineFontDefTemplate, Type <304> Form <1>
-- in package IGESGraph
--
-- Line Font can be defined as a repetition od Template figure
-- that is displayed at regularly spaced locations along a
-- planer anchoring curve. The anchoring curve itself has
-- no visual purpose.
uses
IGESEntity from IGESData,
SubfigureDef from IGESBasic
is
Create returns mutable LineFontDefTemplate;
-- Specific Methods pertaining to class
Init (me : mutable;
anOrientation : Integer;
aTemplate : SubfigureDef;
aDistance : Real;
aScale : Real);
---Purpose : This method is used to set the fields of the class
-- LineFontDefTemplate
-- - anOrientation : Orientation of Template figure on
-- anchoring curve
-- - aTemplate : SubfigureDef entity used as Template figure
-- - aDistance : Distance between the neighbouring Template
-- figures
-- - aScale : Scale factor applied to the Template figure
Orientation (me) returns Integer;
---Purpose : if return value = 0, Each Template display is oriented by aligning
-- the axis of the SubfigureDef with the axis of
-- the definition space of the anchoring curve.
-- = 1, Each Template display is oriented by aligning
-- X-axis of the SubfigureDef with the tangent
-- vector of the anchoring curve at the point of
-- incidence of the curve and the origin of
-- subfigure.
-- Similarly Z-axis is aligned.
TemplateEntity (me) returns SubfigureDef;
---Purpose : returns SubfigureDef as the Entity used as Template figure.
Distance (me) returns Real;
---Purpose : returns the Distance between any two Template figures on the
-- anchoring curve.
Scale (me) returns Real;
---Purpose : returns the Scaling factor applied to SubfigureDef to form
-- Template figure.
fields
--
-- Class : IGESGraph_LineFontDefTemplate
--
-- Purpose : Declaration of the variables specific to Line Font Templates.
--
-- Reminder : A Line Font Template is defined by :
-- - Orientation of Template figure on the anchoring curve
-- - Sub Figure definition entity used as Template figure
-- - Distance between the neighbouring Template figures
-- - Scale factor applied to the Template figure
--
theOrientation : Integer;
theTemplateEntity : SubfigureDef;
theDistance : Real;
theScale : Real;
end LineFontDefTemplate;

View File

@@ -0,0 +1,50 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_LineFontDefTemplate.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_LineFontDefTemplate.ixx>
IGESGraph_LineFontDefTemplate::IGESGraph_LineFontDefTemplate () { }
// This class inherits from IGESData_LineFontEntity
void IGESGraph_LineFontDefTemplate::Init
(const Standard_Integer anOrientation,
const Handle(IGESBasic_SubfigureDef)& aTemplate,
const Standard_Real aDistance,
const Standard_Real aScale)
{
theOrientation = anOrientation;
theTemplateEntity = aTemplate;
theDistance = aDistance;
theScale = aScale;
InitTypeAndForm(304,1);
}
Standard_Integer IGESGraph_LineFontDefTemplate::Orientation () const
{
return theOrientation;
}
Handle(IGESBasic_SubfigureDef) IGESGraph_LineFontDefTemplate::TemplateEntity
() const
{
return theTemplateEntity;
}
Standard_Real IGESGraph_LineFontDefTemplate::Distance () const
{
return theDistance;
}
Standard_Real IGESGraph_LineFontDefTemplate::Scale () const
{
return theScale;
}

View File

@@ -0,0 +1,60 @@
--
-- File : LineFontPredefined.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class LineFontPredefined from IGESGraph inherits IGESEntity
---Purpose: defines IGESLineFontPredefined, Type <406> Form <19>
-- in package IGESGraph
--
-- Provides the ability to specify a line font pattern
-- from a predefined list rather than from
-- Directory Entry Field 4
uses Integer -- no one specific type
is
Create returns mutable LineFontPredefined;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
aLineFontPatternCode : Integer);
---Purpose : This method is used to set the fields of the class
-- LineFontPredefined
-- - nbProps : Number of property values (NP = 1)
-- - aLineFontPatternCode : Line Font Pattern Code
-- Specific Access Methods : According to each type of Entity
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me>
LineFontPatternCode (me) returns Integer;
---Purpose : returns the Line Font Pattern Code of <me>
fields
--
-- Class : IGESGraph_LineFontPredefined
--
-- Purpose : Declaration of the variables specific to a
-- LineFontPredefined property.
--
-- Reminder : A LineFontPredefined property is defined by :
-- - Number of property values
-- - Line Font Pattern Code
--
theNbPropertyValues : Integer;
theLineFontPatternCode : Integer;
end LineFontPredefined;

View File

@@ -0,0 +1,31 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_LineFontPredefined.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_LineFontPredefined.ixx>
IGESGraph_LineFontPredefined::IGESGraph_LineFontPredefined () { }
void IGESGraph_LineFontPredefined::Init
(const Standard_Integer nbProps, const Standard_Integer aLineFontPatternCode)
{
theNbPropertyValues = nbProps;
theLineFontPatternCode = aLineFontPatternCode;
InitTypeAndForm(406,19);
}
Standard_Integer IGESGraph_LineFontPredefined::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Integer IGESGraph_LineFontPredefined::LineFontPatternCode () const
{
return theLineFontPatternCode;
}

View File

@@ -0,0 +1,77 @@
--
-- File : NominalSize.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class NominalSize from IGESGraph inherits IGESEntity
---Purpose: defines IGESNominalSize, Type <406> Form <13>
-- in package IGESGraph
--
-- Specifies a value, a name, and optionally a
-- reference to an engineering standard
uses
HAsciiString from TCollection
is
Create returns mutable NominalSize;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
aNominalSizeValue : Real;
aNominalSizeName : HAsciiString from TCollection;
aStandardName : HAsciiString from TCollection);
---Purpose : This method is used to set the fields of the class
-- NominalSize
-- - nbProps : Number of property values (2 or 3)
-- - aNominalSizeValue : NominalSize Value
-- - aNominalSizeName : NominalSize Name
-- - aStandardName : Name of relevant engineering standard
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me>
NominalSizeValue (me) returns Real;
---Purpose : returns the value of <me>
NominalSizeName (me) returns HAsciiString from TCollection;
---Purpose : returns the name of <me>
HasStandardName (me) returns Boolean;
---Purpose : returns True if an engineering Standard is defined for <me>
-- else, returns False
StandardName (me) returns HAsciiString from TCollection;
---Purpose : returns the name of the relevant engineering standard of <me>
fields
--
-- Class : IGESGraph_NominalSize
--
-- Purpose : Declaration of the variables specific to a Nominal Size.
--
-- Reminder : A Nominal Size is defined by :
-- - Number of property values
-- - Value
-- - Name
-- - Name of relevant engineering standard
--
theNbPropertyValues : Integer;
theNominalSizeValue : Real;
theNominalSizeName : HAsciiString from TCollection;
theStandardName : HAsciiString from TCollection;
end NominalSize;

View File

@@ -0,0 +1,52 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_NominalSize.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_NominalSize.ixx>
IGESGraph_NominalSize::IGESGraph_NominalSize () { }
void IGESGraph_NominalSize::Init
(const Standard_Integer nbProps,
const Standard_Real aNominalSizeValue,
const Handle(TCollection_HAsciiString)& aNominalSizeName,
const Handle(TCollection_HAsciiString)& aStandardName)
{
theNbPropertyValues = nbProps;
theNominalSizeValue = aNominalSizeValue;
theNominalSizeName = aNominalSizeName;
theStandardName = aStandardName;
InitTypeAndForm(406,13);
}
Standard_Integer IGESGraph_NominalSize::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Real IGESGraph_NominalSize::NominalSizeValue () const
{
return theNominalSizeValue;
}
Handle(TCollection_HAsciiString) IGESGraph_NominalSize::NominalSizeName () const
{
return theNominalSizeName;
}
Standard_Boolean IGESGraph_NominalSize::HasStandardName () const
{
return (! theStandardName.IsNull() );
}
Handle(TCollection_HAsciiString) IGESGraph_NominalSize::StandardName () const
{
return theStandardName;
}

View File

@@ -0,0 +1,63 @@
--
-- File : Pick.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class Pick from IGESGraph inherits IGESEntity
---Purpose: defines IGESPick, Type <406> Form <21>
-- in package IGESGraph
--
-- Attaches information that an entity may be picked
-- by whatever pick device is used in the receiving
-- system
uses Integer -- no one specific type
is
Create returns mutable Pick;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
aPickStatus : Integer);
---Purpose : This method is used to set the fields of the class Pick
-- - nbProps : Number of property values (NP = 1)
-- - aPickStatus : Pick Flag
-- Specific Access Methods : According to each type of Entity
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me>.
PickFlag(me) returns Integer;
---Purpose : returns 0 if <me> is pickable(default),
-- 1 if <me> is not pickable.
IsPickable(me) returns Boolean;
---Purpose : returns True if thePick is 0.
fields
--
-- Class : IGESGraph_Pick
--
-- Purpose : Declaration of the variables specific to a Pick property.
--
-- Reminder : A Pick property is defined by :
-- - Number of property values
-- - Flag 0 = entity is pickable(default)
-- 1 = entity is not pickable
--
theNbPropertyValues : Integer;
thePick : Integer;
end Pick;

View File

@@ -0,0 +1,36 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_Pick.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_Pick.ixx>
IGESGraph_Pick::IGESGraph_Pick () { }
void IGESGraph_Pick::Init
(const Standard_Integer nbProps, const Standard_Integer aPickStatus)
{
theNbPropertyValues = nbProps;
thePick = aPickStatus;
InitTypeAndForm(406,21);
}
Standard_Integer IGESGraph_Pick::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Integer IGESGraph_Pick::PickFlag () const
{
return thePick;
}
Standard_Boolean IGESGraph_Pick::IsPickable () const
{
return (thePick == 0);
}

View File

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

View File

@@ -0,0 +1,72 @@
#include <IGESGraph_Protocol.ixx>
#include <IGESGraph_LineFontDefPattern.hxx>
#include <IGESGraph_Color.hxx>
#include <IGESGraph_LineFontPredefined.hxx>
#include <IGESGraph_DefinitionLevel.hxx>
#include <IGESGraph_LineFontDefTemplate.hxx>
#include <IGESGraph_DrawingSize.hxx>
#include <IGESGraph_NominalSize.hxx>
#include <IGESGraph_DrawingUnits.hxx>
#include <IGESGraph_Pick.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <IGESGraph_HighLight.hxx>
#include <IGESGraph_TextFontDef.hxx>
#include <IGESGraph_IntercharacterSpacing.hxx>
#include <IGESGraph_UniformRectGrid.hxx>
#include <IGESBasic.hxx>
#include <IGESBasic_Protocol.hxx>
static int deja = 0;
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14;
IGESGraph_Protocol::IGESGraph_Protocol ()
{
if (deja) return; deja = 1;
atype01 = STANDARD_TYPE(IGESGraph_Color);
atype02 = STANDARD_TYPE(IGESGraph_DefinitionLevel);
atype03 = STANDARD_TYPE(IGESGraph_DrawingSize);
atype04 = STANDARD_TYPE(IGESGraph_DrawingUnits);
atype05 = STANDARD_TYPE(IGESGraph_HighLight);
atype06 = STANDARD_TYPE(IGESGraph_IntercharacterSpacing);
atype07 = STANDARD_TYPE(IGESGraph_LineFontDefPattern);
atype08 = STANDARD_TYPE(IGESGraph_LineFontPredefined);
atype09 = STANDARD_TYPE(IGESGraph_LineFontDefTemplate);
atype10 = STANDARD_TYPE(IGESGraph_NominalSize);
atype11 = STANDARD_TYPE(IGESGraph_Pick);
atype12 = STANDARD_TYPE(IGESGraph_TextDisplayTemplate);
atype13 = STANDARD_TYPE(IGESGraph_TextFontDef);
atype14 = STANDARD_TYPE(IGESGraph_UniformRectGrid);
}
Standard_Integer IGESGraph_Protocol::NbResources () const
{ return 1; }
Handle(Interface_Protocol) IGESGraph_Protocol::Resource
(const Standard_Integer num) const
{
Handle(Interface_Protocol) res = IGESBasic::Protocol();;
return res;
}
Standard_Integer IGESGraph_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: IGESGraph_ReadWriteModule.cdl
-- Created: Mon Sep 6 19:22:12 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class ReadWriteModule from IGESGraph inherits ReadWriteModule from IGESData
---Purpose : Defines Graph File Access Module for IGESGraph (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 IGESGraph;
---Purpose : Creates a ReadWriteModule & puts it into ReaderLib & WriterLib
CaseIGES (me; typenum, formnum : Integer) returns Integer;
---Purpose : Defines Case Numbers for Entities of IGESGraph
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 IGESGraph
WriteOwnParams (me; CN : Integer; ent : IGESEntity;
IW : in out IGESWriter);
---Purpose : Writes own parameters to IGESWriter
end ReadWriteModule;

View File

@@ -0,0 +1,288 @@
#include <IGESGraph_ReadWriteModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESGraph_Color.hxx>
#include <IGESGraph_DefinitionLevel.hxx>
#include <IGESGraph_DrawingSize.hxx>
#include <IGESGraph_DrawingUnits.hxx>
#include <IGESGraph_HighLight.hxx>
#include <IGESGraph_IntercharacterSpacing.hxx>
#include <IGESGraph_LineFontDefPattern.hxx>
#include <IGESGraph_LineFontPredefined.hxx>
#include <IGESGraph_LineFontDefTemplate.hxx>
#include <IGESGraph_NominalSize.hxx>
#include <IGESGraph_Pick.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <IGESGraph_TextFontDef.hxx>
#include <IGESGraph_UniformRectGrid.hxx>
#include <IGESGraph_ToolColor.hxx>
#include <IGESGraph_ToolDefinitionLevel.hxx>
#include <IGESGraph_ToolDrawingSize.hxx>
#include <IGESGraph_ToolDrawingUnits.hxx>
#include <IGESGraph_ToolHighLight.hxx>
#include <IGESGraph_ToolIntercharacterSpacing.hxx>
#include <IGESGraph_ToolLineFontDefPattern.hxx>
#include <IGESGraph_ToolLineFontPredefined.hxx>
#include <IGESGraph_ToolLineFontDefTemplate.hxx>
#include <IGESGraph_ToolNominalSize.hxx>
#include <IGESGraph_ToolPick.hxx>
#include <IGESGraph_ToolTextDisplayTemplate.hxx>
#include <IGESGraph_ToolTextFontDef.hxx>
#include <IGESGraph_ToolUniformRectGrid.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
IGESGraph_ReadWriteModule::IGESGraph_ReadWriteModule () { }
Standard_Integer IGESGraph_ReadWriteModule::CaseIGES
(const Standard_Integer typenum, const Standard_Integer formnum) const
{
switch (typenum) {
case 304 :
if (formnum == 1) return 9;
else if (formnum == 2) return 7;
break;
case 310 : return 13;
case 312 : return 12;
case 314 : return 1;
case 406 :
switch (formnum) {
case 1 : return 2;
case 13 : return 10;
case 16 : return 3;
case 17 : return 4;
case 18 : return 6;
case 19 : return 8;
case 20 : return 5;
case 21 : return 11;
case 22 : return 14;
default : break;
}
break;
default : break;
}
return 0;
}
void IGESGraph_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(IGESGraph_Color,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolColor tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 2 : {
DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDefinitionLevel tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingSize tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingUnits tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 5 : {
DeclareAndCast(IGESGraph_HighLight,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolHighLight tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolIntercharacterSpacing tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 7 : {
DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefPattern tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontPredefined tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 9 : {
DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefTemplate tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolNominalSize tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 11 : {
DeclareAndCast(IGESGraph_Pick,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolPick tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 12 : {
DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextDisplayTemplate tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 13 : {
DeclareAndCast(IGESGraph_TextFontDef,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextFontDef tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolUniformRectGrid tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
default : break;
}
}
void IGESGraph_ReadWriteModule::WriteOwnParams
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
IGESData_IGESWriter& IW) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESGraph_Color,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolColor tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 2 : {
DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDefinitionLevel tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingSize tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingUnits tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 5 : {
DeclareAndCast(IGESGraph_HighLight,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolHighLight tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolIntercharacterSpacing tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 7 : {
DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefPattern tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontPredefined tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 9 : {
DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefTemplate tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolNominalSize tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 11 : {
DeclareAndCast(IGESGraph_Pick,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolPick tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 12 : {
DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextDisplayTemplate tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 13 : {
DeclareAndCast(IGESGraph_TextFontDef,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextFontDef tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolUniformRectGrid tool;
tool.WriteOwnParams(anent,IW);
}
break;
default : break;
}
}

View File

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

View File

@@ -0,0 +1,209 @@
#include <IGESGraph_SpecificModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESGraph_Color.hxx>
#include <IGESGraph_DefinitionLevel.hxx>
#include <IGESGraph_DrawingSize.hxx>
#include <IGESGraph_DrawingUnits.hxx>
#include <IGESGraph_HighLight.hxx>
#include <IGESGraph_IntercharacterSpacing.hxx>
#include <IGESGraph_LineFontDefPattern.hxx>
#include <IGESGraph_LineFontPredefined.hxx>
#include <IGESGraph_LineFontDefTemplate.hxx>
#include <IGESGraph_NominalSize.hxx>
#include <IGESGraph_Pick.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <IGESGraph_TextFontDef.hxx>
#include <IGESGraph_UniformRectGrid.hxx>
#include <IGESGraph_ToolColor.hxx>
#include <IGESGraph_ToolDefinitionLevel.hxx>
#include <IGESGraph_ToolDrawingSize.hxx>
#include <IGESGraph_ToolDrawingUnits.hxx>
#include <IGESGraph_ToolHighLight.hxx>
#include <IGESGraph_ToolIntercharacterSpacing.hxx>
#include <IGESGraph_ToolLineFontDefPattern.hxx>
#include <IGESGraph_ToolLineFontPredefined.hxx>
#include <IGESGraph_ToolLineFontDefTemplate.hxx>
#include <IGESGraph_ToolNominalSize.hxx>
#include <IGESGraph_ToolPick.hxx>
#include <IGESGraph_ToolTextDisplayTemplate.hxx>
#include <IGESGraph_ToolTextFontDef.hxx>
#include <IGESGraph_ToolUniformRectGrid.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
IGESGraph_SpecificModule::IGESGraph_SpecificModule() { }
void IGESGraph_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(IGESGraph_Color,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolColor tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 2 : {
DeclareAndCast(IGESGraph_DefinitionLevel,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDefinitionLevel tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingSize tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolDrawingUnits tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 5 : {
DeclareAndCast(IGESGraph_HighLight,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolHighLight tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolIntercharacterSpacing tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 7 : {
DeclareAndCast(IGESGraph_LineFontDefPattern,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefPattern tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontPredefined tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 9 : {
DeclareAndCast(IGESGraph_LineFontDefTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolLineFontDefTemplate tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolNominalSize tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 11 : {
DeclareAndCast(IGESGraph_Pick,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolPick tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 12 : {
DeclareAndCast(IGESGraph_TextDisplayTemplate,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextDisplayTemplate tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 13 : {
DeclareAndCast(IGESGraph_TextFontDef,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolTextFontDef tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent);
if (anent.IsNull()) return;
IGESGraph_ToolUniformRectGrid tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
default : break;
}
}
Standard_Boolean IGESGraph_SpecificModule::OwnCorrect
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
// Applies only on some types
switch (CN) {
case 3 : {
DeclareAndCast(IGESGraph_DrawingSize,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolDrawingSize tool;
return tool.OwnCorrect(anent);
}
case 4 : {
DeclareAndCast(IGESGraph_DrawingUnits,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolDrawingUnits tool;
return tool.OwnCorrect(anent);
}
case 5 : {
DeclareAndCast(IGESGraph_HighLight,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolHighLight tool;
return tool.OwnCorrect(anent);
}
case 6 : {
DeclareAndCast(IGESGraph_IntercharacterSpacing,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolIntercharacterSpacing tool;
return tool.OwnCorrect(anent);
}
case 8 : {
DeclareAndCast(IGESGraph_LineFontPredefined,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolLineFontPredefined tool;
return tool.OwnCorrect(anent);
}
case 10 : {
DeclareAndCast(IGESGraph_NominalSize,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolNominalSize tool;
return tool.OwnCorrect(anent);
}
case 11 : {
DeclareAndCast(IGESGraph_Pick,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolPick tool;
return tool.OwnCorrect(anent);
}
case 14 : {
DeclareAndCast(IGESGraph_UniformRectGrid,anent,ent);
if (anent.IsNull()) break;
IGESGraph_ToolUniformRectGrid tool;
return tool.OwnCorrect(anent);
}
default : break;
}
return Standard_False;
}

View File

@@ -0,0 +1,170 @@
--
-- File : TextDisplayTemplate.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class TextDisplayTemplate from IGESGraph inherits IGESEntity
---Purpose: defines IGES TextDisplayTemplate Entity,
-- Type <312>, form <0, 1> in package IGESGraph
--
-- Used to set parameters for display of information
-- which has been logically included in another entity
-- as a parameter value
uses
TextFontDef from IGESGraph,
Pnt from gp,
XYZ from gp
is
Create returns mutable TextDisplayTemplate;
-- specific for the entity
Init (me : mutable;
aWidth : Real;
aHeight : Real;
aFontCode : Integer;
aFontEntity : TextFontDef;
aSlantAngle : Real;
aRotationAngle : Real;
aMirrorFlag : Integer;
aRotationFlag : Integer;
aCorner : XYZ);
---Purpose : This method is used to set the fields of the class
-- TextDisplayTemplate
-- - aWidth : Character box width
-- - aHeight : Character box height
-- - afontCode : Font code
-- - aFontEntity : Text Font Definition Entity
-- - aSlantAngle : Slant angle
-- - aRotationAngle : Rotation angle
-- - aMirrorFlag : Mirror Flag
-- - aRotationFlag : Rotate internal text flag
-- - aCorner : Lower left corner coordinates(Form No. 0),
-- Increments from coordinates (Form No. 1)
SetIncremental (me : mutable; mode : Boolean);
---Purpose : Sets <me> to be Incremental (Form 1) if <mode> is True,
-- or Basolute (Form 0) else
IsIncremental (me) returns Boolean;
---Purpose : returns True if entity is Incremental (Form 1).
-- False if entity is Absolute (Form 0).
BoxWidth (me) returns Real;
---Purpose : returns Character Box Width.
BoxHeight (me) returns Real;
---Purpose : returns Character Box Height.
IsFontEntity (me) returns Boolean;
---Purpose : returns False if theFontEntity is Null, True otherwise.
FontCode (me) returns Integer;
---Purpose : returns the font code.
FontEntity (me) returns TextFontDef;
---Purpose : returns Text Font Definition Entity used to define the font.
SlantAngle (me) returns Real;
---Purpose : returns slant angle of character in radians.
RotationAngle (me) returns Real;
---Purpose : returns Rotation angle of text block in radians.
MirrorFlag (me) returns Integer;
---Purpose : returns Mirror flag
-- Mirror flag : 0 = no mirroring.
-- 1 = mirror axis perpendicular to text base line.
-- 2 = mirror axis is text base line.
RotateFlag (me) returns Integer;
---Purpose : returns Rotate internal text flag.
-- Rotate internal text flag : 0 = text horizontal.
-- 1 = text vertical.
StartingCorner (me) returns Pnt;
---Purpose : If IsIncremental() returns False,
-- gets coordinates of lower left corner
-- of first character box.
-- If IsIncremental() returns True,
-- gets increments from X, Y, Z coordinates
-- found in parent entity.
TransformedStartingCorner (me) returns Pnt;
---Purpose : If IsIncremental() returns False,
-- gets coordinates of lower left corner
-- of first character box.
-- If IsIncremental() returns True,
-- gets increments from X, Y, Z coordinates
-- found in parent entity.
fields
-- Class : IGESDraw_TextDisplayTemplate
--
-- Purpose : Declaration of the variables specific to a
-- TextDisplayTemplate.
--
-- Reminder : A Text Display Template Entity is defined by :
-- - character box width,
-- - character box height,
-- - a font code or pointer to TextFontDef
-- used to define the font,
-- - slant angle of each individual character,
-- - rotation angle of text block,
-- - a mirroring axis,
-- - a rotate internal text flag,
-- - coordinates of lower left corner of first character
-- box if form number = 0, or
-- increments in corresponding coordinates found in
-- parent entity, if form number = 1
theBoxWidth : Real;
theBoxHeight : Real;
theFontCode : Integer;
-- one of the predefined font codes
theFontEntity : TextFontDef;
-- Text Font Definition Entity used to define the font
theSlantAngle : Real;
-- slant angle of each individual character
-- For horizontal text, slant angle is measured from the XT axis
-- in a counterclockwise direction.
-- For Vertical Text, it is measured from the YT axis
theRotationAngle : Real;
-- rotation angle of the text block
-- The rotation angle is applied in a counterclockwise direction about
-- the text start point. The plane of rotation is the XT,YT plane.
theMirrorFlag : Integer;
-- specifies the mirroring axis
-- Mirror flag : 0 = no mirroring
-- 1 = mirror axis perpendicular to text base line
-- 2 = mirror axis is text base line
theRotateFlag : Integer;
-- specifies whether text box is filled with horizontal text or vertical
-- text
-- Rotate internal text flag : 0 = text horizontal
-- 1 = text vertical
theCorner : XYZ;
-- theCorner specifies the coordinates of lower left corner of first
-- character box if form-number = 0.
-- If form-number = 1, it gives the increments in X, Y, Z from X, Y, Z
-- coordinates found in parent entity.
end TextDisplayTemplate;

View File

@@ -0,0 +1,106 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_TextDisplayTemplate.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_TextDisplayTemplate.ixx>
#include <gp_GTrsf.hxx>
IGESGraph_TextDisplayTemplate::IGESGraph_TextDisplayTemplate () { }
void IGESGraph_TextDisplayTemplate::Init
(const Standard_Real aWidth,
const Standard_Real aHeight,
const Standard_Integer aFontCode,
const Handle(IGESGraph_TextFontDef)& aFontEntity,
const Standard_Real aSlantAngle,
const Standard_Real aRotationAngle,
const Standard_Integer aMirrorFlag,
const Standard_Integer aRotationFlag,
const gp_XYZ& aCorner)
{
theBoxWidth = aWidth;
theBoxHeight = aHeight;
theFontCode = aFontCode;
theFontEntity = aFontEntity;
theSlantAngle = aSlantAngle;
theRotationAngle = aRotationAngle;
theMirrorFlag = aMirrorFlag;
theRotateFlag = aRotationFlag;
theCorner = aCorner;
InitTypeAndForm(312,FormNumber()); // FormNumber 0-1 : Incremental status
}
void IGESGraph_TextDisplayTemplate::SetIncremental (const Standard_Boolean F)
{
InitTypeAndForm(312, (F ? 1 : 0));
}
Standard_Real IGESGraph_TextDisplayTemplate::BoxWidth () const
{
return theBoxWidth;
}
Standard_Real IGESGraph_TextDisplayTemplate::BoxHeight () const
{
return theBoxHeight;
}
Standard_Boolean IGESGraph_TextDisplayTemplate::IsFontEntity () const
{
return (! theFontEntity.IsNull());
}
Standard_Integer IGESGraph_TextDisplayTemplate::FontCode () const
{
return theFontCode;
}
Handle(IGESGraph_TextFontDef) IGESGraph_TextDisplayTemplate::FontEntity () const
{
return theFontEntity;
}
Standard_Real IGESGraph_TextDisplayTemplate::SlantAngle () const
{
return theSlantAngle;
}
Standard_Real IGESGraph_TextDisplayTemplate::RotationAngle () const
{
return theRotationAngle;
}
Standard_Integer IGESGraph_TextDisplayTemplate::MirrorFlag () const
{
return theMirrorFlag;
}
Standard_Integer IGESGraph_TextDisplayTemplate::RotateFlag () const
{
return theRotateFlag;
}
Standard_Boolean IGESGraph_TextDisplayTemplate::IsIncremental () const
{
return ( FormNumber() == 1 );
}
gp_Pnt IGESGraph_TextDisplayTemplate::StartingCorner () const
{
return ( gp_Pnt(theCorner) );
}
gp_Pnt IGESGraph_TextDisplayTemplate::TransformedStartingCorner () const
{
gp_XYZ TempXYZ = theCorner;
if (HasTransf()) Location().Transforms(TempXYZ);
return ( gp_Pnt(TempXYZ) );
}

View File

@@ -0,0 +1,170 @@
--
-- File : TextFontDef.cdl
-- Created : Mon 11 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class TextFontDef from IGESGraph inherits IGESEntity
---Purpose : defines IGES Text Font Definition Entity, Type <310>
-- in package IGESGraph
--
-- Used to define the appearance of characters in a text font.
-- It may be used to describe a complete font or a
-- modification to a subset of characters in another font.
uses
HAsciiString from TCollection,
HArray1OfInteger from TColStd,
HArray1OfHArray1OfInteger from IGESBasic
raises DimensionMismatch, OutOfRange
is
Create returns mutable TextFontDef;
-- specific for the entity
Init (me : mutable;
aFontCode : Integer;
aFontName : HAsciiString;
aSupersededFont : Integer;
aSupersededEntity : TextFontDef;
aScale : Integer;
allASCIICodes : HArray1OfInteger;
allNextCharX : HArray1OfInteger;
allNextCharY : HArray1OfInteger;
allPenMotions : HArray1OfInteger;
allPenFlags : HArray1OfHArray1OfInteger;
allMovePenToX : HArray1OfHArray1OfInteger;
allMovePenToY : HArray1OfHArray1OfInteger)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- TextFontDef
-- - aFontCode : Font Code
-- - aFontName : Font Name
-- - aSupersededFont : Number of superseded font
-- - aSupersededEntity : Text Definition Entity
-- - aScale : No. of grid units = 1 text height unit
-- - allASCIICodes : ASCII codes for characters
-- - allNextCharX & Y : Grid locations of the next
-- character's origin (Integer vals)
-- - allPenMotions : No. of pen motions for the characters
-- - allPenFlags : Pen up/down flags,
-- 0 = Down (default), 1 = Up
-- - allMovePenToX & Y : Grid locations the pen will move to
-- This method initializes the fields of the class TextFontDef.
-- An exception is raised if the lengths of allASCIICodes,
-- allNextChars, allPenMotions, allPenFlags and allMovePenTo
-- are not same.
FontCode (me) returns Integer;
---Purpose : returns the font code.
FontName (me) returns HAsciiString from TCollection;
---Purpose : returns the font name.
IsSupersededFontEntity (me) returns Boolean;
---Purpose : True if this definition supersedes another
-- TextFontDefinition Entity,
-- False if it supersedes value.
SupersededFontCode (me) returns Integer;
---Purpose : returns the font number which this entity modifies.
SupersededFontEntity (me) returns TextFontDef;
---Purpose : returns the font entity which this entity modifies.
Scale (me) returns Integer;
---Purpose : returns the number of grid units which equal one text height unit.
NbCharacters (me) returns Integer;
---Purpose : returns the number of characters in this definition.
ASCIICode (me; Chnum : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the ASCII code of Chnum'th character.
-- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
NextCharOrigin (me; Chnum : Integer; NX,NY : out Integer)
raises OutOfRange;
---Purpose : returns grid location of origin of character next to Chnum'th char.
-- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
NbPenMotions (me; Chnum : Integer) returns Integer
raises OutOfRange;
---Purpose : returns number of pen motions for Chnum'th character.
-- Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
IsPenUp (me; Chnum : Integer; Motionnum : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns pen status(True if 1, False if 0) of Motionnum'th motion
-- of Chnum'th character.
-- Exception raised if Chnum <= 0 or Chnum > NbCharacters or
-- Motionnum <= 0 or Motionnum > NbPenMotions
NextPenPosition (me; Chnum : Integer; Motionnum : Integer;
IX,IY : out Integer)
raises OutOfRange;
-- returns, for Motionnum'th motion of Chnum'th character,
-- the grid location to which the pen is to move.
-- Exception raised if Chnum <= 0 or Chnum > NbCharacters or
-- Motionnum <= 0 or Motionnum > NbPenMotions
fields
-- Class : IGESDraw_TextFontDef
--
-- Purpose : Declaration of the variables specific to a TextFontDef.
--
-- Reminder : A Text Font Definition Entity is defined by :
-- - a font code,
-- - a font name,
-- - number of the font or pointer to the TextFontDef which
-- this definition supersedes,
-- - number of grid units which equal one text height unit,
-- - ASCII codes for each character in this definition,
-- - Grid locations of next character's origin, for each char
-- - number of pen motions for each character,
-- - status of pen flag for each motion of each character,
-- - Grid location to which pen is to move, for each motion
-- of each character
--
theFontCode : Integer;
theFontName : HAsciiString;
theSupersededFontCode : Integer;
theSupersededFontEntity : TextFontDef;
theScale : Integer;
theASCIICodes : HArray1OfInteger;
-- ASCII code for each character
theNextCharOriginX : HArray1OfInteger;
theNextCharOriginY : HArray1OfInteger;
-- For each character, Grid location of next character's origin
theNbPenMotions : HArray1OfInteger;
-- Number of pen motions for each character(Length = NbCharacters)
-- is (NM1 ,NM2 ....... NMn)
thePenMotions : HArray1OfHArray1OfInteger;
-- Status of Pen up/down flag for each character
-- flag : 0 = Down(Default)
-- 1 = Up
-- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively
thePenMovesToX : HArray1OfHArray1OfInteger;
thePenMovesToY : HArray1OfHArray1OfInteger;
-- For each character, Grid location to which the pen is to move
-- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively
end TextFontDef;

View File

@@ -0,0 +1,124 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_TextFontDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_TextFontDef.ixx>
IGESGraph_TextFontDef::IGESGraph_TextFontDef () { }
void IGESGraph_TextFontDef::Init
(const Standard_Integer aFontCode,
const Handle(TCollection_HAsciiString)& aFontName,
const Standard_Integer aSupersededFont,
const Handle(IGESGraph_TextFontDef)& aSupersededEntity,
const Standard_Integer aScale,
const Handle(TColStd_HArray1OfInteger)& allASCIICodes,
const Handle(TColStd_HArray1OfInteger)& allNextCharX,
const Handle(TColStd_HArray1OfInteger)& allNextCharY,
const Handle(TColStd_HArray1OfInteger)& allPenMotions,
const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allPenFlags,
const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allMovePenToX,
const Handle(IGESBasic_HArray1OfHArray1OfInteger)& allMovePenToY)
{
Standard_Integer Len = allASCIICodes->Length();
if (allASCIICodes->Lower() != 1 ||
(allNextCharX->Lower() != 1 || allNextCharX->Length() != Len) ||
(allNextCharY->Lower() != 1 || allNextCharY->Length() != Len) ||
(allPenMotions->Lower() != 1 || allPenMotions->Length() != Len) ||
(allPenFlags->Lower() != 1 || allPenFlags->Length() != Len) ||
(allMovePenToX->Lower() != 1 || allMovePenToX->Length() != Len) ||
(allMovePenToX->Lower() != 1 || allMovePenToX->Length() != Len) )
Standard_DimensionMismatch::Raise("IGESGraph_TextFontDef : Init");
theFontCode = aFontCode;
theFontName = aFontName;
theSupersededFontCode = aSupersededFont;
theSupersededFontEntity = aSupersededEntity;
theScale = aScale;
theASCIICodes = allASCIICodes;
theNextCharOriginX = allNextCharX;
theNextCharOriginY = allNextCharY;
theNbPenMotions = allPenMotions;
thePenMotions = allPenFlags;
thePenMovesToX = allMovePenToX;
thePenMovesToY = allMovePenToY;
InitTypeAndForm(310,0);
}
Standard_Integer IGESGraph_TextFontDef::FontCode () const
{
return theFontCode;
}
Handle(TCollection_HAsciiString) IGESGraph_TextFontDef::FontName () const
{
return theFontName;
}
Standard_Boolean IGESGraph_TextFontDef::IsSupersededFontEntity () const
{
return (! theSupersededFontEntity.IsNull());
}
Standard_Integer IGESGraph_TextFontDef::SupersededFontCode () const
{
return theSupersededFontCode;
}
Handle(IGESGraph_TextFontDef) IGESGraph_TextFontDef::SupersededFontEntity () const
{
return theSupersededFontEntity;
}
Standard_Integer IGESGraph_TextFontDef::Scale () const
{
return theScale;
}
Standard_Integer IGESGraph_TextFontDef::NbCharacters () const
{
return ( theASCIICodes->Length() );
}
Standard_Integer IGESGraph_TextFontDef::ASCIICode
(const Standard_Integer Chnum) const
{
return ( theASCIICodes->Value(Chnum) );
}
void IGESGraph_TextFontDef::NextCharOrigin
(const Standard_Integer Chnum,
Standard_Integer& NX, Standard_Integer& NY) const
{
NX = theNextCharOriginX->Value(Chnum);
NY = theNextCharOriginY->Value(Chnum);
}
Standard_Integer IGESGraph_TextFontDef::NbPenMotions
(const Standard_Integer Chnum) const
{
return ( theNbPenMotions->Value(Chnum) );
}
Standard_Boolean IGESGraph_TextFontDef::IsPenUp
(const Standard_Integer Chnum, const Standard_Integer Motionnum) const
{
Handle(TColStd_HArray1OfInteger) MotionArr = thePenMotions->Value(Chnum);
Standard_Integer PenStatus = MotionArr->Value(Motionnum);
return ( PenStatus == 1 );
}
void IGESGraph_TextFontDef::NextPenPosition
(const Standard_Integer Chnum, const Standard_Integer Motionnum,
Standard_Integer& IX, Standard_Integer& IY) const
{
IX = thePenMovesToX->Value(Chnum)->Value(Motionnum);
IY = thePenMovesToY->Value(Chnum)->Value(Motionnum);
}

View File

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

View File

@@ -0,0 +1,113 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_Color.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolColor.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <IGESData_Dump.hxx>
IGESGraph_ToolColor::IGESGraph_ToolColor () { }
void IGESGraph_ToolColor::ReadOwnParams
(const Handle(IGESGraph_Color)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
Standard_Real tempRed, tempGreen, tempBlue;
Handle(TCollection_HAsciiString) tempColorName;
PR.ReadReal(PR.Current(), "RED as % Of Full Intensity", tempRed);
PR.ReadReal(PR.Current(), "GREEN as % Of Full Intensity", tempGreen);
PR.ReadReal(PR.Current(), "BLUE as % Of Full Intensity", tempBlue);
if ((PR.CurrentNumber() <= PR.NbParams()) &&
(PR.ParamType(PR.CurrentNumber()) == Interface_ParamText))
PR.ReadText(PR.Current(), "Color Name", tempColorName);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(tempRed, tempGreen, tempBlue, tempColorName);
}
void IGESGraph_ToolColor::WriteOwnParams
(const Handle(IGESGraph_Color)& ent, IGESData_IGESWriter& IW) const
{
Standard_Real Red,Green,Blue;
ent->RGBIntensity(Red,Green,Blue);
IW.Send(Red);
IW.Send(Green);
IW.Send(Blue);
// ATTENTION place a reserver (Null) silya des pointeurs additionnels
if (ent->HasColorName())
IW.Send(ent->ColorName());
else IW.SendVoid(); // placekeeper to be reserved for additional pointers
}
void IGESGraph_ToolColor::OwnShared
(const Handle(IGESGraph_Color)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolColor::OwnCopy
(const Handle(IGESGraph_Color)& another,
const Handle(IGESGraph_Color)& ent, Interface_CopyTool& /*TC*/) const
{
Standard_Real tempRed, tempGreen, tempBlue;
Handle(TCollection_HAsciiString) tempColorName;
another->RGBIntensity(tempRed, tempGreen, tempBlue);
if (another->HasColorName())
tempColorName = new TCollection_HAsciiString(another->ColorName());
ent->Init(tempRed, tempGreen, tempBlue, tempColorName);
}
IGESData_DirChecker IGESGraph_ToolColor::DirChecker
(const Handle(IGESGraph_Color)& /*ent*/ ) const
{
IGESData_DirChecker DC(314, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefAny);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(2);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolColor::OwnCheck
(const Handle(IGESGraph_Color)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
// if (ent->RankColor() == 0)
// ach.AddFail("Color Rank is zero");
// else if (ent->RankColor() < 1 || ent->RankColor() > 8)
// ach.AddFail("Color Rank not between 1 to 8");
}
void IGESGraph_ToolColor::OwnDump
(const Handle(IGESGraph_Color)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_Color" << endl;
Standard_Real Red,Green,Blue;
ent->RGBIntensity(Red,Green,Blue);
S << "Red (in % Of Full Intensity) : " << Red << endl;
S << "Green (in % Of Full Intensity) : " << Green << endl;
S << "Blue (in % Of Full Intensity) : " << Blue << endl;
S << "Color Name : ";
IGESData_DumpString(S,ent->ColorName());
S << endl;
}

View File

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

View File

@@ -0,0 +1,103 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_DefinitionLevel.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <Interface_Macros.hxx>
#include <IGESGraph_ToolDefinitionLevel.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_Dump.hxx>
IGESGraph_ToolDefinitionLevel::IGESGraph_ToolDefinitionLevel () { }
void IGESGraph_ToolDefinitionLevel::ReadOwnParams
(const Handle(IGESGraph_DefinitionLevel)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer nbval;
Handle(TColStd_HArray1OfInteger) levelNumbers;
// Reading nbval(No. of Property Values)
Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of Property Values", nbval);
if (st && nbval > 0)
{
// Reading levelNumbers(HArray1OfInteger)
// levelNumbers = new TColStd_HArray1OfInteger(1, nbval); done by :
PR.ReadInts(PR.CurrentList(nbval), "array levelNumbers", levelNumbers, 1); //szv#4:S4163:12Mar99 `st=` not needed
}
else PR.AddFail("No. of Property Values : Not Positive");
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(levelNumbers);
}
void IGESGraph_ToolDefinitionLevel::WriteOwnParams
(const Handle(IGESGraph_DefinitionLevel)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer Up = ent->NbPropertyValues();
IW.Send( Up );
for ( Standard_Integer i = 1; i <= Up; i++)
IW.Send( ent->LevelNumber(i) );
}
void IGESGraph_ToolDefinitionLevel::OwnShared
(const Handle(IGESGraph_DefinitionLevel)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolDefinitionLevel::OwnCopy
(const Handle(IGESGraph_DefinitionLevel)& another,
const Handle(IGESGraph_DefinitionLevel)& ent, Interface_CopyTool& /*TC*/) const
{
Standard_Integer nbval;
Handle(TColStd_HArray1OfInteger) levelNumbers;
nbval = another->NbPropertyValues();
levelNumbers = new TColStd_HArray1OfInteger(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
levelNumbers->SetValue( i, another->LevelNumber(i) );
ent->Init(levelNumbers);
}
IGESData_DirChecker IGESGraph_ToolDefinitionLevel::DirChecker
(const Handle(IGESGraph_DefinitionLevel)& /*ent*/) const
{
IGESData_DirChecker DC (406, 1);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolDefinitionLevel::OwnCheck
(const Handle(IGESGraph_DefinitionLevel)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESGraph_ToolDefinitionLevel::OwnDump
(const Handle(IGESGraph_DefinitionLevel)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGraph_DefinitionLevel" << endl;
S << "Level Numbers : ";
IGESData_DumpVals(S ,level,1, ent->NbPropertyValues(),ent->LevelNumber);
S << endl;
}

View File

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

View File

@@ -0,0 +1,102 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_DrawingSize.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolDrawingSize.ixx>
#include <IGESData_ParamCursor.hxx>
IGESGraph_ToolDrawingSize::IGESGraph_ToolDrawingSize () { }
void IGESGraph_ToolDrawingSize::ReadOwnParams
(const Handle(IGESGraph_DrawingSize)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbPropertyValues;
Standard_Real xSize;
Standard_Real ySize;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
if (nbPropertyValues != 2)
PR.AddFail("No. of Property values : Value is not 2");
// Reading xSize(Real)
PR.ReadReal (PR.Current(), "Drawing extent along +ve XD axis", xSize); //szv#4:S4163:12Mar99 `st=` not needed
// Reading ySize(Real)
PR.ReadReal (PR.Current(), "Drawing extent along +ve YD axis", ySize); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(nbPropertyValues, xSize, ySize);
}
void IGESGraph_ToolDrawingSize::WriteOwnParams
(const Handle(IGESGraph_DrawingSize)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.Send( ent->XSize() );
IW.Send( ent->YSize() );
}
void IGESGraph_ToolDrawingSize::OwnShared
(const Handle(IGESGraph_DrawingSize)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolDrawingSize::OwnCopy
(const Handle(IGESGraph_DrawingSize)& another,
const Handle(IGESGraph_DrawingSize)& ent, Interface_CopyTool& /*TC*/) const
{
ent->Init(2,another->XSize(),another->YSize());
}
Standard_Boolean IGESGraph_ToolDrawingSize::OwnCorrect
(const Handle(IGESGraph_DrawingSize)& ent) const
{
Standard_Boolean res = (ent->NbPropertyValues() != 2);
if (res) ent->Init(2,ent->XSize(),ent->YSize()); // nbpropertyvalues=2
return res;
}
IGESData_DirChecker IGESGraph_ToolDrawingSize::DirChecker
(const Handle(IGESGraph_DrawingSize)& /*ent*/) const
{
IGESData_DirChecker DC (406, 16);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolDrawingSize::OwnCheck
(const Handle(IGESGraph_DrawingSize)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->NbPropertyValues() != 2)
ach->AddFail("No. of Property values : Value != 2");
}
void IGESGraph_ToolDrawingSize::OwnDump
(const Handle(IGESGraph_DrawingSize)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_DrawingSize" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Drawing extent along positive X-axis : " << ent->XSize() << endl;
S << "Drawing extent along positive Y-axis : " << ent->YSize() << endl;
S << endl;
}

View File

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

View File

@@ -0,0 +1,172 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_DrawingUnits.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolDrawingUnits.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <IGESData_Dump.hxx>
IGESGraph_ToolDrawingUnits::IGESGraph_ToolDrawingUnits () { }
void IGESGraph_ToolDrawingUnits::ReadOwnParams
(const Handle(IGESGraph_DrawingUnits)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbPropertyValues;
Standard_Integer flag;
Handle(TCollection_HAsciiString) unit;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
if (nbPropertyValues != 2)
PR.AddFail("No. of Property values : Value is not 2");
// Reading flag(Integer)
PR.ReadInteger(PR.Current(), "Units Flag", flag); //szv#4:S4163:12Mar99 `st=` not needed
// Reading unit(String)
PR.ReadText(PR.Current(), "Units Name", unit); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(nbPropertyValues, flag, unit);
}
void IGESGraph_ToolDrawingUnits::WriteOwnParams
(const Handle(IGESGraph_DrawingUnits)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.Send( ent->Flag() );
IW.Send( ent->Unit() );
}
void IGESGraph_ToolDrawingUnits::OwnShared
(const Handle(IGESGraph_DrawingUnits)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolDrawingUnits::OwnCopy
(const Handle(IGESGraph_DrawingUnits)& another,
const Handle(IGESGraph_DrawingUnits)& ent, Interface_CopyTool& /*TC*/) const
{
Standard_Integer NbPropertyValues;
Standard_Integer Flag;
Handle(TCollection_HAsciiString) Unit;
NbPropertyValues = another->NbPropertyValues();
Flag = another->Flag();
Unit = new TCollection_HAsciiString(another->Unit());
ent->Init(NbPropertyValues, Flag, Unit);
}
Standard_Boolean IGESGraph_ToolDrawingUnits::OwnCorrect
(const Handle(IGESGraph_DrawingUnits)& ent) const
{
Standard_Boolean res = (ent->NbPropertyValues() != 2);
// ya aussi les noms : Flag a priorite sur Unit
Standard_Integer unf = ent->Flag();
Handle(TCollection_HAsciiString) name;
Standard_CString unm = "";
if (!ent->Unit().IsNull()) unm = ent->Unit()->ToCString();
switch (unf) {
case 1 : if (strcmp(unm,"IN") && strcmp(unm,"INCH"))
name = new TCollection_HAsciiString ("IN"); break;
case 2 : if (strcmp(unm,"MM"))
name = new TCollection_HAsciiString ("MM"); break;
case 3 : break; // nom libre
case 4 : if (strcmp(unm,"FT"))
name = new TCollection_HAsciiString ("FT"); break;
case 5 : if (strcmp(unm,"MI"))
name = new TCollection_HAsciiString ("MI"); break;
case 6 : if (strcmp(unm,"M"))
name = new TCollection_HAsciiString ("M"); break;
case 7 : if (strcmp(unm,"KM"))
name = new TCollection_HAsciiString ("KM"); break;
case 8 : if (strcmp(unm,"MIL"))
name = new TCollection_HAsciiString ("MIL"); break;
case 9 : if (strcmp(unm,"UM"))
name = new TCollection_HAsciiString ("UM"); break;
case 10 : if (strcmp(unm,"CM"))
name = new TCollection_HAsciiString ("CM"); break;
case 11 : if (strcmp(unm,"UIN"))
name = new TCollection_HAsciiString ("UIN"); break;
default : break; // on ne peut rien faire ... ?
}
res |= (!name.IsNull());
if (name.IsNull()) name = ent->Unit();
if (res) ent->Init(2,unf,name); // nbpropertyvalues=2 + Unit Flag//Name
return res;
}
IGESData_DirChecker IGESGraph_ToolDrawingUnits::DirChecker
(const Handle(IGESGraph_DrawingUnits)& /*ent*/) const
{
IGESData_DirChecker DC (406, 17);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolDrawingUnits::OwnCheck
(const Handle(IGESGraph_DrawingUnits)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->NbPropertyValues() != 2)
ach->AddFail("No. of Property values : Value != 2");
// Check Flag//Unit Name
Standard_Integer unf = ent->Flag();
if (ent->Unit().IsNull()) {
if (unf == 3) ach->AddFail
("Unit Flag = 3 (user def.) and Unit Name undefined");
} else {
Standard_CString unm = ent->Unit()->ToCString();
Standard_Boolean unok = Standard_True;
switch (unf) {
case 1 : unok = (!strcmp(unm,"IN") || !strcmp(unm,"INCH")); break;
case 2 : unok = !strcmp(unm,"MM"); break;
case 3 : unok = Standard_True; break; // nom libre
case 4 : unok = !strcmp(unm,"FT"); break;
case 5 : unok = !strcmp(unm,"MI"); break;
case 6 : unok = !strcmp(unm,"M"); break;
case 7 : unok = !strcmp(unm,"KM"); break;
case 8 : unok = !strcmp(unm,"MIL"); break;
case 9 : unok = !strcmp(unm,"UM"); break;
case 10 : unok = !strcmp(unm,"CM"); break;
case 11 : unok = !strcmp(unm,"UIN"); break;
default : ach->AddFail("Unit Flag not in range 1 - 11");
break;
}
if (!unok) ach->AddFail("Unit Flag & Name not accorded");
}
}
void IGESGraph_ToolDrawingUnits::OwnDump
(const Handle(IGESGraph_DrawingUnits)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_DrawingUnits" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << " Units Flag : " << ent->Flag();
S << " Units Name : ";
IGESData_DumpString(S,ent->Unit());
S << " computed Value (in meters) : " << ent->UnitValue();
S << endl;
}

View File

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

View File

@@ -0,0 +1,97 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_HighLight.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolHighLight.ixx>
#include <IGESData_ParamCursor.hxx>
IGESGraph_ToolHighLight::IGESGraph_ToolHighLight () { }
void IGESGraph_ToolHighLight::ReadOwnParams
(const Handle(IGESGraph_HighLight)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
Standard_Integer nbPropertyValues;
Standard_Integer highLightStatus;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues);
if (nbPropertyValues != 1)
PR.AddFail("No. of Property values : Value is not 1");
if (PR.DefinedElseSkip())
// Reading highLightStatus(Integer)
PR.ReadInteger (PR.Current(), "Highlight flag", highLightStatus);
else
highLightStatus = 0; // Default Value
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(nbPropertyValues, highLightStatus);
}
void IGESGraph_ToolHighLight::WriteOwnParams
(const Handle(IGESGraph_HighLight)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.Send( ent->HighLightStatus() );
}
void IGESGraph_ToolHighLight::OwnShared
(const Handle(IGESGraph_HighLight)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolHighLight::OwnCopy
(const Handle(IGESGraph_HighLight)& another,
const Handle(IGESGraph_HighLight)& ent, Interface_CopyTool& /*TC*/) const
{
ent->Init(1,another->HighLightStatus());
}
Standard_Boolean IGESGraph_ToolHighLight::OwnCorrect
(const Handle(IGESGraph_HighLight)& ent) const
{
Standard_Boolean res = (ent->NbPropertyValues() != 1);
if (res) ent->Init(1,ent->HighLightStatus()); // nbpropertyvalues=1
return res;
}
IGESData_DirChecker IGESGraph_ToolHighLight::DirChecker
(const Handle(IGESGraph_HighLight)& /*ent*/) const
{
IGESData_DirChecker DC (406, 20);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolHighLight::OwnCheck
(const Handle(IGESGraph_HighLight)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->NbPropertyValues() != 1)
ach->AddFail("No. of Property values : Value != 1");
}
void IGESGraph_ToolHighLight::OwnDump
(const Handle(IGESGraph_HighLight)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_HighLight" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Highlight Status : " << ent->HighLightStatus() << endl;
S << endl;
}

View File

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

View File

@@ -0,0 +1,99 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_IntercharacterSpacing.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolIntercharacterSpacing.ixx>
#include <IGESData_ParamCursor.hxx>
IGESGraph_ToolIntercharacterSpacing::IGESGraph_ToolIntercharacterSpacing ()
{ }
void IGESGraph_ToolIntercharacterSpacing::ReadOwnParams
(const Handle(IGESGraph_IntercharacterSpacing)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbPropertyValues;
Standard_Real iSpace;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
if (nbPropertyValues != 1)
PR.AddFail("No. of Property values : Value is not 1");
// Reading iSpace(Real)
PR.ReadReal(PR.Current(), "Intercharacter space in % of text height", iSpace); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(nbPropertyValues, iSpace);
}
void IGESGraph_ToolIntercharacterSpacing::WriteOwnParams
(const Handle(IGESGraph_IntercharacterSpacing)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.Send( ent->ISpace() );
}
void IGESGraph_ToolIntercharacterSpacing::OwnShared
(const Handle(IGESGraph_IntercharacterSpacing)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolIntercharacterSpacing::OwnCopy
(const Handle(IGESGraph_IntercharacterSpacing)& another,
const Handle(IGESGraph_IntercharacterSpacing)& ent, Interface_CopyTool& /*TC*/) const
{
ent->Init(1,another->ISpace());
}
Standard_Boolean IGESGraph_ToolIntercharacterSpacing::OwnCorrect
(const Handle(IGESGraph_IntercharacterSpacing)& ent) const
{
Standard_Boolean res = (ent->NbPropertyValues() != 1);
if (res) ent->Init(1,ent->ISpace()); // nbpropertyvalues=1
return res;
}
IGESData_DirChecker IGESGraph_ToolIntercharacterSpacing::DirChecker
(const Handle(IGESGraph_IntercharacterSpacing)& /*ent*/) const
{
IGESData_DirChecker DC (406, 18);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolIntercharacterSpacing::OwnCheck
(const Handle(IGESGraph_IntercharacterSpacing)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if ((ent->ISpace() < 0.0) || (ent->ISpace() > 100.0))
ach->AddFail("Intercharacter Space : Value not in the range [0-100]");
if (ent->NbPropertyValues() != 1)
ach->AddFail("No. of Property values : Value != 1");
}
void IGESGraph_ToolIntercharacterSpacing::OwnDump
(const Handle(IGESGraph_IntercharacterSpacing)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_IntercharacterSpacing" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Intercharacter space in % of text height : " << ent->ISpace() << endl;
S << endl;
}

View File

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

View File

@@ -0,0 +1,130 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_LineFontDefPattern.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolLineFontDefPattern.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESGraph_ToolLineFontDefPattern::IGESGraph_ToolLineFontDefPattern () { }
void IGESGraph_ToolLineFontDefPattern::ReadOwnParams
(const Handle(IGESGraph_LineFontDefPattern)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer tempNbSeg;
Handle(TCollection_HAsciiString) tempDisplayPattern;
Handle(TColStd_HArray1OfReal) tempSegmentLengths;
if (PR.ReadInteger(PR.Current(), "Number of Visible-Blank Segments", tempNbSeg)) { //szv#4:S4163:12Mar99 `st=` not needed
// Initialise HArray1 only if there is no error reading its Length
if (tempNbSeg <= 0) PR.AddFail("Number of Visible-Blank Segments : Not Positive");
else tempSegmentLengths = new TColStd_HArray1OfReal(1, tempNbSeg);
}
// Read the HArray1 only if its Length was read without any Error
if (! tempSegmentLengths.IsNull()) {
Standard_Integer I;
for (I = 1; I <= tempNbSeg; I++) {
Standard_Real tempReal;
if (PR.ReadReal(PR.Current(), "Length of Segment", tempReal)) //szv#4:S4163:12Mar99 `st=` not needed
tempSegmentLengths->SetValue(I, tempReal);
}
}
PR.ReadText(PR.Current(), "Visible-Blank Display Pattern", tempDisplayPattern); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(tempSegmentLengths, tempDisplayPattern);
}
void IGESGraph_ToolLineFontDefPattern::WriteOwnParams
(const Handle(IGESGraph_LineFontDefPattern)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer up = ent->NbSegments();
IW.Send(up);
Standard_Integer I;
for (I = 1; I <= up; I++)
IW.Send(ent->Length(I));
IW.Send(ent->DisplayPattern());
}
void IGESGraph_ToolLineFontDefPattern::OwnShared
(const Handle(IGESGraph_LineFontDefPattern)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolLineFontDefPattern::OwnCopy
(const Handle(IGESGraph_LineFontDefPattern)& another,
const Handle(IGESGraph_LineFontDefPattern)& ent, Interface_CopyTool& /*TC*/) const
{
Handle(TColStd_HArray1OfReal) tempSegmentLengths =
new TColStd_HArray1OfReal(1, another->NbSegments());
Standard_Integer I;
Standard_Integer up = another->NbSegments();
for (I = 1; I <= up; I++)
tempSegmentLengths->SetValue(I, another->Length(I));
Handle(TCollection_HAsciiString) tempDisplayPattern =
new TCollection_HAsciiString(another->DisplayPattern());
ent->Init(tempSegmentLengths, tempDisplayPattern);
}
IGESData_DirChecker IGESGraph_ToolLineFontDefPattern::DirChecker
(const Handle(IGESGraph_LineFontDefPattern)& /*ent*/) const
{
IGESData_DirChecker DC(304, 2);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefValue);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(2);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolLineFontDefPattern::OwnCheck
(const Handle(IGESGraph_LineFontDefPattern)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->RankLineFont() == 0)
ach->AddWarning("Line Font Rank is zero");
else if (ent->RankLineFont() < 1 || ent->RankLineFont() > 5)
ach->AddWarning("Invalid Value As Line Font Rank(Valid Range 1 to 5)");
}
void IGESGraph_ToolLineFontDefPattern::OwnDump
(const Handle(IGESGraph_LineFontDefPattern)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESGraph_LineFontDefPattern" << endl;
S << "Visible-Blank Segments : ";
Standard_Integer nb = ent->NbSegments();
IGESData_DumpVals(S ,level,1, nb,ent->Length);
S <<endl << "Display Pattern : ";
IGESData_DumpString(S,ent->DisplayPattern());
S << endl;
if (level > 4) {
S << " -> Which Segments are Visible (the others are Blank) : " << endl;
for (Standard_Integer I = 1; I <= nb; I ++) {
if (ent->IsVisible(I)) S << " " << I;
}
S << endl;
}
}

View File

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

View File

@@ -0,0 +1,114 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_LineFontDefTemplate.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolLineFontDefTemplate.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESBasic_SubfigureDef.hxx>
#include <Interface_Macros.hxx>
IGESGraph_ToolLineFontDefTemplate::IGESGraph_ToolLineFontDefTemplate () { }
void IGESGraph_ToolLineFontDefTemplate::ReadOwnParams
(const Handle(IGESGraph_LineFontDefTemplate)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer tempOrientation;
Standard_Real tempDistance, tempScale;
Handle(IGESBasic_SubfigureDef) tempTemplateEntity;
PR.ReadInteger(PR.Current(), "Template Orientation", tempOrientation); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadEntity(IR, PR.Current(),
"Subfigure Definition Entity for Template Display",
STANDARD_TYPE(IGESBasic_SubfigureDef), tempTemplateEntity); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), "Distance between successive Template",
tempDistance); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadReal(PR.Current(), "Scale Factor For Subfigure", tempScale); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init (tempOrientation, tempTemplateEntity, tempDistance, tempScale);
}
void IGESGraph_ToolLineFontDefTemplate::WriteOwnParams
(const Handle(IGESGraph_LineFontDefTemplate)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->Orientation());
IW.Send(ent->TemplateEntity());
IW.Send(ent->Distance());
IW.Send(ent->Scale());
}
void IGESGraph_ToolLineFontDefTemplate::OwnShared
(const Handle(IGESGraph_LineFontDefTemplate)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->TemplateEntity());
}
void IGESGraph_ToolLineFontDefTemplate::OwnCopy
(const Handle(IGESGraph_LineFontDefTemplate)& another,
const Handle(IGESGraph_LineFontDefTemplate)& ent, Interface_CopyTool& TC) const
{
Standard_Integer tempOrientation = another->Orientation();
DeclareAndCast(IGESBasic_SubfigureDef, tempTemplateSubfigure,
TC.Transferred(another->TemplateEntity()));
Standard_Real tempDistance = another->Distance();
Standard_Real tempScale = another->Scale();
ent->Init(tempOrientation, tempTemplateSubfigure, tempDistance, tempScale);
}
IGESData_DirChecker IGESGraph_ToolLineFontDefTemplate::DirChecker
(const Handle(IGESGraph_LineFontDefTemplate)& /*ent*/) const
{
IGESData_DirChecker DC(304, 1);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefValue);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(2);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolLineFontDefTemplate::OwnCheck
(const Handle(IGESGraph_LineFontDefTemplate)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->RankLineFont() == 0)
ach->AddWarning("Line Font Rank is zero");
else if ((ent->RankLineFont() < 1) || (ent->RankLineFont() > 5))
ach->AddWarning("Invalid Value As Line Font Rank");
}
void IGESGraph_ToolLineFontDefTemplate::OwnDump
(const Handle(IGESGraph_LineFontDefTemplate)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer tempSubLevel = (level <= 4) ? 0 : 1;
S << "IGESGraph_LineFontDefTemplate" << endl;
S << "Orientation : " << ent->Orientation() << endl;
S << "Subfigure Display Entity For Template Display : ";
dumper.Dump(ent->TemplateEntity(),S, tempSubLevel);
S << endl;
S << "Length Between Successive Template Figure : " << ent->Distance()<<endl;
S << "Scale Factor for Subfigure : " << ent->Scale() << endl;
S << endl;
}

View File

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

View File

@@ -0,0 +1,96 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_LineFontPredefined.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolLineFontPredefined.ixx>
#include <IGESData_ParamCursor.hxx>
IGESGraph_ToolLineFontPredefined::IGESGraph_ToolLineFontPredefined () { }
void IGESGraph_ToolLineFontPredefined::ReadOwnParams
(const Handle(IGESGraph_LineFontPredefined)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbPropertyValues;
Standard_Integer lineFontPatternCode;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
if (nbPropertyValues != 1)
PR.AddFail("No. of Property values : Value is not 1");
// Reading lineFontPatternCode(Integer)
PR.ReadInteger(PR.Current(), "Line Font Pattern Code", lineFontPatternCode); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(nbPropertyValues, lineFontPatternCode);
}
void IGESGraph_ToolLineFontPredefined::WriteOwnParams
(const Handle(IGESGraph_LineFontPredefined)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.Send( ent->LineFontPatternCode() );
}
void IGESGraph_ToolLineFontPredefined::OwnShared
(const Handle(IGESGraph_LineFontPredefined)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolLineFontPredefined::OwnCopy
(const Handle(IGESGraph_LineFontPredefined)& another,
const Handle(IGESGraph_LineFontPredefined)& ent, Interface_CopyTool& /*TC*/) const
{
ent->Init(1,another->LineFontPatternCode());
}
Standard_Boolean IGESGraph_ToolLineFontPredefined::OwnCorrect
(const Handle(IGESGraph_LineFontPredefined)& ent) const
{
Standard_Boolean res = (ent->NbPropertyValues() != 1);
if (res) ent->Init(1,ent->LineFontPatternCode()); // nbpropertyvalues=1
return res;
}
IGESData_DirChecker IGESGraph_ToolLineFontPredefined::DirChecker
(const Handle(IGESGraph_LineFontPredefined)& /*ent*/) const
{
IGESData_DirChecker DC (406, 19);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolLineFontPredefined::OwnCheck
(const Handle(IGESGraph_LineFontPredefined)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->NbPropertyValues() != 1)
ach->AddFail("No. of Property values : Value != 1");
}
void IGESGraph_ToolLineFontPredefined::OwnDump
(const Handle(IGESGraph_LineFontPredefined)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_LineFontPredefined" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Line font pattern code : " << ent->LineFontPatternCode() << endl;
S << endl;
}

View File

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

View File

@@ -0,0 +1,139 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_NominalSize.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolNominalSize.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <IGESData_Dump.hxx>
IGESGraph_ToolNominalSize::IGESGraph_ToolNominalSize () { }
void IGESGraph_ToolNominalSize::ReadOwnParams
(const Handle(IGESGraph_NominalSize)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Integer nbPropertyValues;
Standard_Real nominalSizeValue;
Handle(TCollection_HAsciiString) nominalSizeName;
Handle(TCollection_HAsciiString) standardName;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
if ( (nbPropertyValues != 2) && (nbPropertyValues != 3) )
PR.AddFail("No. of Property values : Value is not 2/3");
// Reading nominalSizeValue(Real)
PR.ReadReal (PR.Current(), "Nominal size value", nominalSizeValue); //szv#4:S4163:12Mar99 `st=` not needed
// Reading nominalSizeName(String)
PR.ReadText (PR.Current(), "Nominal size name", nominalSizeName); //szv#4:S4163:12Mar99 `st=` not needed
if ( PR.NbParams() >= PR.CurrentNumber() )
{
Standard_Integer num = PR.CurrentNumber();
if ( PR.ParamType(num) == Interface_ParamText )
// Reading standardName(String)
PR.ReadText (PR.Current(), "Name of relevant engg. standard",
standardName); //szv#4:S4163:12Mar99 `st=` not needed
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(nbPropertyValues, nominalSizeValue, nominalSizeName, standardName);
}
void IGESGraph_ToolNominalSize::WriteOwnParams
(const Handle(IGESGraph_NominalSize)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.Send( ent->NominalSizeValue() );
IW.Send( ent->NominalSizeName() );
if (ent->HasStandardName() )
IW.Send( ent->StandardName() ); // optionnal
}
void IGESGraph_ToolNominalSize::OwnShared
(const Handle(IGESGraph_NominalSize)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolNominalSize::OwnCopy
(const Handle(IGESGraph_NominalSize)& another,
const Handle(IGESGraph_NominalSize)& ent, Interface_CopyTool& /*TC*/) const
{
Standard_Integer nbPropertyValues;
Standard_Real nominalSizeValue;
Handle(TCollection_HAsciiString) nominalSizeName;
Handle(TCollection_HAsciiString) standardName;
nbPropertyValues = another->NbPropertyValues();
nominalSizeValue = another->NominalSizeValue();
nominalSizeName = new TCollection_HAsciiString(another->NominalSizeName());
if (another->HasStandardName()) standardName =
new TCollection_HAsciiString(another->StandardName());
ent->Init(nbPropertyValues, nominalSizeValue, nominalSizeName, standardName);
}
Standard_Boolean IGESGraph_ToolNominalSize::OwnCorrect
(const Handle(IGESGraph_NominalSize)& ent) const
{
Standard_Integer nbp = 2;
if (ent->HasStandardName()) nbp = 3;
Standard_Boolean res = ( ent->NbPropertyValues() != nbp);
if (res) ent->Init
(nbp,ent->NominalSizeValue(),ent->NominalSizeName(),ent->StandardName());
return res; // nbpropertyvalues=2/3 selon standard
}
IGESData_DirChecker IGESGraph_ToolNominalSize::DirChecker
(const Handle(IGESGraph_NominalSize)& /*ent*/) const
{
IGESData_DirChecker DC (406, 13);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolNominalSize::OwnCheck
(const Handle(IGESGraph_NominalSize)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Integer nbp = 2;
if (ent->HasStandardName()) nbp = 3;
if ( ent->NbPropertyValues() != nbp) ach->AddFail
("No. of Property values : Value != 2/3 according Standard Name Status");
}
void IGESGraph_ToolNominalSize::OwnDump
(const Handle(IGESGraph_NominalSize)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_NominalSize" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Nominal size value : " << ent->NominalSizeValue() << endl;
S << "Nominal size name : ";
IGESData_DumpString(S,ent->NominalSizeName());
S << endl;
S << "Name of relevant engineering standard : ";
IGESData_DumpString(S,ent->StandardName());
S << endl;
}

View File

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

View File

@@ -0,0 +1,100 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_Pick.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolPick.ixx>
#include <IGESData_ParamCursor.hxx>
IGESGraph_ToolPick::IGESGraph_ToolPick () { }
void IGESGraph_ToolPick::ReadOwnParams
(const Handle(IGESGraph_Pick)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
Standard_Integer nbPropertyValues;
Standard_Integer pickStatus;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues);
if (nbPropertyValues != 1)
PR.AddFail("No. of Property values : Value is not 1");
if (PR.DefinedElseSkip())
// Reading pickStatus(Integer)
PR.ReadInteger( PR.Current(), "Pick Flag", pickStatus);
else
pickStatus = 0; // Default Value
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(nbPropertyValues, pickStatus);
}
void IGESGraph_ToolPick::WriteOwnParams
(const Handle(IGESGraph_Pick)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.Send( ent->PickFlag() );
}
void IGESGraph_ToolPick::OwnShared
(const Handle(IGESGraph_Pick)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolPick::OwnCopy
(const Handle(IGESGraph_Pick)& another,
const Handle(IGESGraph_Pick)& ent, Interface_CopyTool& /*TC*/) const
{
ent->Init(1,another->PickFlag());
}
Standard_Boolean IGESGraph_ToolPick::OwnCorrect
(const Handle(IGESGraph_Pick)& ent) const
{
Standard_Boolean res = (ent->NbPropertyValues() != 1);
if (res) ent->Init(1,ent->PickFlag()); // nbpropertyvalues=1
return res;
}
IGESData_DirChecker IGESGraph_ToolPick::DirChecker
(const Handle(IGESGraph_Pick)& /*ent*/) const
{
IGESData_DirChecker DC (406, 21);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolPick::OwnCheck
(const Handle(IGESGraph_Pick)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->NbPropertyValues() != 1)
ach->AddFail("No. of Property values : Value != 1");
if ( (ent->PickFlag() != 0) && (ent->PickFlag() != 1) )
ach->AddFail("Pick Flag : Value != 0/1");
}
void IGESGraph_ToolPick::OwnDump
(const Handle(IGESGraph_Pick)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_Pick" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Pick flag : " << ent->PickFlag();
S << (ent->PickFlag() == 0 ? " NO" : " YES" );
S << endl;
}

View File

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

View File

@@ -0,0 +1,191 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_TextDisplayTemplate.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolTextDisplayTemplate.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <gp_GTrsf.hxx>
#include <IGESGraph_TextFontDef.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESGraph_ToolTextDisplayTemplate::IGESGraph_ToolTextDisplayTemplate () { }
void IGESGraph_ToolTextDisplayTemplate::ReadOwnParams
(const Handle(IGESGraph_TextDisplayTemplate)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Standard_Real boxWidth;
Standard_Real boxHeight;
Standard_Integer fontCode;
Handle(IGESGraph_TextFontDef) fontEnt;
Standard_Real slantAngle;
Standard_Real rotationAngle;
Standard_Integer mirrorFlag;
Standard_Integer rotateFlag;
gp_XYZ corner;
// Reading boxWidth(Real)
PR.ReadReal(PR.Current(), "Character box width", boxWidth); //szv#4:S4163:12Mar99 `st=` not needed
// Reading boxHeight(Real)
PR.ReadReal(PR.Current(), "Character box height", boxHeight); //szv#4:S4163:12Mar99 `st=` not needed
Standard_Integer curnum = PR.CurrentNumber();
if (PR.DefinedElseSkip())
{
// Reading fontCode(Integer, must be positive)
PR.ReadInteger (PR.Current(), "Font Code", fontCode); //szv#4:S4163:12Mar99 `st=` not needed
// Reading fontEnt(TextFontDef) ?
if (fontCode < 0) {
fontEnt = GetCasted(IGESGraph_TextFontDef,PR.ParamEntity (IR,curnum));
if (fontEnt.IsNull()) PR.AddFail("Font Entity : incorrect reference");
}
}
else
fontCode = 1; // Default Value
if (PR.DefinedElseSkip())
// Reading slantAngle(Real)
PR.ReadReal (PR.Current(), "Slant Angle", slantAngle); //szv#4:S4163:12Mar99 `st=` not needed
else
slantAngle = PI/2.0; // Default Value
// Reading rotationAngle(Real)
PR.ReadReal (PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 `st=` not needed
// Reading mirrorFlag(Integer)
PR.ReadInteger (PR.Current(), "Mirror Flag", mirrorFlag); //szv#4:S4163:12Mar99 `st=` not needed
// Reading rotateFlag(Integer)
PR.ReadInteger (PR.Current(), "Rotate Flag", rotateFlag); //szv#4:S4163:12Mar99 `st=` not needed
// Reading corner(XYZ)
PR.ReadXYZ( PR.CurrentList(1, 3), "Lower left coordinates/Increments", corner); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(boxWidth, boxHeight, fontCode, fontEnt,
slantAngle, rotationAngle, mirrorFlag, rotateFlag, corner);
}
void IGESGraph_ToolTextDisplayTemplate::WriteOwnParams
(const Handle(IGESGraph_TextDisplayTemplate)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->BoxWidth() );
IW.Send( ent->BoxHeight() );
if ( ent->IsFontEntity() )
IW.Send( ent->FontEntity(), Standard_True ); // negative
else
IW.Send( ent->FontCode() );
IW.Send( ent->SlantAngle() );
IW.Send( ent->RotationAngle() );
IW.Send( ent->MirrorFlag() );
IW.Send( ent->RotateFlag() );
IW.Send( ent->StartingCorner().X() );
IW.Send( ent->StartingCorner().Y() );
IW.Send( ent->StartingCorner().Z() );
}
void IGESGraph_ToolTextDisplayTemplate::OwnShared
(const Handle(IGESGraph_TextDisplayTemplate)& ent, Interface_EntityIterator& iter) const
{
if ( ent->IsFontEntity() )
iter.GetOneItem( ent->FontEntity() );
}
void IGESGraph_ToolTextDisplayTemplate::OwnCopy
(const Handle(IGESGraph_TextDisplayTemplate)& another,
const Handle(IGESGraph_TextDisplayTemplate)& ent, Interface_CopyTool& TC) const
{
Standard_Real boxWidth;
Standard_Real boxHeight;
Standard_Integer fontCode=0;
Handle(IGESGraph_TextFontDef) fontEntity;
Standard_Real slantAngle;
Standard_Real rotationAngle;
Standard_Integer mirrorFlag;
Standard_Integer rotateFlag;
gp_XYZ corner;
boxWidth = another->BoxWidth();
boxHeight = another->BoxHeight();
if ( another->IsFontEntity() )
fontEntity =
Handle(IGESGraph_TextFontDef)::DownCast (TC.Transferred(another->FontEntity()));
else
fontCode = another->FontCode();
slantAngle = another->SlantAngle();
rotationAngle = another->RotationAngle();
mirrorFlag = another->MirrorFlag();
rotateFlag = another->RotateFlag();
corner = another->StartingCorner().XYZ();
ent->Init(boxWidth, boxHeight, fontCode, fontEntity,
slantAngle, rotationAngle, mirrorFlag, rotateFlag, corner);
}
IGESData_DirChecker IGESGraph_ToolTextDisplayTemplate::DirChecker
(const Handle(IGESGraph_TextDisplayTemplate)& /*ent*/) const
{
IGESData_DirChecker DC (312, 0, 1);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefAny);
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(2);
DC.HierarchyStatusRequired(0);
return DC;
}
void IGESGraph_ToolTextDisplayTemplate::OwnCheck
(const Handle(IGESGraph_TextDisplayTemplate)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESGraph_ToolTextDisplayTemplate::OwnDump
(const Handle(IGESGraph_TextDisplayTemplate)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
S << "IGESGraph_TextDisplayTemplate" << endl;
S << "Character box width : " << ent->BoxWidth() << " ";
S << "Character box height : " << ent->BoxHeight() << endl;
if ( ent->IsFontEntity() )
{
S << "Font Entity : ";
dumper.Dump(ent->FontEntity(),S, sublevel);
}
else
S << "Font code : " << ent->FontCode();
S << endl;
S << "Slant angle : " << ent->SlantAngle() << " ";
S << "Rotation angle : " << ent->RotationAngle() << endl;
S << "Mirror flag : " << ent->MirrorFlag() << " ";
S << "Rotate flag : " << ent->RotateFlag() << endl;
if ( ent->FormNumber() == 0 )
S << "Lower Left Corner coordinates : ";
else
S << "Increments from coordinates : ";
IGESData_DumpXYZL(S,level, ent->StartingCorner(), ent->Location());
S << endl;
}

View File

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

View File

@@ -0,0 +1,328 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_TextFontDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolTextFontDef.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_GTrsf.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt2d.hxx>
#include <TCollection_HAsciiString.hxx>
#include <IGESGraph_TextFontDef.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColgp_HArray1OfXY.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESBasic_HArray1OfHArray1OfInteger.hxx>
#include <IGESBasic_HArray1OfHArray1OfXY.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESGraph_ToolTextFontDef::IGESGraph_ToolTextFontDef () { }
void IGESGraph_ToolTextFontDef::ReadOwnParams
(const Handle(IGESGraph_TextFontDef)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer nbval;
Standard_Integer fontCode;
Handle(TCollection_HAsciiString) fontName;
Standard_Integer supersededFont;
Handle(IGESGraph_TextFontDef) supersededEntity;
Standard_Integer scale;
Handle(TColStd_HArray1OfInteger) aSCIICodes;
Handle(TColStd_HArray1OfInteger) nextCharX, nextCharY;
Handle(TColStd_HArray1OfInteger) penMotions;
Handle(IGESBasic_HArray1OfHArray1OfInteger) penFlags;
Handle(IGESBasic_HArray1OfHArray1OfInteger) movePenX, movePenY;
Standard_Integer tempCode, tempNextX,tempNextY;
Standard_Integer tempMotion;
Standard_Integer tempFlag, tempMoveX,tempMoveY;
// Reading fontCode(Integer)
PR.ReadInteger (PR.Current(), "Font Code", fontCode); //szv#4:S4163:12Mar99 `st=` not needed
// Reading fontName(String)
PR.ReadText (PR.Current(), "Font Name", fontName); //szv#4:S4163:12Mar99 `st=` not needed
if ( PR.IsParamEntity(PR.CurrentNumber()) )
{
supersededFont = -1;
// Reading supersededEntity(TextFontDef)
PR.ReadEntity (IR, PR.Current(), "Text Definition Entity",
STANDARD_TYPE(IGESGraph_TextFontDef), supersededEntity); //szv#4:S4163:12Mar99 `st=` not needed
}
else
// Reading supersededFont(Integer)
PR.ReadInteger(PR.Current(), "No. of superseded font", supersededFont); //szv#4:S4163:12Mar99 `st=` not needed
// Reading scale(Integer)
PR.ReadInteger(PR.Current(), "Grid units eqvt to one text height", scale); //szv#4:S4163:12Mar99 `st=` not needed
// Reading nbval(Integer)
Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of characters in this defn", nbval);
if (st && nbval > 0)
{
aSCIICodes = new TColStd_HArray1OfInteger(1, nbval);
nextCharX = new TColStd_HArray1OfInteger(1, nbval);
nextCharY = new TColStd_HArray1OfInteger(1, nbval);
penMotions = new TColStd_HArray1OfInteger(1, nbval);
penFlags = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
movePenX = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
movePenY = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
for ( Standard_Integer i = 1; i <= nbval; i++ )
{
// Reading aSCIICodes(HArray1OfInteger)
if (PR.ReadInteger(PR.Current(), "array aSCIICodes", tempCode)) //szv#4:S4163:12Mar99 `st=` not needed
aSCIICodes->SetValue(i, tempCode);
// Reading nextChars(HArray1OfInteger*2)
if (PR.ReadInteger(PR.Current(), "array nextChar X", tempNextX)) //szv#4:S4163:12Mar99 `st=` not needed
nextCharX->SetValue(i, tempNextX);
if (PR.ReadInteger(PR.Current(), "array nextChar Y", tempNextY)) //szv#4:S4163:12Mar99 `st=` not needed
nextCharY->SetValue(i, tempNextY);
// Reading penMotions(HArray1OfInteger)
if (PR.ReadInteger(PR.Current(), "array penMotions", tempMotion)) { //szv#4:S4163:12Mar99 `st=` not needed
penMotions->SetValue(i, tempMotion);
if (tempMotion > 0) {
Handle(TColStd_HArray1OfInteger) intarray, xarray, yarray;
intarray = new TColStd_HArray1OfInteger(1, tempMotion);
xarray = new TColStd_HArray1OfInteger(1, tempMotion);
yarray = new TColStd_HArray1OfInteger(1, tempMotion);
for ( Standard_Integer j = 1; j <= tempMotion; j++ ) {
if (PR.DefinedElseSkip()) {
// Reading penFlags(HArray1OfHArray1OfInteger)
if (PR.ReadInteger(PR.Current(), "array penFlags", tempFlag)) //szv#4:S4163:12Mar99 `st=` not needed
intarray->SetValue(j, tempFlag);
}
else intarray->SetValue(j, 0); // Default Value
// Reading movePenTo(HArray1OfHArray1OfInteger*2)
if (PR.ReadInteger(PR.Current(), "array movePenTo X", tempMoveX)) //szv#4:S4163:12Mar99 `st=` not needed
xarray->SetValue(j, tempMoveX);
if (PR.ReadInteger(PR.Current(), "array movePenTo Y", tempMoveY)) //szv#4:S4163:12Mar99 `st=` not needed
yarray->SetValue(j, tempMoveY);
}
penFlags->SetValue(i, intarray);
movePenX->SetValue(i, xarray);
movePenY->SetValue(i, yarray);
}
else PR.AddFail("Count of Pen motions : Not Positive");
}
}
}
else PR.AddFail ("Count of characters in this defn : Not Positive");
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(fontCode, fontName, supersededFont, supersededEntity,
scale, aSCIICodes, nextCharX, nextCharY,
penMotions, penFlags, movePenX, movePenY);
}
void IGESGraph_ToolTextFontDef::WriteOwnParams
(const Handle(IGESGraph_TextFontDef)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer IX,IY;
IW.Send( ent->FontCode() );
IW.Send( ent->FontName() );
if ( ent->IsSupersededFontEntity() )
IW.Send( ent->SupersededFontEntity(), Standard_True ); // negative
else
IW.Send( ent->SupersededFontCode() );
IW.Send( ent->Scale() );
Standard_Integer Up = ent->NbCharacters();
IW.Send( Up );
for ( Standard_Integer i = 1; i <= Up; i++)
{
IW.Send( ent->ASCIICode(i) );
ent->NextCharOrigin (i,IX,IY);
IW.Send( IX );
IW.Send( IY );
IW.Send( ent->NbPenMotions(i) );
for ( Standard_Integer j = 1; j <= ent->NbPenMotions(i); j ++)
{
IW.SendBoolean( ent->IsPenUp(i,j) );
ent->NextPenPosition (i,j, IX,IY);
IW.Send( IX );
IW.Send( IY );
}
}
}
void IGESGraph_ToolTextFontDef::OwnShared
(const Handle(IGESGraph_TextFontDef)& ent, Interface_EntityIterator& iter) const
{
if ( ent->IsSupersededFontEntity() )
iter.GetOneItem( ent->SupersededFontEntity() );
}
void IGESGraph_ToolTextFontDef::OwnCopy
(const Handle(IGESGraph_TextFontDef)& another,
const Handle(IGESGraph_TextFontDef)& ent, Interface_CopyTool& TC) const
{
Standard_Integer nbval;
Standard_Integer fontCode;
Handle(TCollection_HAsciiString) fontName;
Standard_Integer supersededFont=0;
Handle(IGESGraph_TextFontDef) supersededEntity;
Standard_Integer scale;
Handle(TColStd_HArray1OfInteger) aSCIICodes, nextCharX,nextCharY;
Handle(TColStd_HArray1OfInteger) penMotions;
Handle(IGESBasic_HArray1OfHArray1OfInteger) penFlags,movePenX,movePenY;
Standard_Integer tempMotion;
Handle(TColStd_HArray1OfInteger) intarray,xarray,yarray;
nbval = another->NbCharacters();
aSCIICodes = new TColStd_HArray1OfInteger(1, nbval);
nextCharX = new TColStd_HArray1OfInteger(1, nbval);
nextCharY = new TColStd_HArray1OfInteger(1, nbval);
penMotions = new TColStd_HArray1OfInteger(1, nbval);
penFlags = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
movePenX = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
movePenY = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
fontCode = another->FontCode();
fontName = new TCollection_HAsciiString(another->FontName());
if ( another->IsSupersededFontEntity() )
supersededEntity =
Handle(IGESGraph_TextFontDef)::DownCast (TC.Transferred(another->SupersededFontEntity()));
else
supersededFont = another->SupersededFontCode();
scale = another->Scale();
Standard_Integer j, IX,IY;
for (Standard_Integer i = 1; i <= nbval; i++)
{
aSCIICodes->SetValue( i, another->ASCIICode(i) );
ent->NextCharOrigin (i,IX,IY);
nextCharX->SetValue ( i, IX);
nextCharY->SetValue ( i, IY);
tempMotion = another->NbPenMotions(i);
penMotions->SetValue( i, tempMotion );
intarray = new TColStd_HArray1OfInteger(1, tempMotion);
xarray = new TColStd_HArray1OfInteger(1, tempMotion);
yarray = new TColStd_HArray1OfInteger(1, tempMotion);
for (j = 1; j <= tempMotion; j++)
{
if ( another->IsPenUp(i, j) ) intarray->SetValue(j, 1);
else intarray->SetValue(j, 0);
another->NextPenPosition(i, j, IX,IY);
xarray->SetValue(j, IX);
yarray->SetValue(j, IY);
}
penFlags->SetValue(i, intarray);
movePenX->SetValue(i, xarray);
movePenY->SetValue(i, yarray);
}
ent->Init(fontCode, fontName, supersededFont, supersededEntity,
scale, aSCIICodes, nextCharX, nextCharY, penMotions,
penFlags, movePenX, movePenY);
}
IGESData_DirChecker IGESGraph_ToolTextFontDef::DirChecker
(const Handle(IGESGraph_TextFontDef)& /*ent*/) const
{
IGESData_DirChecker DC (310, 0);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(2);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolTextFontDef::OwnCheck
(const Handle(IGESGraph_TextFontDef)& /*ent*/,
const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const
{
}
void IGESGraph_ToolTextFontDef::OwnDump
(const Handle(IGESGraph_TextFontDef)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level <= 4) ? 0 : 1;
Standard_Integer nbchars = ent->NbCharacters();
S << "IGESGraph_TextFontDef" << endl;
S << "Font Code : " << ent->FontCode() << endl;
S << "Font Name : ";
IGESData_DumpString(S,ent->FontName());
S << endl;
if ( ent->IsSupersededFontEntity() ) {
S << "Text Definition Entity : ";
dumper.Dump(ent->SupersededFontEntity(),S, sublevel);
}
else S << "Superseding Font Number : " << ent->SupersededFontCode();
S << endl;
S << "No. of Grid Units eqvt to 1 Text Height : " << ent->Scale() << endl;
S << "ASCII Codes : " << endl
<< "Grid Locations of next character origins : " << endl
<< "Pen Motions : " << endl
<< "Pen Positions : " << endl
<< "Grid Locations the pen moves to : ";
S << "Count = " << nbchars << endl;
IGESData_DumpVals(S,-level,1,nbchars,ent->ASCIICode);
S << endl;
if (level > 4 )
{
Handle(TColgp_HArray1OfXY) arrXY;
Standard_Integer I, J, nbmotions;
for (I = 1; I <= nbchars; I++)
{
Standard_Integer IX,IY;
S << "[" << I << "]: ";
S << "ASCII Code : " << ent->ASCIICode(I) << endl;
S << "Grid Location of next character's origin : ";
ent->NextCharOrigin(I,IX,IY);
S << "X=" << IX << " Y=" << IY;
nbmotions = ent->NbPenMotions(I);
S << " No. of Pen Motions : " << nbmotions;
if (level <= 5) S << " [ ask level > 5 for Details ]" << endl;
else {
S << endl;
for (J = 1; J <= nbmotions; J++)
{
S << "Pen up(1) / down(0) flag : " << (Standard_Integer)ent->IsPenUp(I,J);
S << " Next Pen Position : ";
ent->NextPenPosition(I,J, IX,IY);
S << " X="<<IX<<" Y="<<IY;
S << endl;
}
}
}
}
S << endl;
}

View File

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

View File

@@ -0,0 +1,157 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_UniformRectGrid.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_ToolUniformRectGrid.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XY.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx>
#include <IGESData_Dump.hxx>
IGESGraph_ToolUniformRectGrid::IGESGraph_ToolUniformRectGrid () { }
void IGESGraph_ToolUniformRectGrid::ReadOwnParams
(const Handle(IGESGraph_UniformRectGrid)& ent,
const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{
Standard_Integer nbPropertyValues;
Standard_Integer finite;
Standard_Integer line;
Standard_Integer weighted;
gp_XY gridPoint;
gp_XY gridSpacing;
Standard_Integer nbPointsX;
Standard_Integer nbPointsY;
// Reading nbPropertyValues(Integer)
PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues);
if (nbPropertyValues != 9)
PR.AddFail("No. of Property values : Value is not 9");
// Reading finite(Integer)
PR.ReadInteger(PR.Current(), "Finite/infinite grid flag", finite);
// Reading line(Integer)
PR.ReadInteger(PR.Current(), "Line/point grid flag", line);
// Reading weighted(Integer)
PR.ReadInteger(PR.Current(), "Weighted/unweighted grid flag", weighted);
// Reading gridPoint(XY)
PR.ReadXY(PR.CurrentList(1, 2), "Grid point coordinates", gridPoint);
// Reading gridSpacing(XY)
PR.ReadXY(PR.CurrentList(1, 2), "Grid Spacing coordinates", gridSpacing);
// Reading nbPointsX(Integer) ?? even if not IsFinite ?
if (finite != 0 || PR.DefinedElseSkip())
PR.ReadInteger
(PR.Current(), "No. of points/lines in X direction", nbPointsX);
// Reading nbPointsY(Integer)
if (finite != 0 || PR.DefinedElseSkip())
PR.ReadInteger
(PR.Current(), "No. of points/lines in Y direction", nbPointsY);
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(nbPropertyValues, finite, line, weighted,
gridPoint, gridSpacing, nbPointsX, nbPointsY);
}
void IGESGraph_ToolUniformRectGrid::WriteOwnParams
(const Handle(IGESGraph_UniformRectGrid)& ent, IGESData_IGESWriter& IW) const
{
IW.Send( ent->NbPropertyValues() );
IW.SendBoolean( ent->IsFinite() );
IW.SendBoolean( ent->IsLine() );
IW.SendBoolean( !ent->IsWeighted() );
IW.Send( ent->GridPoint().X() );
IW.Send( ent->GridPoint().Y() );
IW.Send( ent->GridSpacing().X() );
IW.Send( ent->GridSpacing().Y() );
IW.Send( ent->NbPointsX() ); // ?? even if not IsFinite ??
IW.Send( ent->NbPointsY() );
}
void IGESGraph_ToolUniformRectGrid::OwnShared
(const Handle(IGESGraph_UniformRectGrid)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}
void IGESGraph_ToolUniformRectGrid::OwnCopy
(const Handle(IGESGraph_UniformRectGrid)& another,
const Handle(IGESGraph_UniformRectGrid)& ent, Interface_CopyTool& /*TC*/) const
{
ent->Init
(9, (another->IsFinite() ? 1 : 0), (another->IsLine() ? 1 : 0),
(another->IsWeighted() ? 0 : 1),
another->GridPoint().XY(),another->GridSpacing().XY(),
another->NbPointsX(), another->NbPointsY());
}
Standard_Boolean IGESGraph_ToolUniformRectGrid::OwnCorrect
(const Handle(IGESGraph_UniformRectGrid)& ent) const
{
Standard_Boolean res = (ent->NbPropertyValues() != 9);
if (res) ent->Init
(9, (ent->IsFinite() ? 1 : 0), (ent->IsLine() ? 1 : 0),
(ent->IsWeighted() ? 0 : 1),ent->GridPoint().XY(),ent->GridSpacing().XY(),
ent->NbPointsX(), ent->NbPointsY()); // nbpropertyvalues=9
return res;
}
IGESData_DirChecker IGESGraph_ToolUniformRectGrid::DirChecker
(const Handle(IGESGraph_UniformRectGrid)& /*ent*/) const
{
IGESData_DirChecker DC (406, 22);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.UseFlagIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESGraph_ToolUniformRectGrid::OwnCheck
(const Handle(IGESGraph_UniformRectGrid)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if ( ent->IsFinite() != 0 && ent->IsFinite() != 1 )
ach->AddFail("Finite/infinite grid flag : Value != 0/1");
if ( ent->IsLine() != 0 && ent->IsLine() != 1 )
ach->AddFail("Line/point grid flag : Value != 0/1");
if ( ent->IsWeighted() != 0 && ent->IsWeighted() != 1 )
ach->AddFail("Weighted/unweighted grid flag : Value != 0/1");
if (ent->NbPropertyValues() != 9)
ach->AddFail("No. of Property values : Value != 9");
}
void IGESGraph_ToolUniformRectGrid::OwnDump
(const Handle(IGESGraph_UniformRectGrid)& ent, const IGESData_IGESDumper& /*dumper*/,
const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
S << "IGESGraph_UniformRectGrid" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Grid : " << ( ent->IsFinite() ? "Finite" : "Infinite");
S << " - Composed of " << ( ent->IsLine() ? "Lines" : "Points");
S << " - " << ( ent->IsWeighted() ? "Weighted" : "Unweighted") << endl;
S << "Grid Point : ";
IGESData_DumpXY(S, ent->GridPoint());
S << " Grid Spacing : ";
IGESData_DumpXY(S, ent->GridSpacing()); S << endl;
if (ent->IsFinite())
S << "No. of points/lines in direction : X : " << ent->NbPointsX()
<< " - Y : " << ent->NbPointsY() << endl;
}

View File

@@ -0,0 +1,116 @@
--
-- File : UniformRectGrid.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( TCD )
--
---Copyright : MATRA-DATAVISION 1993
--
class UniformRectGrid from IGESGraph inherits IGESEntity
---Purpose: defines IGESUniformRectGrid, Type <406> Form <22>
-- in package IGESGraph
--
-- Stores sufficient information for the creation of
-- a uniform rectangular grid within a drawing
uses
XY from gp,
Pnt2d from gp,
Vec2d from gp
is
Create returns mutable UniformRectGrid;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbProps : Integer;
finite : Integer;
line : Integer;
weighted : Integer;
aGridPoint : XY;
aGridSpacing : XY;
pointsX : Integer;
pointsY : Integer);
---Purpose : This method is used to set the fields of the class
-- UniformRectGrid
-- - nbProps : Number of property values (NP = 9)
-- - finite : Finite/Infinite grid flag
-- - line : Line/Point grid flag
-- - weighted : Weighted/Unweighted grid flag
-- - aGridPoint : Point on the grid
-- - aGridSpacing : Grid spacing
-- - pointsX : No. of points/lines in X Direction
-- - pointsY : No. of points/lines in Y Direction
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values in <me>.
IsFinite (me) returns Boolean;
---Purpose : returns False if <me> is an infinite grid,
-- True if <me> is a finite grid.
IsLine (me) returns Boolean;
---Purpose : returns False if <me> is a Point grid,
-- True if <me> is a Line grid.
IsWeighted (me) returns Boolean;
---Purpose : returns False if <me> is a Weighted grid,
-- True if <me> is not a Weighted grid.
GridPoint (me) returns Pnt2d;
---Purpose : returns coordinates of lower left corner,
-- if <me> is a finite grid,
-- coordinates of an arbitrary point,
-- if <me> is an infinite grid.
GridSpacing (me) returns Vec2d;
---Purpose : returns the grid-spacing in drawing coordinates.
NbPointsX (me) returns Integer;
---Purpose : returns the no. of points/lines in X direction
-- (only applicable if IsFinite() = 1, i.e: a finite grid).
NbPointsY (me) returns Integer;
---Purpose : returns the no. of points/lines in Y direction
-- (only applicable if IsFinite() = 1, i.e: a finite grid).
fields
--
-- Class : IGESGraph_UniformRectGrid
--
-- Purpose : Declaration of the variables specific to a
-- Uniform Rectangular Grid.
--
-- Reminder : A Uniform Rectangular Grid is defined by :
-- - Number of property values
-- - Finite/Infinite grid flag
-- - Line/Point grid flag
-- - Weighted/Unweighted grid flag
-- - Point on the grid
-- - Grid spacing
-- - No. of points/lines in X Direction
-- - No. of points/lines in Y Direction
--
theNbPropertyValues : Integer;
isItFinite : Integer;
isItLine : Integer;
isItWeighted : Integer;
theGridPoint : XY;
theGridSpacing : XY;
theNbPointsX : Integer;
theNbPointsY : Integer;
end UniformRectGrid;

View File

@@ -0,0 +1,74 @@
//--------------------------------------------------------------------
//
// File Name : IGESGraph_UniformRectGrid.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESGraph_UniformRectGrid.ixx>
IGESGraph_UniformRectGrid::IGESGraph_UniformRectGrid () { }
void IGESGraph_UniformRectGrid::Init
(const Standard_Integer nbProps,
const Standard_Integer finite,
const Standard_Integer line,
const Standard_Integer weighted,
const gp_XY& aGridPoint,
const gp_XY& aGridSpacing,
const Standard_Integer pointsX,
const Standard_Integer pointsY)
{
theNbPropertyValues = nbProps;
isItFinite = finite;
isItLine = line;
isItWeighted = weighted;
theGridPoint = aGridPoint;
theGridSpacing = aGridSpacing;
theNbPointsX = pointsX;
theNbPointsY = pointsY;
InitTypeAndForm(406,22);
}
Standard_Integer IGESGraph_UniformRectGrid::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Boolean IGESGraph_UniformRectGrid::IsFinite () const
{
return (isItFinite == 1);
}
Standard_Boolean IGESGraph_UniformRectGrid::IsLine () const
{
return (isItLine == 1);
}
Standard_Boolean IGESGraph_UniformRectGrid::IsWeighted () const
{
return (isItWeighted == 0);
}
gp_Pnt2d IGESGraph_UniformRectGrid::GridPoint () const
{
return ( gp_Pnt2d(theGridPoint) );
}
gp_Vec2d IGESGraph_UniformRectGrid::GridSpacing () const
{
return ( gp_Vec2d(theGridSpacing) );
}
Standard_Integer IGESGraph_UniformRectGrid::NbPointsX () const
{
return theNbPointsX;
}
Standard_Integer IGESGraph_UniformRectGrid::NbPointsY () const
{
return theNbPointsY;
}