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

Integration of OCCT 6.5.0 from SVN

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

105
src/IGESDefs/IGESDefs.cdl Executable file
View File

@@ -0,0 +1,105 @@
--
-- File : IGESDefs.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Deepak PRABHU )
--
---Copyright : MATRA-DATAVISION 1993
--
package IGESDefs
---Purpose : To embody general definitions of Entities
-- (Parameters, Tables ...)
uses
Standard,
TCollection,
TColStd,
Message,
Interface,
IGESData,
IGESBasic,
IGESGraph
is
class AssociativityDef;
-- Type 302, Form 5001-9999
---Purpose : This class permits the preprocessor to define an
-- associativity schema. i.e., by using it preprocessor
-- defines the type of relationship.
class MacroDef;
-- Type 306, Form 0
---Purpose : This Class specifies the action of a specific MACRO.
-- After specification MACRO can be used as necessary
-- by means of MACRO class instance entity.
class UnitsData;
-- Type 316, Form 0
---Purpose : This class stores data about a model's
-- fundamental units.
class AttributeDef;
-- Type 322, Form 0,1,2
---Purpose : This is class is used to support the concept of well
-- defined collection of attributes, whether it is a table
-- or a single row of attributes.
class TabularData;
-- Type 406, Form 11
---Purpose : This Class is used to provide a Structure to accomodate
-- point form data.
class GenericData;
-- Type 406, Form 27
---Purpose : This Class is used to communicate information which is
-- defined by the system operator while creating the model.
-- The information is system specific and does not map into
-- one of the predefined properties or associativities.
-- Properties and property values can be defined by multiple
-- instances of this property.
class AttributeTable;
-- Type 422, Form 0,1
---Purpose : This class is used to represent an occurence of
-- Attribute Table. This Class may be independent
-- or dependent or pointed at by other Entities.
-- Tools for Entities --
class ToolAssociativityDef;
class ToolMacroDef;
class ToolUnitsData;
class ToolAttributeDef;
class ToolTabularData;
class ToolGenericData;
class ToolAttributeTable;
-- Definition and Exploitation of Entities defined in this Package
class Protocol;
class ReadWriteModule;
class GeneralModule;
class SpecificModule;
-- Instantiations
class Array1OfTabularData instantiates Array1 from TCollection(TabularData);
class HArray1OfTabularData instantiates HArray1 from TCollection
(TabularData,Array1OfTabularData);
class HArray1OfHArray1OfTextDisplayTemplate instantiates
-- HArray1 (HArray1OfTextDisplayTemplate,Array1OfHArray1OfTextDisplayTemplate);
JaggedArray from Interface (HArray1OfTextDisplayTemplate from IGESGraph);
-- Package Methods
Init;
---Purpose : Prepares dynamic data (Protocol, Modules) for this package
Protocol returns Protocol from IGESDefs;
---Purpose : Returns the Protocol for this Package
end IGESDefs;

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

@@ -0,0 +1,33 @@
#include <IGESDefs.ixx>
#include <IGESDefs_Protocol.hxx>
#include <IGESDefs_GeneralModule.hxx>
#include <IGESDefs_ReadWriteModule.hxx>
#include <IGESDefs_SpecificModule.hxx>
#include <Interface_GeneralLib.hxx>
#include <Interface_ReaderLib.hxx>
#include <IGESData_WriterLib.hxx>
#include <IGESData_SpecificLib.hxx>
#include <IGESGraph.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(IGESDefs_Protocol) protocol;
void IGESDefs::Init ()
{
IGESGraph::Init();
if (protocol.IsNull()) {
protocol = new IGESDefs_Protocol;
Interface_GeneralLib::SetGlobal (new IGESDefs_GeneralModule, protocol);
Interface_ReaderLib::SetGlobal (new IGESDefs_ReadWriteModule,protocol);
IGESData_WriterLib::SetGlobal (new IGESDefs_ReadWriteModule,protocol);
IGESData_SpecificLib::SetGlobal (new IGESDefs_SpecificModule, protocol);
}
}
Handle(IGESDefs_Protocol) IGESDefs::Protocol ()
{
return protocol;
}

View File

@@ -0,0 +1,103 @@
--
-- File : AssociativityDef.cdl
-- Created : Wed 13 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Deepak PRABHU )
--
---Copyright : MATRA-DATAVISION 1993
--
class AssociativityDef from IGESDefs inherits IGESEntity
---Purpose: defines IGES Associativity Definition Entity, Type <302>
-- Form <5001 - 9999> in package IGESDefs.
-- This class permits the preprocessor to define an
-- associativity schema. i.e., by using it preprocessor
-- defines the type of relationship.
uses
HArray1OfInteger from TColStd,
HArray1OfHArray1OfInteger from IGESBasic
raises DimensionMismatch, OutOfRange
is
Create returns mutable AssociativityDef;
-- Specific methods for the entity
Init (me : mutable;
requirements : HArray1OfInteger;
orders : HArray1OfInteger;
numItems : HArray1OfInteger;
items : HArray1OfHArray1OfInteger)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- AssociativityDef
-- - requirements : Back Pointers requirements
-- - orders : Class Orders
-- - numItems : Number of Items per Class
-- - items : Items in each class
-- raises exception if lengths of the arrays are not the same.
SetFormNumber (me : mutable; form : Integer);
-- Sets Form Number to a given value (free over 5000)
NbClassDefs(me) returns Integer;
---Purpose : returns the Number of class definitions
IsBackPointerReq(me ; ClassNum : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns 1 if the theBackPointerReqs(ClassNum) = 1
-- returns 0 if the theBackPointerReqs(ClassNum) = 2
-- raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
BackPointerReq(me ; ClassNum : Integer) returns Integer
raises OutOfRange;
---Purpose : returns 1 or 2
-- raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
IsOrdered(me ; ClassNum : Integer) returns Boolean
raises OutOfRange;
---Purpose : returns 1 if theClassOrders(ClassNum) = 1 (ordered class)
-- returns 0 if theClassOrders(ClassNum) = 2 (unordered class)
-- raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
ClassOrder(me ; ClassNum : Integer) returns Integer
raises OutOfRange;
---Purpose : returns 1 or 2
-- raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
NbItemsPerClass(me ; ClassNum : Integer) returns Integer
raises OutOfRange;
---Purpose : returns no. of items per class entry
-- raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
Item(me ; ClassNum : Integer; ItemNum : Integer) returns Integer
raises OutOfRange;
---Purpose : returns ItemNum'th Item of ClassNum'th Class
-- raises exception if
-- ClassNum <= 0 or ClassNum > NbClassDefs()
-- ItemNum <= 0 or ItemNum > NbItemsPerClass(ClassNum)
fields
--
-- Class : IGESDefs_AssociativityDef
--
-- Purpose : Declaration of variables specific to AssociativityDef
--
-- Reminder : An AssociativityDef Entity permits the preprocessor
-- to define an associativity schema. The definition
-- includes associativity form, the no. of classes,
-- the number and type of items in each class, and
-- whether back pointers are required.
theBackPointerReqs : HArray1OfInteger;
theClassOrders : HArray1OfInteger;
theNbItemsPerClass : HArray1OfInteger;
theItems : HArray1OfHArray1OfInteger;
end AssociativityDef;

View File

@@ -0,0 +1,83 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_AssociativityDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_AssociativityDef.ixx>
IGESDefs_AssociativityDef::IGESDefs_AssociativityDef () { }
void IGESDefs_AssociativityDef::Init
(const Handle(TColStd_HArray1OfInteger)& requirements,
const Handle(TColStd_HArray1OfInteger)& orders,
const Handle(TColStd_HArray1OfInteger)& numItems,
const Handle(IGESBasic_HArray1OfHArray1OfInteger)& items)
{
Standard_Integer len = requirements->Length();
if ( requirements->Lower() != 1 ||
(orders->Lower() != 1 || orders->Length() != len) ||
(numItems->Lower() != 1 || numItems->Length() != len) ||
(items->Lower() != 1 || items->Length() != len) )
Standard_DimensionMismatch::Raise("IGESDefs_AssociativityDef : Init");
theBackPointerReqs = requirements;
theClassOrders = orders;
theNbItemsPerClass = numItems;
theItems = items;
InitTypeAndForm(302,FormNumber());
// FormNumber is free over 5000
}
void IGESDefs_AssociativityDef::SetFormNumber (const Standard_Integer form)
{
InitTypeAndForm(302,form);
}
Standard_Integer IGESDefs_AssociativityDef::NbClassDefs () const
{
return theBackPointerReqs->Length();
}
Standard_Boolean IGESDefs_AssociativityDef::IsBackPointerReq
(const Standard_Integer ClassNum) const
{
return (theBackPointerReqs->Value(ClassNum) == 1);
// 1 True 2 False
}
Standard_Integer IGESDefs_AssociativityDef::BackPointerReq
(const Standard_Integer ClassNum) const
{
return theBackPointerReqs->Value(ClassNum);
}
Standard_Boolean IGESDefs_AssociativityDef::IsOrdered
(const Standard_Integer ClassNum) const
{
return (theClassOrders->Value(ClassNum) == 1);
// 1 True 2 False
}
Standard_Integer IGESDefs_AssociativityDef::ClassOrder
(const Standard_Integer ClassNum) const
{
return theClassOrders->Value(ClassNum);
}
Standard_Integer IGESDefs_AssociativityDef::NbItemsPerClass
(const Standard_Integer ClassNum) const
{
return theNbItemsPerClass->Value(ClassNum);
}
Standard_Integer IGESDefs_AssociativityDef::Item
(const Standard_Integer ClassNum, const Standard_Integer ItemNum) const
{
return theItems->Value(ClassNum)->Value(ItemNum);
}

View File

@@ -0,0 +1,160 @@
--
-- File : AttributeDef.cdl
-- Created : Wed 13 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Deepak PRABHU )
--
---Copyright : MATRA-DATAVISION 1993
--
class AttributeDef from IGESDefs inherits IGESEntity
---Purpose: defines IGES Attribute Table Definition Entity,
-- Type <322> Form [0, 1, 2] in package IGESDefs.
-- This is class is used to support the concept of well
-- defined collection of attributes, whether it is a table
-- or a single row of attributes.
uses
HAsciiString from TCollection,
HArray1OfInteger from TColStd,
HArray1OfTransient from TColStd,
HArray1OfReal from TColStd,
HArray1OfHAsciiString from Interface,
HArray1OfIGESEntity from IGESData,
TextDisplayTemplate from IGESGraph,
HArray1OfTextDisplayTemplate from IGESGraph,
HArray1OfHArray1OfTextDisplayTemplate from IGESDefs
raises DimensionMismatch, OutOfRange, NullObject
is
Create returns mutable AttributeDef;
-- Specific methods for the entity
Init(me : mutable;
aName : HAsciiString;
aListType : Integer;
attrTypes : HArray1OfInteger;
attrValueDataTypes : HArray1OfInteger;
attrValueCounts : HArray1OfInteger;
attrValues : HArray1OfTransient from TColStd;
attrValuePointers : HArray1OfHArray1OfTextDisplayTemplate)
raises DimensionMismatch;
-- This method is used to set the fields of the
-- class AttributeDef
-- - aName : Attribute Table Names
-- - aListType : Attribute List Types
-- - attrTypes : Attribute Types
-- - attrValueDataTypes : Attribute Value Data Types
-- - attrValueCounts : Attribute Value Counts
-- - attrValues : Attribute Values
-- - attrValuePointers : Attribute Value Pointers to
-- TextDisplayTemplate
-- raises exceptions if lengths of attrTypes, attrValueDataTypes,
-- and attrValueCounts are not same
HasTableName (me) returns Boolean;
---Purpose : Returns True if a Table Name is defined
TableName(me) returns HAsciiString from TCollection;
---Purpose : returns the Attribute Table name, or comment
-- (default = null, no name : seeHasTableName)
ListType(me) returns Integer;
---Purpose : returns the Attribute List Type
NbAttributes(me) returns Integer;
---Purpose : returns the Number of Attributes
AttributeType(me ; num : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the num'th Attribute Type
-- raises exception if num <= 0 or num > NbAttributes()
AttributeValueDataType(me ; num : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the num'th Attribute value data type
-- raises exception if num <= 0 or num > NbAttributes()
AttributeValueCount(me; num : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the num'th Attribute value count
-- raises exception if num <= 0 or num > NbAttributes()
HasValues(me) returns Boolean;
---Purpose : returns false if Values are defined (i.e. for Form = 1 or 2)
HasTextDisplay(me) returns Boolean;
---Purpose : returns false if TextDisplays are defined (i.e. for Form = 2)
AttributeTextDisplay(me ; AttrNum : Integer; PointerNum : Integer)
returns TextDisplayTemplate
raises OutOfRange;
-- returns Null handle if form is 0 or 1
-- returns PointerNum'th TextDisplayTemplate of AttrNum'th attribute
-- raises exception if
-- AttrNum <= 0 or num > NbAttributes()
-- PointerNum <=0 or PointerNum > AttributeValueCount(AttrNum)
AttributeList (me ; AttrNum : Integer) returns Transient
---Purpose : Returns the List of Attributes <AttrNum>, as a Transient.
---Purpose : Its effective Type depends of the Type of Attribute :
-- HArray1OfInteger for Integer, Logical(0-1),
-- HArray1OfReal for Real, HArray1OfHSaciiString for String,
-- HArray1OfIGESEntity for Entity (Pointer)
-- See methods AttributeAs... for an accurate access
raises OutOfRange;
-- Error if AttrNum <= 0 or num > NbAttributes()
-- PointerNum <=0 or PointerNum > AttributeValueCount(AttrNum)
AttributeAsInteger (me; AttrNum, ValueNum : Integer) returns Integer
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not an Integer
AttributeAsReal (me; AttrNum, ValueNum : Integer) returns Real
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as a Real
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not a Real
AttributeAsString (me; AttrNum, ValueNum : Integer)
returns HAsciiString from TCollection
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
raises OutOfRange, NullObject;
-- Error if Indices out of Range, or no Value defined, or not a String
AttributeAsEntity (me; AttrNum, ValueNum : Integer) returns IGESEntity
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Entity
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not a Entity
AttributeAsLogical (me; AttrNum, ValueNum : Integer) returns Boolean
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not a Logical
fields
--
-- Class : IGESDefs_AttributeDef
--
-- Purpose : Declaration of variables specific to AttributeDef.
--
-- Reminder : An AttributeDef Entity provides a template for the
-- instance of attribute tables. It includes a table
-- name and for each attribute, an attribute type,
-- data type, and a count.
theName : HAsciiString;
theListType : Integer;
theAttrTypes : HArray1OfInteger;
theAttrValueDataTypes : HArray1OfInteger;
theAttrValueCounts : HArray1OfInteger;
theAttrValues : HArray1OfTransient from TColStd;
theAttrValuePointers : HArray1OfHArray1OfTextDisplayTemplate;
end AttributeDef;

View File

@@ -0,0 +1,163 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_AttributeDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_AttributeDef.ixx>
#include <Standard_DimensionMismatch.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESGraph_HArray1OfTextDisplayTemplate.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <Interface_Macros.hxx>
// For each Attribute Value, according to Attribute Type :
// 0 -> Void, 1 -> Integer, 2 -> Real, 3 -> String, 4 -> Entity 6 -> Logical
IGESDefs_AttributeDef::IGESDefs_AttributeDef () { }
void IGESDefs_AttributeDef::Init
(const Handle(TCollection_HAsciiString)& aName,
const Standard_Integer aListType,
const Handle(TColStd_HArray1OfInteger)& attrTypes,
const Handle(TColStd_HArray1OfInteger)& attrValueDataTypes,
const Handle(TColStd_HArray1OfInteger)& attrValueCounts,
const Handle(TColStd_HArray1OfTransient)& attrValues,
const Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate)&
attrValuePointers)
{
Standard_Integer nb = attrTypes->Length();
if (attrTypes->Lower() != 1 || attrValueDataTypes->Lower() != 1 ||
attrValueDataTypes->Length() != nb ||
attrValueCounts->Lower() != 1 || attrValueCounts->Length() != nb)
Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init");
if (FormNumber() >= 1)
if (attrValues->Lower() != 1 || attrValues->Length() != nb)
Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init");
if (FormNumber() == 2)
if (attrValuePointers->Lower() != 1 || attrValuePointers->Length() != nb)
Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init");
// Form 1 : attrValues defined Form = 2 : attrValuePointers defined
theName = aName;
theListType = aListType;
theAttrTypes = attrTypes;
theAttrValueDataTypes = attrValueDataTypes;
theAttrValueCounts = attrValueCounts;
theAttrValues = attrValues;
theAttrValuePointers = attrValuePointers;
if (attrValues.IsNull()) InitTypeAndForm(322,0);
else if (attrValuePointers.IsNull()) InitTypeAndForm(322,1);
else InitTypeAndForm(322,2);
}
Standard_Boolean IGESDefs_AttributeDef::HasTableName () const
{
return (!theName.IsNull());
}
Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::TableName () const
{
return theName;
}
Standard_Integer IGESDefs_AttributeDef::ListType () const
{
return theListType;
}
Standard_Integer IGESDefs_AttributeDef::NbAttributes () const
{
return theAttrTypes->Length();
}
Standard_Integer IGESDefs_AttributeDef::AttributeType
(const Standard_Integer num) const
{
return theAttrTypes->Value(num);
}
Standard_Integer IGESDefs_AttributeDef::AttributeValueDataType
(const Standard_Integer num) const
{
return theAttrValueDataTypes->Value(num);
}
Standard_Integer IGESDefs_AttributeDef::AttributeValueCount
(const Standard_Integer num) const
{
return theAttrValueCounts->Value(num);
}
Standard_Boolean IGESDefs_AttributeDef::HasValues () const
{
return (!theAttrValues.IsNull());
}
Standard_Boolean IGESDefs_AttributeDef::HasTextDisplay () const
{
return (!theAttrValuePointers.IsNull());
}
Handle(IGESGraph_TextDisplayTemplate)
IGESDefs_AttributeDef::AttributeTextDisplay
(const Standard_Integer AttrNum, const Standard_Integer PointerNum) const
{
Handle(IGESGraph_TextDisplayTemplate) res;
if (HasTextDisplay()) res =
theAttrValuePointers->Value(AttrNum)->Value(PointerNum);
return res;
}
Handle(Standard_Transient) IGESDefs_AttributeDef::AttributeList
(const Standard_Integer AttrNum) const
{
Handle(Standard_Transient) nulres;
if (!HasValues()) return nulres;
return theAttrValues->Value(AttrNum);
}
Standard_Integer IGESDefs_AttributeDef::AttributeAsInteger
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
{
return GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum))
->Value(ValueNum);
}
Standard_Real IGESDefs_AttributeDef::AttributeAsReal
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
{
return GetCasted(TColStd_HArray1OfReal,theAttrValues->Value(AttrNum))
->Value(ValueNum);
}
Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::AttributeAsString
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
{
return GetCasted(Interface_HArray1OfHAsciiString,theAttrValues->Value(AttrNum))
->Value(ValueNum);
}
Handle(IGESData_IGESEntity) IGESDefs_AttributeDef::AttributeAsEntity
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
{
return GetCasted(IGESData_HArray1OfIGESEntity,theAttrValues->Value(AttrNum))
->Value(ValueNum);
}
Standard_Boolean IGESDefs_AttributeDef::AttributeAsLogical
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
{
return (GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum))
->Value(ValueNum) != 0);
}

