mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Coding - Apply .clang-format formatting #286
Update empty method guards to new style with regex (see PR). Used clang-format 18.1.8. New actions to validate code formatting is added. Update .clang-format with disabling of include sorting. It is temporary changes, then include will be sorted. Apply formatting for /src and /tools folder. The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
@@ -27,20 +27,20 @@
|
||||
// (Modules are created and loaded in appropriate libraries, once by Init)
|
||||
static Handle(IGESDefs_Protocol) protocol;
|
||||
|
||||
|
||||
void IGESDefs::Init ()
|
||||
void IGESDefs::Init()
|
||||
{
|
||||
IGESGraph::Init();
|
||||
if (protocol.IsNull()) {
|
||||
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);
|
||||
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 ()
|
||||
Handle(IGESDefs_Protocol) IGESDefs::Protocol()
|
||||
{
|
||||
return protocol;
|
||||
}
|
||||
|
@@ -23,22 +23,18 @@
|
||||
|
||||
class IGESDefs_Protocol;
|
||||
|
||||
|
||||
//! To embody general definitions of Entities
|
||||
//! (Parameters, Tables ...)
|
||||
class IGESDefs
|
||||
class IGESDefs
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Prepares dynamic data (Protocol, Modules) for this package
|
||||
Standard_EXPORT static void Init();
|
||||
|
||||
|
||||
//! Returns the Protocol for this Package
|
||||
Standard_EXPORT static Handle(IGESDefs_Protocol) Protocol();
|
||||
|
||||
};
|
||||
|
||||
#endif // _IGESDefs_HeaderFile
|
||||
|
@@ -22,5 +22,4 @@
|
||||
|
||||
typedef NCollection_Array1<Handle(IGESDefs_TabularData)> IGESDefs_Array1OfTabularData;
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -21,76 +21,68 @@
|
||||
#include <Standard_DimensionMismatch.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AssociativityDef,IGESData_IGESEntity)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AssociativityDef, IGESData_IGESEntity)
|
||||
|
||||
IGESDefs_AssociativityDef::IGESDefs_AssociativityDef () { }
|
||||
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)
|
||||
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) )
|
||||
if (requirements->Lower() != 1 || (orders->Lower() != 1 || orders->Length() != len)
|
||||
|| (numItems->Lower() != 1 || numItems->Length() != len)
|
||||
|| (items->Lower() != 1 || items->Length() != len))
|
||||
throw Standard_DimensionMismatch("IGESDefs_AssociativityDef : Init");
|
||||
|
||||
theBackPointerReqs = requirements;
|
||||
theClassOrders = orders;
|
||||
theNbItemsPerClass = numItems;
|
||||
theItems = items;
|
||||
InitTypeAndForm(302,FormNumber());
|
||||
// FormNumber is free over 5000
|
||||
InitTypeAndForm(302, FormNumber());
|
||||
// FormNumber is free over 5000
|
||||
}
|
||||
|
||||
void IGESDefs_AssociativityDef::SetFormNumber (const Standard_Integer form)
|
||||
void IGESDefs_AssociativityDef::SetFormNumber(const Standard_Integer form)
|
||||
{
|
||||
InitTypeAndForm(302,form);
|
||||
InitTypeAndForm(302, form);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AssociativityDef::NbClassDefs () const
|
||||
Standard_Integer IGESDefs_AssociativityDef::NbClassDefs() const
|
||||
{
|
||||
return theBackPointerReqs->Length();
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_AssociativityDef::IsBackPointerReq
|
||||
(const Standard_Integer ClassNum) const
|
||||
Standard_Boolean IGESDefs_AssociativityDef::IsBackPointerReq(const Standard_Integer ClassNum) const
|
||||
{
|
||||
return (theBackPointerReqs->Value(ClassNum) == 1);
|
||||
// 1 True 2 False
|
||||
// 1 True 2 False
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AssociativityDef::BackPointerReq
|
||||
(const Standard_Integer ClassNum) const
|
||||
Standard_Integer IGESDefs_AssociativityDef::BackPointerReq(const Standard_Integer ClassNum) const
|
||||
{
|
||||
return theBackPointerReqs->Value(ClassNum);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_AssociativityDef::IsOrdered
|
||||
(const Standard_Integer ClassNum) const
|
||||
Standard_Boolean IGESDefs_AssociativityDef::IsOrdered(const Standard_Integer ClassNum) const
|
||||
{
|
||||
return (theClassOrders->Value(ClassNum) == 1);
|
||||
// 1 True 2 False
|
||||
// 1 True 2 False
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AssociativityDef::ClassOrder
|
||||
(const Standard_Integer ClassNum) const
|
||||
Standard_Integer IGESDefs_AssociativityDef::ClassOrder(const Standard_Integer ClassNum) const
|
||||
{
|
||||
return theClassOrders->Value(ClassNum);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AssociativityDef::NbItemsPerClass
|
||||
(const Standard_Integer ClassNum) const
|
||||
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
|
||||
Standard_Integer IGESDefs_AssociativityDef::Item(const Standard_Integer ClassNum,
|
||||
const Standard_Integer ItemNum) const
|
||||
{
|
||||
return theItems->Value(ClassNum)->Value(ItemNum);
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
class IGESBasic_HArray1OfHArray1OfInteger;
|
||||
|
||||
|
||||
class IGESDefs_AssociativityDef;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_AssociativityDef, IGESData_IGESEntity)
|
||||
|
||||
@@ -38,10 +37,8 @@ class IGESDefs_AssociativityDef : public IGESData_IGESEntity
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_AssociativityDef();
|
||||
|
||||
|
||||
//! This method is used to set the fields of the class
|
||||
//! AssociativityDef
|
||||
//! - requirements : Back Pointers requirements
|
||||
@@ -49,66 +46,53 @@ public:
|
||||
//! - numItems : Number of Items per Class
|
||||
//! - items : Items in each class
|
||||
//! raises exception if lengths of the arrays are not the same.
|
||||
Standard_EXPORT void Init (const Handle(TColStd_HArray1OfInteger)& requirements, const Handle(TColStd_HArray1OfInteger)& orders, const Handle(TColStd_HArray1OfInteger)& numItems, const Handle(IGESBasic_HArray1OfHArray1OfInteger)& items);
|
||||
|
||||
Standard_EXPORT void SetFormNumber (const Standard_Integer form);
|
||||
|
||||
Standard_EXPORT void Init(const Handle(TColStd_HArray1OfInteger)& requirements,
|
||||
const Handle(TColStd_HArray1OfInteger)& orders,
|
||||
const Handle(TColStd_HArray1OfInteger)& numItems,
|
||||
const Handle(IGESBasic_HArray1OfHArray1OfInteger)& items);
|
||||
|
||||
Standard_EXPORT void SetFormNumber(const Standard_Integer form);
|
||||
|
||||
//! returns the Number of class definitions
|
||||
Standard_EXPORT Standard_Integer NbClassDefs() const;
|
||||
|
||||
|
||||
//! returns 1 if the theBackPointerReqs(ClassNum) = 1
|
||||
//! returns 0 if the theBackPointerReqs(ClassNum) = 2
|
||||
//! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
|
||||
Standard_EXPORT Standard_Boolean IsBackPointerReq (const Standard_Integer ClassNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsBackPointerReq(const Standard_Integer ClassNum) const;
|
||||
|
||||
//! returns 1 or 2
|
||||
//! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
|
||||
Standard_EXPORT Standard_Integer BackPointerReq (const Standard_Integer ClassNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer BackPointerReq(const Standard_Integer ClassNum) const;
|
||||
|
||||
//! returns 1 if theClassOrders(ClassNum) = 1 (ordered class)
|
||||
//! returns 0 if theClassOrders(ClassNum) = 2 (unordered class)
|
||||
//! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
|
||||
Standard_EXPORT Standard_Boolean IsOrdered (const Standard_Integer ClassNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsOrdered(const Standard_Integer ClassNum) const;
|
||||
|
||||
//! returns 1 or 2
|
||||
//! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
|
||||
Standard_EXPORT Standard_Integer ClassOrder (const Standard_Integer ClassNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer ClassOrder(const Standard_Integer ClassNum) const;
|
||||
|
||||
//! returns no. of items per class entry
|
||||
//! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
|
||||
Standard_EXPORT Standard_Integer NbItemsPerClass (const Standard_Integer ClassNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbItemsPerClass(const Standard_Integer ClassNum) const;
|
||||
|
||||
//! returns ItemNum'th Item of ClassNum'th Class
|
||||
//! raises exception if
|
||||
//! ClassNum <= 0 or ClassNum > NbClassDefs()
|
||||
//! ItemNum <= 0 or ItemNum > NbItemsPerClass(ClassNum)
|
||||
Standard_EXPORT Standard_Integer Item (const Standard_Integer ClassNum, const Standard_Integer ItemNum) const;
|
||||
Standard_EXPORT Standard_Integer Item(const Standard_Integer ClassNum,
|
||||
const Standard_Integer ItemNum) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_AssociativityDef,IGESData_IGESEntity)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_AssociativityDef, IGESData_IGESEntity)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TColStd_HArray1OfInteger) theBackPointerReqs;
|
||||
Handle(TColStd_HArray1OfInteger) theClassOrders;
|
||||
Handle(TColStd_HArray1OfInteger) theNbItemsPerClass;
|
||||
Handle(TColStd_HArray1OfInteger) theBackPointerReqs;
|
||||
Handle(TColStd_HArray1OfInteger) theClassOrders;
|
||||
Handle(TColStd_HArray1OfInteger) theNbItemsPerClass;
|
||||
Handle(IGESBasic_HArray1OfHArray1OfInteger) theItems;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_AssociativityDef_HeaderFile
|
||||
|
@@ -31,27 +31,25 @@
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AttributeDef,IGESData_IGESEntity)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AttributeDef, IGESData_IGESEntity)
|
||||
|
||||
// For each Attribute Value, according to Attribute Type :
|
||||
// 0 -> Void, 1 -> Integer, 2 -> Real, 3 -> String, 4 -> Entity 6 -> Logical
|
||||
IGESDefs_AttributeDef::IGESDefs_AttributeDef () { }
|
||||
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)
|
||||
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)
|
||||
if (attrTypes->Lower() != 1 || attrValueDataTypes->Lower() != 1
|
||||
|| attrValueDataTypes->Length() != nb || attrValueCounts->Lower() != 1
|
||||
|| attrValueCounts->Length() != nb)
|
||||
throw Standard_DimensionMismatch("IGESDefs_AttributeDef : Init");
|
||||
|
||||
if (FormNumber() >= 1)
|
||||
@@ -61,7 +59,7 @@ IGESDefs_AttributeDef::IGESDefs_AttributeDef () { }
|
||||
if (FormNumber() == 2)
|
||||
if (attrValuePointers->Lower() != 1 || attrValuePointers->Length() != nb)
|
||||
throw Standard_DimensionMismatch("IGESDefs_AttributeDef : Init");
|
||||
// Form 1 : attrValues defined Form = 2 : attrValuePointers defined
|
||||
// Form 1 : attrValues defined Form = 2 : attrValuePointers defined
|
||||
|
||||
theName = aName;
|
||||
theListType = aListType;
|
||||
@@ -70,108 +68,106 @@ IGESDefs_AttributeDef::IGESDefs_AttributeDef () { }
|
||||
theAttrValueCounts = attrValueCounts;
|
||||
theAttrValues = attrValues;
|
||||
theAttrValuePointers = attrValuePointers;
|
||||
if (attrValues.IsNull()) InitTypeAndForm(322,0);
|
||||
else if (attrValuePointers.IsNull()) InitTypeAndForm(322,1);
|
||||
else InitTypeAndForm(322,2);
|
||||
if (attrValues.IsNull())
|
||||
InitTypeAndForm(322, 0);
|
||||
else if (attrValuePointers.IsNull())
|
||||
InitTypeAndForm(322, 1);
|
||||
else
|
||||
InitTypeAndForm(322, 2);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_AttributeDef::HasTableName () const
|
||||
Standard_Boolean IGESDefs_AttributeDef::HasTableName() const
|
||||
{
|
||||
return (!theName.IsNull());
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::TableName () const
|
||||
Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::TableName() const
|
||||
{
|
||||
return theName;
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeDef::ListType () const
|
||||
Standard_Integer IGESDefs_AttributeDef::ListType() const
|
||||
{
|
||||
return theListType;
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeDef::NbAttributes () const
|
||||
Standard_Integer IGESDefs_AttributeDef::NbAttributes() const
|
||||
{
|
||||
return theAttrTypes->Length();
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeType
|
||||
(const Standard_Integer num) const
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeType(const Standard_Integer num) const
|
||||
{
|
||||
return theAttrTypes->Value(num);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeValueDataType
|
||||
(const Standard_Integer num) const
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeValueDataType(const Standard_Integer num) const
|
||||
{
|
||||
return theAttrValueDataTypes->Value(num);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeValueCount
|
||||
(const Standard_Integer num) const
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeValueCount(const Standard_Integer num) const
|
||||
{
|
||||
return theAttrValueCounts->Value(num);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_AttributeDef::HasValues () const
|
||||
Standard_Boolean IGESDefs_AttributeDef::HasValues() const
|
||||
{
|
||||
return (!theAttrValues.IsNull());
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_AttributeDef::HasTextDisplay () const
|
||||
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) IGESDefs_AttributeDef::AttributeTextDisplay(
|
||||
const Standard_Integer AttrNum,
|
||||
const Standard_Integer PointerNum) const
|
||||
{
|
||||
Handle(IGESGraph_TextDisplayTemplate) res;
|
||||
if (HasTextDisplay()) res =
|
||||
theAttrValuePointers->Value(AttrNum)->Value(PointerNum);
|
||||
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) IGESDefs_AttributeDef::AttributeList(
|
||||
const Standard_Integer AttrNum) const
|
||||
{
|
||||
Handle(Standard_Transient) nulres;
|
||||
if (!HasValues()) return nulres;
|
||||
if (!HasValues())
|
||||
return nulres;
|
||||
return theAttrValues->Value(AttrNum);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeAsInteger
|
||||
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
|
||||
Standard_Integer IGESDefs_AttributeDef::AttributeAsInteger(const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const
|
||||
{
|
||||
return GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum))
|
||||
->Value(ValueNum);
|
||||
return GetCasted(TColStd_HArray1OfInteger, theAttrValues->Value(AttrNum))->Value(ValueNum);
|
||||
}
|
||||
|
||||
Standard_Real IGESDefs_AttributeDef::AttributeAsReal
|
||||
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
|
||||
Standard_Real IGESDefs_AttributeDef::AttributeAsReal(const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const
|
||||
{
|
||||
return GetCasted(TColStd_HArray1OfReal,theAttrValues->Value(AttrNum))
|
||||
->Value(ValueNum);
|
||||
return GetCasted(TColStd_HArray1OfReal, theAttrValues->Value(AttrNum))->Value(ValueNum);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::AttributeAsString
|
||||
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
|
||||
Handle(TCollection_HAsciiString) IGESDefs_AttributeDef::AttributeAsString(
|
||||
const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const
|
||||
{
|
||||
return GetCasted(Interface_HArray1OfHAsciiString,theAttrValues->Value(AttrNum))
|
||||
->Value(ValueNum);
|
||||
return GetCasted(Interface_HArray1OfHAsciiString, theAttrValues->Value(AttrNum))->Value(ValueNum);
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESDefs_AttributeDef::AttributeAsEntity
|
||||
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
|
||||
Handle(IGESData_IGESEntity) IGESDefs_AttributeDef::AttributeAsEntity(
|
||||
const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const
|
||||
{
|
||||
return GetCasted(IGESData_HArray1OfIGESEntity,theAttrValues->Value(AttrNum))
|
||||
->Value(ValueNum);
|
||||
return GetCasted(IGESData_HArray1OfIGESEntity, theAttrValues->Value(AttrNum))->Value(ValueNum);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_AttributeDef::AttributeAsLogical
|
||||
(const Standard_Integer AttrNum, const Standard_Integer ValueNum) const
|
||||
Standard_Boolean IGESDefs_AttributeDef::AttributeAsLogical(const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const
|
||||
{
|
||||
return (GetCasted(TColStd_HArray1OfInteger,theAttrValues->Value(AttrNum))
|
||||
->Value(ValueNum) != 0);
|
||||
return (GetCasted(TColStd_HArray1OfInteger, theAttrValues->Value(AttrNum))->Value(ValueNum) != 0);
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ class IGESDefs_HArray1OfHArray1OfTextDisplayTemplate;
|
||||
class IGESGraph_TextDisplayTemplate;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
class IGESDefs_AttributeDef;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_AttributeDef, IGESData_IGESEntity)
|
||||
|
||||
@@ -42,100 +41,97 @@ class IGESDefs_AttributeDef : public IGESData_IGESEntity
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_AttributeDef();
|
||||
|
||||
Standard_EXPORT void 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_EXPORT void 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);
|
||||
|
||||
//! Returns True if a Table Name is defined
|
||||
Standard_EXPORT Standard_Boolean HasTableName() const;
|
||||
|
||||
|
||||
//! returns the Attribute Table name, or comment
|
||||
//! (default = null, no name : seeHasTableName)
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) TableName() const;
|
||||
|
||||
|
||||
//! returns the Attribute List Type
|
||||
Standard_EXPORT Standard_Integer ListType() const;
|
||||
|
||||
|
||||
//! returns the Number of Attributes
|
||||
Standard_EXPORT Standard_Integer NbAttributes() const;
|
||||
|
||||
|
||||
//! returns the num'th Attribute Type
|
||||
//! raises exception if num <= 0 or num > NbAttributes()
|
||||
Standard_EXPORT Standard_Integer AttributeType (const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer AttributeType(const Standard_Integer num) const;
|
||||
|
||||
//! returns the num'th Attribute value data type
|
||||
//! raises exception if num <= 0 or num > NbAttributes()
|
||||
Standard_EXPORT Standard_Integer AttributeValueDataType (const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer AttributeValueDataType(const Standard_Integer num) const;
|
||||
|
||||
//! returns the num'th Attribute value count
|
||||
//! raises exception if num <= 0 or num > NbAttributes()
|
||||
Standard_EXPORT Standard_Integer AttributeValueCount (const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer AttributeValueCount(const Standard_Integer num) const;
|
||||
|
||||
//! returns false if Values are defined (i.e. for Form = 1 or 2)
|
||||
Standard_EXPORT Standard_Boolean HasValues() const;
|
||||
|
||||
|
||||
//! returns false if TextDisplays are defined (i.e. for Form = 2)
|
||||
Standard_EXPORT Standard_Boolean HasTextDisplay() const;
|
||||
|
||||
Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) AttributeTextDisplay (const Standard_Integer AttrNum, const Standard_Integer PointerNum) const;
|
||||
|
||||
|
||||
Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) AttributeTextDisplay(
|
||||
const Standard_Integer AttrNum,
|
||||
const Standard_Integer PointerNum) const;
|
||||
|
||||
//! Returns the List of Attributes <AttrNum>, as a Transient.
|
||||
//! 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
|
||||
Standard_EXPORT Handle(Standard_Transient) AttributeList (const Standard_Integer AttrNum) const;
|
||||
|
||||
Standard_EXPORT Handle(Standard_Transient) AttributeList(const Standard_Integer AttrNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
|
||||
//! Error if Indices out of Range, or no Value defined, or not an Integer
|
||||
Standard_EXPORT Standard_Integer AttributeAsInteger (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer AttributeAsInteger(const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as a Real
|
||||
//! Error if Indices out of Range, or no Value defined, or not a Real
|
||||
Standard_EXPORT Standard_Real AttributeAsReal (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Real AttributeAsReal(const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) AttributeAsString (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) AttributeAsString(
|
||||
const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as an Entity
|
||||
//! Error if Indices out of Range, or no Value defined, or not a Entity
|
||||
Standard_EXPORT Handle(IGESData_IGESEntity) AttributeAsEntity (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Handle(IGESData_IGESEntity) AttributeAsEntity(
|
||||
const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean
|
||||
//! Error if Indices out of Range, or no Value defined, or not a Logical
|
||||
Standard_EXPORT Standard_Boolean AttributeAsLogical (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
|
||||
Standard_EXPORT Standard_Boolean AttributeAsLogical(const Standard_Integer AttrNum,
|
||||
const Standard_Integer ValueNum) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeDef,IGESData_IGESEntity)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeDef, IGESData_IGESEntity)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TCollection_HAsciiString) theName;
|
||||
Standard_Integer theListType;
|
||||
Handle(TColStd_HArray1OfInteger) theAttrTypes;
|
||||
Handle(TColStd_HArray1OfInteger) theAttrValueDataTypes;
|
||||
Handle(TColStd_HArray1OfInteger) theAttrValueCounts;
|
||||
Handle(TColStd_HArray1OfTransient) theAttrValues;
|
||||
Handle(TCollection_HAsciiString) theName;
|
||||
Standard_Integer theListType;
|
||||
Handle(TColStd_HArray1OfInteger) theAttrTypes;
|
||||
Handle(TColStd_HArray1OfInteger) theAttrValueDataTypes;
|
||||
Handle(TColStd_HArray1OfInteger) theAttrValueCounts;
|
||||
Handle(TColStd_HArray1OfTransient) theAttrValues;
|
||||
Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) theAttrValuePointers;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_AttributeDef_HeaderFile
|
||||
|
@@ -29,103 +29,100 @@
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AttributeTable,IGESData_IGESEntity)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AttributeTable, IGESData_IGESEntity)
|
||||
|
||||
// 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 () { }
|
||||
IGESDefs_AttributeTable::IGESDefs_AttributeTable() {}
|
||||
|
||||
|
||||
void IGESDefs_AttributeTable::Init
|
||||
(const Handle(TColStd_HArray2OfTransient)& attributes)
|
||||
void IGESDefs_AttributeTable::Init(const Handle(TColStd_HArray2OfTransient)& attributes)
|
||||
{
|
||||
if (attributes->LowerCol() != 1 || attributes->LowerRow() != 1)
|
||||
throw Standard_DimensionMismatch("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 ...)
|
||||
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)
|
||||
void IGESDefs_AttributeTable::SetDefinition(const Handle(IGESDefs_AttributeDef)& def)
|
||||
{
|
||||
InitMisc (def,LabelDisplay(),LineWeightNumber());
|
||||
InitMisc(def, LabelDisplay(), LineWeightNumber());
|
||||
}
|
||||
|
||||
Handle(IGESDefs_AttributeDef) IGESDefs_AttributeTable::Definition () const
|
||||
Handle(IGESDefs_AttributeDef) IGESDefs_AttributeTable::Definition() const
|
||||
{
|
||||
return GetCasted(IGESDefs_AttributeDef,Structure());
|
||||
return GetCasted(IGESDefs_AttributeDef, Structure());
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer IGESDefs_AttributeTable::NbRows () const
|
||||
Standard_Integer IGESDefs_AttributeTable::NbRows() const
|
||||
{
|
||||
return theAttributes->UpperCol();
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeTable::NbAttributes () const
|
||||
Standard_Integer IGESDefs_AttributeTable::NbAttributes() const
|
||||
{
|
||||
return theAttributes->UpperRow();
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeTable::DataType
|
||||
(const Standard_Integer Atnum) const
|
||||
Standard_Integer IGESDefs_AttributeTable::DataType(const Standard_Integer Atnum) const
|
||||
{
|
||||
return Definition()->AttributeType(Atnum);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeTable::ValueCount
|
||||
(const Standard_Integer Atnum) const
|
||||
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
|
||||
Handle(Standard_Transient) IGESDefs_AttributeTable::AttributeList(
|
||||
const Standard_Integer Atnum,
|
||||
const Standard_Integer Rownum) const
|
||||
{
|
||||
return theAttributes->Value(Atnum,Rownum);
|
||||
return theAttributes->Value(Atnum, Rownum);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_AttributeTable::AttributeAsInteger
|
||||
(const Standard_Integer Atnum, const Standard_Integer Rownum,
|
||||
const Standard_Integer Valuenum) const
|
||||
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))
|
||||
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);
|
||||
}
|
||||
|
||||
Standard_Real IGESDefs_AttributeTable::AttributeAsReal
|
||||
(const Standard_Integer Atnum, const Standard_Integer Rownum,
|
||||
const Standard_Integer Valuenum) const
|
||||
Handle(IGESData_IGESEntity) IGESDefs_AttributeTable::AttributeAsEntity(
|
||||
const Standard_Integer Atnum,
|
||||
const Standard_Integer Rownum,
|
||||
const Standard_Integer Valuenum) const
|
||||
{
|
||||
return GetCasted(TColStd_HArray1OfReal,theAttributes->Value(Atnum,Rownum))
|
||||
return GetCasted(IGESData_HArray1OfIGESEntity, 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
|
||||
Standard_Boolean IGESDefs_AttributeTable::AttributeAsLogical(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
|
||||
return (AttributeAsInteger(Atnum, Rownum, Valuenum) != 0); // raccourci
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ class IGESDefs_AttributeDef;
|
||||
class Standard_Transient;
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
|
||||
class IGESDefs_AttributeTable;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_AttributeTable, IGESData_IGESEntity)
|
||||
|
||||
@@ -40,85 +39,79 @@ class IGESDefs_AttributeTable : public IGESData_IGESEntity
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_AttributeTable();
|
||||
|
||||
|
||||
//! 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)
|
||||
Standard_EXPORT void Init (const Handle(TColStd_HArray2OfTransient)& attributes);
|
||||
|
||||
Standard_EXPORT void Init(const Handle(TColStd_HArray2OfTransient)& attributes);
|
||||
|
||||
//! Sets a Definition as Structure information
|
||||
//! (works by calling InitMisc)
|
||||
Standard_EXPORT void SetDefinition (const Handle(IGESDefs_AttributeDef)& def);
|
||||
|
||||
Standard_EXPORT void SetDefinition(const Handle(IGESDefs_AttributeDef)& def);
|
||||
|
||||
//! Return the Structure information in Directory Entry,
|
||||
//! casted as an AttributeDef
|
||||
Standard_EXPORT Handle(IGESDefs_AttributeDef) Definition() const;
|
||||
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT Standard_Integer NbRows() const;
|
||||
|
||||
|
||||
//! returns Number of Attributes
|
||||
Standard_EXPORT Standard_Integer NbAttributes() const;
|
||||
|
||||
|
||||
//! 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)
|
||||
Standard_EXPORT Standard_Integer DataType (const Standard_Integer Atnum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer DataType(const Standard_Integer Atnum) const;
|
||||
|
||||
//! returns the Count of Value for an Attribute, given its No. :
|
||||
//! it is read in the Definition.
|
||||
Standard_EXPORT Standard_Integer ValueCount (const Standard_Integer Atnum) const;
|
||||
|
||||
Standard_EXPORT Handle(Standard_Transient) AttributeList (const Standard_Integer Attribnum, const Standard_Integer Rownum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer ValueCount(const Standard_Integer Atnum) const;
|
||||
|
||||
Standard_EXPORT Handle(Standard_Transient) AttributeList(const Standard_Integer Attribnum,
|
||||
const Standard_Integer Rownum) const;
|
||||
|
||||
//! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
|
||||
//! Error if Indices out of Range, or no Value defined, or not an Integer
|
||||
Standard_EXPORT Standard_Integer AttributeAsInteger (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer AttributeAsInteger(const Standard_Integer AtNum,
|
||||
const Standard_Integer Rownum,
|
||||
const Standard_Integer ValNum) const;
|
||||
|
||||
//! Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Real
|
||||
//! Error if Indices out of Range, or no Value defined, or not a Real
|
||||
Standard_EXPORT Standard_Real AttributeAsReal (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Real AttributeAsReal(const Standard_Integer AtNum,
|
||||
const Standard_Integer Rownum,
|
||||
const Standard_Integer ValNum) const;
|
||||
|
||||
//! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) AttributeAsString (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) AttributeAsString(
|
||||
const Standard_Integer AtNum,
|
||||
const Standard_Integer Rownum,
|
||||
const Standard_Integer ValNum) const;
|
||||
|
||||
//! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Entity
|
||||
//! Error if Indices out of Range, or no Value defined, or not an Entity
|
||||
Standard_EXPORT Handle(IGESData_IGESEntity) AttributeAsEntity (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
|
||||
|
||||
Standard_EXPORT Handle(IGESData_IGESEntity) AttributeAsEntity(
|
||||
const Standard_Integer AtNum,
|
||||
const Standard_Integer Rownum,
|
||||
const Standard_Integer ValNum) const;
|
||||
|
||||
//! Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Boolean
|
||||
//! Error if Indices out of Range, or no Value defined, or not a Logical
|
||||
Standard_EXPORT Standard_Boolean AttributeAsLogical (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
|
||||
Standard_EXPORT Standard_Boolean AttributeAsLogical(const Standard_Integer AtNum,
|
||||
const Standard_Integer Rownum,
|
||||
const Standard_Integer ValNum) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeTable,IGESData_IGESEntity)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeTable, IGESData_IGESEntity)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TColStd_HArray2OfTransient) theAttributes;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_AttributeTable_HeaderFile
|
||||
|
@@ -11,7 +11,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <IGESData_DirChecker.hxx>
|
||||
#include <IGESDefs_AssociativityDef.hxx>
|
||||
#include <IGESDefs_AttributeDef.hxx>
|
||||
@@ -37,265 +36,304 @@
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_GeneralModule,IGESData_GeneralModule)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_GeneralModule, IGESData_GeneralModule)
|
||||
|
||||
// Each Module is attached to a Protocol : it must interpret Case Numbers
|
||||
// (arguments <CN> of various methods) in accordance to values returned by
|
||||
// the method TypeNumber from this Protocol
|
||||
IGESDefs_GeneralModule::IGESDefs_GeneralModule () { }
|
||||
IGESDefs_GeneralModule::IGESDefs_GeneralModule() {}
|
||||
|
||||
|
||||
void IGESDefs_GeneralModule::OwnSharedCase
|
||||
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
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;
|
||||
switch (CN)
|
||||
{
|
||||
case 1: {
|
||||
DeclareAndCast(IGESDefs_AssociativityDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAssociativityDef tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
tool.OwnShared(anent, iter);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 2: {
|
||||
DeclareAndCast(IGESDefs_AttributeDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeDef tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
tool.OwnShared(anent, iter);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 3: {
|
||||
DeclareAndCast(IGESDefs_AttributeTable, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeTable tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
tool.OwnShared(anent, iter);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESDefs_GenericData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 4: {
|
||||
DeclareAndCast(IGESDefs_GenericData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolGenericData tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
tool.OwnShared(anent, iter);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 5: {
|
||||
DeclareAndCast(IGESDefs_MacroDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolMacroDef tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
tool.OwnShared(anent, iter);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESDefs_TabularData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 6: {
|
||||
DeclareAndCast(IGESDefs_TabularData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolTabularData tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
tool.OwnShared(anent, iter);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 7: {
|
||||
DeclareAndCast(IGESDefs_UnitsData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolUnitsData tool;
|
||||
tool.OwnShared(anent,iter);
|
||||
tool.OwnShared(anent, iter);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IGESData_DirChecker IGESDefs_GeneralModule::DirChecker
|
||||
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
case 7: {
|
||||
DeclareAndCast(IGESDefs_UnitsData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
break;
|
||||
IGESDefs_ToolUnitsData tool;
|
||||
return tool.DirChecker(anent);
|
||||
}
|
||||
default : break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return IGESData_DirChecker(); // by default, no specific criterium
|
||||
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
|
||||
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;
|
||||
switch (CN)
|
||||
{
|
||||
case 1: {
|
||||
DeclareAndCast(IGESDefs_AssociativityDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAssociativityDef tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
tool.OwnCheck(anent, shares, ach);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 2: {
|
||||
DeclareAndCast(IGESDefs_AttributeDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeDef tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
tool.OwnCheck(anent, shares, ach);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 3: {
|
||||
DeclareAndCast(IGESDefs_AttributeTable, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeTable tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
tool.OwnCheck(anent, shares, ach);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESDefs_GenericData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 4: {
|
||||
DeclareAndCast(IGESDefs_GenericData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolGenericData tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
tool.OwnCheck(anent, shares, ach);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 5: {
|
||||
DeclareAndCast(IGESDefs_MacroDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolMacroDef tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
tool.OwnCheck(anent, shares, ach);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESDefs_TabularData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 6: {
|
||||
DeclareAndCast(IGESDefs_TabularData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolTabularData tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
tool.OwnCheck(anent, shares, ach);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 7: {
|
||||
DeclareAndCast(IGESDefs_UnitsData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolUnitsData tool;
|
||||
tool.OwnCheck(anent,shares,ach);
|
||||
tool.OwnCheck(anent, shares, ach);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean IGESDefs_GeneralModule::NewVoid
|
||||
(const Standard_Integer CN, Handle(Standard_Transient)& ent) const
|
||||
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
|
||||
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
|
||||
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);
|
||||
switch (CN)
|
||||
{
|
||||
case 1: {
|
||||
DeclareAndCast(IGESDefs_AssociativityDef, enfr, entfrom);
|
||||
DeclareAndCast(IGESDefs_AssociativityDef, ento, entto);
|
||||
IGESDefs_ToolAssociativityDef tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
tool.OwnCopy(enfr, ento, TC);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESDefs_AttributeDef,enfr,entfrom);
|
||||
DeclareAndCast(IGESDefs_AttributeDef,ento,entto);
|
||||
break;
|
||||
case 2: {
|
||||
DeclareAndCast(IGESDefs_AttributeDef, enfr, entfrom);
|
||||
DeclareAndCast(IGESDefs_AttributeDef, ento, entto);
|
||||
IGESDefs_ToolAttributeDef tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
tool.OwnCopy(enfr, ento, TC);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESDefs_AttributeTable,enfr,entfrom);
|
||||
DeclareAndCast(IGESDefs_AttributeTable,ento,entto);
|
||||
break;
|
||||
case 3: {
|
||||
DeclareAndCast(IGESDefs_AttributeTable, enfr, entfrom);
|
||||
DeclareAndCast(IGESDefs_AttributeTable, ento, entto);
|
||||
IGESDefs_ToolAttributeTable tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
tool.OwnCopy(enfr, ento, TC);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESDefs_GenericData,enfr,entfrom);
|
||||
DeclareAndCast(IGESDefs_GenericData,ento,entto);
|
||||
break;
|
||||
case 4: {
|
||||
DeclareAndCast(IGESDefs_GenericData, enfr, entfrom);
|
||||
DeclareAndCast(IGESDefs_GenericData, ento, entto);
|
||||
IGESDefs_ToolGenericData tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
tool.OwnCopy(enfr, ento, TC);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESDefs_MacroDef,enfr,entfrom);
|
||||
DeclareAndCast(IGESDefs_MacroDef,ento,entto);
|
||||
break;
|
||||
case 5: {
|
||||
DeclareAndCast(IGESDefs_MacroDef, enfr, entfrom);
|
||||
DeclareAndCast(IGESDefs_MacroDef, ento, entto);
|
||||
IGESDefs_ToolMacroDef tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
tool.OwnCopy(enfr, ento, TC);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESDefs_TabularData,enfr,entfrom);
|
||||
DeclareAndCast(IGESDefs_TabularData,ento,entto);
|
||||
break;
|
||||
case 6: {
|
||||
DeclareAndCast(IGESDefs_TabularData, enfr, entfrom);
|
||||
DeclareAndCast(IGESDefs_TabularData, ento, entto);
|
||||
IGESDefs_ToolTabularData tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
tool.OwnCopy(enfr, ento, TC);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESDefs_UnitsData,enfr,entfrom);
|
||||
DeclareAndCast(IGESDefs_UnitsData,ento,entto);
|
||||
break;
|
||||
case 7: {
|
||||
DeclareAndCast(IGESDefs_UnitsData, enfr, entfrom);
|
||||
DeclareAndCast(IGESDefs_UnitsData, ento, entto);
|
||||
IGESDefs_ToolUnitsData tool;
|
||||
tool.OwnCopy(enfr,ento,TC);
|
||||
tool.OwnCopy(enfr, ento, TC);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer IGESDefs_GeneralModule::CategoryNumber
|
||||
(const Standard_Integer /*CN*/, const Handle(Standard_Transient)& /*ent*/,
|
||||
const Interface_ShareTool& ) const
|
||||
Standard_Integer IGESDefs_GeneralModule::CategoryNumber(const Standard_Integer /*CN*/,
|
||||
const Handle(Standard_Transient)& /*ent*/,
|
||||
const Interface_ShareTool&) const
|
||||
{
|
||||
return Interface_Category::Number("Auxiliary");
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@ class Interface_Check;
|
||||
class Standard_Transient;
|
||||
class Interface_CopyTool;
|
||||
|
||||
|
||||
class IGESDefs_GeneralModule;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_GeneralModule, IGESData_GeneralModule)
|
||||
|
||||
@@ -40,54 +39,49 @@ class IGESDefs_GeneralModule : public IGESData_GeneralModule
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a GeneralModule from IGESDefs and puts it into GeneralLib
|
||||
Standard_EXPORT IGESDefs_GeneralModule();
|
||||
|
||||
|
||||
//! Lists the Entities shared by a given IGESEntity <ent>, from
|
||||
//! its specific parameters : specific for each type
|
||||
Standard_EXPORT void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void OwnSharedCase(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& ent,
|
||||
Interface_EntityIterator& iter) const Standard_OVERRIDE;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker
|
||||
DirChecker(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& ent) const Standard_OVERRIDE;
|
||||
|
||||
//! Performs Specific Semantic Check for each type of Entity
|
||||
Standard_EXPORT void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void OwnCheckCase(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const Standard_OVERRIDE;
|
||||
|
||||
//! Specific creation of a new void entity
|
||||
Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean
|
||||
NewVoid(const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE;
|
||||
|
||||
//! Copies parameters which are specific of each Type of Entity
|
||||
Standard_EXPORT void OwnCopyCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& entfrom, const Handle(IGESData_IGESEntity)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void OwnCopyCase(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& entfrom,
|
||||
const Handle(IGESData_IGESEntity)& entto,
|
||||
Interface_CopyTool& TC) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns a category number which characterizes an entity
|
||||
//! Auxiliary for all
|
||||
Standard_EXPORT virtual Standard_Integer CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Integer CategoryNumber(const Standard_Integer CN,
|
||||
const Handle(Standard_Transient)& ent,
|
||||
const Interface_ShareTool& shares) const
|
||||
Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_GeneralModule,IGESData_GeneralModule)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_GeneralModule, IGESData_GeneralModule)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_GeneralModule_HeaderFile
|
||||
|
@@ -26,85 +26,77 @@
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_GenericData,IGESData_IGESEntity)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_GenericData, IGESData_IGESEntity)
|
||||
|
||||
IGESDefs_GenericData::IGESDefs_GenericData () { }
|
||||
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)
|
||||
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() ) )
|
||||
if (!allTypes.IsNull() && !allValues.IsNull()
|
||||
&& (allValues->Lower() != 1 || allTypes->Lower() != 1
|
||||
|| allTypes->Length() != allValues->Length()))
|
||||
throw Standard_DimensionMismatch("IGESDefs_GenericData: Init");
|
||||
theNbPropertyValues = nbPropVal;
|
||||
theName = aName;
|
||||
theTypes = allTypes;
|
||||
theValues = allValues;
|
||||
InitTypeAndForm(406,27);
|
||||
theName = aName;
|
||||
theTypes = allTypes;
|
||||
theValues = allValues;
|
||||
InitTypeAndForm(406, 27);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_GenericData::NbPropertyValues () const
|
||||
Standard_Integer IGESDefs_GenericData::NbPropertyValues() const
|
||||
{
|
||||
// return 2 * theTypes->Length() + 2;
|
||||
return theNbPropertyValues;
|
||||
// return 2 * theTypes->Length() + 2;
|
||||
return theNbPropertyValues;
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_GenericData::Name () const
|
||||
Handle(TCollection_HAsciiString) IGESDefs_GenericData::Name() const
|
||||
{
|
||||
return theName;
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_GenericData::NbTypeValuePairs () const
|
||||
Standard_Integer IGESDefs_GenericData::NbTypeValuePairs() const
|
||||
{
|
||||
return theTypes->Length();
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_GenericData::Type (const Standard_Integer Index) const
|
||||
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
|
||||
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
|
||||
Standard_Integer IGESDefs_GenericData::ValueAsInteger(const Standard_Integer Index) const
|
||||
{
|
||||
return GetCasted(TColStd_HArray1OfInteger,theValues->Value(Index))->Value(1);
|
||||
return GetCasted(TColStd_HArray1OfInteger, theValues->Value(Index))->Value(1);
|
||||
}
|
||||
|
||||
Standard_Real IGESDefs_GenericData::ValueAsReal
|
||||
(const Standard_Integer Index) const
|
||||
Standard_Real IGESDefs_GenericData::ValueAsReal(const Standard_Integer Index) const
|
||||
{
|
||||
return GetCasted(TColStd_HArray1OfReal,theValues->Value(Index))->Value(1);
|
||||
return GetCasted(TColStd_HArray1OfReal, theValues->Value(Index))->Value(1);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_GenericData::ValueAsString
|
||||
(const Standard_Integer Index) const
|
||||
Handle(TCollection_HAsciiString) IGESDefs_GenericData::ValueAsString(
|
||||
const Standard_Integer Index) const
|
||||
{
|
||||
return GetCasted(TCollection_HAsciiString,theValues->Value(Index));
|
||||
return GetCasted(TCollection_HAsciiString, theValues->Value(Index));
|
||||
}
|
||||
|
||||
Handle(IGESData_IGESEntity) IGESDefs_GenericData::ValueAsEntity
|
||||
(const Standard_Integer Index) const
|
||||
Handle(IGESData_IGESEntity) IGESDefs_GenericData::ValueAsEntity(const Standard_Integer Index) const
|
||||
{
|
||||
return GetCasted(IGESData_IGESEntity,theValues->Value(Index));
|
||||
return GetCasted(IGESData_IGESEntity, theValues->Value(Index));
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_GenericData::ValueAsLogical
|
||||
(const Standard_Integer Index) const
|
||||
Standard_Boolean IGESDefs_GenericData::ValueAsLogical(const Standard_Integer Index) const
|
||||
{
|
||||
return (GetCasted(TColStd_HArray1OfInteger,theValues->Value(Index))->Value(1)
|
||||
!= 0);
|
||||
return (GetCasted(TColStd_HArray1OfInteger, theValues->Value(Index))->Value(1) != 0);
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@
|
||||
class TCollection_HAsciiString;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
class IGESDefs_GenericData;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_GenericData, IGESData_IGESEntity)
|
||||
|
||||
@@ -43,81 +42,66 @@ class IGESDefs_GenericData : public IGESData_IGESEntity
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_GenericData();
|
||||
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TCollection_HAsciiString)& aName, const Handle(TColStd_HArray1OfInteger)& allTypes, const Handle(TColStd_HArray1OfTransient)& allValues);
|
||||
|
||||
Standard_EXPORT void Init(const Standard_Integer nbPropVal,
|
||||
const Handle(TCollection_HAsciiString)& aName,
|
||||
const Handle(TColStd_HArray1OfInteger)& allTypes,
|
||||
const Handle(TColStd_HArray1OfTransient)& allValues);
|
||||
|
||||
//! returns the number of property values
|
||||
Standard_EXPORT Standard_Integer NbPropertyValues() const;
|
||||
|
||||
|
||||
//! returns property name
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Name() const;
|
||||
|
||||
|
||||
//! returns the number of TYPE/VALUE pairs
|
||||
Standard_EXPORT Standard_Integer NbTypeValuePairs() const;
|
||||
|
||||
|
||||
//! returns the Index'th property value data type
|
||||
//! raises exception if Index <= 0 or Index > NbTypeValuePairs()
|
||||
Standard_EXPORT Standard_Integer Type (const Standard_Integer Index) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer Type(const Standard_Integer Index) const;
|
||||
|
||||
//! 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)
|
||||
Standard_EXPORT Handle(Standard_Transient) Value (const Standard_Integer Index) const;
|
||||
|
||||
Standard_EXPORT Handle(Standard_Transient) Value(const Standard_Integer Index) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
|
||||
//! Error if Index out of Range, or not an Integer
|
||||
Standard_EXPORT Standard_Integer ValueAsInteger (const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer ValueAsInteger(const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as a Real
|
||||
//! Error if Index out of Range, or not a Real
|
||||
Standard_EXPORT Standard_Real ValueAsReal (const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Standard_Real ValueAsReal(const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) ValueAsString (const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) ValueAsString(
|
||||
const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as an Entity
|
||||
//! Error if Index out of Range, or not a Entity
|
||||
Standard_EXPORT Handle(IGESData_IGESEntity) ValueAsEntity (const Standard_Integer ValueNum) const;
|
||||
|
||||
Standard_EXPORT Handle(IGESData_IGESEntity) ValueAsEntity(const Standard_Integer ValueNum) const;
|
||||
|
||||
//! Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean
|
||||
//! Error if Index out of Range, or not a Logical
|
||||
Standard_EXPORT Standard_Boolean ValueAsLogical (const Standard_Integer ValueNum) const;
|
||||
Standard_EXPORT Standard_Boolean ValueAsLogical(const Standard_Integer ValueNum) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_GenericData,IGESData_IGESEntity)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_GenericData, IGESData_IGESEntity)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Integer theNbPropertyValues;
|
||||
Handle(TCollection_HAsciiString) theName;
|
||||
Handle(TColStd_HArray1OfInteger) theTypes;
|
||||
Standard_Integer theNbPropertyValues;
|
||||
Handle(TCollection_HAsciiString) theName;
|
||||
Handle(TColStd_HArray1OfInteger) theTypes;
|
||||
Handle(TColStd_HArray1OfTransient) theValues;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_GenericData_HeaderFile
|
||||
|
@@ -25,51 +25,33 @@
|
||||
#include <IGESGraph_HArray1OfTextDisplayTemplate.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
|
||||
class IGESDefs_HArray1OfHArray1OfTextDisplayTemplate;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate, Standard_Transient)
|
||||
|
||||
|
||||
class IGESDefs_HArray1OfHArray1OfTextDisplayTemplate : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
Standard_EXPORT IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(const Standard_Integer low,
|
||||
const Standard_Integer up);
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_HArray1OfHArray1OfTextDisplayTemplate(const Standard_Integer low, const Standard_Integer up);
|
||||
|
||||
Standard_EXPORT Standard_Integer Lower() const;
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer Upper() const;
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer Length() const;
|
||||
|
||||
Standard_EXPORT void SetValue (const Standard_Integer num, const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& val);
|
||||
|
||||
Standard_EXPORT Handle(IGESGraph_HArray1OfTextDisplayTemplate) Value (const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT void SetValue(const Standard_Integer num,
|
||||
const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& val);
|
||||
|
||||
Standard_EXPORT Handle(IGESGraph_HArray1OfTextDisplayTemplate) Value(
|
||||
const Standard_Integer num) const;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate,Standard_Transient)
|
||||
DEFINE_STANDARD_RTTI_INLINE(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate, Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TColStd_Array1OfTransient thelist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_HeaderFile
|
||||
|
@@ -18,16 +18,6 @@
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define Handle_TheKey Handle(IGESGraph_HArray1OfTextDisplayTemplate)
|
||||
#define TheKey IGESGraph_HArray1OfTextDisplayTemplate
|
||||
#define TheKey_hxx <IGESGraph_HArray1OfTextDisplayTemplate.hxx>
|
||||
@@ -35,4 +25,3 @@
|
||||
#define Interface_JaggedArray_hxx <IGESDefs_HArray1OfHArray1OfTextDisplayTemplate.hxx>
|
||||
#define Handle_Interface_JaggedArray Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate)
|
||||
#include "../Interface/Interface_JaggedArray.gxx"
|
||||
|
||||
|
@@ -22,5 +22,4 @@
|
||||
|
||||
DEFINE_HARRAY1(IGESDefs_HArray1OfTabularData, IGESDefs_Array1OfTabularData)
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -21,15 +21,14 @@
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_MacroDef,IGESData_IGESEntity)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_MacroDef, IGESData_IGESEntity)
|
||||
|
||||
IGESDefs_MacroDef::IGESDefs_MacroDef () { }
|
||||
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)
|
||||
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)
|
||||
throw Standard_DimensionMismatch("IGESDefs_MacroDef : Init");
|
||||
@@ -37,31 +36,31 @@ IGESDefs_MacroDef::IGESDefs_MacroDef () { }
|
||||
theEntityTypeID = entityTypeID;
|
||||
theLangStatements = langStatements;
|
||||
theENDMACRO = endMacro;
|
||||
InitTypeAndForm(306,0);
|
||||
InitTypeAndForm(306, 0);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_MacroDef::NbStatements () const
|
||||
Standard_Integer IGESDefs_MacroDef::NbStatements() const
|
||||
{
|
||||
return theLangStatements->Length();
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::MACRO () const
|
||||
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::MACRO() const
|
||||
{
|
||||
return theMACRO;
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_MacroDef::EntityTypeID () const
|
||||
Standard_Integer IGESDefs_MacroDef::EntityTypeID() const
|
||||
{
|
||||
return theEntityTypeID;
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::LanguageStatement
|
||||
(const Standard_Integer StatNum) const
|
||||
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::LanguageStatement(
|
||||
const Standard_Integer StatNum) const
|
||||
{
|
||||
return theLangStatements->Value(StatNum);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::ENDMACRO () const
|
||||
Handle(TCollection_HAsciiString) IGESDefs_MacroDef::ENDMACRO() const
|
||||
{
|
||||
return theENDMACRO;
|
||||
}
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
|
||||
class IGESDefs_MacroDef;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_MacroDef, IGESData_IGESEntity)
|
||||
|
||||
@@ -37,57 +36,42 @@ class IGESDefs_MacroDef : public IGESData_IGESEntity
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_MacroDef();
|
||||
|
||||
|
||||
//! This method is used to set the fields of the class
|
||||
//! MacroDef
|
||||
//! - macro : MACRO
|
||||
//! - entityTypeID : Entity Type ID
|
||||
//! - langStatements : Language Statements
|
||||
//! - endMacro : END MACRO
|
||||
Standard_EXPORT void Init (const Handle(TCollection_HAsciiString)& macro, const Standard_Integer entityTypeID, const Handle(Interface_HArray1OfHAsciiString)& langStatements, const Handle(TCollection_HAsciiString)& endMacro);
|
||||
|
||||
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& macro,
|
||||
const Standard_Integer entityTypeID,
|
||||
const Handle(Interface_HArray1OfHAsciiString)& langStatements,
|
||||
const Handle(TCollection_HAsciiString)& endMacro);
|
||||
|
||||
//! returns the number of language statements
|
||||
Standard_EXPORT Standard_Integer NbStatements() const;
|
||||
|
||||
|
||||
//! returns the MACRO(Literal)
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) MACRO() const;
|
||||
|
||||
|
||||
//! returns the Entity Type ID
|
||||
Standard_EXPORT Standard_Integer EntityTypeID() const;
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) LanguageStatement (const Standard_Integer StatNum) const;
|
||||
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) LanguageStatement(
|
||||
const Standard_Integer StatNum) const;
|
||||
|
||||
//! returns the ENDM(Literal)
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) ENDMACRO() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_MacroDef,IGESData_IGESEntity)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_MacroDef, IGESData_IGESEntity)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TCollection_HAsciiString) theMACRO;
|
||||
Standard_Integer theEntityTypeID;
|
||||
Handle(TCollection_HAsciiString) theMACRO;
|
||||
Standard_Integer theEntityTypeID;
|
||||
Handle(Interface_HArray1OfHAsciiString) theLangStatements;
|
||||
Handle(TCollection_HAsciiString) theENDMACRO;
|
||||
|
||||
|
||||
Handle(TCollection_HAsciiString) theENDMACRO;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_MacroDef_HeaderFile
|
||||
|
@@ -27,8 +27,7 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_Protocol, IGESData_Protocol)
|
||||
|
||||
IGESDefs_Protocol::IGESDefs_Protocol()
|
||||
{}
|
||||
IGESDefs_Protocol::IGESDefs_Protocol() {}
|
||||
|
||||
Standard_Integer IGESDefs_Protocol::NbResources() const
|
||||
{
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
class Interface_Protocol;
|
||||
|
||||
|
||||
class IGESDefs_Protocol;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_Protocol, IGESData_Protocol)
|
||||
|
||||
@@ -33,45 +32,28 @@ class IGESDefs_Protocol : public IGESData_Protocol
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_Protocol();
|
||||
|
||||
|
||||
//! Gives the count of Resource Protocol. Here, one
|
||||
//! (Protocol from IGESGraph)
|
||||
Standard_EXPORT virtual Standard_Integer NbResources() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Returns a Resource, given a rank.
|
||||
Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Handle(Interface_Protocol) Resource(const Standard_Integer num) const
|
||||
Standard_OVERRIDE;
|
||||
|
||||
//! 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)
|
||||
Standard_EXPORT virtual Standard_Integer TypeNumber (const Handle(Standard_Type)& atype) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_Integer TypeNumber(const Handle(Standard_Type)& atype) const
|
||||
Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_Protocol,IGESData_Protocol)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_Protocol, IGESData_Protocol)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_Protocol_HeaderFile
|
||||
|
@@ -11,7 +11,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <IGESData_IGESReaderData.hxx>
|
||||
#include <IGESData_IGESWriter.hxx>
|
||||
#include <IGESData_ParamReader.hxx>
|
||||
@@ -33,149 +32,176 @@
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_ReadWriteModule,IGESData_ReadWriteModule)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_ReadWriteModule, IGESData_ReadWriteModule)
|
||||
|
||||
// Each Module is attached to a Protocol : it must interpret Case Numbers
|
||||
// (arguments <CN> of various methods) in accordance to values returned by
|
||||
// the method TypeNumber from this Protocol
|
||||
IGESDefs_ReadWriteModule::IGESDefs_ReadWriteModule () { }
|
||||
IGESDefs_ReadWriteModule::IGESDefs_ReadWriteModule() {}
|
||||
|
||||
|
||||
Standard_Integer IGESDefs_ReadWriteModule::CaseIGES
|
||||
(const Standard_Integer typenum, const Standard_Integer formnum) const
|
||||
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;
|
||||
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;
|
||||
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
|
||||
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;
|
||||
switch (CN)
|
||||
{
|
||||
case 1: {
|
||||
DeclareAndCast(IGESDefs_AssociativityDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAssociativityDef tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
tool.ReadOwnParams(anent, IR, PR);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 2: {
|
||||
DeclareAndCast(IGESDefs_AttributeDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeDef tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
tool.ReadOwnParams(anent, IR, PR);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 3: {
|
||||
DeclareAndCast(IGESDefs_AttributeTable, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeTable tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
tool.ReadOwnParams(anent, IR, PR);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESDefs_GenericData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 4: {
|
||||
DeclareAndCast(IGESDefs_GenericData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolGenericData tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
tool.ReadOwnParams(anent, IR, PR);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 5: {
|
||||
DeclareAndCast(IGESDefs_MacroDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolMacroDef tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
tool.ReadOwnParams(anent, IR, PR);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESDefs_TabularData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 6: {
|
||||
DeclareAndCast(IGESDefs_TabularData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolTabularData tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
tool.ReadOwnParams(anent, IR, PR);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 7: {
|
||||
DeclareAndCast(IGESDefs_UnitsData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolUnitsData tool;
|
||||
tool.ReadOwnParams(anent,IR,PR);
|
||||
tool.ReadOwnParams(anent, IR, PR);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void IGESDefs_ReadWriteModule::WriteOwnParams
|
||||
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
|
||||
IGESData_IGESWriter& IW) const
|
||||
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;
|
||||
switch (CN)
|
||||
{
|
||||
case 1: {
|
||||
DeclareAndCast(IGESDefs_AssociativityDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAssociativityDef tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
tool.WriteOwnParams(anent, IW);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 2: {
|
||||
DeclareAndCast(IGESDefs_AttributeDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeDef tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
tool.WriteOwnParams(anent, IW);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 3: {
|
||||
DeclareAndCast(IGESDefs_AttributeTable, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeTable tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
tool.WriteOwnParams(anent, IW);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESDefs_GenericData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 4: {
|
||||
DeclareAndCast(IGESDefs_GenericData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolGenericData tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
tool.WriteOwnParams(anent, IW);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 5: {
|
||||
DeclareAndCast(IGESDefs_MacroDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolMacroDef tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
tool.WriteOwnParams(anent, IW);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESDefs_TabularData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 6: {
|
||||
DeclareAndCast(IGESDefs_TabularData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolTabularData tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
tool.WriteOwnParams(anent, IW);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 7: {
|
||||
DeclareAndCast(IGESDefs_UnitsData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolUnitsData tool;
|
||||
tool.WriteOwnParams(anent,IW);
|
||||
tool.WriteOwnParams(anent, IW);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ class IGESData_IGESReaderData;
|
||||
class IGESData_ParamReader;
|
||||
class IGESData_IGESWriter;
|
||||
|
||||
|
||||
class IGESDefs_ReadWriteModule;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_ReadWriteModule, IGESData_ReadWriteModule)
|
||||
|
||||
@@ -38,41 +37,28 @@ class IGESDefs_ReadWriteModule : public IGESData_ReadWriteModule
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a ReadWriteModule & puts it into ReaderLib & WriterLib
|
||||
Standard_EXPORT IGESDefs_ReadWriteModule();
|
||||
|
||||
|
||||
//! Defines Case Numbers for Entities of IGESDefs
|
||||
Standard_EXPORT Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer CaseIGES(const Standard_Integer typenum,
|
||||
const Standard_Integer formnum) const Standard_OVERRIDE;
|
||||
|
||||
//! Reads own parameters from file for an Entity of IGESDefs
|
||||
Standard_EXPORT void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const Standard_OVERRIDE;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const Standard_OVERRIDE;
|
||||
Standard_EXPORT void WriteOwnParams(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& ent,
|
||||
IGESData_IGESWriter& IW) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_ReadWriteModule,IGESData_ReadWriteModule)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_ReadWriteModule, IGESData_ReadWriteModule)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ReadWriteModule_HeaderFile
|
||||
|
@@ -11,7 +11,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <IGESData_IGESDumper.hxx>
|
||||
#include <IGESDefs_AssociativityDef.hxx>
|
||||
#include <IGESDefs_AttributeDef.hxx>
|
||||
@@ -31,69 +30,78 @@
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_SpecificModule,IGESData_SpecificModule)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_SpecificModule, IGESData_SpecificModule)
|
||||
|
||||
// Each Module is attached to a Protocol : it must interpret Case Numbers
|
||||
// (arguments <CN> of various methods) in accordance to values returned by
|
||||
// the method TypeNumber from this Protocol
|
||||
IGESDefs_SpecificModule::IGESDefs_SpecificModule() { }
|
||||
IGESDefs_SpecificModule::IGESDefs_SpecificModule() {}
|
||||
|
||||
|
||||
void IGESDefs_SpecificModule::OwnDump
|
||||
(const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
|
||||
const IGESData_IGESDumper& dumper, Standard_OStream& S,
|
||||
const Standard_Integer own) const
|
||||
void IGESDefs_SpecificModule::OwnDump(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const
|
||||
{
|
||||
switch (CN) {
|
||||
case 1 : {
|
||||
DeclareAndCast(IGESDefs_AssociativityDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
switch (CN)
|
||||
{
|
||||
case 1: {
|
||||
DeclareAndCast(IGESDefs_AssociativityDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAssociativityDef tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
tool.OwnDump(anent, dumper, S, own);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
DeclareAndCast(IGESDefs_AttributeDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 2: {
|
||||
DeclareAndCast(IGESDefs_AttributeDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeDef tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
tool.OwnDump(anent, dumper, S, own);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
DeclareAndCast(IGESDefs_AttributeTable,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 3: {
|
||||
DeclareAndCast(IGESDefs_AttributeTable, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolAttributeTable tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
tool.OwnDump(anent, dumper, S, own);
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
DeclareAndCast(IGESDefs_GenericData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 4: {
|
||||
DeclareAndCast(IGESDefs_GenericData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolGenericData tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
tool.OwnDump(anent, dumper, S, own);
|
||||
}
|
||||
break;
|
||||
case 5 : {
|
||||
DeclareAndCast(IGESDefs_MacroDef,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 5: {
|
||||
DeclareAndCast(IGESDefs_MacroDef, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolMacroDef tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
tool.OwnDump(anent, dumper, S, own);
|
||||
}
|
||||
break;
|
||||
case 6 : {
|
||||
DeclareAndCast(IGESDefs_TabularData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 6: {
|
||||
DeclareAndCast(IGESDefs_TabularData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolTabularData tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
tool.OwnDump(anent, dumper, S, own);
|
||||
}
|
||||
break;
|
||||
case 7 : {
|
||||
DeclareAndCast(IGESDefs_UnitsData,anent,ent);
|
||||
if (anent.IsNull()) return;
|
||||
break;
|
||||
case 7: {
|
||||
DeclareAndCast(IGESDefs_UnitsData, anent, ent);
|
||||
if (anent.IsNull())
|
||||
return;
|
||||
IGESDefs_ToolUnitsData tool;
|
||||
tool.OwnDump(anent,dumper,S,own);
|
||||
tool.OwnDump(anent, dumper, S, own);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
@@ -33,35 +33,20 @@ class IGESDefs_SpecificModule : public IGESData_SpecificModule
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a SpecificModule from IGESDefs & puts it into SpecificLib
|
||||
Standard_EXPORT IGESDefs_SpecificModule();
|
||||
|
||||
|
||||
//! Specific Dump (own parameters) for IGESDefs
|
||||
Standard_EXPORT void OwnDump (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const Standard_OVERRIDE;
|
||||
Standard_EXPORT void OwnDump(const Standard_Integer CN,
|
||||
const Handle(IGESData_IGESEntity)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_SpecificModule,IGESData_SpecificModule)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_SpecificModule, IGESData_SpecificModule)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_SpecificModule_HeaderFile
|
||||
|
@@ -24,99 +24,94 @@
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_TabularData,IGESData_IGESEntity)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_TabularData, IGESData_IGESEntity)
|
||||
|
||||
IGESDefs_TabularData::IGESDefs_TabularData () { }
|
||||
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)
|
||||
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 )
|
||||
if (typesInd->Lower() != 1 || nbValuesInd->Lower() != 1 || nbValuesInd->Length() != num
|
||||
|| valuesInd->Lower() != 1 || valuesInd->Length() != num || valuesDep->Lower() != 1)
|
||||
throw Standard_DimensionMismatch("IGESDefs_TabularData : Init");
|
||||
theNbPropertyValues = nbProps;
|
||||
thePropertyType = propType;
|
||||
/* theNbDependents = nbDeps; */
|
||||
/* theNbIndependents = nbIndeps; */
|
||||
thePropertyType = propType;
|
||||
/* theNbDependents = nbDeps; */
|
||||
/* theNbIndependents = nbIndeps; */
|
||||
theTypeOfIndependentVariables = typesInd;
|
||||
theNbValues = nbValuesInd;
|
||||
theIndependentValues = valuesInd;
|
||||
theDependentValues = valuesDep;
|
||||
InitTypeAndForm(406,11);
|
||||
InitTypeAndForm(406, 11);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_TabularData::NbPropertyValues () const
|
||||
Standard_Integer IGESDefs_TabularData::NbPropertyValues() const
|
||||
{
|
||||
return theNbPropertyValues;
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_TabularData::ComputedNbPropertyValues () const
|
||||
Standard_Integer IGESDefs_TabularData::ComputedNbPropertyValues() const
|
||||
{
|
||||
return theNbPropertyValues; // pas malin ... a ameliorer
|
||||
return theNbPropertyValues; // pas malin ... a ameliorer
|
||||
}
|
||||
|
||||
Standard_Boolean IGESDefs_TabularData::OwnCorrect ()
|
||||
Standard_Boolean IGESDefs_TabularData::OwnCorrect()
|
||||
{
|
||||
Standard_Integer newnb = ComputedNbPropertyValues();
|
||||
if (newnb == theNbPropertyValues) return Standard_False;
|
||||
if (newnb == theNbPropertyValues)
|
||||
return Standard_False;
|
||||
theNbPropertyValues = newnb;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer IGESDefs_TabularData::PropertyType () const
|
||||
Standard_Integer IGESDefs_TabularData::PropertyType() const
|
||||
{
|
||||
return thePropertyType;
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_TabularData::NbDependents () const
|
||||
Standard_Integer IGESDefs_TabularData::NbDependents() const
|
||||
{
|
||||
return theDependentValues->Length();
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_TabularData::NbIndependents () const
|
||||
Standard_Integer IGESDefs_TabularData::NbIndependents() const
|
||||
{
|
||||
return theTypeOfIndependentVariables->Length();
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_TabularData::TypeOfIndependents
|
||||
(const Standard_Integer num) const
|
||||
Standard_Integer IGESDefs_TabularData::TypeOfIndependents(const Standard_Integer num) const
|
||||
{
|
||||
return theTypeOfIndependentVariables->Value(num);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_TabularData::NbValues (const Standard_Integer num) const
|
||||
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
|
||||
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
|
||||
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 IGESDefs_TabularData::DependentValue(const Standard_Integer /*variablenum*/,
|
||||
const Standard_Integer /*valuenum*/) const
|
||||
{
|
||||
Standard_Real val = 0.;
|
||||
#if 0
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
class IGESBasic_HArray1OfHArray1OfReal;
|
||||
|
||||
|
||||
class IGESDefs_TabularData;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_TabularData, IGESData_IGESEntity)
|
||||
|
||||
@@ -38,10 +37,8 @@ class IGESDefs_TabularData : public IGESData_IGESEntity
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_TabularData();
|
||||
|
||||
|
||||
//! This method is used to set the fields of the class
|
||||
//! TabularData
|
||||
//! - nbProps : Number of property values
|
||||
@@ -51,68 +48,58 @@ public:
|
||||
//! - valuesInd : Values of independent variables
|
||||
//! - valuesDep : Values of dependent variables
|
||||
//! raises exception if lengths of typeInd and nbValuesInd are not same
|
||||
Standard_EXPORT void Init (const Standard_Integer nbProps, const Standard_Integer propType, const Handle(TColStd_HArray1OfInteger)& typesInd, const Handle(TColStd_HArray1OfInteger)& nbValuesInd, const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesInd, const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesDep);
|
||||
|
||||
Standard_EXPORT void Init(const Standard_Integer nbProps,
|
||||
const Standard_Integer propType,
|
||||
const Handle(TColStd_HArray1OfInteger)& typesInd,
|
||||
const Handle(TColStd_HArray1OfInteger)& nbValuesInd,
|
||||
const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesInd,
|
||||
const Handle(IGESBasic_HArray1OfHArray1OfReal)& valuesDep);
|
||||
|
||||
//! returns the number of property values (recorded)
|
||||
Standard_EXPORT Standard_Integer NbPropertyValues() const;
|
||||
|
||||
|
||||
//! determines the number of property values required
|
||||
Standard_EXPORT Standard_Integer ComputedNbPropertyValues() const;
|
||||
|
||||
|
||||
//! checks, and correct as necessary, the number of property
|
||||
//! values. Returns True if corrected, False if already OK
|
||||
Standard_EXPORT Standard_Boolean OwnCorrect();
|
||||
|
||||
|
||||
//! returns the property type
|
||||
Standard_EXPORT Standard_Integer PropertyType() const;
|
||||
|
||||
|
||||
//! returns the number of dependent variables
|
||||
Standard_EXPORT Standard_Integer NbDependents() const;
|
||||
|
||||
|
||||
//! returns the number of independent variables
|
||||
Standard_EXPORT Standard_Integer NbIndependents() const;
|
||||
|
||||
|
||||
//! returns the type of the num'th independent variable
|
||||
//! raises exception if num <= 0 or num > NbIndependents()
|
||||
Standard_EXPORT Standard_Integer TypeOfIndependents (const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer TypeOfIndependents(const Standard_Integer num) const;
|
||||
|
||||
//! returns the number of different values of the num'th indep. variable
|
||||
//! raises exception if num <= 0 or num > NbIndependents()
|
||||
Standard_EXPORT Standard_Integer NbValues (const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Real IndependentValue (const Standard_Integer variablenum, const Standard_Integer valuenum) const;
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HArray1OfReal) DependentValues (const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Real DependentValue (const Standard_Integer variablenum, const Standard_Integer valuenum) const;
|
||||
Standard_EXPORT Standard_Integer NbValues(const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Real IndependentValue(const Standard_Integer variablenum,
|
||||
const Standard_Integer valuenum) const;
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HArray1OfReal) DependentValues(const Standard_Integer num) const;
|
||||
|
||||
Standard_EXPORT Standard_Real DependentValue(const Standard_Integer variablenum,
|
||||
const Standard_Integer valuenum) const;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_TabularData,IGESData_IGESEntity)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_TabularData, IGESData_IGESEntity)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Integer theNbPropertyValues;
|
||||
Standard_Integer thePropertyType;
|
||||
Handle(TColStd_HArray1OfInteger) theTypeOfIndependentVariables;
|
||||
Handle(TColStd_HArray1OfInteger) theNbValues;
|
||||
Standard_Integer theNbPropertyValues;
|
||||
Standard_Integer thePropertyType;
|
||||
Handle(TColStd_HArray1OfInteger) theTypeOfIndependentVariables;
|
||||
Handle(TColStd_HArray1OfInteger) theNbValues;
|
||||
Handle(IGESBasic_HArray1OfHArray1OfReal) theIndependentValues;
|
||||
Handle(IGESBasic_HArray1OfHArray1OfReal) theDependentValues;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_TabularData_HeaderFile
|
||||
|
@@ -33,129 +33,134 @@
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
|
||||
IGESDefs_ToolAssociativityDef::IGESDefs_ToolAssociativityDef () { }
|
||||
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;
|
||||
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_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");
|
||||
{
|
||||
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())
|
||||
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 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);
|
||||
}
|
||||
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);
|
||||
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
|
||||
{
|
||||
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(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));
|
||||
IW.Send(ent->Item(i, j));
|
||||
}
|
||||
}
|
||||
|
||||
void IGESDefs_ToolAssociativityDef::OwnShared
|
||||
(const Handle(IGESDefs_AssociativityDef)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
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
|
||||
{
|
||||
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(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);
|
||||
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);
|
||||
{
|
||||
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);
|
||||
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());
|
||||
ent->SetFormNumber(another->FormNumber());
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESDefs_ToolAssociativityDef::DirChecker
|
||||
(const Handle(IGESDefs_AssociativityDef)& /* ent */ ) const
|
||||
{
|
||||
IGESData_DirChecker DC (302, 5001, 9999);
|
||||
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);
|
||||
@@ -167,47 +172,53 @@ IGESData_DirChecker IGESDefs_ToolAssociativityDef::DirChecker
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESDefs_ToolAssociativityDef::OwnCheck
|
||||
(const Handle(IGESDefs_AssociativityDef)& /* ent */,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
|
||||
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 */,
|
||||
Standard_OStream& S, const Standard_Integer level) const
|
||||
{
|
||||
void IGESDefs_ToolAssociativityDef::OwnDump(const Handle(IGESDefs_AssociativityDef)& ent,
|
||||
const IGESData_IGESDumper& /* dumper */,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESDefs_AssociativityDef\n"
|
||||
<< "Number of Class Definitions : " << ent->NbClassDefs() << "\n"
|
||||
<< "Back Pointer Requirement :\n"
|
||||
<< "Ordered / Unordered Class :\n"
|
||||
<< "Number Of Items per Entry :\n"
|
||||
<< "Items :\n";
|
||||
IGESData_DumpVals(S,-level,1, ent->NbClassDefs(),ent->BackPointerReq);
|
||||
IGESData_DumpVals(S, -level, 1, ent->NbClassDefs(), ent->BackPointerReq);
|
||||
S << std::endl;
|
||||
if (level > 4)
|
||||
{
|
||||
// Warning : Item is a JAGGED Array
|
||||
Standard_Integer upper = ent->NbClassDefs();
|
||||
for (Standard_Integer i = 1; i <= upper; i++)
|
||||
{
|
||||
// Warning : Item is a JAGGED Array
|
||||
Standard_Integer upper = ent->NbClassDefs();
|
||||
for (Standard_Integer i = 1; i <= upper; i ++) {
|
||||
S << "[" << i << "]:\n";
|
||||
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)\n";
|
||||
else S << "(No)\n";
|
||||
S << "Number Of Items per Entry : " << ent->NbItemsPerClass(i);
|
||||
if (level < 6) {
|
||||
S << " [ask level > 5 for more]\n";
|
||||
continue;
|
||||
}
|
||||
S << "\n [";
|
||||
for (Standard_Integer j = 1; j <= ent->NbItemsPerClass(i); j ++)
|
||||
S << " " << ent->Item(i,j);
|
||||
S << "]\n";
|
||||
S << "[" << i << "]:\n";
|
||||
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)\n";
|
||||
else
|
||||
S << "(No)\n";
|
||||
S << "Number Of Items per Entry : " << ent->NbItemsPerClass(i);
|
||||
if (level < 6)
|
||||
{
|
||||
S << " [ask level > 5 for more]\n";
|
||||
continue;
|
||||
}
|
||||
S << "\n [";
|
||||
for (Standard_Integer j = 1; j <= ent->NbItemsPerClass(i); j++)
|
||||
S << " " << ent->Item(i, j);
|
||||
S << "]\n";
|
||||
}
|
||||
}
|
||||
S << std::endl;
|
||||
}
|
||||
|
||||
|
@@ -35,60 +35,51 @@ class IGESData_IGESDumper;
|
||||
|
||||
//! Tool to work on a AssociativityDef. Called by various Modules
|
||||
//! (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
class IGESDefs_ToolAssociativityDef
|
||||
class IGESDefs_ToolAssociativityDef
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns a ToolAssociativityDef, ready to work
|
||||
Standard_EXPORT IGESDefs_ToolAssociativityDef();
|
||||
|
||||
|
||||
//! Reads own parameters from file. <PR> gives access to them,
|
||||
//! <IR> detains parameter types and values
|
||||
Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_AssociativityDef)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Handle(IGESDefs_AssociativityDef)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_AssociativityDef)& ent, IGESData_IGESWriter& IW) const;
|
||||
|
||||
Standard_EXPORT void WriteOwnParams(const Handle(IGESDefs_AssociativityDef)& ent,
|
||||
IGESData_IGESWriter& IW) const;
|
||||
|
||||
//! Lists the Entities shared by a AssociativityDef <ent>, from
|
||||
//! its specific (own) parameters
|
||||
Standard_EXPORT void OwnShared (const Handle(IGESDefs_AssociativityDef)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
Standard_EXPORT void OwnShared(const Handle(IGESDefs_AssociativityDef)& ent,
|
||||
Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns specific DirChecker
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_AssociativityDef)& ent) const;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker
|
||||
DirChecker(const Handle(IGESDefs_AssociativityDef)& ent) const;
|
||||
|
||||
//! Performs Specific Semantic Check
|
||||
Standard_EXPORT void OwnCheck (const Handle(IGESDefs_AssociativityDef)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const;
|
||||
|
||||
Standard_EXPORT void OwnCheck(const Handle(IGESDefs_AssociativityDef)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Copies Specific Parameters
|
||||
Standard_EXPORT void OwnCopy (const Handle(IGESDefs_AssociativityDef)& entfrom, const Handle(IGESDefs_AssociativityDef)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
Standard_EXPORT void OwnCopy(const Handle(IGESDefs_AssociativityDef)& entfrom,
|
||||
const Handle(IGESDefs_AssociativityDef)& entto,
|
||||
Interface_CopyTool& TC) const;
|
||||
|
||||
//! Dump of Specific Parameters
|
||||
Standard_EXPORT void OwnDump (const Handle(IGESDefs_AssociativityDef)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void OwnDump(const Handle(IGESDefs_AssociativityDef)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ToolAssociativityDef_HeaderFile
|
||||
|
@@ -40,325 +40,388 @@
|
||||
#include <TColStd_HArray1OfTransient.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
IGESDefs_ToolAttributeDef::IGESDefs_ToolAttributeDef () { }
|
||||
|
||||
IGESDefs_ToolAttributeDef::IGESDefs_ToolAttributeDef() {}
|
||||
|
||||
void IGESDefs_ToolAttributeDef::ReadOwnParams
|
||||
(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
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;
|
||||
// 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();
|
||||
Standard_Integer nbval;
|
||||
Standard_Integer fn = ent->FormNumber();
|
||||
|
||||
if (PR.DefinedElseSkip())
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
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
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
|
||||
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");
|
||||
{
|
||||
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())
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
attrValueCounts->SetValue(i, avc);
|
||||
if (fn > 1)
|
||||
attrValuePointer = new IGESGraph_HArray1OfTextDisplayTemplate(1, avc);
|
||||
}
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init
|
||||
(aName, aListType, attrTypes, attrValueDataTypes, attrValueCounts,
|
||||
attrValues, attrValuePointers);
|
||||
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
|
||||
void IGESDefs_ToolAttributeDef::WriteOwnParams(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
IGESData_IGESWriter& IW) const
|
||||
{
|
||||
if (ent->HasTableName()) IW.Send(ent->TableName());
|
||||
else IW.SendVoid();
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
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
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
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
|
||||
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());
|
||||
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();
|
||||
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);
|
||||
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);
|
||||
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())
|
||||
{
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
ent->Init(aName,
|
||||
aListType,
|
||||
attrTypes,
|
||||
attrValueDataTypes,
|
||||
attrValueCounts,
|
||||
attrValues,
|
||||
attrValuePointers);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESDefs_ToolAttributeDef::DirChecker
|
||||
(const Handle(IGESDefs_AttributeDef)& /* ent */ ) const
|
||||
IGESData_DirChecker IGESDefs_ToolAttributeDef::DirChecker(
|
||||
const Handle(IGESDefs_AttributeDef)& /* ent */) const
|
||||
{
|
||||
IGESData_DirChecker DC (322, 0, 2);
|
||||
IGESData_DirChecker DC(322, 0, 2);
|
||||
DC.Structure(IGESData_DefVoid);
|
||||
DC.LineFont(IGESData_DefAny);
|
||||
DC.LineWeight(IGESData_DefValue);
|
||||
@@ -370,150 +433,184 @@ IGESData_DirChecker IGESDefs_ToolAttributeDef::DirChecker
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESDefs_ToolAttributeDef::OwnCheck
|
||||
(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
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 ++) {
|
||||
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));
|
||||
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);
|
||||
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;
|
||||
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);
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
sprintf(mess, "Attribute List n0.%d (Logicals i.e. Integers) badly defined", aty);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (mess[0] != '\0') ach->AddFail(mess);
|
||||
if (mess[0] != '\0')
|
||||
ach->AddFail(mess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void IGESDefs_ToolAttributeDef::OwnDump
|
||||
(const Handle(IGESDefs_AttributeDef)& ent, const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S, const Standard_Integer level) const
|
||||
void IGESDefs_ToolAttributeDef::OwnDump(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
Standard_Integer sublevel = (level > 4) ? 1 : 0;
|
||||
|
||||
S << "IGESDefs_AttributeDef\n"
|
||||
<< "Attribute Table Name: ";
|
||||
IGESData_DumpString(S,ent->TableName());
|
||||
IGESData_DumpString(S, ent->TableName());
|
||||
S << "\n"
|
||||
<< "Attribute List Type : " << ent->ListType() << "\n"
|
||||
<< "Number of Attributes : " << ent->NbAttributes() << "\n"
|
||||
<< "Attribute Types :\n"
|
||||
<< "Attribute Value Data Types :\n"
|
||||
<< "Attribute Value Counts :\n";
|
||||
if (ent->HasValues()) S << "Attribute Values :\n";
|
||||
if (ent->HasTextDisplay()) S << "Attribute Value Entities :\n";
|
||||
IGESData_DumpVals(S,-level,1, ent->NbAttributes(),ent->AttributeType);
|
||||
if (ent->HasValues())
|
||||
S << "Attribute Values :\n";
|
||||
if (ent->HasTextDisplay())
|
||||
S << "Attribute Value Entities :\n";
|
||||
IGESData_DumpVals(S, -level, 1, ent->NbAttributes(), ent->AttributeType);
|
||||
S << "\n";
|
||||
if (level > 4)
|
||||
{
|
||||
Standard_Integer upper = ent->NbAttributes();
|
||||
for (Standard_Integer i = 1; i <= upper; i++)
|
||||
{
|
||||
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 << "]: "
|
||||
<< "Attribute Type : " << ent->AttributeType(i) << " "
|
||||
<< "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 << "\n";
|
||||
if (ent->HasValues())
|
||||
{
|
||||
if (level <= 5) {
|
||||
S << " [ content (Values) : ask level > 5 ]\n";
|
||||
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 << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
Standard_Integer avc = ent->AttributeValueCount(i);
|
||||
Standard_Integer typ = ent->AttributeValueDataType(i);
|
||||
S << "[" << i << "]: "
|
||||
<< "Attribute Type : " << ent->AttributeType(i) << " "
|
||||
<< "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 << "\n";
|
||||
if (ent->HasValues())
|
||||
{
|
||||
if (level <= 5)
|
||||
{
|
||||
S << " [ content (Values) : ask level > 5 ]\n";
|
||||
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 << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
S << std::endl;
|
||||
}
|
||||
|
@@ -35,60 +35,50 @@ class IGESData_IGESDumper;
|
||||
|
||||
//! Tool to work on a AttributeDef. Called by various Modules
|
||||
//! (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
class IGESDefs_ToolAttributeDef
|
||||
class IGESDefs_ToolAttributeDef
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns a ToolAttributeDef, ready to work
|
||||
Standard_EXPORT IGESDefs_ToolAttributeDef();
|
||||
|
||||
|
||||
//! Reads own parameters from file. <PR> gives access to them,
|
||||
//! <IR> detains parameter types and values
|
||||
Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_AttributeDef)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_AttributeDef)& ent, IGESData_IGESWriter& IW) const;
|
||||
|
||||
Standard_EXPORT void WriteOwnParams(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
IGESData_IGESWriter& IW) const;
|
||||
|
||||
//! Lists the Entities shared by a AttributeDef <ent>, from
|
||||
//! its specific (own) parameters
|
||||
Standard_EXPORT void OwnShared (const Handle(IGESDefs_AttributeDef)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
Standard_EXPORT void OwnShared(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns specific DirChecker
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_AttributeDef)& ent) const;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker(const Handle(IGESDefs_AttributeDef)& ent) const;
|
||||
|
||||
//! Performs Specific Semantic Check
|
||||
Standard_EXPORT void OwnCheck (const Handle(IGESDefs_AttributeDef)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const;
|
||||
|
||||
Standard_EXPORT void OwnCheck(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Copies Specific Parameters
|
||||
Standard_EXPORT void OwnCopy (const Handle(IGESDefs_AttributeDef)& entfrom, const Handle(IGESDefs_AttributeDef)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
Standard_EXPORT void OwnCopy(const Handle(IGESDefs_AttributeDef)& entfrom,
|
||||
const Handle(IGESDefs_AttributeDef)& entto,
|
||||
Interface_CopyTool& TC) const;
|
||||
|
||||
//! Dump of Specific Parameters
|
||||
Standard_EXPORT void OwnDump (const Handle(IGESDefs_AttributeDef)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void OwnDump(const Handle(IGESDefs_AttributeDef)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ToolAttributeDef_HeaderFile
|
||||
|
@@ -37,243 +37,258 @@
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray2OfTransient.hxx>
|
||||
|
||||
IGESDefs_ToolAttributeTable::IGESDefs_ToolAttributeTable () { }
|
||||
IGESDefs_ToolAttributeTable::IGESDefs_ToolAttributeTable() {}
|
||||
|
||||
|
||||
void IGESDefs_ToolAttributeTable::ReadOwnParams
|
||||
(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
{
|
||||
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(IGESDefs_AttributeDef) ab = ent->Definition(); // formerly loaded
|
||||
Handle(TColStd_HArray2OfTransient) list2;
|
||||
if (ab.IsNull()) {
|
||||
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);
|
||||
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 ++)
|
||||
// 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++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(), ent);
|
||||
ent->Init(list2);
|
||||
}
|
||||
|
||||
void IGESDefs_ToolAttributeTable::WriteOwnParams
|
||||
(const Handle(IGESDefs_AttributeTable)& ent, IGESData_IGESWriter& IW) const
|
||||
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 ++)
|
||||
if (ent->FormNumber() == 1)
|
||||
IW.Send(nr);
|
||||
for (Standard_Integer k = 1; k <= nr; k++)
|
||||
{
|
||||
for (Standard_Integer i = 1; i <= na; i++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
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 ++)
|
||||
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++)
|
||||
{
|
||||
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));
|
||||
}
|
||||
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 ++)
|
||||
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++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
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);
|
||||
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();
|
||||
@@ -281,14 +296,16 @@ IGESData_DirChecker IGESDefs_ToolAttributeTable::DirChecker
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESDefs_ToolAttributeTable::OwnCheck
|
||||
(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
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->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");
|
||||
@@ -296,10 +313,11 @@ void IGESDefs_ToolAttributeTable::OwnCheck
|
||||
ach->AddFail("Mismatch between Definition (Structure) and Content");
|
||||
}
|
||||
|
||||
void IGESDefs_ToolAttributeTable::OwnDump
|
||||
(const Handle(IGESDefs_AttributeTable)& ent, const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S, const Standard_Integer level) const
|
||||
{
|
||||
void IGESDefs_ToolAttributeTable::OwnDump(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESDefs_AttributeTable\n";
|
||||
|
||||
Handle(IGESDefs_AttributeDef) ab = ent->Definition();
|
||||
@@ -308,44 +326,71 @@ void IGESDefs_ToolAttributeTable::OwnDump
|
||||
Standard_Integer nr = ent->NbRows();
|
||||
if (ent->FormNumber() == 1)
|
||||
S << "Number of Rows (i.e. complete sets of Attributes) : " << nr << "\n";
|
||||
else S << "One set of Attributes\n";
|
||||
S << "Number of defined Attributes : " << na << "\n";
|
||||
if (level <= 4) S <<
|
||||
" [ structure : see Structure in Directory Entry; content : level > 4 ]\n";
|
||||
else
|
||||
for (Standard_Integer k = 1; k <= nr; k ++)
|
||||
S << "One set of Attributes\n";
|
||||
S << "Number of defined Attributes : " << na << "\n";
|
||||
if (level <= 4)
|
||||
S << " [ structure : see Structure in Directory Entry; content : level > 4 ]\n";
|
||||
else
|
||||
for (Standard_Integer k = 1; k <= nr; k++)
|
||||
{
|
||||
for (Standard_Integer i = 1; i <= na; i++)
|
||||
{
|
||||
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 << "\n";
|
||||
}
|
||||
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 << "\n";
|
||||
}
|
||||
}
|
||||
S << std::endl;
|
||||
}
|
||||
|
@@ -35,60 +35,50 @@ class IGESData_IGESDumper;
|
||||
|
||||
//! Tool to work on a AttributeTable. Called by various Modules
|
||||
//! (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
class IGESDefs_ToolAttributeTable
|
||||
class IGESDefs_ToolAttributeTable
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns a ToolAttributeTable, ready to work
|
||||
Standard_EXPORT IGESDefs_ToolAttributeTable();
|
||||
|
||||
|
||||
//! Reads own parameters from file. <PR> gives access to them,
|
||||
//! <IR> detains parameter types and values
|
||||
Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_AttributeTable)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_AttributeTable)& ent, IGESData_IGESWriter& IW) const;
|
||||
|
||||
Standard_EXPORT void WriteOwnParams(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
IGESData_IGESWriter& IW) const;
|
||||
|
||||
//! Lists the Entities shared by a AttributeTable <ent>, from
|
||||
//! its specific (own) parameters
|
||||
Standard_EXPORT void OwnShared (const Handle(IGESDefs_AttributeTable)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
Standard_EXPORT void OwnShared(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns specific DirChecker
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_AttributeTable)& ent) const;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker(const Handle(IGESDefs_AttributeTable)& ent) const;
|
||||
|
||||
//! Performs Specific Semantic Check
|
||||
Standard_EXPORT void OwnCheck (const Handle(IGESDefs_AttributeTable)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const;
|
||||
|
||||
Standard_EXPORT void OwnCheck(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Copies Specific Parameters
|
||||
Standard_EXPORT void OwnCopy (const Handle(IGESDefs_AttributeTable)& entfrom, const Handle(IGESDefs_AttributeTable)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
Standard_EXPORT void OwnCopy(const Handle(IGESDefs_AttributeTable)& entfrom,
|
||||
const Handle(IGESDefs_AttributeTable)& entto,
|
||||
Interface_CopyTool& TC) const;
|
||||
|
||||
//! Dump of Specific Parameters
|
||||
Standard_EXPORT void OwnDump (const Handle(IGESDefs_AttributeTable)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void OwnDump(const Handle(IGESDefs_AttributeTable)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ToolAttributeTable_HeaderFile
|
||||
|
@@ -35,199 +35,212 @@
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray1OfTransient.hxx>
|
||||
|
||||
IGESDefs_ToolGenericData::IGESDefs_ToolGenericData () { }
|
||||
IGESDefs_ToolGenericData::IGESDefs_ToolGenericData() {}
|
||||
|
||||
|
||||
void IGESDefs_ToolGenericData::ReadOwnParams
|
||||
(const Handle(IGESDefs_GenericData)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
|
||||
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;
|
||||
// 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;
|
||||
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropVal); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
|
||||
PR.ReadText(PR.Current(), "Property Name", tempName); //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");
|
||||
{
|
||||
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++ )
|
||||
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)
|
||||
{
|
||||
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))
|
||||
{
|
||||
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;
|
||||
tempObj->SetValue(1, (tempBool ? 1 : 0));
|
||||
tempValues->SetValue(i, tempObj);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (tempNbPropVal, tempName, tempTypes, tempValues);
|
||||
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
|
||||
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++ )
|
||||
for (num = ent->NbTypeValuePairs(), i = 1; i <= num; i++)
|
||||
{
|
||||
IW.Send(ent->Type(i));
|
||||
switch (ent->Type(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;
|
||||
}
|
||||
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
|
||||
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));
|
||||
}
|
||||
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
|
||||
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);
|
||||
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))
|
||||
{
|
||||
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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
ent->Init(tempNbPropVal, tempName, tempTypes, tempValues);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESDefs_ToolGenericData::DirChecker
|
||||
(const Handle(IGESDefs_GenericData)& /* ent */ ) const
|
||||
IGESData_DirChecker IGESDefs_ToolGenericData::DirChecker(
|
||||
const Handle(IGESDefs_GenericData)& /* ent */) const
|
||||
{
|
||||
IGESData_DirChecker DC(406, 27);
|
||||
DC.Structure(IGESData_DefVoid);
|
||||
@@ -242,57 +255,70 @@ IGESData_DirChecker IGESDefs_ToolGenericData::DirChecker
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESDefs_ToolGenericData::OwnCheck
|
||||
(const Handle(IGESDefs_GenericData)& ent,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
|
||||
void IGESDefs_ToolGenericData::OwnCheck(const Handle(IGESDefs_GenericData)& ent,
|
||||
const Interface_ShareTool&,
|
||||
Handle(Interface_Check)& ach) const
|
||||
{
|
||||
if (ent->NbPropertyValues() != ent->NbTypeValuePairs()*2 + 2)
|
||||
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,
|
||||
Standard_OStream& S, const Standard_Integer level) const
|
||||
void IGESDefs_ToolGenericData::OwnDump(const Handle(IGESDefs_GenericData)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESDefs_GenericData\n"
|
||||
<< "Number of property values : " << ent->NbPropertyValues() << "\n"
|
||||
<< "Property Name : ";
|
||||
IGESData_DumpString(S,ent->Name());
|
||||
IGESData_DumpString(S, ent->Name());
|
||||
S << std::endl;
|
||||
switch (level)
|
||||
{
|
||||
{
|
||||
case 4:
|
||||
S << "Types :\n";
|
||||
S << "Values : Count = " << ent->NbTypeValuePairs() << "\n";
|
||||
S << " [ as level > 4 for content ]\n";
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
case 6: {
|
||||
Standard_Integer i, num;
|
||||
S << "Types & Values : " << "\n";
|
||||
for (num = ent->NbTypeValuePairs(), i = 1; i <= num; i++)
|
||||
{
|
||||
Standard_Integer i, num;
|
||||
S << "Types & Values : " << "\n";
|
||||
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 << "\n";
|
||||
}
|
||||
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 << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
S << std::endl;
|
||||
}
|
||||
|
@@ -35,60 +35,50 @@ class IGESData_IGESDumper;
|
||||
|
||||
//! Tool to work on a GenericData. Called by various Modules
|
||||
//! (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
class IGESDefs_ToolGenericData
|
||||
class IGESDefs_ToolGenericData
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns a ToolGenericData, ready to work
|
||||
Standard_EXPORT IGESDefs_ToolGenericData();
|
||||
|
||||
|
||||
//! Reads own parameters from file. <PR> gives access to them,
|
||||
//! <IR> detains parameter types and values
|
||||
Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_GenericData)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Handle(IGESDefs_GenericData)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_GenericData)& ent, IGESData_IGESWriter& IW) const;
|
||||
|
||||
Standard_EXPORT void WriteOwnParams(const Handle(IGESDefs_GenericData)& ent,
|
||||
IGESData_IGESWriter& IW) const;
|
||||
|
||||
//! Lists the Entities shared by a GenericData <ent>, from
|
||||
//! its specific (own) parameters
|
||||
Standard_EXPORT void OwnShared (const Handle(IGESDefs_GenericData)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
Standard_EXPORT void OwnShared(const Handle(IGESDefs_GenericData)& ent,
|
||||
Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns specific DirChecker
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_GenericData)& ent) const;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker(const Handle(IGESDefs_GenericData)& ent) const;
|
||||
|
||||
//! Performs Specific Semantic Check
|
||||
Standard_EXPORT void OwnCheck (const Handle(IGESDefs_GenericData)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const;
|
||||
|
||||
Standard_EXPORT void OwnCheck(const Handle(IGESDefs_GenericData)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Copies Specific Parameters
|
||||
Standard_EXPORT void OwnCopy (const Handle(IGESDefs_GenericData)& entfrom, const Handle(IGESDefs_GenericData)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
Standard_EXPORT void OwnCopy(const Handle(IGESDefs_GenericData)& entfrom,
|
||||
const Handle(IGESDefs_GenericData)& entto,
|
||||
Interface_CopyTool& TC) const;
|
||||
|
||||
//! Dump of Specific Parameters
|
||||
Standard_EXPORT void OwnDump (const Handle(IGESDefs_GenericData)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void OwnDump(const Handle(IGESDefs_GenericData)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ToolGenericData_HeaderFile
|
||||
|
@@ -32,57 +32,59 @@
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
IGESDefs_ToolMacroDef::IGESDefs_ToolMacroDef () { }
|
||||
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
|
||||
|
||||
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(TCollection_HAsciiString) macro;
|
||||
Standard_Integer entityTypeID;
|
||||
Handle(Interface_HArray1OfHAsciiString) langStatements;
|
||||
Handle(TCollection_HAsciiString) endMacro;
|
||||
Handle(TCollection_HAsciiString) endMacro;
|
||||
|
||||
PR.ReadText(PR.Current(), "MACRO", macro); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
PR.ReadText(PR.Current(), "MACRO", macro); // szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
PR.ReadInteger(PR.Current(), "Entity Type ID", entityTypeID); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
|
||||
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));
|
||||
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 (nbval > 0)
|
||||
langStatements = new Interface_HArray1OfHAsciiString(1, nbval);
|
||||
else
|
||||
PR.AddFail("Number of Lang. Stats. : Not Positive");
|
||||
|
||||
if (! langStatements.IsNull())
|
||||
if (!langStatements.IsNull())
|
||||
{
|
||||
for (Standard_Integer i = 1; i <= nbval; i++)
|
||||
{
|
||||
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);
|
||||
}
|
||||
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
|
||||
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);
|
||||
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
|
||||
{
|
||||
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();
|
||||
@@ -91,38 +93,36 @@ void IGESDefs_ToolMacroDef::WriteOwnParams
|
||||
IW.Send(ent->ENDMACRO());
|
||||
}
|
||||
|
||||
void IGESDefs_ToolMacroDef::OwnShared
|
||||
(const Handle(IGESDefs_MacroDef)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
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
|
||||
{
|
||||
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(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);
|
||||
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);
|
||||
}
|
||||
{
|
||||
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);
|
||||
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);
|
||||
@@ -134,24 +134,25 @@ IGESData_DirChecker IGESDefs_ToolMacroDef::DirChecker
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESDefs_ToolMacroDef::OwnCheck
|
||||
(const Handle(IGESDefs_MacroDef)& /* ent */,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
|
||||
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 */,
|
||||
Standard_OStream& S, const Standard_Integer level) const
|
||||
{
|
||||
void IGESDefs_ToolMacroDef::OwnDump(const Handle(IGESDefs_MacroDef)& ent,
|
||||
const IGESData_IGESDumper& /* dumper */,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESDefs_MacroDef\n"
|
||||
<< "MACRO : ";
|
||||
IGESData_DumpString(S,ent->MACRO());
|
||||
IGESData_DumpString(S, ent->MACRO());
|
||||
S << "\n"
|
||||
<< "Entity Type ID : " << ent->EntityTypeID() << "\n"
|
||||
<< "Language Statement : ";
|
||||
IGESData_DumpStrings(S,level,1, ent->NbStatements(),ent->LanguageStatement);
|
||||
IGESData_DumpStrings(S, level, 1, ent->NbStatements(), ent->LanguageStatement);
|
||||
S << "END MACRO : ";
|
||||
IGESData_DumpString(S,ent->ENDMACRO());
|
||||
IGESData_DumpString(S, ent->ENDMACRO());
|
||||
S << std::endl;
|
||||
}
|
||||
|
@@ -35,60 +35,50 @@ class IGESData_IGESDumper;
|
||||
|
||||
//! Tool to work on a MacroDef. Called by various Modules
|
||||
//! (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
class IGESDefs_ToolMacroDef
|
||||
class IGESDefs_ToolMacroDef
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns a ToolMacroDef, ready to work
|
||||
Standard_EXPORT IGESDefs_ToolMacroDef();
|
||||
|
||||
|
||||
//! Reads own parameters from file. <PR> gives access to them,
|
||||
//! <IR> detains parameter types and values
|
||||
Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_MacroDef)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Handle(IGESDefs_MacroDef)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_MacroDef)& ent, IGESData_IGESWriter& IW) const;
|
||||
|
||||
Standard_EXPORT void WriteOwnParams(const Handle(IGESDefs_MacroDef)& ent,
|
||||
IGESData_IGESWriter& IW) const;
|
||||
|
||||
//! Lists the Entities shared by a MacroDef <ent>, from
|
||||
//! its specific (own) parameters
|
||||
Standard_EXPORT void OwnShared (const Handle(IGESDefs_MacroDef)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
Standard_EXPORT void OwnShared(const Handle(IGESDefs_MacroDef)& ent,
|
||||
Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns specific DirChecker
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_MacroDef)& ent) const;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker(const Handle(IGESDefs_MacroDef)& ent) const;
|
||||
|
||||
//! Performs Specific Semantic Check
|
||||
Standard_EXPORT void OwnCheck (const Handle(IGESDefs_MacroDef)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const;
|
||||
|
||||
Standard_EXPORT void OwnCheck(const Handle(IGESDefs_MacroDef)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Copies Specific Parameters
|
||||
Standard_EXPORT void OwnCopy (const Handle(IGESDefs_MacroDef)& entfrom, const Handle(IGESDefs_MacroDef)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
Standard_EXPORT void OwnCopy(const Handle(IGESDefs_MacroDef)& entfrom,
|
||||
const Handle(IGESDefs_MacroDef)& entto,
|
||||
Interface_CopyTool& TC) const;
|
||||
|
||||
//! Dump of Specific Parameters
|
||||
Standard_EXPORT void OwnDump (const Handle(IGESDefs_MacroDef)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void OwnDump(const Handle(IGESDefs_MacroDef)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ToolMacroDef_HeaderFile
|
||||
|
@@ -36,29 +36,28 @@
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
IGESDefs_ToolTabularData::IGESDefs_ToolTabularData () { }
|
||||
IGESDefs_ToolTabularData::IGESDefs_ToolTabularData() {}
|
||||
|
||||
|
||||
void IGESDefs_ToolTabularData::ReadOwnParams
|
||||
(const Handle(IGESDefs_TabularData)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
|
||||
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;
|
||||
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_Boolean st; //szv#4:S4163:12Mar99 moved down
|
||||
Standard_Integer i;
|
||||
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
PR.ReadInteger(PR.Current(), "Number of Property values", nbProps); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
|
||||
PR.ReadInteger(PR.Current(), "Property type", propType); //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)
|
||||
@@ -66,93 +65,103 @@ void IGESDefs_ToolTabularData::ReadOwnParams
|
||||
|
||||
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);
|
||||
}
|
||||
{
|
||||
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
|
||||
"Type of independent variables",
|
||||
typesInd); // szv#4:S4163:12Mar99 `st=` not needed
|
||||
|
||||
PR.ReadInts(PR.CurrentList(nbIndeps),
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
"No. of values of independent variables", nbValuesInd); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
|
||||
for (i=1; i<=nbIndeps; i++)
|
||||
for (i = 1; i <= nbIndeps; i++)
|
||||
{
|
||||
Handle(TColStd_HArray1OfReal) tarr;
|
||||
Standard_Integer nb = nbValuesInd->Value(i), j;
|
||||
if (nb > 0)
|
||||
{
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
// ?? 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
|
||||
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;
|
||||
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 ++) {
|
||||
if (nbd > 0)
|
||||
somedeps = new TColStd_HArray1OfReal(1, nbd);
|
||||
for (i = 1; i <= nbd; i++)
|
||||
{
|
||||
Standard_Real treal;
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
PR.ReadReal(PR.Current(), "Value of dependent variable", treal); //szv#4:S4163:12Mar99 `st=` not needed
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
somedeps->SetValue(i, treal);
|
||||
}
|
||||
if (nbDeps > 0) valuesDep->SetValue(1,somedeps);
|
||||
else PR.AddWarning("Some Real remain while no dependent value is defined");
|
||||
if (nbDeps > 0)
|
||||
valuesDep->SetValue(1, somedeps);
|
||||
else
|
||||
PR.AddWarning("Some Real remain while no dependent value 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);
|
||||
} */
|
||||
/* 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 dependent values ...");
|
||||
// ?? a eclaircir
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
|
||||
ent->Init (nbProps, propType, typesInd, nbValuesInd, valuesInd, valuesDep);
|
||||
// ?? 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
|
||||
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();
|
||||
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++)
|
||||
for (i = 1; i <= nbIndeps; i++)
|
||||
IW.Send(ent->TypeOfIndependents(i));
|
||||
for (i=1; i<=nbIndeps; 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));
|
||||
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;
|
||||
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 <= deps->Length(); i++)
|
||||
IW.Send(deps->Value(i));
|
||||
/*
|
||||
for (i=1; i<=nbDeps; i++)
|
||||
for (j=1; j<= .. ->Value(i); j++)
|
||||
@@ -160,77 +169,74 @@ void IGESDefs_ToolTabularData::WriteOwnParams
|
||||
*/
|
||||
}
|
||||
|
||||
void IGESDefs_ToolTabularData::OwnShared
|
||||
(const Handle(IGESDefs_TabularData)& /* ent */, Interface_EntityIterator& /* iter */) const
|
||||
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
|
||||
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 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);
|
||||
}
|
||||
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);
|
||||
ent->Init(nbProps, propType, typesInd, nbValuesInd, valuesInd, valuesDep);
|
||||
}
|
||||
|
||||
IGESData_DirChecker IGESDefs_ToolTabularData::DirChecker
|
||||
(const Handle(IGESDefs_TabularData)& /* ent */ ) const
|
||||
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.Structure(IGESData_DefVoid);
|
||||
DC.LineFont(IGESData_DefVoid);
|
||||
DC.LineWeight(IGESData_DefVoid);
|
||||
DC.Color(IGESData_DefVoid);
|
||||
|
||||
DC.BlankStatusIgnored ();
|
||||
DC.UseFlagIgnored ();
|
||||
DC.HierarchyStatusIgnored ();
|
||||
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::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 */,
|
||||
Standard_OStream& S, const Standard_Integer level) const
|
||||
void IGESDefs_ToolTabularData::OwnDump(const Handle(IGESDefs_TabularData)& ent,
|
||||
const IGESData_IGESDumper& /* dumper */,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
Standard_Integer nbIndeps = ent->NbIndependents(); //szv#4:S4163:12Mar99 i unused
|
||||
Standard_Integer nbDeps = ent->NbDependents();
|
||||
Standard_Integer nbIndeps = ent->NbIndependents(); // szv#4:S4163:12Mar99 i unused
|
||||
Standard_Integer nbDeps = ent->NbDependents();
|
||||
|
||||
S << "IGESDefs_TabularData\n"
|
||||
<< "No. of property values : " << ent->NbPropertyValues() << "\n"
|
||||
@@ -238,23 +244,25 @@ void IGESDefs_ToolTabularData::OwnDump
|
||||
<< "No. of Dependent variables : " << nbDeps << "\n"
|
||||
<< "No. of Independent variables : " << nbIndeps << "\n"
|
||||
<< "Type of independent variables : ";
|
||||
IGESData_DumpVals(S,level,1, nbIndeps,ent->TypeOfIndependents);
|
||||
IGESData_DumpVals(S, level, 1, nbIndeps, ent->TypeOfIndependents);
|
||||
S << "\nNumber of values of independent variables : ";
|
||||
IGESData_DumpVals(S,level,1, nbIndeps,ent->NbValues);
|
||||
// ?? JAGGED ??
|
||||
IGESData_DumpVals(S, level, 1, nbIndeps, ent->NbValues);
|
||||
// ?? JAGGED ??
|
||||
S << std::endl << "Values of the independent variable : ";
|
||||
if (level < 5) S << " [ask level > 4]";
|
||||
else {
|
||||
for (Standard_Integer ind = 1; ind <= nbIndeps; ind ++) {
|
||||
if (level < 5)
|
||||
S << " [ask level > 4]";
|
||||
else
|
||||
{
|
||||
for (Standard_Integer ind = 1; ind <= nbIndeps; ind++)
|
||||
{
|
||||
S << std::endl << "[" << ind << "]:";
|
||||
Standard_Integer nbi = ent->NbValues(ind);
|
||||
for (Standard_Integer iv = 1; iv <= nbi; iv ++)
|
||||
S << " " << ent->IndependentValue(ind,iv);
|
||||
for (Standard_Integer iv = 1; iv <= nbi; iv++)
|
||||
S << " " << ent->IndependentValue(ind, iv);
|
||||
}
|
||||
}
|
||||
// IGESData_DumpVals(aSender,level,1, nbIndeps,ent->IndependentValue);
|
||||
// IGESData_DumpVals(aSender,level,1, nbIndeps,ent->IndependentValue);
|
||||
S << std::endl << "Values of the dependent variable : ";
|
||||
// IGESData_DumpVals(aSender,level,1, nbDeps,ent->DependentValue);
|
||||
S << " TO BE DONE"
|
||||
<< std::endl;
|
||||
// IGESData_DumpVals(aSender,level,1, nbDeps,ent->DependentValue);
|
||||
S << " TO BE DONE" << std::endl;
|
||||
}
|
||||
|
@@ -35,60 +35,50 @@ class IGESData_IGESDumper;
|
||||
|
||||
//! Tool to work on a TabularData. Called by various Modules
|
||||
//! (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
class IGESDefs_ToolTabularData
|
||||
class IGESDefs_ToolTabularData
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns a ToolTabularData, ready to work
|
||||
Standard_EXPORT IGESDefs_ToolTabularData();
|
||||
|
||||
|
||||
//! Reads own parameters from file. <PR> gives access to them,
|
||||
//! <IR> detains parameter types and values
|
||||
Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_TabularData)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Handle(IGESDefs_TabularData)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_TabularData)& ent, IGESData_IGESWriter& IW) const;
|
||||
|
||||
Standard_EXPORT void WriteOwnParams(const Handle(IGESDefs_TabularData)& ent,
|
||||
IGESData_IGESWriter& IW) const;
|
||||
|
||||
//! Lists the Entities shared by a TabularData <ent>, from
|
||||
//! its specific (own) parameters
|
||||
Standard_EXPORT void OwnShared (const Handle(IGESDefs_TabularData)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
Standard_EXPORT void OwnShared(const Handle(IGESDefs_TabularData)& ent,
|
||||
Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns specific DirChecker
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_TabularData)& ent) const;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker(const Handle(IGESDefs_TabularData)& ent) const;
|
||||
|
||||
//! Performs Specific Semantic Check
|
||||
Standard_EXPORT void OwnCheck (const Handle(IGESDefs_TabularData)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const;
|
||||
|
||||
Standard_EXPORT void OwnCheck(const Handle(IGESDefs_TabularData)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Copies Specific Parameters
|
||||
Standard_EXPORT void OwnCopy (const Handle(IGESDefs_TabularData)& entfrom, const Handle(IGESDefs_TabularData)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
Standard_EXPORT void OwnCopy(const Handle(IGESDefs_TabularData)& entfrom,
|
||||
const Handle(IGESDefs_TabularData)& entto,
|
||||
Interface_CopyTool& TC) const;
|
||||
|
||||
//! Dump of Specific Parameters
|
||||
Standard_EXPORT void OwnDump (const Handle(IGESDefs_TabularData)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void OwnDump(const Handle(IGESDefs_TabularData)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ToolTabularData_HeaderFile
|
||||
|
@@ -32,104 +32,105 @@
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
IGESDefs_ToolUnitsData::IGESDefs_ToolUnitsData () { }
|
||||
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
|
||||
|
||||
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;
|
||||
Standard_Integer nbval;
|
||||
Handle(Interface_HArray1OfHAsciiString) unitTypes;
|
||||
Handle(Interface_HArray1OfHAsciiString) unitValues;
|
||||
Handle(TColStd_HArray1OfReal) unitScales;
|
||||
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");
|
||||
{
|
||||
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())
|
||||
if (!unitTypes.IsNull())
|
||||
for (Standard_Integer i = 1; i <= nbval; i++)
|
||||
{
|
||||
Handle(TCollection_HAsciiString) unitType;
|
||||
Handle(TCollection_HAsciiString) unitValue;
|
||||
Standard_Real unitScale;
|
||||
{
|
||||
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(), "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.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);
|
||||
}
|
||||
// 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);
|
||||
DirChecker(ent).CheckTypeAndForm(PR.CCheck(), ent);
|
||||
ent->Init(unitTypes, unitValues, unitScales);
|
||||
}
|
||||
|
||||
void IGESDefs_ToolUnitsData::WriteOwnParams
|
||||
(const Handle(IGESDefs_UnitsData)& ent, IGESData_IGESWriter& IW) const
|
||||
{
|
||||
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));
|
||||
}
|
||||
{
|
||||
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::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
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
}
|
||||
{
|
||||
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);
|
||||
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);
|
||||
@@ -141,37 +142,38 @@ IGESData_DirChecker IGESDefs_ToolUnitsData::DirChecker
|
||||
return DC;
|
||||
}
|
||||
|
||||
void IGESDefs_ToolUnitsData::OwnCheck
|
||||
(const Handle(IGESDefs_UnitsData)& /* ent */,
|
||||
const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
|
||||
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 */,
|
||||
Standard_OStream& S, const Standard_Integer level) const
|
||||
{
|
||||
void IGESDefs_ToolUnitsData::OwnDump(const Handle(IGESDefs_UnitsData)& ent,
|
||||
const IGESData_IGESDumper& /* dumper */,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer level) const
|
||||
{
|
||||
S << "IGESDefs_UnitsData\n"
|
||||
<< "Number of Units : " << ent->NbUnits() << "\n"
|
||||
<< "Type of Unit :\n"
|
||||
<< "Value of Unit :\n"
|
||||
<< "Scale Factor :\n";
|
||||
IGESData_DumpStrings(S,-level,1, ent->NbUnits(),ent->UnitType);
|
||||
IGESData_DumpStrings(S, -level, 1, ent->NbUnits(), ent->UnitType);
|
||||
S << "\n";
|
||||
if (level > 4)
|
||||
{
|
||||
S << "Details of the Units\n";
|
||||
Standard_Integer upper = ent->NbUnits();
|
||||
for (Standard_Integer i = 1; i <= upper; i++)
|
||||
{
|
||||
S << "Details of the Units\n";
|
||||
Standard_Integer upper = ent->NbUnits();
|
||||
for (Standard_Integer i = 1; i <= upper; i++)
|
||||
{
|
||||
S << "[" << i << "] Type : ";
|
||||
IGESData_DumpString(S,ent->UnitType(i));
|
||||
S << "\n"
|
||||
<< " Value : ";
|
||||
IGESData_DumpString(S,ent->UnitValue(i));
|
||||
S << "\n"
|
||||
<< " ScaleFactor: " << ent->ScaleFactor(i) << "\n";
|
||||
}
|
||||
S << "[" << i << "] Type : ";
|
||||
IGESData_DumpString(S, ent->UnitType(i));
|
||||
S << "\n"
|
||||
<< " Value : ";
|
||||
IGESData_DumpString(S, ent->UnitValue(i));
|
||||
S << "\n"
|
||||
<< " ScaleFactor: " << ent->ScaleFactor(i) << "\n";
|
||||
}
|
||||
}
|
||||
S << std::endl;
|
||||
}
|
||||
|
@@ -35,60 +35,50 @@ class IGESData_IGESDumper;
|
||||
|
||||
//! Tool to work on a UnitsData. Called by various Modules
|
||||
//! (ReadWriteModule, GeneralModule, SpecificModule)
|
||||
class IGESDefs_ToolUnitsData
|
||||
class IGESDefs_ToolUnitsData
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns a ToolUnitsData, ready to work
|
||||
Standard_EXPORT IGESDefs_ToolUnitsData();
|
||||
|
||||
|
||||
//! Reads own parameters from file. <PR> gives access to them,
|
||||
//! <IR> detains parameter types and values
|
||||
Standard_EXPORT void ReadOwnParams (const Handle(IGESDefs_UnitsData)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
|
||||
|
||||
Standard_EXPORT void ReadOwnParams(const Handle(IGESDefs_UnitsData)& ent,
|
||||
const Handle(IGESData_IGESReaderData)& IR,
|
||||
IGESData_ParamReader& PR) const;
|
||||
|
||||
//! Writes own parameters to IGESWriter
|
||||
Standard_EXPORT void WriteOwnParams (const Handle(IGESDefs_UnitsData)& ent, IGESData_IGESWriter& IW) const;
|
||||
|
||||
Standard_EXPORT void WriteOwnParams(const Handle(IGESDefs_UnitsData)& ent,
|
||||
IGESData_IGESWriter& IW) const;
|
||||
|
||||
//! Lists the Entities shared by a UnitsData <ent>, from
|
||||
//! its specific (own) parameters
|
||||
Standard_EXPORT void OwnShared (const Handle(IGESDefs_UnitsData)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
Standard_EXPORT void OwnShared(const Handle(IGESDefs_UnitsData)& ent,
|
||||
Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns specific DirChecker
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker (const Handle(IGESDefs_UnitsData)& ent) const;
|
||||
|
||||
Standard_EXPORT IGESData_DirChecker DirChecker(const Handle(IGESDefs_UnitsData)& ent) const;
|
||||
|
||||
//! Performs Specific Semantic Check
|
||||
Standard_EXPORT void OwnCheck (const Handle(IGESDefs_UnitsData)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const;
|
||||
|
||||
Standard_EXPORT void OwnCheck(const Handle(IGESDefs_UnitsData)& ent,
|
||||
const Interface_ShareTool& shares,
|
||||
Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Copies Specific Parameters
|
||||
Standard_EXPORT void OwnCopy (const Handle(IGESDefs_UnitsData)& entfrom, const Handle(IGESDefs_UnitsData)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
Standard_EXPORT void OwnCopy(const Handle(IGESDefs_UnitsData)& entfrom,
|
||||
const Handle(IGESDefs_UnitsData)& entto,
|
||||
Interface_CopyTool& TC) const;
|
||||
|
||||
//! Dump of Specific Parameters
|
||||
Standard_EXPORT void OwnDump (const Handle(IGESDefs_UnitsData)& ent, const IGESData_IGESDumper& dumper, Standard_OStream& S, const Standard_Integer own) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void OwnDump(const Handle(IGESDefs_UnitsData)& ent,
|
||||
const IGESData_IGESDumper& dumper,
|
||||
Standard_OStream& S,
|
||||
const Standard_Integer own) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_ToolUnitsData_HeaderFile
|
||||
|
@@ -21,46 +21,40 @@
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_UnitsData,IGESData_IGESEntity)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_UnitsData, IGESData_IGESEntity)
|
||||
|
||||
IGESDefs_UnitsData::IGESDefs_UnitsData () { }
|
||||
IGESDefs_UnitsData::IGESDefs_UnitsData() {}
|
||||
|
||||
|
||||
void IGESDefs_UnitsData::Init
|
||||
(const Handle(Interface_HArray1OfHAsciiString)& unitTypes,
|
||||
const Handle(Interface_HArray1OfHAsciiString)& unitValues,
|
||||
const Handle(TColStd_HArray1OfReal)& unitScales)
|
||||
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) )
|
||||
if (unitTypes->Lower() != 1 || (unitValues->Lower() != 1 || unitValues->Length() != length)
|
||||
|| (unitScales->Lower() != 1 || unitScales->Length() != length))
|
||||
throw Standard_DimensionMismatch("IGESDefs_UnitsData : Init");
|
||||
theUnitTypes = unitTypes;
|
||||
theUnitValues = unitValues;
|
||||
theUnitScales = unitScales;
|
||||
InitTypeAndForm(316,0);
|
||||
theUnitTypes = unitTypes;
|
||||
theUnitValues = unitValues;
|
||||
theUnitScales = unitScales;
|
||||
InitTypeAndForm(316, 0);
|
||||
}
|
||||
|
||||
Standard_Integer IGESDefs_UnitsData::NbUnits () const
|
||||
Standard_Integer IGESDefs_UnitsData::NbUnits() const
|
||||
{
|
||||
return theUnitTypes->Length();
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) IGESDefs_UnitsData::UnitType
|
||||
(const Standard_Integer UnitNum) const
|
||||
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
|
||||
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
|
||||
Standard_Real IGESDefs_UnitsData::ScaleFactor(const Standard_Integer UnitNum) const
|
||||
{
|
||||
return theUnitScales->Value(UnitNum);
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#include <Standard_Real.hxx>
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
|
||||
class IGESDefs_UnitsData;
|
||||
DEFINE_STANDARD_HANDLE(IGESDefs_UnitsData, IGESData_IGESEntity)
|
||||
|
||||
@@ -37,10 +36,8 @@ class IGESDefs_UnitsData : public IGESData_IGESEntity
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT IGESDefs_UnitsData();
|
||||
|
||||
|
||||
//! This method is used to set the fields of the class
|
||||
//! UnitsData
|
||||
//! - unitTypes : Types of the units being defined
|
||||
@@ -48,48 +45,33 @@ public:
|
||||
//! - unitScales : Multiplicative Scale Factors
|
||||
//! raises exception if lengths of unitTypes, unitValues and
|
||||
//! unitScale are not same
|
||||
Standard_EXPORT void Init (const Handle(Interface_HArray1OfHAsciiString)& unitTypes, const Handle(Interface_HArray1OfHAsciiString)& unitValues, const Handle(TColStd_HArray1OfReal)& unitScales);
|
||||
|
||||
Standard_EXPORT void Init(const Handle(Interface_HArray1OfHAsciiString)& unitTypes,
|
||||
const Handle(Interface_HArray1OfHAsciiString)& unitValues,
|
||||
const Handle(TColStd_HArray1OfReal)& unitScales);
|
||||
|
||||
//! returns the Number of units defined by this entity
|
||||
Standard_EXPORT Standard_Integer NbUnits() const;
|
||||
|
||||
|
||||
//! returns the Type of the UnitNum'th unit being defined
|
||||
//! raises exception if UnitNum <= 0 or UnitNum > NbUnits()
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) UnitType (const Standard_Integer UnitNum) const;
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) UnitType(const Standard_Integer UnitNum) const;
|
||||
|
||||
//! returns the Units of the UnitNum'th unit being defined
|
||||
//! raises exception if UnitNum <= 0 or UnitNum > NbUnits()
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) UnitValue (const Standard_Integer UnitNum) const;
|
||||
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) UnitValue(const Standard_Integer UnitNum) const;
|
||||
|
||||
//! returns the multiplicative scale factor to be applied to the
|
||||
//! UnitNum'th unit being defined
|
||||
//! raises exception if UnitNum <= 0 or UnitNum > NbUnits()
|
||||
Standard_EXPORT Standard_Real ScaleFactor (const Standard_Integer UnitNum) const;
|
||||
Standard_EXPORT Standard_Real ScaleFactor(const Standard_Integer UnitNum) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_UnitsData,IGESData_IGESEntity)
|
||||
DEFINE_STANDARD_RTTIEXT(IGESDefs_UnitsData, IGESData_IGESEntity)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Interface_HArray1OfHAsciiString) theUnitTypes;
|
||||
Handle(Interface_HArray1OfHAsciiString) theUnitValues;
|
||||
Handle(TColStd_HArray1OfReal) theUnitScales;
|
||||
|
||||
|
||||
Handle(TColStd_HArray1OfReal) theUnitScales;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESDefs_UnitsData_HeaderFile
|
||||
|
Reference in New Issue
Block a user