View File

@@ -0,0 +1,132 @@
--
-- File : AttributeTable.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Arun MENON )
--
---Copyright : MATRA-DATAVISION 1993
--
class AttributeTable from IGESDefs inherits IGESEntity
---Purpose: defines IGES Attribute Table, Type <422> Form <0, 1>
-- in package IGESDefs
-- This class is used to represent an occurence of
-- Attribute Table. This Class may be independent
-- or dependent or pointed at by other Entities.
uses
HAsciiString from TCollection,
AttributeDef from IGESDefs,
HArray1OfReal from TColStd,
HArray2OfTransient from TColStd,
HArray1OfInteger from TColStd,
HArray1OfHAsciiString from Interface,
HArray1OfIGESEntity from IGESData
raises OutOfRange, NullObject
is
Create returns mutable AttributeTable;
-- Specific methods for the entity
Init (me : mutable;
attributes : HArray2OfTransient from TColStd);
---Purpose : This method is used to set the fields of the class
-- AttributeTable
-- - attributes : Attribute instances, created as
-- (1,NbAttributes,1,NbRows)
-- - NbRows = 1 is a particular case (Form 0)
SetDefinition (me : mutable; def : AttributeDef);
---Purpose : Sets a Definition as Structure information
-- (works by calling InitMisc)
Definition (me) returns AttributeDef;
---Purpose : Return the Structure information in Directory Entry,
-- casted as an AttributeDef
NbRows(me) returns Integer;
---Purpose : returns Number of Rows. Remark that it is always 1 if Form = 0
-- It means that the list of Attributes (by their number, and for each
-- one its type and ValueCount) is repeated <NbRows> times
NbAttributes (me) returns Integer;
---Purpose : returns Number of Attributes
DataType (me; Atnum : Integer) returns Integer;
---Purpose : returns the Type of an Attribute, given its No. : it is read in the
-- Definition.
-- (1 : Integer, 2 : Real, 3 : String, 4 : Entity, 6 : Logical)
ValueCount (me; Atnum : Integer) returns Integer;
---Purpose : returns the Count of Value for an Attribute, given its No. :
-- it is read in the Definition.
AttributeList (me; Attribnum : Integer; Rownum : Integer)
returns Transient
-- returns the List of Values which correspond to an Attribute,
-- given its No. and the No. of the Row
-- Remark : for Form 0, Rownum must be given equal to 1.
-- the Transient returned is a HArray1 of appropriate Type
-- (OfInteger, OfReal, OfHAsciiString, OfIGESEntity) and Length
-- See methods AttributeAs... for accurate access
raises OutOfRange;
-- Error if Attribnum or RowNum OutofRange
AttributeAsInteger (me; AtNum, Rownum, ValNum : Integer) returns Integer
---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not an Integer
AttributeAsReal (me; AtNum, Rownum, ValNum : Integer) returns Real
---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Real
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not a Real
AttributeAsString (me; AtNum, Rownum, ValNum : Integer)
returns HAsciiString from TCollection
---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
raises OutOfRange, NullObject;
-- Error if Indices out of Range, or no Value defined, or not a String
AttributeAsEntity (me; AtNum, Rownum, ValNum : Integer) returns IGESEntity
---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Entity
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not an Entity
AttributeAsLogical (me; AtNum, Rownum, ValNum : Integer) returns Boolean
---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Boolean
raises OutOfRange, NullObject;
---Purpose : Error if Indices out of Range, or no Value defined, or not a Logical
fields
--
-- Class : IGESDefs_AttributeTable
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class AttributeTable.
--
-- Reminder : The attributes can be of type no value, integer, real, string,
-- pointer or Boolean. Accordingly each list is stored as HArray1 of
-- Integer, Real, HAsciiString, IGESEntity of appropriate Length
--
theAttributes : HArray2OfTransient from TColStd;
-- if form number = 0 , only one Row
-- size = AVC(1) + AVC(2) + ... + AVC(NA)
-- where NA is Number of attributes obtained from AttributeDef
-- AVC(1), AVC(2),..., AVC(NA) is also obtained from the same
--
-- if form number = 1 , NbRows > 1 possible
-- size = NR * (AVC(1) + AVC(2) + ... + AVC(NA))
-- where NR is theNbRows
--
-- Ref : IGES specs for Attribute Table Definition Entity (Type 322)
end AttributeTable;

View File

@@ -0,0 +1,120 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_AttributeTable.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_AttributeTable.ixx>
#include <Standard_DimensionMismatch.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESDefs_AttributeDef.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Macros.hxx>
// ATTENTION ATTENTION : L Appellation "ROW" n est pas reconduite en l etat
// Le Numero d Attribut est donne en 1er (donc, en colonne du HArray2 et non
// en ligne), le numero de Colonne en 2e (donc, comme un numero de Ligne)
IGESDefs_AttributeTable::IGESDefs_AttributeTable () { }
void IGESDefs_AttributeTable::Init
(const Handle(TColStd_HArray2OfTransient)& attributes)
{
if (attributes->LowerCol() != 1 || attributes->LowerRow() != 1)
Standard_DimensionMismatch::Raise("IGESDefs_AttributeTable : Init");
theAttributes = attributes;
Standard_Integer fn = FormNumber();
if (attributes->UpperCol() > 1) fn = 1;
else if (fn < 0 || fn > 1) fn = 0;
InitTypeAndForm(422,fn);
// FormNumber : 0 SingleRow, 1 MultipleRows (can be reduced to one ...)
}
void IGESDefs_AttributeTable::SetDefinition
(const Handle(IGESDefs_AttributeDef)& def)
{
InitMisc (def,LabelDisplay(),LineWeightNumber());
}
Handle(IGESDefs_AttributeDef) IGESDefs_AttributeTable::Definition () const
{
return GetCasted(IGESDefs_AttributeDef,Structure());
}
Standard_Integer IGESDefs_AttributeTable::NbRows () const
{
return theAttributes->UpperCol();
}
Standard_Integer IGESDefs_AttributeTable::NbAttributes () const
{
return theAttributes->UpperRow();
}
Standard_Integer IGESDefs_AttributeTable::DataType
(const Standard_Integer Atnum) const
{
return Definition()->AttributeType(Atnum);
}
Standard_Integer IGESDefs_AttributeTable::ValueCount
(const Standard_Integer Atnum) const
{
return Definition()->AttributeValueCount(Atnum);
}
Handle(Standard_Transient) IGESDefs_AttributeTable::AttributeList
(const Standard_Integer Atnum, const Standard_Integer Rownum) const
{
return theAttributes->Value(Atnum,Rownum);
}
Standard_Integer IGESDefs_AttributeTable::AttributeAsInteger
(const Standard_Integer Atnum, const Standard_Integer Rownum,
const Standard_Integer Valuenum) const
{
return GetCasted(TColStd_HArray1OfInteger,theAttributes->Value(Atnum,Rownum))
->Value(Valuenum);
}
Standard_Real IGESDefs_AttributeTable::AttributeAsReal
(const Standard_Integer Atnum, const Standard_Integer Rownum,
const Standard_Integer Valuenum) const
{
return GetCasted(TColStd_HArray1OfReal,theAttributes->Value(Atnum,Rownum))
->Value(Valuenum);
}
Handle(TCollection_HAsciiString) IGESDefs_AttributeTable::AttributeAsString
(const Standard_Integer Atnum, const Standard_Integer Rownum,
const Standard_Integer Valuenum) const
{
return GetCasted(Interface_HArray1OfHAsciiString,theAttributes->Value(Atnum,Rownum))
->Value(Valuenum);
}
Handle(IGESData_IGESEntity) IGESDefs_AttributeTable::AttributeAsEntity
(const Standard_Integer Atnum, const Standard_Integer Rownum,
const Standard_Integer Valuenum) const
{
return GetCasted(IGESData_HArray1OfIGESEntity,theAttributes->Value(Atnum,Rownum))
->Value(Valuenum);
}
Standard_Boolean IGESDefs_AttributeTable::AttributeAsLogical
(const Standard_Integer Atnum, const Standard_Integer Rownum,
const Standard_Integer Valuenum) const
{
return (AttributeAsInteger(Atnum,Rownum,Valuenum) != 0); // raccourci
}

View File

@@ -0,0 +1,51 @@
-- File: IGESDefs_GeneralModule.cdl
-- Created: Mon May 10 15:00:51 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class GeneralModule from IGESDefs inherits GeneralModule from IGESData
---Purpose : Definition of General Services for IGESDefs (specific part)
-- This Services comprise : Shared & Implied Lists, Copy, Check
uses OStream,
Check, ShareTool, EntityIterator, CopyTool,
IGESEntity, DirChecker
is
Create returns mutable GeneralModule from IGESDefs;
---Purpose : Creates a GeneralModule from IGESDefs 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
-- Auxiliary for all
end GeneralModule;

View File

@@ -0,0 +1,284 @@
#include <IGESDefs_GeneralModule.ixx>
#include <Interface_Macros.hxx>
#include <Interface_Category.hxx>
#include <IGESDefs_AssociativityDef.hxx>
#include <IGESDefs_AttributeDef.hxx>
#include <IGESDefs_AttributeTable.hxx>
#include <IGESDefs_GenericData.hxx>
#include <IGESDefs_MacroDef.hxx>
#include <IGESDefs_TabularData.hxx>
#include <IGESDefs_UnitsData.hxx>
#include <IGESDefs_ToolAssociativityDef.hxx>
#include <IGESDefs_ToolAttributeDef.hxx>
#include <IGESDefs_ToolAttributeTable.hxx>
#include <IGESDefs_ToolGenericData.hxx>
#include <IGESDefs_ToolMacroDef.hxx>
#include <IGESDefs_ToolTabularData.hxx>
#include <IGESDefs_ToolUnitsData.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
IGESDefs_GeneralModule::IGESDefs_GeneralModule () { }
void IGESDefs_GeneralModule::OwnSharedCase
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
Interface_EntityIterator& iter) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESDefs_AssociativityDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAssociativityDef tool;
tool.OwnShared(anent,iter);
}
break;
case 2 : {
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeDef tool;
tool.OwnShared(anent,iter);
}
break;
case 3 : {
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeTable tool;
tool.OwnShared(anent,iter);
}
break;
case 4 : {
DeclareAndCast(IGESDefs_GenericData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolGenericData tool;
tool.OwnShared(anent,iter);
}
break;
case 5 : {
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolMacroDef tool;
tool.OwnShared(anent,iter);
}
break;
case 6 : {
DeclareAndCast(IGESDefs_TabularData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolTabularData tool;
tool.OwnShared(anent,iter);
}
break;
case 7 : {
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolUnitsData tool;
tool.OwnShared(anent,iter);
}
break;
default : break;
}
}
IGESData_DirChecker IGESDefs_GeneralModule::DirChecker
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESDefs_AssociativityDef,anent,ent);
if (anent.IsNull()) break;
IGESDefs_ToolAssociativityDef tool;
return tool.DirChecker(anent);
}
case 2 : {
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
if (anent.IsNull()) break;
IGESDefs_ToolAttributeDef tool;
return tool.DirChecker(anent);
}
case 3 : {
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
if (anent.IsNull()) break;
IGESDefs_ToolAttributeTable tool;
return tool.DirChecker(anent);
}
case 4 : {
DeclareAndCast(IGESDefs_GenericData,anent,ent);
if (anent.IsNull()) break;
IGESDefs_ToolGenericData tool;
return tool.DirChecker(anent);
}
case 5 : {
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
if (anent.IsNull()) break;
IGESDefs_ToolMacroDef tool;
return tool.DirChecker(anent);
}
case 6 : {
DeclareAndCast(IGESDefs_TabularData,anent,ent);
if (anent.IsNull()) break;
IGESDefs_ToolTabularData tool;
return tool.DirChecker(anent);
}
case 7 : {
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
if (anent.IsNull()) break;
IGESDefs_ToolUnitsData tool;
return tool.DirChecker(anent);
}
default : break;
}
return IGESData_DirChecker(); // by default, no specific criterium
}
void IGESDefs_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(IGESDefs_AssociativityDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAssociativityDef tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 2 : {
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeDef tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 3 : {
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeTable tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 4 : {
DeclareAndCast(IGESDefs_GenericData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolGenericData tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 5 : {
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolMacroDef tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 6 : {
DeclareAndCast(IGESDefs_TabularData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolTabularData tool;
tool.OwnCheck(anent,shares,ach);
}
break;
case 7 : {
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolUnitsData tool;
tool.OwnCheck(anent,shares,ach);
}
break;
default : break;
}
}
Standard_Boolean IGESDefs_GeneralModule::NewVoid
(const Standard_Integer CN, Handle(Standard_Transient)& ent) const
{
switch (CN) {
case 1 : ent = new IGESDefs_AssociativityDef; break;
case 2 : ent = new IGESDefs_AttributeDef; break;
case 3 : ent = new IGESDefs_AttributeTable; break;
case 4 : ent = new IGESDefs_GenericData; break;
case 5 : ent = new IGESDefs_MacroDef; break;
case 6 : ent = new IGESDefs_TabularData; break;
case 7 : ent = new IGESDefs_UnitsData; break;
default : return Standard_False; // by default, Failure on Recognize
}
return Standard_True;
}
void IGESDefs_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(IGESDefs_AssociativityDef,enfr,entfrom);
DeclareAndCast(IGESDefs_AssociativityDef,ento,entto);
IGESDefs_ToolAssociativityDef tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 2 : {
DeclareAndCast(IGESDefs_AttributeDef,enfr,entfrom);
DeclareAndCast(IGESDefs_AttributeDef,ento,entto);
IGESDefs_ToolAttributeDef tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 3 : {
DeclareAndCast(IGESDefs_AttributeTable,enfr,entfrom);
DeclareAndCast(IGESDefs_AttributeTable,ento,entto);
IGESDefs_ToolAttributeTable tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 4 : {
DeclareAndCast(IGESDefs_GenericData,enfr,entfrom);
DeclareAndCast(IGESDefs_GenericData,ento,entto);
IGESDefs_ToolGenericData tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 5 : {
DeclareAndCast(IGESDefs_MacroDef,enfr,entfrom);
DeclareAndCast(IGESDefs_MacroDef,ento,entto);
IGESDefs_ToolMacroDef tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 6 : {
DeclareAndCast(IGESDefs_TabularData,enfr,entfrom);
DeclareAndCast(IGESDefs_TabularData,ento,entto);
IGESDefs_ToolTabularData tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
case 7 : {
DeclareAndCast(IGESDefs_UnitsData,enfr,entfrom);
DeclareAndCast(IGESDefs_UnitsData,ento,entto);
IGESDefs_ToolUnitsData tool;
tool.OwnCopy(enfr,ento,TC);
}
break;
default : break;
}
}
Standard_Integer IGESDefs_GeneralModule::CategoryNumber
(const Standard_Integer CN, const Handle(Standard_Transient)& ent,
const Interface_ShareTool& ) const
{
return Interface_Category::Number("Auxiliary");
}

View File

@@ -0,0 +1,126 @@
--
-- File : GenericData.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen (Anand NATRAJAN)
--
---Copyright : MATRA-DATAVISION 1993
--
class GenericData from IGESDefs inherits IGESEntity
---Purpose: defines IGES Generic Data, Type <406> Form <27>
-- in package IGESDefs
-- Used to communicate information defined by the system
-- operator while creating the model. The information is
-- system specific and does not map into one of the
-- predefined properties or associativities. Properties
-- and property values can be defined by multiple
-- instances of this property.
uses
HAsciiString from TCollection,
HArray1OfReal from TColStd,
HArray1OfTransient from TColStd,
HArray1OfInteger from TColStd,
HArray1OfHAsciiString from Interface,
HArray1OfIGESEntity from IGESData
raises DimensionMismatch, OutOfRange, NullObject
is
Create returns mutable GenericData;
-- Specific Methods pertaining to the class
Init (me : mutable;
nbPropVal : Integer;
aName : HAsciiString;
allTypes : HArray1OfInteger;
allValues : HArray1OfTransient from TColStd)
---Purpose : This method is used to set the fields of the class
-- GenericData
-- - nbPropVal : Number of property values
-- - aName : Property Name
-- - allTypes : Property Types
-- - allValues : Property Values
raises DimensionMismatch;
-- if lengths of allTypes and allValues are not same
NbPropertyValues (me) returns Integer;
---Purpose : returns the number of property values
Name (me) returns HAsciiString from TCollection;
---Purpose : returns property name
NbTypeValuePairs (me) returns Integer;
---Purpose : returns the number of TYPE/VALUE pairs
Type (me; Index : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the Index'th property value data type
-- raises exception if Index <= 0 or Index > NbTypeValuePairs()
Value (me; Index : Integer) returns Transient
--The Transient returned depends of Type :
---Purpose : HArray1OfInteger (length 1), HArray1OfReal (length 1) for
-- Integer, Real, Boolean (= Integer 0/1),
-- HAsciiString for String (the value itself),
-- IGESEntity for Entity (the value itself)
raises OutOfRange;
-- raises exception if Index <= 0 or Index > NbTypeValuePairs()
ValueAsInteger (me; ValueNum : Integer) returns Integer
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
raises OutOfRange, NullObject;
---Purpose : Error if Index out of Range, or not an Integer
ValueAsReal (me; ValueNum : Integer) returns Real
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as a Real
raises OutOfRange, NullObject;
---Purpose : Error if Index out of Range, or not a Real
ValueAsString (me; ValueNum : Integer)
returns HAsciiString from TCollection
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
raises OutOfRange, NullObject;
-- Error if Index out of Range, or not a String
ValueAsEntity (me; ValueNum : Integer) returns IGESEntity
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Entity
raises OutOfRange, NullObject;
---Purpose : Error if Index out of Range, or not a Entity
ValueAsLogical (me; ValueNum : Integer) returns Boolean
---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean
raises OutOfRange, NullObject;
---Purpose : Error if Index out of Range, or not a Logical
fields
--
-- Class : IGESDefs_GenericData
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class GenericData.
--
-- Reminder : A GenericData instance is defined by :
-- - Number of property values
-- - Property Name
-- - Property Types
-- - Property Values
-- The values can be of type either no value, integer, real,
-- string, pointer or boolean. Accordingly we store them in a
-- Transient Object of appropriate Type :
-- - HArray1OfInteger/OfReal of length 1, for Integer, Real, Logical
-- - a single HAsciiString for String
-- - a single IGESEntity for Entity (Pointer)
theNbPropertyValues : Integer;
theName : HAsciiString;
theTypes : HArray1OfInteger;
theValues : HArray1OfTransient from TColStd;
end GenericData;

View File

@@ -0,0 +1,98 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_GenericData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
// rln 11.05.2000 BUC60660
#include <IGESDefs_GenericData.ixx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <Interface_Macros.hxx>
IGESDefs_GenericData::IGESDefs_GenericData () { }
void IGESDefs_GenericData::Init
(const Standard_Integer nbPropVal,
const Handle(TCollection_HAsciiString)& aName,
const Handle(TColStd_HArray1OfInteger)& allTypes,
const Handle(TColStd_HArray1OfTransient)& allValues)
{
// rln May 11, 2000 BUC60660
// Number of TYPE/VALUE pairs is 0 and arrays are null handles,
// this caused exception
if ( !allTypes.IsNull() && !allValues.IsNull() &&
(allValues->Lower() != 1 || allTypes->Lower() != 1 ||
allTypes->Length() != allValues->Length() ) )
Standard_DimensionMismatch::Raise("IGESDefs_GenericData: Init");
theNbPropertyValues = nbPropVal;
theName = aName;
theTypes = allTypes;
theValues = allValues;
InitTypeAndForm(406,27);
}
Standard_Integer IGESDefs_GenericData::NbPropertyValues () const
{
// return 2 * theTypes->Length() + 2;
return theNbPropertyValues;
}
Handle(TCollection_HAsciiString) IGESDefs_GenericData::Name () const
{
return theName;
}
Standard_Integer IGESDefs_GenericData::NbTypeValuePairs () const
{
return theTypes->Length();
}
Standard_Integer IGESDefs_GenericData::Type (const Standard_Integer Index) const
{
return theTypes->Value(Index);
}
Handle(Standard_Transient) IGESDefs_GenericData::Value
(const Standard_Integer Index) const
{
return theValues->Value(Index);
}
Standard_Integer IGESDefs_GenericData::ValueAsInteger
(const Standard_Integer Index) const
{
return GetCasted(TColStd_HArray1OfInteger,theValues->Value(Index))->Value(1);
}
Standard_Real IGESDefs_GenericData::ValueAsReal
(const Standard_Integer Index) const
{
return GetCasted(TColStd_HArray1OfReal,theValues->Value(Index))->Value(1);
}
Handle(TCollection_HAsciiString) IGESDefs_GenericData::ValueAsString
(const Standard_Integer Index) const
{
return GetCasted(TCollection_HAsciiString,theValues->Value(Index));
}
Handle(IGESData_IGESEntity) IGESDefs_GenericData::ValueAsEntity
(const Standard_Integer Index) const
{
return GetCasted(IGESData_IGESEntity,theValues->Value(Index));
}
Standard_Boolean IGESDefs_GenericData::ValueAsLogical
(const Standard_Integer Index) const
{
return (GetCasted(TColStd_HArray1OfInteger,theValues->Value(Index))->Value(1)
!= 0);
}

View File

@@ -0,0 +1,76 @@
--
-- File : MacroDef.cdl
-- Created : Wed 13 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Deepak PRABHU )
--
---Copyright : MATRA-DATAVISION 1993
--
class MacroDef from IGESDefs inherits IGESEntity
---Purpose: defines IGES Macro Definition Entity, Type <306> Form <0>
-- in package IGESDefs
-- This Class specifies the action of a specific MACRO.
-- After specification MACRO can be used as necessary
-- by means of MACRO class instance entity.
uses
HAsciiString from TCollection,
HArray1OfHAsciiString from Interface
raises OutOfRange
is
Create returns mutable MacroDef;
-- Specific methods for the entity
Init (me : mutable;
macro : HAsciiString;
entityTypeID : Integer;
langStatements : HArray1OfHAsciiString;
endMacro : HAsciiString);
---Purpose : This method is used to set the fields of the class
-- MacroDef
-- - macro : MACRO
-- - entityTypeID : Entity Type ID
-- - langStatements : Language Statements
-- - endMacro : END MACRO
NbStatements(me) returns Integer;
---Purpose : returns the number of language statements
MACRO(me) returns HAsciiString from TCollection;
---Purpose : returns the MACRO(Literal)
EntityTypeID(me) returns Integer;
---Purpose : returns the Entity Type ID
LanguageStatement(me ; StatNum : Integer)
returns HAsciiString from TCollection
raises OutOfRange;
-- returns the StatNum'th statement
-- raises exception if StatNum <= 0 or StatNum > NbStatements()
ENDMACRO(me) returns HAsciiString from TCollection;
---Purpose : returns the ENDM(Literal)
fields
--
-- Class : IGESDefs_MacroDef
--
-- Purpose : Declaration of variables specific to MacroDef
--
-- Reminder : An MacroDef Entity specifies the action of a
-- specific MACRO. It consists of only language
-- statements in the parameter data.
theMACRO : HAsciiString;
theEntityTypeID : Integer;
theLangStatements : HArray1OfHAsciiString;
theENDMACRO : HAsciiString;
end MacroDef;

View File

@@ -0,0 +1,55 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_MacroDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_MacroDef.ixx>
#include <Standard_DimensionMismatch.hxx>
IGESDefs_MacroDef::IGESDefs_MacroDef () { }
void IGESDefs_MacroDef::Init
(const Handle(TCollection_HAsciiString)& macro,
const Standard_Integer entityTypeID,
const Handle(Interface_HArray1OfHAsciiString)& langStatements,
const Handle(TCollection_HAsciiString)& endMacro)
{
if (langStatements->Lower() != 1)
Standard_DimensionMismatch::Raise("IGESDefs_MacroDef : Init");
theMACRO = macro;
theEntityTypeID = entityTypeID;
theLangStatements = langStatements;
theENDMACRO = endMacro;
InitTypeAndForm(306,0);
}
Standard_Integer IGESDefs_MacroDef::NbStatements () const
{
return theLangStatements->Length();
}
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::MACRO () const
{
return theMACRO;
}
Standard_Integer IGESDefs_MacroDef::EntityTypeID () const
{
return theEntityTypeID;
}
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::LanguageStatement
(const Standard_Integer StatNum) const
{
return theLangStatements->Value(StatNum);
}
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::ENDMACRO () const
{
return theENDMACRO;
}

View File

@@ -0,0 +1,33 @@
-- File: IGESDefs_Protocol.cdl
-- Created: Wed May 5 11:30:30 1993
-- Author: Christian CAILLET
-- <cky@bravox>
---Copyright: Matra Datavision 1993
class Protocol from IGESDefs inherits Protocol from IGESData
---Purpose : Description of Protocol for IGESDefs
uses Type, Protocol from Interface
is
Create returns mutable Protocol from IGESDefs;
NbResources (me) returns Integer is redefined;
---Purpose : Gives the count of Resource Protocol. Here, one
-- (Protocol from IGESGraph)
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,50 @@
#include <IGESDefs_Protocol.ixx>
#include <IGESDefs_AssociativityDef.hxx>
#include <IGESDefs_MacroDef.hxx>
#include <IGESDefs_UnitsData.hxx>
#include <IGESDefs_AttributeDef.hxx>
#include <IGESDefs_TabularData.hxx>
#include <IGESDefs_GenericData.hxx>
#include <IGESDefs_AttributeTable.hxx>
#include <IGESGraph.hxx>
#include <IGESGraph_Protocol.hxx>
static int deja = 0;
static Handle(Standard_Type) atype1,atype2,atype3,atype4,atype5,atype6,atype7;
IGESDefs_Protocol::IGESDefs_Protocol ()
{
if (deja) return; deja = 1;
atype1 = STANDARD_TYPE(IGESDefs_AssociativityDef);
atype2 = STANDARD_TYPE(IGESDefs_AttributeDef);
atype3 = STANDARD_TYPE(IGESDefs_AttributeTable);
atype4 = STANDARD_TYPE(IGESDefs_GenericData);
atype5 = STANDARD_TYPE(IGESDefs_MacroDef);
atype6 = STANDARD_TYPE(IGESDefs_TabularData);
atype7 = STANDARD_TYPE(IGESDefs_UnitsData);
}
Standard_Integer IGESDefs_Protocol::NbResources () const
{ return 1; }
Handle(Interface_Protocol) IGESDefs_Protocol::Resource
(const Standard_Integer num) const
{
Handle(Interface_Protocol) res = IGESGraph::Protocol();
return res;
}
Standard_Integer IGESDefs_Protocol::TypeNumber
(const Handle(Standard_Type)& atype) const
{
if (atype == atype1) return 1;
else if (atype == atype2) return 2;
else if (atype == atype3) return 3;
else if (atype == atype4) return 4;
else if (atype == atype5) return 5;
else if (atype == atype6) return 6;
else if (atype == atype7) return 7;
return 0;
}

View File

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

View File

@@ -0,0 +1,167 @@
#include <IGESDefs_ReadWriteModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESDefs_AssociativityDef.hxx>
#include <IGESDefs_AttributeDef.hxx>
#include <IGESDefs_AttributeTable.hxx>
#include <IGESDefs_GenericData.hxx>
#include <IGESDefs_MacroDef.hxx>
#include <IGESDefs_TabularData.hxx>
#include <IGESDefs_UnitsData.hxx>
#include <IGESDefs_ToolAssociativityDef.hxx>
#include <IGESDefs_ToolAttributeDef.hxx>
#include <IGESDefs_ToolAttributeTable.hxx>
#include <IGESDefs_ToolGenericData.hxx>
#include <IGESDefs_ToolMacroDef.hxx>
#include <IGESDefs_ToolTabularData.hxx>
#include <IGESDefs_ToolUnitsData.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
IGESDefs_ReadWriteModule::IGESDefs_ReadWriteModule () { }
Standard_Integer IGESDefs_ReadWriteModule::CaseIGES
(const Standard_Integer typenum, const Standard_Integer formnum) const
{
switch (typenum) {
case 302 : return 1;
case 306 : return 5;
case 316 : return 7;
case 322 : return 2;
case 406 :
switch (formnum) {
case 11 : return 6;
case 27 : return 4;
default : break;
}
break;
case 422 : return 3;
default : break;
}
return 0;
}
void IGESDefs_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(IGESDefs_AssociativityDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAssociativityDef tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 2 : {
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeDef tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 3 : {
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeTable tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 4 : {
DeclareAndCast(IGESDefs_GenericData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolGenericData tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 5 : {
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolMacroDef tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 6 : {
DeclareAndCast(IGESDefs_TabularData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolTabularData tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
case 7 : {
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolUnitsData tool;
tool.ReadOwnParams(anent,IR,PR);
}
break;
default : break;
}
}
void IGESDefs_ReadWriteModule::WriteOwnParams
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
IGESData_IGESWriter& IW) const
{
switch (CN) {
case 1 : {
DeclareAndCast(IGESDefs_AssociativityDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAssociativityDef tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 2 : {
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeDef tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 3 : {
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeTable tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 4 : {
DeclareAndCast(IGESDefs_GenericData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolGenericData tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 5 : {
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolMacroDef tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 6 : {
DeclareAndCast(IGESDefs_TabularData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolTabularData tool;
tool.WriteOwnParams(anent,IW);
}
break;
case 7 : {
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolUnitsData tool;
tool.WriteOwnParams(anent,IW);
}
break;
default : break;
}
}

View File

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

View File

@@ -0,0 +1,87 @@
#include <IGESDefs_SpecificModule.ixx>
#include <Interface_Macros.hxx>
#include <IGESDefs_AssociativityDef.hxx>
#include <IGESDefs_AttributeDef.hxx>
#include <IGESDefs_AttributeTable.hxx>
#include <IGESDefs_GenericData.hxx>
#include <IGESDefs_MacroDef.hxx>
#include <IGESDefs_TabularData.hxx>
#include <IGESDefs_UnitsData.hxx>
#include <IGESDefs_ToolAssociativityDef.hxx>
#include <IGESDefs_ToolAttributeDef.hxx>
#include <IGESDefs_ToolAttributeTable.hxx>
#include <IGESDefs_ToolGenericData.hxx>
#include <IGESDefs_ToolMacroDef.hxx>
#include <IGESDefs_ToolTabularData.hxx>
#include <IGESDefs_ToolUnitsData.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
IGESDefs_SpecificModule::IGESDefs_SpecificModule() { }
void IGESDefs_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(IGESDefs_AssociativityDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAssociativityDef tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 2 : {
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeDef tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 3 : {
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolAttributeTable tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 4 : {
DeclareAndCast(IGESDefs_GenericData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolGenericData tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 5 : {
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolMacroDef tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 6 : {
DeclareAndCast(IGESDefs_TabularData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolTabularData tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
case 7 : {
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
if (anent.IsNull()) return;
IGESDefs_ToolUnitsData tool;
tool.OwnDump(anent,dumper,S,own);
}
break;
default : break;
}
}

View File

@@ -0,0 +1,125 @@
--
-- File : TabularData.cdl
-- Created : Sat 9 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( SIVA )
--
---Copyright : MATRA-DATAVISION 1993
--
class TabularData from IGESDefs inherits IGESEntity
---Purpose: Defines IGES Tabular Data, Type <406> Form <11>,
-- in package IGESDefs
-- This Class is used to provide a Structure to accomodate
-- point form data.
uses
HArray1OfInteger from TColStd,
HArray1OfReal from TColStd,
HArray1OfHArray1OfReal from IGESBasic
raises DimensionMismatch, OutOfRange
is
Create returns mutable TabularData;
-- Specific methods for the entity
Init (me : mutable;
nbProps : Integer;
propType : Integer;
typesInd : HArray1OfInteger;
nbValuesInd : HArray1OfInteger;
valuesInd : HArray1OfHArray1OfReal;
valuesDep : HArray1OfHArray1OfReal)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- TabularData
-- - nbProps : Number of property values
-- - propType : Property Type
-- - typesInd : Type of independent variables
-- - nbValuesInd : Number of values of independent variables
-- - valuesInd : Values of independent variables
-- - valuesDep : Values of dependent variables
-- raises exception if lengths of typeInd and nbValuesInd are not same
NbPropertyValues(me) returns Integer;
---Purpose : returns the number of property values (recorded)
ComputedNbPropertyValues (me) returns Integer;
---Purpose : determines the number of property values required
OwnCorrect (me : mutable) returns Boolean;
---Purpose : checks, and correct as necessary, the number of property
-- values. Returns True if corrected, False if already OK
PropertyType(me) returns Integer;
---Purpose : returns the property type
NbDependents(me) returns Integer;
---Purpose : returns the number of dependent variables
NbIndependents(me) returns Integer;
---Purpose : returns the number of independent variables
TypeOfIndependents(me; num: Integer) returns Integer
raises OutOfRange;
---Purpose : returns the type of the num'th independent variable
-- raises exception if num <= 0 or num > NbIndependents()
NbValues(me; num : Integer) returns Integer
raises OutOfRange;
---Purpose : returns the number of different values of the num'th indep. variable
-- raises exception if num <= 0 or num > NbIndependents()
IndependentValue(me; variablenum : Integer; valuenum : Integer)
returns Real
raises OutOfRange;
-- returns valuenum'th value of the variablenum'th independent variable
-- raises exception if
-- variablenum <= 0 or variablenum > NbIndependents()
-- valuenum <= 0 or valuenum > NbValues(variablenum)
DependentValues (me; num : Integer) returns HArray1OfReal from TColStd
raises OutOfRange;
-- returns the entire list of recorded Dependent Values
-- UNRESOLVED. Temporarily, all dependent values are attached to
-- <num> = 1, the other values remain undefined
DependentValue(me; variablenum: Integer; valuenum: Integer)
returns Real
raises OutOfRange;
-- RESERVED, unresolved
-- valuenum'th value of the variablenum'th dependent variable
-- raises exception if
-- variablenum <= 0 or variablenum > NbIndependents()
-- valuenum <= 0 or valuenum > NbValues(variablenum)
fields
--
-- Class : IGESDefs_TabularData
--
-- Purpose : Declaration of variables specific to the definition
-- of the Class TabularData.
--
-- Reminder : A TabularData instance is defined by :
-- - The number of properties
-- - The property type, an integer
-- - The property type, an integer
-- - The number of dependent variables
-- - The type of independent variables, a single array of Int
-- - The single array of integer values
-- - The single array of independent values
-- - The single array of dependent values
theNbPropertyValues : Integer;
thePropertyType : Integer;
theTypeOfIndependentVariables : HArray1OfInteger;
theNbValues : HArray1OfInteger;
theIndependentValues : HArray1OfHArray1OfReal;
theDependentValues : HArray1OfHArray1OfReal;
end TabularData;

View File

@@ -0,0 +1,121 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_TabularData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
// UNFINISHED
// The last field (theDependentValues) not resolved. Queried to mdtv
#include <IGESDefs_TabularData.ixx>
#include <Standard_DimensionMismatch.hxx>
#include <TColStd_HArray1OfReal.hxx>
IGESDefs_TabularData::IGESDefs_TabularData () { }
void IGESDefs_TabularData::Init
(const Standard_Integer nbProps,
const Standard_Integer propType,
/* const Standard_Integer nbDeps, */
/* const Standard_Integer nbIndeps, */
const Handle(TColStd_HArray1OfInteger)& typesInd,
const Handle(TColStd_HArray1OfInteger)& nbValuesInd,
const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesInd,
const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesDep)
{
Standard_Integer num = typesInd->Length();
if (typesInd->Lower() != 1 ||
nbValuesInd->Lower() != 1 || nbValuesInd->Length() != num ||
valuesInd->Lower() != 1 || valuesInd->Length() != num ||
valuesDep->Lower() != 1 )
Standard_DimensionMismatch::Raise("IGESDefs_TabularData : Init");
theNbPropertyValues = nbProps;
thePropertyType = propType;
/* theNbDependents = nbDeps; */
/* theNbIndependents = nbIndeps; */
theTypeOfIndependentVariables = typesInd;
theNbValues = nbValuesInd;
theIndependentValues = valuesInd;
theDependentValues = valuesDep;
InitTypeAndForm(406,11);
}
Standard_Integer IGESDefs_TabularData::NbPropertyValues () const
{
return theNbPropertyValues;
}
Standard_Integer IGESDefs_TabularData::ComputedNbPropertyValues () const
{
return theNbPropertyValues; // pas malin ... a ameliorer
}
Standard_Boolean IGESDefs_TabularData::OwnCorrect ()
{
Standard_Integer newnb = ComputedNbPropertyValues();
if (newnb == theNbPropertyValues) return Standard_False;
theNbPropertyValues = newnb;
return Standard_True;
}
Standard_Integer IGESDefs_TabularData::PropertyType () const
{
return thePropertyType;
}
Standard_Integer IGESDefs_TabularData::NbDependents () const
{
return theDependentValues->Length();
}
Standard_Integer IGESDefs_TabularData::NbIndependents () const
{
return theTypeOfIndependentVariables->Length();
}
Standard_Integer IGESDefs_TabularData::TypeOfIndependents
(const Standard_Integer num) const
{
return theTypeOfIndependentVariables->Value(num);
}
Standard_Integer IGESDefs_TabularData::NbValues (const Standard_Integer num) const
{
return theNbValues->Value(num);
}
Standard_Real IGESDefs_TabularData::IndependentValue
(const Standard_Integer variablenum, const Standard_Integer valuenum) const
{
return (theIndependentValues->Value(variablenum))->Value(valuenum);
}
Handle(TColStd_HArray1OfReal) IGESDefs_TabularData::DependentValues
(const Standard_Integer num) const
{
return theDependentValues->Value(num);
}
// UNFINISHED
// Array limits not sure.
Standard_Real IGESDefs_TabularData::DependentValue
(const Standard_Integer variablenum, const Standard_Integer valuenum) const
{
Standard_Real val = 0.;
#if 0
Standard_Integer sum = 0;
for (Standard_Integer i = 1; i < variablenum; i++)
{
sum += theNbValues->Value(i);
}
sum += valuenum;
val = theDependentValues->Value(sum);
#endif
return val;
}

View File

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

View File

@@ -0,0 +1,195 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_AssociativityDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_ToolAssociativityDef.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESBasic_HArray1OfHArray1OfInteger.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDefs_ToolAssociativityDef::IGESDefs_ToolAssociativityDef () { }
void IGESDefs_ToolAssociativityDef::ReadOwnParams
(const Handle(IGESDefs_AssociativityDef)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Handle(TColStd_HArray1OfInteger) requirements;
Handle(TColStd_HArray1OfInteger) orders;
Handle(TColStd_HArray1OfInteger) numItems;
Handle(IGESBasic_HArray1OfHArray1OfInteger) items;
Standard_Integer nbval;
Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of Class definitions", nbval);
if (st && nbval > 0)
{
requirements = new TColStd_HArray1OfInteger(1, nbval);
orders = new TColStd_HArray1OfInteger(1, nbval);
numItems = new TColStd_HArray1OfInteger(1, nbval);
items = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
}
else PR.AddFail("No. of Class definitions: Not Positive");
if ( ! requirements.IsNull())
for (Standard_Integer i = 1; i <= nbval; i++)
{
Standard_Integer requirement;
Standard_Integer order;
Standard_Integer numItem;
Handle(TColStd_HArray1OfInteger) item;
//st = PR.ReadInteger(PR.Current(), "Back Pointer Requirement", requirement); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Back Pointer Requirement", requirement))
requirements->SetValue(i, requirement);
//st = PR.ReadInteger(PR.Current(), "Ordered/Unordered Class", order); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Ordered/Unordered Class", order))
orders->SetValue(i, order);
//st = PR.ReadInteger(PR.Current(),"No. of items per entry", numItem); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(),"No. of items per entry", numItem)) {
Standard_Integer temp;
numItems->SetValue(i, numItem);
item = new TColStd_HArray1OfInteger(1, numItem);
for (Standard_Integer j = 1; j <= numItem; j++)
{
//Standard_Integer temp; //szv#4:S4163:12Mar99 moved out of for
//st = PR.ReadInteger(PR.Current(), "Item", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Item", temp))
item->SetValue(j, temp);
}
items->SetValue(i, item);
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(requirements, orders, numItems, items);
}
void IGESDefs_ToolAssociativityDef::WriteOwnParams
(const Handle(IGESDefs_AssociativityDef)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer upper = ent->NbClassDefs();
IW.Send(upper);
for (Standard_Integer i = 1; i <= upper; i++) {
IW.Send(ent->BackPointerReq(i));
IW.Send(ent->ClassOrder(i));
IW.Send(ent->NbItemsPerClass(i));
Standard_Integer items = ent->NbItemsPerClass(i);
for (Standard_Integer j = 1; j <= items; j++)
IW.Send(ent->Item(i,j));
}
}
void IGESDefs_ToolAssociativityDef::OwnShared
(const Handle(IGESDefs_AssociativityDef)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESDefs_ToolAssociativityDef::OwnCopy
(const Handle(IGESDefs_AssociativityDef)& another,
const Handle(IGESDefs_AssociativityDef)& ent, Interface_CopyTool& /* TC */) const
{
Handle(TColStd_HArray1OfInteger) requirements;
Handle(TColStd_HArray1OfInteger) orders;
Handle(TColStd_HArray1OfInteger) numItems;
Handle(IGESBasic_HArray1OfHArray1OfInteger) items;
Standard_Integer nbval = another->NbClassDefs();
requirements = new TColStd_HArray1OfInteger(1, nbval);
orders = new TColStd_HArray1OfInteger(1, nbval);
numItems = new TColStd_HArray1OfInteger(1, nbval);
items = new IGESBasic_HArray1OfHArray1OfInteger(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
Standard_Integer requirement = another->BackPointerReq(i);
requirements->SetValue(i, requirement);
Standard_Integer order = another->ClassOrder(i);
orders->SetValue(i, order);
Standard_Integer numItem = another->NbItemsPerClass(i);
numItems->SetValue(i, numItem);
Handle(TColStd_HArray1OfInteger) item;
item = new TColStd_HArray1OfInteger(1, numItem);
for (Standard_Integer j = 1; j <= numItem; j++)
{
Standard_Integer temp = another->Item(i, j);
item->SetValue(j, temp);
}
items->SetValue(i, item);
}
ent->Init(requirements, orders, numItems, items);
ent->SetFormNumber (another->FormNumber());
}
IGESData_DirChecker IGESDefs_ToolAssociativityDef::DirChecker
(const Handle(IGESDefs_AssociativityDef)& /* ent */ ) const
{
IGESData_DirChecker DC (302, 5001, 9999);
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 IGESDefs_ToolAssociativityDef::OwnCheck
(const Handle(IGESDefs_AssociativityDef)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESDefs_ToolAssociativityDef::OwnDump
(const Handle(IGESDefs_AssociativityDef)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESDefs_AssociativityDef" << endl;
S << "Number of Class Definitions : " << ent->NbClassDefs() << endl;
S << "Back Pointer Requirement : " << endl;
S << "Ordered / Unordered Class : " << endl;
S << "Number Of Items per Entry : " << endl;
S << "Items : " << endl;
IGESData_DumpVals(S,-level,1, ent->NbClassDefs(),ent->BackPointerReq);
S << endl;
if (level > 4)
{
// Warning : Item is a JAGGED Array
Standard_Integer upper = ent->NbClassDefs();
for (Standard_Integer i = 1; i <= upper; i ++) {
S << "[" << i << "]: " << endl;
S << "Back Pointer Requirement : " << ent->BackPointerReq(i) << " ";
if (ent->IsBackPointerReq(i)) S << "(Yes) ";
else S << "(No) ";
S << " Ordered/Unordered Class : " << ent->ClassOrder(i) << " ";
if (ent->IsOrdered(i)) S << "(Yes)" <<endl;
else S << "(No)" <<endl;
S << "Number Of Items per Entry : " << ent->NbItemsPerClass(i);
if (level < 6) {
S << " [ask level > 5 for more]" << endl;
continue;
}
S << endl << " [";
for (Standard_Integer j = 1; j <= ent->NbItemsPerClass(i); j ++)
S << " " << ent->Item(i,j);
S << "]" << endl;
}
}
S << endl;
}

View File

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

View File

@@ -0,0 +1,484 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_AttributeDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_ToolAttributeDef.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESGraph_TextDisplayTemplate.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <IGESData_IGESEntity.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESGraph_HArray1OfTextDisplayTemplate.hxx>
#include <IGESDefs_HArray1OfHArray1OfTextDisplayTemplate.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
IGESDefs_ToolAttributeDef::IGESDefs_ToolAttributeDef () { }
void IGESDefs_ToolAttributeDef::ReadOwnParams
(const Handle(IGESDefs_AttributeDef)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Handle(TCollection_HAsciiString) aName;
Standard_Integer aListType;
Handle(TColStd_HArray1OfInteger) attrTypes;
Handle(TColStd_HArray1OfInteger) attrValueDataTypes;
Handle(TColStd_HArray1OfInteger) attrValueCounts;
Handle(TColStd_HArray1OfTransient) attrValues;
Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) attrValuePointers;
Standard_Integer nbval;
Standard_Integer fn = ent->FormNumber();
if (PR.DefinedElseSkip())
PR.ReadText(PR.Current(), "Attribute Table Name", aName); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Attribute List Type", aListType); //szv#4:S4163:12Mar99 `st=` not needed
Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Attributes", nbval);
if (st && nbval > 0)
{
attrTypes = new TColStd_HArray1OfInteger(1, nbval);
attrValueDataTypes = new TColStd_HArray1OfInteger(1, nbval);
attrValueCounts = new TColStd_HArray1OfInteger(1, nbval);
if (fn > 0) attrValues =
new TColStd_HArray1OfTransient(1, nbval);
if (fn > 1) attrValuePointers =
new IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(1, nbval);
}
else PR.AddFail("Number of Attributes: Not Positive");
if ( ! attrTypes.IsNull())
for (Standard_Integer i = 1; i <= nbval; i++)
{
Standard_Integer attrType;
Standard_Integer attrValueDataType;
Standard_Integer avc;
// Value according type
Handle(IGESGraph_HArray1OfTextDisplayTemplate) attrValuePointer;
//st = PR.ReadInteger(PR.Current(), "Attribute Type", attrType); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Attribute Type", attrType))
attrTypes->SetValue(i, attrType);
st = PR.ReadInteger(PR.Current(),"Attribute Data Type",attrValueDataType);
if (st) attrValueDataTypes->SetValue(i, attrValueDataType);
if (PR.DefinedElseSkip())
st = PR.ReadInteger (PR.Current(),"Attribute Value Count",avc);
else avc = 1;
if (st) {
attrValueCounts->SetValue(i, avc);
if (fn > 1) attrValuePointer =
new IGESGraph_HArray1OfTextDisplayTemplate(1, avc);
}
if (! attrValues.IsNull())
if (fn > 0)
{
Handle(TColStd_HArray1OfInteger) attrInt;
Handle(TColStd_HArray1OfReal) attrReal;
Handle(Interface_HArray1OfHAsciiString) attrStr;
Handle(IGESData_HArray1OfIGESEntity) attrEnt;
switch (attrValueDataType) {
case 1 : attrInt = new TColStd_HArray1OfInteger (1,avc);
attrValues->SetValue(i,attrInt); break;
case 2 : attrReal = new TColStd_HArray1OfReal (1,avc);
attrValues->SetValue(i,attrReal); break;
case 3 : attrStr = new Interface_HArray1OfHAsciiString(1,avc);
attrValues->SetValue(i,attrStr); break;
case 4 : attrEnt = new IGESData_HArray1OfIGESEntity (1,avc);
attrValues->SetValue(i,attrEnt); break;
case 6 : attrInt = new TColStd_HArray1OfInteger (1,avc);
attrValues->SetValue(i,attrInt); break;
default : break;
}
for (Standard_Integer j = 1; j <= avc; j++)
{
switch(attrValueDataType)
{
case 0:
{
PR.SetCurrentNumber(PR.CurrentNumber() + 1); // passer
//// attrValue->SetValue(j, NULL); par defaut
break;
}
case 1:
{
Standard_Integer temp;
//st = PR.ReadInteger(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(), "Attribute Value", temp))
attrInt->SetValue(j, temp);
}
break;
case 2:
{
Standard_Real temp;
//st = PR.ReadReal(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Attribute Value", temp))
attrReal->SetValue(j, temp);
}
break;
case 3:
{
Handle(TCollection_HAsciiString) temp;
//st = PR.ReadText(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadText(PR.Current(), "Attribute Value", temp))
attrStr->SetValue(j, temp);
}
break;
case 4:
{
Handle(IGESData_IGESEntity) temp;
//st = PR.ReadEntity(IR, PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR, PR.Current(), "Attribute Value", temp))
attrEnt->SetValue(j, temp);
}
break;
case 5:
PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip
break;
case 6:
{
Standard_Boolean temp;
//st = PR.ReadBoolean(PR.Current(), "Attribute Value", temp); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadBoolean(PR.Current(), "Attribute Value", temp))
attrInt->SetValue(j, (temp ? 1 : 0));
}
break;
}
if (fn == 2)
{
Handle(IGESGraph_TextDisplayTemplate) tempText;
//st = PR.ReadEntity(IR,PR.Current(),"Attribute Val. Pointer",
//STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempText); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR,PR.Current(),"Attribute Val. Pointer",
STANDARD_TYPE(IGESGraph_TextDisplayTemplate), tempText))
attrValuePointer->SetValue(j, tempText);
}
}
if (fn == 2)
attrValuePointers->SetValue(i, attrValuePointer);
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init
(aName, aListType, attrTypes, attrValueDataTypes, attrValueCounts,
attrValues, attrValuePointers);
}
void IGESDefs_ToolAttributeDef::WriteOwnParams
(const Handle(IGESDefs_AttributeDef)& ent, IGESData_IGESWriter& IW) const
{
if (ent->HasTableName()) IW.Send(ent->TableName());
else IW.SendVoid();
IW.Send(ent->ListType());
Standard_Integer upper = ent->NbAttributes();
IW.Send(upper);
for (Standard_Integer i = 1; i <= upper; i++)
{
Standard_Integer check = ent->AttributeValueDataType(i);
Standard_Integer count = ent->AttributeValueCount(i);
IW.Send(ent->AttributeType(i));
IW.Send(check);
IW.Send(count);
if (ent->FormNumber() > 0)
{
for (Standard_Integer j = 1; j <= count; j++)
{
switch (check) {
case 0 : IW.SendVoid(); break;
case 1 : IW.Send(ent->AttributeAsInteger(i,j)); break;
case 2 : IW.Send(ent->AttributeAsReal(i,j)); break;
case 3 : IW.Send(ent->AttributeAsString(i,j)); break;
case 4 : IW.Send(ent->AttributeAsEntity(i,j)); break;
case 5 : IW.SendVoid(); break;
case 6 : IW.SendBoolean(ent->AttributeAsLogical(i,j)); break;
default : break;
}
if ( ent->FormNumber() == 2)
IW.Send(ent->AttributeTextDisplay(i,j));
}
}
}
}
void IGESDefs_ToolAttributeDef::OwnShared
(const Handle(IGESDefs_AttributeDef)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer upper = ent->NbAttributes();
for (Standard_Integer i = 1; i <= upper; i++)
{
Standard_Integer check = ent->AttributeValueDataType(i);
Standard_Integer count = ent->AttributeValueCount(i);
if (ent->FormNumber() > 0)
{
for (Standard_Integer j = 1; j <= count; j++)
{
if ( check == 4 ) iter.GetOneItem(ent->AttributeAsEntity(i,j));
if ( ent->FormNumber() == 2)
iter.GetOneItem(ent->AttributeTextDisplay(i,j));
}
}
}
}
void IGESDefs_ToolAttributeDef::OwnCopy
(const Handle(IGESDefs_AttributeDef)& another,
const Handle(IGESDefs_AttributeDef)& ent, Interface_CopyTool& TC) const
{
Handle(TCollection_HAsciiString) aName;
if (!another->TableName().IsNull()) aName =
new TCollection_HAsciiString(another->TableName());
Standard_Integer aListType = another->ListType();
Handle(TColStd_HArray1OfInteger) attrTypes;
Handle(TColStd_HArray1OfInteger) attrValueDataTypes;
Handle(TColStd_HArray1OfInteger) attrValueCounts;
Handle(TColStd_HArray1OfTransient) attrValues;
Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) attrValuePointers;
Standard_Integer nbval = another->NbAttributes();
attrTypes = new TColStd_HArray1OfInteger(1, nbval);
attrValueDataTypes = new TColStd_HArray1OfInteger(1, nbval);
attrValueCounts = new TColStd_HArray1OfInteger(1, nbval);
if (another->HasValues()) attrValues =
new TColStd_HArray1OfTransient(1, nbval);
if (another->HasTextDisplay()) attrValuePointers =
new IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
Standard_Integer attrType = another->AttributeType(i);
attrTypes->SetValue(i, attrType);
Standard_Integer attrValueDataType = another->AttributeValueDataType(i);
attrValueDataTypes->SetValue(i, attrValueDataType);
Standard_Integer avc = another->AttributeValueCount(i);
attrValueCounts->SetValue(i, avc);
Handle(IGESGraph_HArray1OfTextDisplayTemplate) attrValuePointer;
if (another->HasTextDisplay()) attrValuePointer =
new IGESGraph_HArray1OfTextDisplayTemplate(1, avc);
if (another->HasValues())
{
Handle(TColStd_HArray1OfInteger) attrInt;
Handle(TColStd_HArray1OfReal) attrReal;
Handle(Interface_HArray1OfHAsciiString) attrStr;
Handle(IGESData_HArray1OfIGESEntity) attrEnt;
switch (attrValueDataType) {
case 1 : attrInt = new TColStd_HArray1OfInteger (1,avc);
attrValues->SetValue(i,attrInt); break;
case 2 : attrReal = new TColStd_HArray1OfReal (1,avc);
attrValues->SetValue(i,attrReal); break;
case 3 : attrStr = new Interface_HArray1OfHAsciiString(1,avc);
attrValues->SetValue(i,attrStr); break;
case 4 : attrEnt = new IGESData_HArray1OfIGESEntity (1,avc);
attrValues->SetValue(i,attrEnt); break;
case 6 : attrInt = new TColStd_HArray1OfInteger (1,avc);
attrValues->SetValue(i,attrInt); break;
default : break;
}
for (Standard_Integer j = 1; j <= avc; j ++)
{
switch(attrValueDataType)
{
case 0:
break;
case 1: attrInt->SetValue(j,another->AttributeAsInteger(i,j));
break;
case 2: attrReal->SetValue(j,another->AttributeAsReal(i,j));
break;
case 3: attrStr->SetValue(j,new TCollection_HAsciiString
(another->AttributeAsString(i,j)));
break;
case 4: {
DeclareAndCast(IGESData_IGESEntity,Ent,TC.Transferred
(another->AttributeAsEntity(i,j)));
attrEnt->SetValue(j,Ent);
}
break;
case 5:
break;
case 6: attrInt->SetValue
(j,(another->AttributeAsLogical(i,j) ? 1 : 0));
break;
default : break;
}
if (another->HasTextDisplay())
{
DeclareAndCast(IGESGraph_TextDisplayTemplate, temptext,
TC.Transferred(another->AttributeTextDisplay(i,j)));
attrValuePointer->SetValue (j, temptext);
}
}
if (another->HasTextDisplay())
attrValuePointers->SetValue(i, attrValuePointer);
}
}
ent->Init
(aName, aListType, attrTypes, attrValueDataTypes, attrValueCounts,
attrValues, attrValuePointers);
}
IGESData_DirChecker IGESDefs_ToolAttributeDef::DirChecker
(const Handle(IGESDefs_AttributeDef)& /* ent */ ) const
{
IGESData_DirChecker DC (322, 0, 2);
DC.Structure(IGESData_DefVoid);
DC.LineFont(IGESData_DefAny);
DC.LineWeight(IGESData_DefValue);
DC.Color(IGESData_DefAny);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(0);
DC.UseFlagRequired(2);
DC.GraphicsIgnored(1);
return DC;
}
void IGESDefs_ToolAttributeDef::OwnCheck
(const Handle(IGESDefs_AttributeDef)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
Standard_Integer nb = ent->NbAttributes();
Standard_Integer fn = ent->FormNumber();
for (Standard_Integer i = 1; i <= nb; i ++) {
char mess[80];
if (ent->AttributeType(i) < 0 || ent->AttributeType(i) > 9999) {
sprintf(mess,"Attribute Type n0.%d not in <0 - 9999>", ent->AttributeType(i));
ach->AddFail(mess);
}
Standard_Integer aty = ent->AttributeValueDataType(i);
if (aty < 0 || aty > 6) {
sprintf(mess,"Attribute Value Data Type n0.%d not in <0 - 6>", aty);
ach->AddFail(mess);
}
if (ent->AttributeValueCount(i) <= 0) continue;
Handle(Standard_Transient) list = ent->AttributeList(i);
if (fn > 0 && ent.IsNull()) {
if (aty == 0 || aty == 5) continue;
sprintf(mess,"Form Number > 0 and Attribute Value List n0.%d undefined", aty);
ach->AddFail(mess);
continue;
}
else if (fn == 0) continue;
mess[0] = '\0';
switch (aty) {
case 1 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger)))
sprintf(mess,"Attribute List n0.%d (Integers) badly defined", aty);
break;
case 2 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfReal)))
sprintf(mess,"Attribute List n0.%d (Reals) badly defined", aty);
break;
case 3 : if (!list->IsKind(STANDARD_TYPE(Interface_HArray1OfHAsciiString)))
sprintf(mess,"Attribute List n0.%d (Strings) badly defined", aty);
break;
case 4 : if (!list->IsKind(STANDARD_TYPE(IGESData_HArray1OfIGESEntity)))
sprintf(mess,"Attribute List n0.%d (IGES Pointers) badly defined", aty);
break;
case 6 : if (!list->IsKind(STANDARD_TYPE(TColStd_HArray1OfInteger)))
sprintf(mess,"Attribute List n0.%d (Logicals i.e. Integers) badly defined", aty);
break;
default : break;
}
if (mess[0] != '\0') ach->AddFail(mess);
}
}
void IGESDefs_ToolAttributeDef::OwnDump
(const Handle(IGESDefs_AttributeDef)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer sublevel = (level > 4) ? 1 : 0;
S << "IGESDefs_AttributeDef" << endl;
S << "Attribute Table Name: ";
IGESData_DumpString(S,ent->TableName());
S << endl;
S << "Attribute List Type : " << ent->ListType() << endl;
S << "Number of Attributes : " << ent->NbAttributes() << endl;
S << "Attribute Types : " << endl;
S << "Attribute Value Data Types : " << endl;
S << "Attribute Value Counts : " << endl;
if (ent->HasValues()) S << "Attribute Values : " << endl;
if (ent->HasTextDisplay()) S << "Attribute Value Entities : " << endl;
IGESData_DumpVals(S,-level,1, ent->NbAttributes(),ent->AttributeType);
S << endl;
if (level > 4)
{
Standard_Integer upper = ent->NbAttributes();
for (Standard_Integer i = 1; i <= upper ; i ++)
{
Standard_Integer avc = ent->AttributeValueCount(i);
Standard_Integer typ = ent->AttributeValueDataType(i);
S << "[" << i << "]: ";
S << "Attribute Type : " << ent->AttributeType(i) << " ";
S << "Value Data Type : " << typ;
switch (typ) {
case 0 : S << " (Void)"; break;
case 1 : S << " : Integer "; break;
case 2 : S << " : Real "; break;
case 3 : S << " : String "; break;
case 4 : S << " : Entity "; break;
case 5 : S << " (Not Used)"; break;
case 6 : S << " : Logical "; break;
default : break;
}
S << " Count : " << avc << endl;
if (ent->HasValues())
{
if (level <= 5) {
S << " [ content (Values) : ask level > 5 ]" << endl;
continue;
}
for (Standard_Integer j = 1; j <= avc; j ++)
{
S << "[" << j << "]: ";
switch(ent->AttributeValueDataType(i))
{
case 0: S << "(Void) ";
break;
case 1: S << ent->AttributeAsInteger(i,j);
break;
case 2: S << ent->AttributeAsReal(i,j);
break;
case 3: IGESData_DumpString(S,ent->AttributeAsString(i,j));
break;
case 4: dumper.Dump(ent->AttributeAsEntity(i,j),S,level-5);
break;
case 5: S << "(Not Used)";
break;
case 6:
S << ( ent->AttributeAsLogical(i,j) ? "True" : "False");
break;
default : break;
}
if (ent->HasTextDisplay())
{
S << " Attribute Value Pointer : ";
dumper.Dump (ent->AttributeTextDisplay(i,j),S, sublevel);
}
S << endl;
}
}
}
}
S << endl;
}

View File

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

View File

@@ -0,0 +1,333 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_AttributeTable.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_ToolAttributeTable.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESDefs_AttributeDef.hxx>
#include <TColStd_HArray2OfTransient.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <IGESData_Dump.hxx>
IGESDefs_ToolAttributeTable::IGESDefs_ToolAttributeTable () { }
void IGESDefs_ToolAttributeTable::ReadOwnParams
(const Handle(IGESDefs_AttributeTable)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
Standard_Integer nr = 1;
Standard_Integer j;
Standard_Boolean st = Standard_True;
Handle(IGESDefs_AttributeDef) ab = ent->Definition(); // formerly loaded
Handle(TColStd_HArray2OfTransient) list2;
if (ab.IsNull()) {
PR.AddFail("No Attribute Definition as Structure");
return;
}
Standard_Integer na = ab->NbAttributes();
if (ent->FormNumber() == 1)
st = PR.ReadInteger(PR.Current(),"No. of rows",nr);
if (st) list2 = new TColStd_HArray2OfTransient(1,na,1,nr);
// AttributeDef repeated once (Form 0) or <nr> times (Form 1)
for (Standard_Integer k = 1; k <= nr; k ++)
{
for (Standard_Integer i = 1; i <= na; i ++)
{
Standard_Integer avc = ab->AttributeValueCount(i);
Standard_Integer atype = ab->AttributeValueDataType(i);
switch (atype)
{
case 0 :
for (j = 1; j <= avc; j ++)
PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip
break;
case 1 : {
Handle(TColStd_HArray1OfInteger) attrInt = new TColStd_HArray1OfInteger(1,avc);
list2->SetValue(i,k,attrInt);
Standard_Integer item;
for (j = 1; j <= avc; j ++) {
//st = PR.ReadInteger(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(),"Value",item))
attrInt->SetValue(j,item);
}
}
break;
case 2 : {
Handle(TColStd_HArray1OfReal) attrReal = new TColStd_HArray1OfReal(1,avc);
list2->SetValue(i,k,attrReal);
Standard_Real item;
for (j = 1; j <= avc; j ++) {
//st = PR.ReadReal(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(),"Value",item))
attrReal->SetValue(j,item);
}
}
break;
case 3 : {
Handle(Interface_HArray1OfHAsciiString) attrStr = new Interface_HArray1OfHAsciiString(1,avc);
list2->SetValue(i,k,attrStr);
Handle(TCollection_HAsciiString) item;
for (j = 1; j <= avc; j ++) {
//st = PR.ReadText(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadText(PR.Current(),"Value",item))
attrStr->SetValue(j,item);
}
}
break;
case 4 : {
Handle(IGESData_HArray1OfIGESEntity) attrEnt = new IGESData_HArray1OfIGESEntity(1,avc);
list2->SetValue(i,k,attrEnt);
Handle(IGESData_IGESEntity) item;
for (j = 1; j <= avc; j ++) {
//st = PR.ReadEntity(IR,PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR,PR.Current(),"Value",item))
attrEnt->SetValue(j,item);
}
}
break;
case 5 :
for (j = 1; j <= avc; j ++)
PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip
break;
case 6 : { // Here item takes value 0 or 1
Handle(TColStd_HArray1OfInteger) attrInt = new TColStd_HArray1OfInteger(1,avc);
list2->SetValue(i,k,attrInt);
Standard_Integer item;
for (j = 1; j <= avc; j ++) {
//st = PR.ReadInteger(PR.Current(),"Value",item); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInteger(PR.Current(),"Value",item))
attrInt->SetValue(j,item);
}
}
break;
default : break;
}
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(list2);
}
void IGESDefs_ToolAttributeTable::WriteOwnParams
(const Handle(IGESDefs_AttributeTable)& ent, IGESData_IGESWriter& IW) const
{
Handle(IGESDefs_AttributeDef) ab = ent->Definition();
Standard_Integer nr = ent->NbRows();
Standard_Integer na = ent->NbAttributes();
if (ent->FormNumber() == 1) IW.Send(nr);
for (Standard_Integer k = 1; k <= nr; k ++)
{
for (Standard_Integer i = 1; i <= na; i ++)
{
Standard_Integer count = ab->AttributeValueCount(i);
for (Standard_Integer j = 1;j <= count; j++)
{
switch(ab->AttributeValueDataType(i))
{
case 0 : IW.SendVoid(); break;
case 1 : IW.Send(ent->AttributeAsInteger(i,k,j)); break;
case 2 : IW.Send(ent->AttributeAsReal (i,k,j)); break;
case 3 : IW.Send(ent->AttributeAsString (i,k,j)); break;
case 4 : IW.Send(ent->AttributeAsEntity (i,k,j)); break;
case 5 : IW.SendVoid(); break;
case 6 : IW.SendBoolean(ent->AttributeAsLogical(i,k,j)); break;
default : break;
}
}
}
}
}
void IGESDefs_ToolAttributeTable::OwnShared
(const Handle(IGESDefs_AttributeTable)& ent, Interface_EntityIterator& iter) const
{
Handle(IGESDefs_AttributeDef) ab = ent->Definition();
Standard_Integer na = ent->NbAttributes();
Standard_Integer nr = ent->NbRows();
for (Standard_Integer k = 1; k <= nr; k ++)
{
for (Standard_Integer i = 1; i <= na; i ++)
{
if (ab->AttributeValueDataType(i) != 4) continue;
Standard_Integer avc = ab->AttributeValueCount(i);
for (Standard_Integer j = 1; j <= avc; j ++)
iter.GetOneItem(ent->AttributeAsEntity(i,k,j));
}
}
}
void IGESDefs_ToolAttributeTable::OwnCopy
(const Handle(IGESDefs_AttributeTable)& another,
const Handle(IGESDefs_AttributeTable)& ent, Interface_CopyTool& TC) const
{
Standard_Integer j = 1;
Handle(IGESDefs_AttributeDef) ab = another->Definition();
Standard_Integer na = another->NbAttributes();
Standard_Integer nr = another->NbRows();
Handle(TColStd_HArray2OfTransient) list2 =
new TColStd_HArray2OfTransient(1,na,1,nr);
for (Standard_Integer k = 1; k <= nr; k ++)
{
for (Standard_Integer i = 1; i <= na; i ++)
{
Standard_Integer avc = ab->AttributeValueCount(i);
Standard_Integer atype = ab->AttributeValueDataType(i);
switch (atype)
{
case 0 : //// list2->SetValue(i,k,NULL); par defaut
break;
case 1 : {
DeclareAndCast(TColStd_HArray1OfInteger,otherInt,
another->AttributeList(i,k));
Handle(TColStd_HArray1OfInteger) attrInt =
new TColStd_HArray1OfInteger (1,avc);
list2->SetValue(i,k,attrInt);
for (j = 1; j <= avc; j++)
attrInt->SetValue(j,otherInt->Value(j));
}
break;
case 2 : {
DeclareAndCast(TColStd_HArray1OfReal,otherReal,
another->AttributeList(i,k));
Handle(TColStd_HArray1OfReal) attrReal =
new TColStd_HArray1OfReal (1,avc);
list2->SetValue(i,k,attrReal);
for (j = 1; j <= avc; j++)
attrReal->SetValue(j,otherReal->Value(j));
}
break;
case 3 : {
DeclareAndCast(Interface_HArray1OfHAsciiString,otherStr,
another->AttributeList(i,k));
Handle(Interface_HArray1OfHAsciiString) attrStr =
new Interface_HArray1OfHAsciiString (1,avc);
list2->SetValue(i,k,attrStr);
for (j = 1; j <= avc; j++)
attrStr->SetValue
(j,new TCollection_HAsciiString(otherStr->Value(j)));
}
break;
case 4 : {
DeclareAndCast(IGESData_HArray1OfIGESEntity,otherEnt,
another->AttributeList(i,k));
Handle(IGESData_HArray1OfIGESEntity) attrEnt =
new IGESData_HArray1OfIGESEntity (1,avc);
list2->SetValue(i,k,attrEnt);
for (j = 1; j <= avc; j++)
attrEnt->SetValue(j,GetCasted(IGESData_IGESEntity,
TC.Transferred(otherEnt->Value(j))));
}
break;
case 5 : ///// list2->SetValue(i,k,NULL); par defaut
break;
case 6 :{ // Here item takes value 0 or 1
DeclareAndCast(TColStd_HArray1OfInteger,otherInt,
another->AttributeList(i,k));
Handle(TColStd_HArray1OfInteger) attrInt =
new TColStd_HArray1OfInteger (1,avc);
list2->SetValue(i,k,attrInt);
for (j = 1; j <= avc; j++)
attrInt->SetValue(j,otherInt->Value(j));
}
break;
default : break;
}
}
}
ent->Init(list2);
}
IGESData_DirChecker IGESDefs_ToolAttributeTable::DirChecker
(const Handle(IGESDefs_AttributeTable)& /* ent */ ) const
{
IGESData_DirChecker DC(422,0,1);
DC.Structure(IGESData_DefReference);
DC.GraphicsIgnored();
DC.BlankStatusIgnored();
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDefs_ToolAttributeTable::OwnCheck
(const Handle(IGESDefs_AttributeTable)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->Definition().IsNull())
if (ent->HasStructure()) ach->AddFail
("Structure in Directory Entry is not an Attribute Definition Table");
else ach->AddFail("No Attribute Definition defined");
if (ent->FormNumber() == 0 && ent->NbRows() != 1)
ach->AddFail("Form 0 with several Rows");
if (ent->NbAttributes() != ent->Definition()->NbAttributes())
ach->AddFail("Mismatch between Definition (Structure) and Content");
}
void IGESDefs_ToolAttributeTable::OwnDump
(const Handle(IGESDefs_AttributeTable)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESDefs_AttributeTable" << endl;
Handle(IGESDefs_AttributeDef) ab = ent->Definition();
Standard_Integer na = ent->NbAttributes();
Standard_Integer nr = ent->NbRows();
if (ent->FormNumber() == 1)
S << "Number of Rows (i.e. complete sets of Attributes) : " << nr << endl;
else S << "One set of Attributes" << endl;
S << "Number of defined Attributes : " << na << endl;
if (level <= 4) S <<
" [ structure : see Structure in Directory Entry; content : level > 4 ]" <<endl;
else
for (Standard_Integer k = 1; k <= nr; k ++)
{
for (Standard_Integer i = 1; i <= na; i ++)
{
Standard_Integer avc = ab->AttributeValueCount(i);
S << "[At.no."<<i<<" Row:"<<k<<"]";
switch (ab->AttributeValueDataType(i)) {
case 0 : S << " (Void) "; break;
case 1 : S << " Integer"; break;
case 2 : S << " Real "; break;
case 3 : S << " String "; break;
case 4 : S << " Entity "; break;
case 5 : S << " (Not used)"; break;
case 6 : S << " Logical"; break;
default : break;
}
S << " :";
for (Standard_Integer j = 1;j <= avc; j++) {
S << " ";
switch(ab->AttributeValueDataType(i)) {
case 1 : S << ent->AttributeAsInteger(i,k,j); break;
case 2 : S << ent->AttributeAsReal (i,k,j); break;
case 3 : IGESData_DumpString(S,ent->AttributeAsString (i,k,j));
break;
case 4 : dumper.Dump(ent->AttributeAsEntity (i,k,j),S,level-5);
break;
case 6 : S << (ent->AttributeAsLogical(i,k,j) ? "True" : "False");
break;
default : break;
}
}
S << endl;
}
}
S << endl;
}

View File

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

View File

@@ -0,0 +1,281 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_GenericData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_ToolGenericData.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <IGESData_Dump.hxx>
IGESDefs_ToolGenericData::IGESDefs_ToolGenericData () { }
void IGESDefs_ToolGenericData::ReadOwnParams
(const Handle(IGESDefs_GenericData)& ent,
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer i, num;
Standard_Integer tempNbPropVal;
Handle(TCollection_HAsciiString) tempName;
Handle(TColStd_HArray1OfInteger) tempTypes;
Handle(TColStd_HArray1OfTransient) tempValues;
PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropVal); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadText(PR.Current(), "Property Name", tempName); //szv#4:S4163:12Mar99 `st=` not needed
Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of TYPE/VALUEs", num);
if (st && num > 0)
{
tempTypes = new TColStd_HArray1OfInteger(1, num);
tempValues = new TColStd_HArray1OfTransient(1, num);
}
else PR.AddFail("Number of TYPE/VALUEs: Not Positive");
if (!tempTypes.IsNull() && !tempValues.IsNull())
for ( i = 1; i <= num; i++ )
{
Standard_Integer tempTyp;
PR.ReadInteger(PR.Current(), "Type code", tempTyp); //szv#4:S4163:12Mar99 `st=` not needed
tempTypes->SetValue(i, tempTyp);
switch (tempTyp)
{
case 0: // No value
PR.SetCurrentNumber(PR.CurrentNumber()+1);
break;
case 1: // Integer
{
Handle(TColStd_HArray1OfInteger) tempObj;
//st = PR.ReadInts(PR.CurrentList(1), "Integer value", tempObj); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadInts(PR.CurrentList(1), "Integer value", tempObj))
tempValues->SetValue(i, tempObj);
}
break;
case 2: // Real
{
Handle(TColStd_HArray1OfReal) tempObj;
//st = PR.ReadReals(PR.CurrentList(1), "Real value", tempObj); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReals(PR.CurrentList(1), "Real value", tempObj))
tempValues->SetValue(i, tempObj);
}
break;
case 3: // Character string
{
Handle(TCollection_HAsciiString) tempObj;
//st = PR.ReadText(PR.Current(), "String value", tempObj); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadText(PR.Current(), "String value", tempObj))
tempValues->SetValue(i, tempObj);
}
break;
case 4: // Pointer
{
Handle(IGESData_IGESEntity) tempEntity;
//st = PR.ReadEntity(IR, PR.Current(), "Entity value", tempEntity); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadEntity(IR, PR.Current(), "Entity value", tempEntity))
tempValues->SetValue(i, tempEntity);
}
break;
case 5: // Not used
PR.SetCurrentNumber(PR.CurrentNumber()+1);
break;
case 6: // Logical
{
Handle(TColStd_HArray1OfInteger) tempObj = new TColStd_HArray1OfInteger(1, 1);
Standard_Boolean tempBool;
//st = PR.ReadBoolean(PR.Current(), "Boolean value", tempBool); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadBoolean(PR.Current(), "Boolean value", tempBool)) {
tempObj->SetValue(1, (tempBool ? 1 : 0));
tempValues->SetValue(i, tempObj);
}
}
break;
}
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init (tempNbPropVal, tempName, tempTypes, tempValues);
}
void IGESDefs_ToolGenericData::WriteOwnParams
(const Handle(IGESDefs_GenericData)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer i, num;
IW.Send(ent->NbPropertyValues());
IW.Send(ent->Name());
IW.Send(ent->NbTypeValuePairs());
for ( num = ent->NbTypeValuePairs(), i = 1; i <= num; i++ )
{
IW.Send(ent->Type(i));
switch (ent->Type(i))
{
case 0 : IW.SendVoid(); break;
case 1 : IW.Send(ent->ValueAsInteger(i)); break;
case 2 : IW.Send(ent->ValueAsReal(i)); break;
case 3 : IW.Send(ent->ValueAsString(i)); break;
case 4 : IW.Send(ent->ValueAsEntity(i)); break;
case 5 : IW.SendVoid(); break;
case 6 : IW.SendBoolean(ent->ValueAsLogical(i)); break;
default : break;
}
}
}
void IGESDefs_ToolGenericData::OwnShared
(const Handle(IGESDefs_GenericData)& ent, Interface_EntityIterator& iter) const
{
Standard_Integer i, num;
for ( num = ent->NbTypeValuePairs(), i = 1; i <= num; i++ )
{
if (ent->Type(i) == 4)
iter.GetOneItem(ent->ValueAsEntity(i));
}
}
void IGESDefs_ToolGenericData::OwnCopy
(const Handle(IGESDefs_GenericData)& another,
const Handle(IGESDefs_GenericData)& ent, Interface_CopyTool& TC) const
{
Standard_Integer num = another->NbTypeValuePairs();
Standard_Integer tempNbPropVal = another->NbPropertyValues();
Handle(TCollection_HAsciiString) tempName =
new TCollection_HAsciiString(another->Name());
Handle(TColStd_HArray1OfInteger) tempTypes =
new TColStd_HArray1OfInteger(1, num);
Handle(TColStd_HArray1OfTransient) tempValues =
new TColStd_HArray1OfTransient(1, num);
for (Standard_Integer i = 1; i <= num; i++)
{
tempTypes->SetValue(i, another->Type(i));
switch (another->Type(i))
{
case 0: // No value
break;
case 1: // Integer
{
Handle(TColStd_HArray1OfInteger) tempObj =
new TColStd_HArray1OfInteger(1,1);
tempObj->SetValue(1,another->ValueAsInteger(i));
tempValues->SetValue(i, tempObj);
}
break;
case 2: // Real
{
Handle(TColStd_HArray1OfReal) tempObj =
new TColStd_HArray1OfReal(1,1);
tempObj->SetValue(1,another->ValueAsReal(i));
tempValues->SetValue(i, tempObj);
}
break;
case 3: // Character string
{
tempValues->SetValue
(i, new TCollection_HAsciiString(another->ValueAsString(i)));
}
break;
case 4: // Pointer
{
DeclareAndCast(IGESData_IGESEntity, tempObj,
TC.Transferred(another->ValueAsEntity(i)));
tempValues->SetValue(i, tempObj);
}
break;
case 5: // Not used
break;
case 6: // Logical
{
Handle(TColStd_HArray1OfInteger) tempObj =
new TColStd_HArray1OfInteger(1,1);
tempObj->SetValue(1, (another->ValueAsLogical(i) ? 1 : 0) );
tempValues->SetValue(i, tempObj);
}
break;
}
}
ent->Init (tempNbPropVal, tempName, tempTypes, tempValues);
}
IGESData_DirChecker IGESDefs_ToolGenericData::DirChecker
(const Handle(IGESDefs_GenericData)& /* ent */ ) const
{
IGESData_DirChecker DC(406, 27);
DC.Structure(IGESData_DefVoid);
DC.GraphicsIgnored();
DC.LineFont(IGESData_DefVoid);
DC.LineWeight(IGESData_DefVoid);
DC.Color(IGESData_DefVoid);
DC.BlankStatusIgnored();
DC.SubordinateStatusRequired(1);
DC.UseFlagRequired(2);
DC.HierarchyStatusIgnored();
return DC;
}
void IGESDefs_ToolGenericData::OwnCheck
(const Handle(IGESDefs_GenericData)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
if (ent->NbPropertyValues() != ent->NbTypeValuePairs()*2 + 2)
ach->AddFail("Nb. of Property Values not consistent with Nb. of Type/value Pairs");
}
void IGESDefs_ToolGenericData::OwnDump
(const Handle(IGESDefs_GenericData)& ent, const IGESData_IGESDumper& dumper,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESDefs_GenericData" << endl;
S << "Number of property values : " << ent->NbPropertyValues() << endl;
S << "Property Name : ";
IGESData_DumpString(S,ent->Name());
S << endl;
switch (level)
{
case 4:
S << "Types : " << endl;
S << "Values : " << "Count = " << ent->NbTypeValuePairs() << endl;
S << " [ as level > 4 for content ]" << endl;
break;
case 5:
case 6:
{
Standard_Integer i, num;
S << "Types & Values : " << endl;
for ( num = ent->NbTypeValuePairs(), i = 1; i <= num; i++ )
{
S << "[" << i << "]: ";
S << "Type : " << ent->Type(i);
switch (ent->Type(i)) {
case 0 : S << " (Void)"; break;
case 1 : S << " Integer, Value : " << ent->ValueAsInteger(i);
break;
case 2 : S << " Real , Value : " << ent->ValueAsReal(i);
break;
case 3 : S << " String , Value : ";
IGESData_DumpString(S,ent->ValueAsString(i)); break;
case 4 : S << " Entity , Value : ";
dumper.Dump(ent->ValueAsEntity(i),S,level-1); break;
case 5 : S << " (Not used)"; break;
case 6 : S << " Logical, Value : "
<< (ent->ValueAsLogical(i) ? "True" : "False"); break;
default : break;
}
S << endl;
}
}
}
S << endl;
}

View File

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

View File

@@ -0,0 +1,138 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_MacroDef.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_ToolMacroDef.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDefs_ToolMacroDef::IGESDefs_ToolMacroDef () { }
void IGESDefs_ToolMacroDef::ReadOwnParams
(const Handle(IGESDefs_MacroDef)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
Handle(TCollection_HAsciiString) macro;
Standard_Integer entityTypeID;
Handle(Interface_HArray1OfHAsciiString) langStatements;
Handle(TCollection_HAsciiString) endMacro;
PR.ReadText(PR.Current(), "MACRO", macro); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Entity Type ID", entityTypeID); //szv#4:S4163:12Mar99 `st=` not needed
Standard_Integer tempCurrent = PR.CurrentNumber();
// Counting the no. of language statements.
Standard_Integer nbval; // svv Jan 10 2000 : porting on DEC
for (nbval = 0; PR.CurrentNumber() != PR.NbParams();
nbval++, PR.SetCurrentNumber(PR.CurrentNumber() + 1));
PR.SetCurrentNumber(tempCurrent);
if (nbval > 0) langStatements =
new Interface_HArray1OfHAsciiString(1, nbval);
else PR.AddFail("Number of Lang. Stats. : Not Positive");
if (! langStatements.IsNull())
{
for (Standard_Integer i = 1; i <= nbval; i++)
{
Handle(TCollection_HAsciiString) langStat;
//st = PR.ReadText(PR.Current(), "Language Statement", langStat); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadText(PR.Current(), "Language Statement", langStat))
langStatements->SetValue(i, langStat);
}
}
PR.ReadText(PR.Current(), "END MACRO", endMacro); //szv#4:S4163:12Mar99 `st=` not needed
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init (macro, entityTypeID, langStatements, endMacro);
}
void IGESDefs_ToolMacroDef::WriteOwnParams
(const Handle(IGESDefs_MacroDef)& ent, IGESData_IGESWriter& IW) const
{
IW.Send(ent->MACRO());
IW.Send(ent->EntityTypeID());
Standard_Integer upper = ent->NbStatements();
for (Standard_Integer i = 1; i <= upper; i++)
IW.Send(ent->LanguageStatement(i));
IW.Send(ent->ENDMACRO());
}
void IGESDefs_ToolMacroDef::OwnShared
(const Handle(IGESDefs_MacroDef)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESDefs_ToolMacroDef::OwnCopy
(const Handle(IGESDefs_MacroDef)& another,
const Handle(IGESDefs_MacroDef)& ent, Interface_CopyTool& /* TC */) const
{
Handle(TCollection_HAsciiString) macro =
new TCollection_HAsciiString(another->MACRO());
Standard_Integer entityTypeID = another->EntityTypeID();
Handle(TCollection_HAsciiString) endMacro =
new TCollection_HAsciiString(another->ENDMACRO());
Handle(Interface_HArray1OfHAsciiString) langStatements;
Standard_Integer nbval = another->NbStatements();
langStatements = new Interface_HArray1OfHAsciiString(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
Handle(TCollection_HAsciiString) langStat =
new TCollection_HAsciiString(another->LanguageStatement(i));
langStatements->SetValue(i, langStat);
}
ent->Init(macro, entityTypeID, langStatements, endMacro);
}
IGESData_DirChecker IGESDefs_ToolMacroDef::DirChecker
(const Handle(IGESDefs_MacroDef)& /* ent */ ) const
{
IGESData_DirChecker DC (306, 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 IGESDefs_ToolMacroDef::OwnCheck
(const Handle(IGESDefs_MacroDef)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESDefs_ToolMacroDef::OwnDump
(const Handle(IGESDefs_MacroDef)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESDefs_MacroDef" << endl;
S << "MACRO : ";
IGESData_DumpString(S,ent->MACRO());
S << endl;
S << "Entity Type ID : " << ent->EntityTypeID() << endl;
S << "Language Statement : ";
IGESData_DumpStrings(S ,level,1, ent->NbStatements(),ent->LanguageStatement);
S << "END MACRO : ";
IGESData_DumpString(S,ent->ENDMACRO());
S << endl;
}

View File

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

View File

@@ -0,0 +1,238 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_TabularData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
// UNFINISHED
// The last field (ent->DependentValues()) not resolved. Queried to mdtv
#include <IGESDefs_ToolTabularData.ixx>
#include <IGESData_ParamCursor.hxx>
#include <IGESBasic_HArray1OfHArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <TColStd_HArray1OfReal.hxx>
IGESDefs_ToolTabularData::IGESDefs_ToolTabularData () { }
void IGESDefs_ToolTabularData::ReadOwnParams
(const Handle(IGESDefs_TabularData)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
Standard_Integer nbProps;
Standard_Integer propType;
Standard_Integer nbDeps;
Standard_Integer nbIndeps;
Handle(TColStd_HArray1OfInteger) typesInd;
Handle(TColStd_HArray1OfInteger) nbValuesInd;
Handle(IGESBasic_HArray1OfHArray1OfReal) valuesInd;
Handle(IGESBasic_HArray1OfHArray1OfReal) valuesDep;
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer i;
PR.ReadInteger(PR.Current(), "Number of Property values", nbProps); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInteger(PR.Current(), "Property type", propType); //szv#4:S4163:12Mar99 `st=` not needed
Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of dependent variables", nbDeps);
if (st && nbDeps > 0)
valuesDep = new IGESBasic_HArray1OfHArray1OfReal(1, nbDeps);
st = PR.ReadInteger(PR.Current(), "No. of Independent variables", nbIndeps);
if (st && nbIndeps > 0)
{
valuesInd = new IGESBasic_HArray1OfHArray1OfReal(1, nbIndeps);
typesInd = new TColStd_HArray1OfInteger(1, nbIndeps);
nbValuesInd = new TColStd_HArray1OfInteger(1, nbIndeps);
}
PR.ReadInts(PR.CurrentList(nbIndeps),
"Type of independent variables", typesInd); //szv#4:S4163:12Mar99 `st=` not needed
PR.ReadInts(PR.CurrentList(nbIndeps),
"No. of values of independent variables", nbValuesInd); //szv#4:S4163:12Mar99 `st=` not needed
for (i=1; i<=nbIndeps; i++)
{
Handle(TColStd_HArray1OfReal) tarr;
Standard_Integer nb = nbValuesInd->Value(i), j;
if (nb > 0 )
{
tarr = new TColStd_HArray1OfReal(1, nb);
for (j=1; j<= nb; j++)
{
Standard_Real treal;
PR.ReadReal(PR.Current(), "Value of independent variable",
treal); //szv#4:S4163:12Mar99 `st=` not needed
tarr->SetValue(j, treal);
}
}
valuesInd->SetValue(i, tarr);
}
// ?? for (i=1; i<=nbDeps; i++) { }
// Dependents : definition pas limpide, on accumule tout sur un seul
// HArray1OfReal, mis en 1re position du HArray1OfHArray1OfReal
// On y met tous les flottants qui restent
Standard_Integer curnum = PR.CurrentNumber();
Standard_Integer nbpars = PR.NbParams();
Standard_Integer nbd = 0;
for (i = curnum; i <= nbpars; i ++) {
if (PR.ParamType(i) != Interface_ParamReal) break;
nbd = i - curnum + 1;
}
Handle(TColStd_HArray1OfReal) somedeps;
if (nbd > 0) somedeps = new TColStd_HArray1OfReal(1,nbd);
for (i = 1; i <= nbd; i ++) {
Standard_Real treal;
PR.ReadReal(PR.Current(), "Value of dependent variable", treal); //szv#4:S4163:12Mar99 `st=` not needed
somedeps->SetValue(i, treal);
}
if (nbDeps > 0) valuesDep->SetValue(1,somedeps);
else PR.AddWarning("Some Real remain while no dependent vakue is defined");
nbProps = PR.CurrentNumber() - 2;
/* for (;;) {
curnum = PR.CurrentNumber();
if (curnum > PR.NbParams()) break;
if (PR.ParamType(curnum) != Interface_ParamReal) break;
PR.SetCurrentNumber (curnum+1);
} */
PR.AddWarning("Don't know exactly how to read dependant values ...");
// ?? a eclaircir
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init (nbProps, propType, typesInd, nbValuesInd, valuesInd, valuesDep);
}
void IGESDefs_ToolTabularData::WriteOwnParams
(const Handle(IGESDefs_TabularData)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer i, nbIndeps = ent->NbIndependents();
Standard_Integer j, nbDeps = ent->NbDependents();
IW.Send(ent->NbPropertyValues());
IW.Send(ent->PropertyType());
IW.Send(nbDeps);
IW.Send(nbIndeps);
for (i=1; i<=nbIndeps; i++)
IW.Send(ent->TypeOfIndependents(i));
for (i=1; i<=nbIndeps; i++)
IW.Send(ent->NbValues(i));
for (i=1; i<=nbIndeps; i++)
for (j=1; j<=ent->NbValues(i); j++)
IW.Send(ent->IndependentValue(i,j));
// UNFINISHED
if (nbDeps == 0) return;
Handle(TColStd_HArray1OfReal) deps = ent->DependentValues(1);
for (i = 1; i <= deps->Length(); i ++) IW.Send(deps->Value(i));
/*
for (i=1; i<=nbDeps; i++)
for (j=1; j<= .. ->Value(i); j++)
IW.Send(ent->DependentValue(i,j));
*/
}
void IGESDefs_ToolTabularData::OwnShared
(const Handle(IGESDefs_TabularData)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESDefs_ToolTabularData::OwnCopy
(const Handle(IGESDefs_TabularData)& another,
const Handle(IGESDefs_TabularData)& ent, Interface_CopyTool& /* TC */) const
{
Standard_Integer nbProps = another->NbPropertyValues();
Standard_Integer propType = another->PropertyType();
Standard_Integer nbDeps = another->NbDependents();
Standard_Integer nbIndeps = another->NbIndependents();
Handle(TColStd_HArray1OfInteger) typesInd = new
TColStd_HArray1OfInteger(1, nbIndeps);
Handle(TColStd_HArray1OfInteger) nbValuesInd = new
TColStd_HArray1OfInteger(1, nbIndeps);
Handle(IGESBasic_HArray1OfHArray1OfReal) valuesInd = new
IGESBasic_HArray1OfHArray1OfReal(1, nbIndeps);
Handle(IGESBasic_HArray1OfHArray1OfReal) valuesDep = new
IGESBasic_HArray1OfHArray1OfReal(1, nbDeps);
Standard_Integer i;
for (i=1; i<=nbIndeps; i++)
{
Standard_Integer j, nval;
typesInd->SetValue(i, another->TypeOfIndependents(i));
nval = another->NbValues(i);
nbValuesInd->SetValue(i, nval);
Handle(TColStd_HArray1OfReal) tmparr = new
TColStd_HArray1OfReal(1, nval);
for (j=1; j<=nval; j++)
tmparr->SetValue(j, another->IndependentValue(i, j));
valuesInd->SetValue(i, tmparr);
}
// UNFINISHED
/*
for (i=1; i<=nbDeps; i++)
{
}
*/
ent->Init(nbProps, propType, typesInd, nbValuesInd,
valuesInd, valuesDep);
}
IGESData_DirChecker IGESDefs_ToolTabularData::DirChecker
(const Handle(IGESDefs_TabularData)& /* ent */ ) const
{
IGESData_DirChecker DC(406, 11);
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 IGESDefs_ToolTabularData::OwnCheck
(const Handle(IGESDefs_TabularData)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESDefs_ToolTabularData::OwnDump
(const Handle(IGESDefs_TabularData)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
Standard_Integer nbIndeps = ent->NbIndependents(); //szv#4:S4163:12Mar99 i unused
Standard_Integer nbDeps = ent->NbDependents();
S << "IGESDefs_TabularData" << endl;
S << "No. of property values : " << ent->NbPropertyValues() << endl;
S << "Property type : " << ent->PropertyType() << endl;
S << "No. of Dependent variables : " << nbDeps << endl;
S << "No. of Independent variables : " << nbIndeps << endl;
S << "Type of independent variables : ";
IGESData_DumpVals(S ,level,1, nbIndeps,ent->TypeOfIndependents);
S << endl << "Number of values of independent variables : ";
IGESData_DumpVals(S ,level,1, nbIndeps,ent->NbValues);
// ?? JAGGED ??
S << endl << "Values of the independent variable : ";
if (level < 5) S << " [ask level > 4]";
else {
for (Standard_Integer ind = 1; ind <= nbIndeps; ind ++) {
S << endl << "[" << ind << "]:";
Standard_Integer nbi = ent->NbValues(ind);
for (Standard_Integer iv = 1; iv <= nbi; iv ++)
S << " " << ent->IndependentValue(ind,iv);
}
}
// IGESData_DumpVals(S ,level,1, nbIndeps,ent->IndependentValue);
S << endl << "Values of the dependent variable : ";
// IGESData_DumpVals(S ,level,1, nbDeps,ent->DependentValue);
S << " TO BE DONE";
S << endl;
}

View File

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

View File

@@ -0,0 +1,161 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_UnitsData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_ToolUnitsData.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
IGESDefs_ToolUnitsData::IGESDefs_ToolUnitsData () { }
void IGESDefs_ToolUnitsData::ReadOwnParams
(const Handle(IGESDefs_UnitsData)& ent,
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
{
//Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
Standard_Integer nbval;
Handle(Interface_HArray1OfHAsciiString) unitTypes;
Handle(Interface_HArray1OfHAsciiString) unitValues;
Handle(TColStd_HArray1OfReal) unitScales;
Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Units", nbval);
if (st && nbval > 0)
{
unitTypes = new Interface_HArray1OfHAsciiString(1, nbval);
unitValues = new Interface_HArray1OfHAsciiString(1, nbval);
unitScales = new TColStd_HArray1OfReal(1, nbval);
}
else PR.AddFail("Number of Units: Less than or Equal or zero");
if (! unitTypes.IsNull())
for (Standard_Integer i = 1; i <= nbval; i++)
{
Handle(TCollection_HAsciiString) unitType;
Handle(TCollection_HAsciiString) unitValue;
Standard_Real unitScale;
//st = PR.ReadText(PR.Current(), "Type of Unit", unitType); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadText(PR.Current(), "Type of Unit", unitType))
unitTypes->SetValue(i, unitType);
//st = PR.ReadText(PR.Current(), "Value of Unit", unitValue); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadText(PR.Current(), "Value of Unit", unitValue))
unitValues->SetValue(i, unitValue);
//st = PR.ReadReal(PR.Current(), "Scale of Unit", unitScale); //szv#4:S4163:12Mar99 moved in if
if (PR.ReadReal(PR.Current(), "Scale of Unit", unitScale))
unitScales->SetValue(i, unitScale);
}
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
ent->Init(unitTypes, unitValues, unitScales);
}
void IGESDefs_ToolUnitsData::WriteOwnParams
(const Handle(IGESDefs_UnitsData)& ent, IGESData_IGESWriter& IW) const
{
Standard_Integer upper = ent->NbUnits();
IW.Send(upper);
for (Standard_Integer i = 1; i <= upper; i++)
{
IW.Send(ent->UnitType(i));
IW.Send(ent->UnitValue(i));
IW.Send(ent->ScaleFactor(i));
}
}
void IGESDefs_ToolUnitsData::OwnShared
(const Handle(IGESDefs_UnitsData)& /* ent */, Interface_EntityIterator& /* iter */) const
{
}
void IGESDefs_ToolUnitsData::OwnCopy
(const Handle(IGESDefs_UnitsData)& another,
const Handle(IGESDefs_UnitsData)& ent, Interface_CopyTool& /* TC */) const
{
Handle(Interface_HArray1OfHAsciiString) unitTypes;
Handle(Interface_HArray1OfHAsciiString) unitValues;
Handle(TColStd_HArray1OfReal) unitScales;
Standard_Integer nbval = another->NbUnits();
unitTypes = new Interface_HArray1OfHAsciiString(1, nbval);
unitValues = new Interface_HArray1OfHAsciiString(1, nbval);
unitScales = new TColStd_HArray1OfReal(1, nbval);
for (Standard_Integer i = 1; i <= nbval; i++)
{
Handle(TCollection_HAsciiString) unitType =
new TCollection_HAsciiString(another->UnitType(i));
unitTypes->SetValue(i, unitType);
Handle(TCollection_HAsciiString) unitValue =
new TCollection_HAsciiString(another->UnitValue(i));
unitValues->SetValue(i, unitValue);
Standard_Real unitScale = another->ScaleFactor(i);
unitScales->SetValue(i, unitScale);
}
ent->Init(unitTypes, unitValues, unitScales);
}
IGESData_DirChecker IGESDefs_ToolUnitsData::DirChecker
(const Handle(IGESDefs_UnitsData)& /* ent */ ) const
{
IGESData_DirChecker DC (316, 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 IGESDefs_ToolUnitsData::OwnCheck
(const Handle(IGESDefs_UnitsData)& /* ent */,
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
{
}
void IGESDefs_ToolUnitsData::OwnDump
(const Handle(IGESDefs_UnitsData)& ent, const IGESData_IGESDumper& /* dumper */,
const Handle(Message_Messenger)& S, const Standard_Integer level) const
{
S << "IGESDefs_UnitsData" << endl;
S << "Number of Units : " << ent->NbUnits() << endl;
S << "Type of Unit : " << endl;
S << "Value of Unit : " << endl;
S << "Scale Factor : " << endl;
IGESData_DumpStrings(S,-level,1, ent->NbUnits(),ent->UnitType);
S << endl;
if (level > 4)
{
S << "Details of the Units" << endl;
Standard_Integer upper = ent->NbUnits();
for (Standard_Integer i = 1; i <= upper; i++)
{
S << "[" << i << "] Type : ";
IGESData_DumpString(S,ent->UnitType(i));
S << endl;
S << " Value : ";
IGESData_DumpString(S,ent->UnitValue(i));
S << endl;
S << " ScaleFactor: " << ent->ScaleFactor(i) << endl;
}
}
S << endl;
}

View File

@@ -0,0 +1,78 @@
--
-- File : UnitData.cdl
-- Created : Wed 13 Jan 1993
-- Author : CKY / Contract Toubro-Larsen ( Deepak PRABHU )
--
---Copyright : MATRA-DATAVISION 1993
--
class UnitsData from IGESDefs inherits IGESEntity
---Purpose: defines IGES UnitsData Entity, Type <316> Form <0>
-- in package IGESDefs
-- This class stores data about a model's fundamental units.
uses
HAsciiString from TCollection,
HArray1OfReal from TColStd,
HArray1OfHAsciiString from Interface
raises DimensionMismatch, OutOfRange
is
Create returns mutable UnitsData;
-- Specific methods for the entity
Init (me : mutable;
unitTypes : HArray1OfHAsciiString;
unitValues : HArray1OfHAsciiString;
unitScales : HArray1OfReal)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- UnitsData
-- - unitTypes : Types of the units being defined
-- - unitValues : Unit Values of the units
-- - unitScales : Multiplicative Scale Factors
-- raises exception if lengths of unitTypes, unitValues and
-- unitScale are not same
NbUnits(me) returns Integer;
---Purpose : returns the Number of units defined by this entity
UnitType(me ; UnitNum : Integer) returns HAsciiString from TCollection
raises OutOfRange;
---Purpose : returns the Type of the UnitNum'th unit being defined
-- raises exception if UnitNum <= 0 or UnitNum > NbUnits()
UnitValue(me ; UnitNum : Integer) returns HAsciiString from TCollection
raises OutOfRange;
---Purpose : returns the Units of the UnitNum'th unit being defined
-- raises exception if UnitNum <= 0 or UnitNum > NbUnits()
ScaleFactor(me ; UnitNum : Integer) returns Real
raises OutOfRange;
---Purpose : returns the multiplicative scale factor to be apllied to the
-- UnitNum'th unit being defined
-- raises exception if UnitNum <= 0 or UnitNum > NbUnits()
fields
--
-- Class : IGESDefs_UnitsData
--
-- Purpose : Declaration of variables specific to UnitsData
--
-- Reminder : An UnitsData Entity stores data about a model's
-- fundamental units. It consists of no. of data strings.
-- The entity then contains records, each of which
-- contains a pair of string variables and a real
-- scale factor.
theUnitTypes : HArray1OfHAsciiString;
theUnitValues : HArray1OfHAsciiString;
theUnitScales : HArray1OfReal;
end UnitsData;

View File

@@ -0,0 +1,53 @@
//--------------------------------------------------------------------
//
// File Name : IGESDefs_UnitsData.cxx
// Date :
// Author : CKY / Contract Toubro-Larsen
// Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------
#include <IGESDefs_UnitsData.ixx>
IGESDefs_UnitsData::IGESDefs_UnitsData () { }
void IGESDefs_UnitsData::Init
(const Handle(Interface_HArray1OfHAsciiString)& unitTypes,
const Handle(Interface_HArray1OfHAsciiString)& unitValues,
const Handle(TColStd_HArray1OfReal)& unitScales)
{
Standard_Integer length = unitTypes->Length();
if ( unitTypes->Lower() != 1 ||
(unitValues->Lower() != 1 || unitValues->Length() != length) ||
(unitScales->Lower() != 1 || unitScales->Length() != length) )
Standard_DimensionMismatch::Raise("IGESDefs_UnitsData : Init");
theUnitTypes = unitTypes;
theUnitValues = unitValues;
theUnitScales = unitScales;
InitTypeAndForm(316,0);
}
Standard_Integer IGESDefs_UnitsData::NbUnits () const
{
return theUnitTypes->Length();
}
Handle(TCollection_HAsciiString) IGESDefs_UnitsData::UnitType
(const Standard_Integer UnitNum) const
{
return theUnitTypes->Value(UnitNum);
}
Handle(TCollection_HAsciiString) IGESDefs_UnitsData::UnitValue
(const Standard_Integer UnitNum) const
{
return theUnitValues->Value(UnitNum);
}
Standard_Real IGESDefs_UnitsData::ScaleFactor
(const Standard_Integer UnitNum) const
{
return theUnitScales->Value(UnitNum);
}