From: dpasukhi Date: Thu, 9 Mar 2023 17:36:26 +0000 (+0000) Subject: // on progress X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=7bf8cf9fa5a8d4f4c1417179194f4a648c4796d9;p=occt.git // on progress --- diff --git a/src/DE/DE_DataModel.cxx b/src/DE/DE_DataModel.cxx index 184743ce32..355e315857 100644 --- a/src/DE/DE_DataModel.cxx +++ b/src/DE/DE_DataModel.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -32,7 +32,7 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(Interface_InterfaceModel, Standard_Transient) +IMPLEMENT_STANDARD_RTTIEXT(DE_DataModel, Standard_Transient) // Un Modele d`Interface est un ensemble ferme d`Entites d`interface : chacune // est dans un seul modele a la fois; elle y a un numero (Number) qui permet de @@ -57,11 +57,11 @@ static const Handle(Interface_Check)& nulch() //======================================================================= -//function : Interface_InterfaceModel +//function : DE_DataModel //purpose : //======================================================================= -Interface_InterfaceModel::Interface_InterfaceModel () +DE_DataModel::DE_DataModel () : haschecksem (Standard_False), isdispatch (Standard_False) { thecheckstx = new Interface_Check; @@ -74,7 +74,7 @@ Interface_InterfaceModel::Interface_InterfaceModel () //purpose : //======================================================================= -void Interface_InterfaceModel::Destroy () // on fait un mimumum +void DE_DataModel::Destroy () // on fait un mimumum { // Moins que Clear que, lui, est adapte a chaque norme ClearEntities(); @@ -89,7 +89,7 @@ void Interface_InterfaceModel::Destroy () // on fait un mimumum //purpose : //======================================================================= -void Interface_InterfaceModel::SetProtocol(const Handle(Interface_Protocol)& proto) +void DE_DataModel::SetProtocol(const Handle(Interface_Protocol)& proto) { thegtool = new Interface_GTool(proto); } @@ -100,7 +100,7 @@ void Interface_InterfaceModel::SetProtocol(const Handle(Interface_Protocol)& pro //purpose : //======================================================================= -Handle(Interface_Protocol) Interface_InterfaceModel::Protocol () const +Handle(Interface_Protocol) DE_DataModel::Protocol () const { Handle(Interface_Protocol) proto; if (!thegtool.IsNull()) return thegtool->Protocol(); @@ -113,7 +113,7 @@ Handle(Interface_Protocol) Interface_InterfaceModel::Protocol () const //purpose : //======================================================================= -void Interface_InterfaceModel::SetGTool(const Handle(Interface_GTool)& gtool) +void DE_DataModel::SetGTool(const Handle(Interface_GTool)& gtool) { thegtool = gtool; } @@ -124,7 +124,7 @@ void Interface_InterfaceModel::SetGTool(const Handle(Interface_GTool)& gtool) //purpose : //======================================================================= -Handle(Interface_GTool) Interface_InterfaceModel::GTool () const +Handle(Interface_GTool) DE_DataModel::GTool () const { return thegtool; } @@ -135,7 +135,7 @@ Handle(Interface_GTool) Interface_InterfaceModel::GTool () const //purpose : //======================================================================= -void Interface_InterfaceModel::Clear () +void DE_DataModel::Clear () { ClearEntities(); thecheckstx->Clear(); @@ -151,7 +151,7 @@ void Interface_InterfaceModel::Clear () //purpose : //======================================================================= -Standard_Boolean& Interface_InterfaceModel::DispatchStatus () +Standard_Boolean& DE_DataModel::DispatchStatus () { return isdispatch; } @@ -162,7 +162,7 @@ Standard_Boolean& Interface_InterfaceModel::DispatchStatus () //purpose : //======================================================================= -void Interface_InterfaceModel::ClearEntities () +void DE_DataModel::ClearEntities () { thereports.Clear(); therepch.Clear(); @@ -192,7 +192,7 @@ void Interface_InterfaceModel::ClearEntities () //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::NbEntities () const +Standard_Integer DE_DataModel::NbEntities () const { return theentities.Extent(); } @@ -203,7 +203,7 @@ Standard_Integer Interface_InterfaceModel::NbEntities () const //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::Contains +Standard_Boolean DE_DataModel::Contains (const Handle(Standard_Transient)& anentity) const { if (theentities.Contains(anentity)) return Standard_True; @@ -219,7 +219,7 @@ Standard_Boolean Interface_InterfaceModel::Contains //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::Number +Standard_Integer DE_DataModel::Number (const Handle(Standard_Transient)& anentity) const { if (anentity.IsNull()) return 0; @@ -234,7 +234,7 @@ Standard_Integer Interface_InterfaceModel::Number } /* -Standard_Integer Interface_InterfaceModel::DENumber +Standard_Integer DE_DataModel::DENumber (const Handle(Standard_Transient)& anentity) const { if (anentity.IsNull()) return 0; @@ -257,7 +257,7 @@ Standard_Integer Interface_InterfaceModel::DENumber //purpose : //======================================================================= -const Handle(Standard_Transient)& Interface_InterfaceModel::Value +const Handle(Standard_Transient)& DE_DataModel::Value (const Standard_Integer num) const { return theentities.FindKey(num); @@ -269,7 +269,7 @@ const Handle(Standard_Transient)& Interface_InterfaceModel::Value //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::NbTypes +Standard_Integer DE_DataModel::NbTypes (const Handle(Standard_Transient)& ent) const { if (Protocol().IsNull()) return 1; @@ -282,7 +282,7 @@ Standard_Integer Interface_InterfaceModel::NbTypes //purpose : //======================================================================= -Handle(Standard_Type) Interface_InterfaceModel::Type +Handle(Standard_Type) DE_DataModel::Type (const Handle(Standard_Transient)& ent, const Standard_Integer nt) const { if (Protocol().IsNull()) return ent->DynamicType(); @@ -295,13 +295,13 @@ Handle(Standard_Type) Interface_InterfaceModel::Type //purpose : //======================================================================= -Standard_CString Interface_InterfaceModel::TypeName +Standard_CString DE_DataModel::TypeName (const Handle(Standard_Transient)& ent, const Standard_Boolean complet) const { if (!thegtool.IsNull()) return thegtool->SignValue (ent,this); Standard_CString tn = ent->DynamicType()->Name(); if (complet) return tn; - return Interface_InterfaceModel::ClassName(tn); + return DE_DataModel::ClassName(tn); } @@ -310,7 +310,7 @@ Standard_CString Interface_InterfaceModel::TypeName //purpose : //======================================================================= -Standard_CString Interface_InterfaceModel::ClassName(const Standard_CString typnam) +Standard_CString DE_DataModel::ClassName(const Standard_CString typnam) { return Interface_SignType::ClassName (typnam); } @@ -321,7 +321,7 @@ Standard_CString Interface_InterfaceModel::ClassName(const Standard_CString typn //purpose : //======================================================================= -Interface_DataState Interface_InterfaceModel::EntityState +Interface_DataState DE_DataModel::EntityState (const Standard_Integer num) const { Handle(Interface_ReportEntity) rep; @@ -349,7 +349,7 @@ Interface_DataState Interface_InterfaceModel::EntityState //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::IsReportEntity +Standard_Boolean DE_DataModel::IsReportEntity (const Standard_Integer num, const Standard_Boolean semantic) const { return (semantic ? therepch.IsBound(num) : thereports.IsBound(num)); @@ -361,7 +361,7 @@ Standard_Boolean Interface_InterfaceModel::IsReportEntity //purpose : //======================================================================= -Handle(Interface_ReportEntity) Interface_InterfaceModel::ReportEntity +Handle(Interface_ReportEntity) DE_DataModel::ReportEntity (const Standard_Integer num, const Standard_Boolean semantic) const { Handle(Interface_ReportEntity) rep; @@ -377,7 +377,7 @@ Handle(Interface_ReportEntity) Interface_InterfaceModel::ReportEntity //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::IsErrorEntity +Standard_Boolean DE_DataModel::IsErrorEntity (const Standard_Integer num) const { Handle(Interface_ReportEntity) rep = ReportEntity(num); @@ -391,7 +391,7 @@ Standard_Boolean Interface_InterfaceModel::IsErrorEntity //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::IsRedefinedContent +Standard_Boolean DE_DataModel::IsRedefinedContent (const Standard_Integer num) const { Handle(Interface_ReportEntity) rep = ReportEntity(num); @@ -405,7 +405,7 @@ Standard_Boolean Interface_InterfaceModel::IsRedefinedContent //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::ClearReportEntity +Standard_Boolean DE_DataModel::ClearReportEntity (const Standard_Integer num) { if (!thereports.IsBound(num)) return Standard_False; @@ -419,7 +419,7 @@ Standard_Boolean Interface_InterfaceModel::ClearReportEntity //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::SetReportEntity +Standard_Boolean DE_DataModel::SetReportEntity (const Standard_Integer num, const Handle(Interface_ReportEntity)& rep) { Standard_Integer nm = num; @@ -450,7 +450,7 @@ Standard_Boolean Interface_InterfaceModel::SetReportEntity //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::AddReportEntity +Standard_Boolean DE_DataModel::AddReportEntity (const Handle(Interface_ReportEntity)& rep, const Standard_Boolean semantic) { if (rep.IsNull()) return Standard_False; @@ -468,7 +468,7 @@ Standard_Boolean Interface_InterfaceModel::AddReportEntity //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::IsUnknownEntity +Standard_Boolean DE_DataModel::IsUnknownEntity (const Standard_Integer num) const { Handle(Interface_ReportEntity) rep = ReportEntity(num); @@ -485,7 +485,7 @@ Standard_Boolean Interface_InterfaceModel::IsUnknownEntity //purpose : //======================================================================= -void Interface_InterfaceModel::FillSemanticChecks +void DE_DataModel::FillSemanticChecks (const Interface_CheckIterator& checks, const Standard_Boolean clear) { if (!checks.Model().IsNull()) { @@ -517,7 +517,7 @@ void Interface_InterfaceModel::FillSemanticChecks //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::HasSemanticChecks () const +Standard_Boolean DE_DataModel::HasSemanticChecks () const { return haschecksem; } @@ -528,7 +528,7 @@ Standard_Boolean Interface_InterfaceModel::HasSemanticChecks () const //purpose : //======================================================================= -const Handle(Interface_Check)& Interface_InterfaceModel::Check +const Handle(Interface_Check)& DE_DataModel::Check (const Standard_Integer num, const Standard_Boolean syntactic) const { if (num == 0) { @@ -554,7 +554,7 @@ const Handle(Interface_Check)& Interface_InterfaceModel::Check //purpose : //======================================================================= -void Interface_InterfaceModel::Reservate (const Standard_Integer nbent) +void DE_DataModel::Reservate (const Standard_Integer nbent) { if (nbent > theentities.NbBuckets()) theentities.ReSize (nbent); if (nbent < -thereports.NbBuckets()) thereports.ReSize (-nbent); @@ -566,7 +566,7 @@ void Interface_InterfaceModel::Reservate (const Standard_Integer nbent) //purpose : //======================================================================= -void Interface_InterfaceModel::AddEntity(const Handle(Standard_Transient)& anentity) +void DE_DataModel::AddEntity(const Handle(Standard_Transient)& anentity) { //Standard_Integer newnum; svv #2 if (!anentity->IsKind(typerep())) theentities.Add(anentity); @@ -591,7 +591,7 @@ void Interface_InterfaceModel::AddEntity(const Handle(Standard_Transient)& anent //purpose : //======================================================================= -void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& anent, +void DE_DataModel::AddWithRefs(const Handle(Standard_Transient)& anent, const Handle(Interface_Protocol)& proto, const Standard_Integer level, const Standard_Boolean listall) @@ -611,7 +611,7 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane //purpose : //======================================================================= -void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& anent, +void DE_DataModel::AddWithRefs(const Handle(Standard_Transient)& anent, const Standard_Integer level, const Standard_Boolean listall) { @@ -626,7 +626,7 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane //purpose : //======================================================================= -void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& anent, +void DE_DataModel::AddWithRefs(const Handle(Standard_Transient)& anent, const Interface_GeneralLib& lib, const Standard_Integer level, const Standard_Boolean listall) @@ -657,7 +657,7 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane //purpose : //======================================================================= -void Interface_InterfaceModel::ReplaceEntity(const Standard_Integer nument, +void DE_DataModel::ReplaceEntity(const Standard_Integer nument, const Handle(Standard_Transient)& anent) { theentities.Substitute(nument,anent); @@ -673,7 +673,7 @@ void Interface_InterfaceModel::ReplaceEntity(const Standard_Integer nument, //purpose : //======================================================================= -void Interface_InterfaceModel::ReverseOrders (const Standard_Integer after) +void DE_DataModel::ReverseOrders (const Standard_Integer after) { Standard_Integer nb = NbEntities(); //Standard_Integer num; svv #2 if (nb < 2 || after >= nb) return; @@ -706,7 +706,7 @@ void Interface_InterfaceModel::ReverseOrders (const Standard_Integer after) //purpose : //======================================================================= -void Interface_InterfaceModel::ChangeOrder(const Standard_Integer oldnum, +void DE_DataModel::ChangeOrder(const Standard_Integer oldnum, const Standard_Integer newnum, const Standard_Integer cnt) //szv#4:S4163:12Mar99 `count` hid one from this { @@ -751,7 +751,7 @@ void Interface_InterfaceModel::ChangeOrder(const Standard_Integer oldnum, //purpose : //======================================================================= -void Interface_InterfaceModel::GetFromTransfer +void DE_DataModel::GetFromTransfer (const Interface_EntityIterator& aniter) { theentities.Clear(); theentities.ReSize (aniter.NbEntities()); @@ -769,7 +769,7 @@ void Interface_InterfaceModel::GetFromTransfer //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::SetCategoryNumber +Standard_Boolean DE_DataModel::SetCategoryNumber (const Standard_Integer num, const Standard_Integer val) { Standard_Integer i,nb = NbEntities(); @@ -792,7 +792,7 @@ Standard_Boolean Interface_InterfaceModel::SetCategoryNumber //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::CategoryNumber +Standard_Integer DE_DataModel::CategoryNumber (const Standard_Integer num) const { if (thecategory.IsNull()) return 0; @@ -807,7 +807,7 @@ Standard_Integer Interface_InterfaceModel::CategoryNumber //purpose : //======================================================================= -void Interface_InterfaceModel::FillIterator(Interface_EntityIterator& iter) const +void DE_DataModel::FillIterator(Interface_EntityIterator& iter) const { Standard_Integer nb = NbEntities(); for (Standard_Integer i = 1; i <= nb; i ++) @@ -820,7 +820,7 @@ void Interface_InterfaceModel::FillIterator(Interface_EntityIterator& iter) cons //purpose : //======================================================================= -Interface_EntityIterator Interface_InterfaceModel::Entities () const +Interface_EntityIterator DE_DataModel::Entities () const { Interface_EntityIterator iter; FillIterator(iter); @@ -833,7 +833,7 @@ Interface_EntityIterator Interface_InterfaceModel::Entities () const //purpose : //======================================================================= -Interface_EntityIterator Interface_InterfaceModel::Reports +Interface_EntityIterator DE_DataModel::Reports (const Standard_Boolean semantic) const { Interface_EntityIterator iter; @@ -853,7 +853,7 @@ Interface_EntityIterator Interface_InterfaceModel::Reports //purpose : //======================================================================= -Interface_EntityIterator Interface_InterfaceModel::Redefineds () const +Interface_EntityIterator DE_DataModel::Redefineds () const { Interface_EntityIterator iter; TColStd_DataMapIteratorOfDataMapOfIntegerTransient itmap (thereports); @@ -876,7 +876,7 @@ Interface_EntityIterator Interface_InterfaceModel::Redefineds () const //purpose : //======================================================================= -const Handle(Interface_Check)& Interface_InterfaceModel::GlobalCheck +const Handle(Interface_Check)& DE_DataModel::GlobalCheck (const Standard_Boolean syntactic) const { if (syntactic) return thecheckstx; @@ -889,7 +889,7 @@ const Handle(Interface_Check)& Interface_InterfaceModel::GlobalCheck //purpose : //======================================================================= -void Interface_InterfaceModel::SetGlobalCheck(const Handle(Interface_Check)& ach) +void DE_DataModel::SetGlobalCheck(const Handle(Interface_Check)& ach) { thecheckstx = ach; } @@ -900,7 +900,7 @@ void Interface_InterfaceModel::SetGlobalCheck(const Handle(Interface_Check)& ach //purpose : //======================================================================= -void Interface_InterfaceModel::VerifyCheck (Handle(Interface_Check)& /*ach*/) const +void DE_DataModel::VerifyCheck (Handle(Interface_Check)& /*ach*/) const { } @@ -910,7 +910,7 @@ void Interface_InterfaceModel::VerifyCheck (Handle(Interface_Check)& /*ach*/) co //purpose : //======================================================================= -void Interface_InterfaceModel::Print(const Handle(Standard_Transient)& ent, +void DE_DataModel::Print(const Handle(Standard_Transient)& ent, Standard_OStream& S, const Standard_Integer mode) const { @@ -932,7 +932,7 @@ void Interface_InterfaceModel::Print(const Handle(Standard_Transient)& ent, //purpose : //======================================================================= -void Interface_InterfaceModel::PrintToLog(const Handle(Standard_Transient)& ent, +void DE_DataModel::PrintToLog(const Handle(Standard_Transient)& ent, Standard_OStream& S) const { PrintLabel (ent,S); @@ -947,7 +947,7 @@ void Interface_InterfaceModel::PrintToLog(const Handle(Standard_Transient)& ent, //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::NextNumberForLabel +Standard_Integer DE_DataModel::NextNumberForLabel (const Standard_CString label, const Standard_Integer fromnum, const Standard_Boolean exact) const { @@ -983,7 +983,7 @@ Standard_Integer Interface_InterfaceModel::NextNumberForLabel //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::HasTemplate +Standard_Boolean DE_DataModel::HasTemplate (const Standard_CString name) { return atemp.IsBound(name); @@ -995,12 +995,12 @@ Standard_Boolean Interface_InterfaceModel::HasTemplate //purpose : //======================================================================= -Handle(Interface_InterfaceModel) Interface_InterfaceModel::Template +Handle(DE_DataModel) DE_DataModel::Template (const Standard_CString name) { - Handle(Interface_InterfaceModel) model,newmod; + Handle(DE_DataModel) model,newmod; if (!HasTemplate(name)) return model; - model = Handle(Interface_InterfaceModel)::DownCast(atemp.ChangeFind(name)); + model = Handle(DE_DataModel)::DownCast(atemp.ChangeFind(name)); newmod = model->NewEmptyModel(); newmod->GetFromAnother (model); return newmod; @@ -1012,8 +1012,8 @@ Handle(Interface_InterfaceModel) Interface_InterfaceModel::Template //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::SetTemplate - (const Standard_CString name, const Handle(Interface_InterfaceModel)& model) +Standard_Boolean DE_DataModel::SetTemplate + (const Standard_CString name, const Handle(DE_DataModel)& model) { return atemp.Bind(name, model); } @@ -1024,7 +1024,7 @@ Standard_Boolean Interface_InterfaceModel::SetTemplate //purpose : //======================================================================= -Handle(TColStd_HSequenceOfHAsciiString) Interface_InterfaceModel::ListTemplates () +Handle(TColStd_HSequenceOfHAsciiString) DE_DataModel::ListTemplates () { Handle(TColStd_HSequenceOfHAsciiString) list = new TColStd_HSequenceOfHAsciiString(); diff --git a/src/DE/DE_DataModel.hxx b/src/DE/DE_DataModel.hxx index 4cec14469e..0a0d994a4e 100644 --- a/src/DE/DE_DataModel.hxx +++ b/src/DE/DE_DataModel.hxx @@ -13,30 +13,24 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _Interface_InterfaceModel_HeaderFile -#define _Interface_InterfaceModel_HeaderFile +#ifndef _DE_DataModel_HeaderFile +#define _DE_DataModel_HeaderFile #include #include +#include +#include +#include +#include +#include #include #include #include #include -#include #include -class Interface_Check; -class TCollection_HAsciiString; -class Interface_GTool; -class Interface_Protocol; -class Interface_ReportEntity; -class Interface_CheckIterator; -class Interface_GeneralLib; -class Interface_EntityIterator; - -class Interface_InterfaceModel; -DEFINE_STANDARD_HANDLE(Interface_InterfaceModel, Standard_Transient) +class TCollection_HAsciiString; //! Defines an (Indexed) Set of data corresponding to a complete //! Transfer by a File Interface, i.e. File Header and Transient @@ -64,70 +58,50 @@ DEFINE_STANDARD_HANDLE(Interface_InterfaceModel, Standard_Transient) //! under another name). //! //! See also Graph, ShareTool, CheckTool for more -class Interface_InterfaceModel : public Standard_Transient +class DE_DataModel : public Standard_Transient { public: - - //! Clears the list of entities (service WhenDelete) + + //! Defines empty InterfaceModel, ready to be filled + Standard_EXPORT DE_DataModel(); + + //! Clear Standard_EXPORT void Destroy(); -~Interface_InterfaceModel() -{ - Destroy(); -} - - //! Sets a Protocol for this Model - //! It is also set by a call to AddWithRefs with Protocol - //! It is used for : DumpHeader (as required), ClearEntities ... - Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto); - - //! Returns the Protocol which has been set by SetProtocol, or - //! AddWithRefs with Protocol - Standard_EXPORT virtual Handle(Interface_Protocol) Protocol() const; - - //! Sets a GTool for this model, which already defines a Protocol - Standard_EXPORT void SetGTool (const Handle(Interface_GTool)& gtool); - - //! Returns the GTool, set by SetProtocol or by SetGTool - Standard_EXPORT Handle(Interface_GTool) GTool() const; - - //! Returns the Dispatch Status, either for get or set - //! A Model which is produced from Dispatch may share entities - //! with the original (according to the Protocol), hence these - //! non-copied entities should not be deleted - Standard_EXPORT Standard_Boolean& DispatchStatus(); - + + virtual ~DE_DataModel() { Destroy(); } + //! Erases contained data; used when a Model is copied to others : //! the new copied ones begin from clear //! Clear calls specific method ClearHeader (see below) Standard_EXPORT virtual void Clear(); - + //! Clears the entities; uses the general service WhenDelete, in //! addition to the standard Memory Manager; can be redefined Standard_EXPORT virtual void ClearEntities(); - + //! Erases information about labels, if any : specific to each //! norm - Standard_EXPORT virtual void ClearLabels() = 0; - + Standard_EXPORT virtual void ClearLabels(); + //! Clears Model's header : specific to each norm - Standard_EXPORT virtual void ClearHeader() = 0; - + Standard_EXPORT virtual void ClearHeader(); + //! Returns count of contained Entities Standard_EXPORT Standard_Integer NbEntities() const; - + //! Returns True if a Model contains an Entity (for a ReportEntity, //! looks for the ReportEntity itself AND its Concerned Entity) - Standard_EXPORT Standard_Boolean Contains (const Handle(Standard_Transient)& anentity) const; - + Standard_EXPORT Standard_Boolean Contains(const Handle(Standard_Transient)& anentity) const; + //! Returns the Number of an Entity in the Model if it contains it. //! Else returns 0. For a ReportEntity, looks at Concerned Entity. //! Returns the Directory entry Number of an Entity in //! the Model if it contains it. Else returns 0. For a //! ReportEntity, looks at Concerned Entity. - Standard_EXPORT Standard_Integer Number (const Handle(Standard_Transient)& anentity) const; - + Standard_EXPORT Standard_Integer Number(const Handle(Standard_Transient)& anentity) const; + //! Returns an Entity identified by its number in the Model //! Each sub-class of InterfaceModel can define its own method //! Entity to return its specific class of Entity (e.g. for VDA, @@ -135,31 +109,33 @@ public: //! Remark : For a Reported Entity, (Erroneous, Corrected, Unknown), this //! method returns this Reported Entity. //! See ReportEntity for other questions. - Standard_EXPORT const Handle(Standard_Transient)& Value (const Standard_Integer num) const; - + Standard_EXPORT const Handle(Standard_Transient)& Value(const Standard_Integer num) const; + //! Returns the count of DISTINCT types under which an entity may //! be processed. Defined by the Protocol, which gives default as //! 1 (dynamic Type). - Standard_EXPORT Standard_Integer NbTypes (const Handle(Standard_Transient)& ent) const; - + Standard_EXPORT Standard_Integer NbTypes(const Handle(Standard_Transient)& ent) const; + //! Returns a type, given its rank : defined by the Protocol //! (by default, the first one) - Standard_EXPORT Handle(Standard_Type) Type (const Handle(Standard_Transient)& ent, const Standard_Integer num = 1) const; - + Standard_EXPORT Handle(Standard_Type) Type(const Handle(Standard_Transient)& ent, + const Standard_Integer num = 1) const; + //! Returns the type name of an entity, from the list of types //! (one or more ...) //! True (D) gives the complete type, else packages are //! removed //! WARNING : buffered, to be immediately copied or printed - Standard_EXPORT Standard_CString TypeName (const Handle(Standard_Transient)& ent, const Standard_Boolean complete = Standard_True) const; - + Standard_EXPORT Standard_CString TypeName(const Handle(Standard_Transient)& ent, + const Standard_Boolean complete = Standard_True) const; + //! From a CDL Type Name, returns the Class part (package dropped) //! WARNING : buffered, to be immediately copied or printed - Standard_EXPORT static Standard_CString ClassName (const Standard_CString typnam); - + Standard_EXPORT static Standard_CString ClassName(const Standard_CString typnam); + //! Returns the State of an entity, given its number - Standard_EXPORT Interface_DataState EntityState (const Standard_Integer num) const; - + Standard_EXPORT Interface_DataState EntityState(const Standard_Integer num) const; + //! Returns True if identifies a ReportEntity in the Model //! Hence, ReportEntity can be called. //! @@ -169,70 +145,76 @@ public: //! Remember that a Report Entity can be defined for an Unknown //! Entity, or a Corrected or Erroneous (at read time) Entity. //! The ReportEntity is defined before call to method AddEntity. - Standard_EXPORT Standard_Boolean IsReportEntity (const Standard_Integer num, const Standard_Boolean semantic = Standard_False) const; - + Standard_EXPORT Standard_Boolean IsReportEntity(const Standard_Integer num, + const Standard_Boolean semantic = Standard_False) const; + //! Returns a ReportEntity identified by its number in the Model, //! or a Null Handle If does not identify a ReportEntity. //! //! By default, queries main report, if is True, it //! queries report for semantic check - Standard_EXPORT Handle(Interface_ReportEntity) ReportEntity (const Standard_Integer num, const Standard_Boolean semantic = Standard_False) const; - + Standard_EXPORT Handle(Interface_ReportEntity) ReportEntity(const Standard_Integer num, + const Standard_Boolean semantic = Standard_False) const; + //! Returns True if identifies an Error Entity : in this //! case, a ReportEntity brings Fail Messages and possibly an //! "undefined" Content, see IsRedefinedEntity - Standard_EXPORT Standard_Boolean IsErrorEntity (const Standard_Integer num) const; - + Standard_EXPORT Standard_Boolean IsErrorEntity(const Standard_Integer num) const; + //! Returns True if identifies an Entity which content is //! redefined through a ReportEntity (i.e. with literal data only) //! This happens when an entity is syntactically erroneous in the //! way that its basic content remains empty. //! For more details (such as content itself), see ReportEntity - Standard_EXPORT Standard_Boolean IsRedefinedContent (const Standard_Integer num) const; - + Standard_EXPORT Standard_Boolean IsRedefinedContent(const Standard_Integer num) const; + //! Removes the ReportEntity attached to Entity . Returns //! True if done, False if no ReportEntity was attached to . //! Warning : the caller must assume that this clearing is meaningful - Standard_EXPORT Standard_Boolean ClearReportEntity (const Standard_Integer num); - + Standard_EXPORT Standard_Boolean ClearReportEntity(const Standard_Integer num); + //! Sets or Replaces a ReportEntity for the Entity . Returns //! True if Report is replaced, False if it has been replaced //! Warning : the caller must assume that this setting is meaningful - Standard_EXPORT Standard_Boolean SetReportEntity (const Standard_Integer num, const Handle(Interface_ReportEntity)& rep); - + Standard_EXPORT Standard_Boolean SetReportEntity(const Standard_Integer num, + const Handle(Interface_ReportEntity)& rep); + //! Adds a ReportEntity as such. Returns False if the concerned //! entity is not recorded in the Model //! Else, adds it into, either the main report list or the //! list for semantic checks, then returns True - Standard_EXPORT Standard_Boolean AddReportEntity (const Handle(Interface_ReportEntity)& rep, const Standard_Boolean semantic = Standard_False); - + Standard_EXPORT Standard_Boolean AddReportEntity(const Handle(Interface_ReportEntity)& rep, + const Standard_Boolean semantic = Standard_False); + //! Returns True if identifies an Unknown Entity : in this //! case, a ReportEntity with no Check Messages designates it. - Standard_EXPORT Standard_Boolean IsUnknownEntity (const Standard_Integer num) const; - + Standard_EXPORT Standard_Boolean IsUnknownEntity(const Standard_Integer num) const; + //! Fills the list of semantic checks. //! This list is computed (by CheckTool). Hence, it can be stored //! in the model for later queries //! True (D) : new list replaces //! False : new list is cumulated - Standard_EXPORT void FillSemanticChecks (const Interface_CheckIterator& checks, const Standard_Boolean clear = Standard_True); - + Standard_EXPORT void FillSemanticChecks(const Interface_CheckIterator& checks, + const Standard_Boolean clear = Standard_True); + //! Returns True if semantic checks have been filled Standard_EXPORT Standard_Boolean HasSemanticChecks() const; - + //! Returns the check attached to an entity, designated by its //! Number. 0 for global check //! True : recorded semantic check //! False : recorded syntactic check (see ReportEntity) //! If no check is recorded for , returns an empty Check - Standard_EXPORT const Handle(Interface_Check)& Check (const Standard_Integer num, const Standard_Boolean syntactic) const; - + Standard_EXPORT const Handle(Interface_Check)& Check(const Standard_Integer num, + const Standard_Boolean syntactic) const; + //! Does a reservation for the List of Entities (for optimized //! storage management). If it is not called, storage management //! can be less efficient. is the expected count of //! Entities to store - Standard_EXPORT virtual void Reservate (const Standard_Integer nbent); - + Standard_EXPORT virtual void Reservate(const Standard_Integer nbent); + //! Internal method for adding an Entity. Used by file reading //! (defined by each Interface) and Transfer tools. It adds the //! entity required to be added, not its refs : see AddWithRefs. @@ -240,129 +222,89 @@ public: //! Reports, its Concerned Entity (Erroneous or Corrected, else //! Unknown) is added to the list of Entities. //! That is, the ReportEntity must be created before Adding - Standard_EXPORT virtual void AddEntity (const Handle(Standard_Transient)& anentity); - - //! Adds to the Model, an Entity with all its References, as they - //! are defined by General Services FillShared and ListImplied. - //! Process is recursive (any sub-levels) if = 0 (Default) - //! Else, adds sub-entities until the required sub-level. - //! Especially, if = 1, adds immediate subs and that's all - //! - //! If is False (Default), an entity ( itself - //! or one of its subs at any level) which is already recorded in - //! the Model is not analysed, only the newly added ones are. - //! If is True, all items are analysed (this allows to - //! ensure the consistency of an adding made by steps) - Standard_EXPORT void AddWithRefs (const Handle(Standard_Transient)& anent, const Handle(Interface_Protocol)& proto, const Standard_Integer level = 0, const Standard_Boolean listall = Standard_False); - - //! Same as above, but works with the Protocol of the Model - Standard_EXPORT void AddWithRefs (const Handle(Standard_Transient)& anent, const Standard_Integer level = 0, const Standard_Boolean listall = Standard_False); - - //! Same as above, but works with an already created GeneralLib - Standard_EXPORT void AddWithRefs (const Handle(Standard_Transient)& anent, const Interface_GeneralLib& lib, const Standard_Integer level = 0, const Standard_Boolean listall = Standard_False); - + Standard_EXPORT virtual void AddEntity(const Handle(Standard_Transient)& anentity); + //! Replace Entity with Number=nument on other entity - "anent" - Standard_EXPORT void ReplaceEntity (const Standard_Integer nument, const Handle(Standard_Transient)& anent); - + Standard_EXPORT void ReplaceEntity(const Standard_Integer nument, + const Handle(Standard_Transient)& anent); + //! Reverses the Numbers of the Entities, between and the //! total count of Entities. Thus, the entities : //! 1,2 ... after, after+1 ... nb-1, nb become numbered as : //! 1,2 ... after, nb, nb-1 ... after+1 //! By default (after = 0) the whole list of Entities is reversed - Standard_EXPORT void ReverseOrders (const Standard_Integer after = 0); - + Standard_EXPORT void ReverseOrders(const Standard_Integer after = 0); + //! Changes the Numbers of some Entities : is moved to //! , same for entities. Thus : //! 1,2 ... newnum-1 newnum ... oldnum .. oldnum+count oldnum+count+1 .. gives //! 1,2 ... newnum-1 oldnum .. oldnum+count newnum ... oldnum+count+1 //! (can be seen as a circular permutation) - Standard_EXPORT void ChangeOrder (const Standard_Integer oldnum, const Standard_Integer newnum, const Standard_Integer count = 1); - + Standard_EXPORT void ChangeOrder(const Standard_Integer oldnum, + const Standard_Integer newnum, + const Standard_Integer count = 1); + //! Gets contents from an EntityIterator, prepared by a //! Transfer tool (e.g TransferCopy). Starts from clear - Standard_EXPORT void GetFromTransfer (const Interface_EntityIterator& aniter); - + Standard_EXPORT void GetFromTransfer(const Interface_EntityIterator& aniter); + //! Gets header (data specific of a defined Interface) from //! another InterfaceModel; called from TransferCopy - Standard_EXPORT virtual void GetFromAnother (const Handle(Interface_InterfaceModel)& other) = 0; - + Standard_EXPORT virtual void GetFromAnother(const Handle(DE_DataModel)& other); + //! Returns a New Empty Model, same type as (whatever its //! Type); called to Copy parts a Model into other ones, then //! followed by a call to GetFromAnother (Header) then filling //! with specified Entities, themselves copied - Standard_EXPORT virtual Handle(Interface_InterfaceModel) NewEmptyModel() const = 0; - + Standard_EXPORT virtual Handle(DE_DataModel) NewEmptyModel() const; + //! Records a category number for an entity number //! Returns True when done, False if is out of range - Standard_EXPORT Standard_Boolean SetCategoryNumber (const Standard_Integer num, const Standard_Integer val); - + Standard_EXPORT Standard_Boolean SetCategoryNumber(const Standard_Integer num, const Standard_Integer val); + //! Returns the recorded category number for a given entity number //! 0 if none was defined for this entity - Standard_EXPORT Standard_Integer CategoryNumber (const Standard_Integer num) const; - + Standard_EXPORT Standard_Integer CategoryNumber(const Standard_Integer num) const; + //! Allows an EntityIterator to get a list of Entities - Standard_EXPORT void FillIterator (Interface_EntityIterator& iter) const; - + Standard_EXPORT void FillIterator(Interface_EntityIterator& iter) const; + //! Returns the list of all Entities, as an Iterator on Entities //! (the Entities themselves, not the Reports) Standard_EXPORT Interface_EntityIterator Entities() const; - + //! Returns the list of all ReportEntities, i.e. data about //! Entities read with Error or Warning information //! (each item has to be casted to Report Entity then it can be //! queried for Concerned Entity, Content, Check ...) //! By default, returns the main reports, is is True it //! returns the list for semantic checks - Standard_EXPORT Interface_EntityIterator Reports (const Standard_Boolean semantic = Standard_False) const; - + Standard_EXPORT Interface_EntityIterator Reports(const Standard_Boolean semantic = Standard_False) const; + //! Returns the list of ReportEntities which redefine data //! (generally, if concerned entity is "Error", a literal content //! is added to it : this is a "redefined entity" Standard_EXPORT Interface_EntityIterator Redefineds() const; - + //! Returns the GlobalCheck, which memorizes messages global to //! the file (not specific to an Entity), especially Header - Standard_EXPORT const Handle(Interface_Check)& GlobalCheck (const Standard_Boolean syntactic = Standard_True) const; - + Standard_EXPORT const Handle(Interface_Check)& GlobalCheck(const Standard_Boolean syntactic = Standard_True) const; + //! Allows to modify GlobalCheck, after getting then completing it //! Remark : it is SYNTACTIC check. Semantics, see FillChecks - Standard_EXPORT void SetGlobalCheck (const Handle(Interface_Check)& ach); - + Standard_EXPORT void SetGlobalCheck(const Handle(Interface_Check)& ach); + //! Minimum Semantic Global Check on data in model (header) //! Can only check basic Data. See also GlobalCheck from Protocol //! for a check which takes the Graph into account //! Default does nothing, can be redefined - Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const; - - //! Dumps Header in a short, easy to read, form, onto a Stream - //! allows to print more or less parts of the header, - //! if necessary. 0 for basic print - Standard_EXPORT virtual void DumpHeader (Standard_OStream& S, const Standard_Integer level = 0) const = 0; - - //! Prints identification of a given entity in , in order to - //! be printed in a list or phrase - //! < 0 : prints only its number - //! = 1 : just calls PrintLabel - //! = 0 (D) : prints its number plus '/' plus PrintLabel - //! If == , simply prints "Global" - //! If is unknown, prints "??/its type" - Standard_EXPORT void Print (const Handle(Standard_Transient)& ent, Standard_OStream& s, const Standard_Integer mode = 0) const; - - //! Prints label specific to each norm, for a given entity. - //! Must only print label itself, in order to be included in a - //! phrase. Can call the result of StringLabel, but not obliged. - Standard_EXPORT virtual void PrintLabel (const Handle(Standard_Transient)& ent, Standard_OStream& S) const = 0; - - //! Prints label specific to each norm in log format, for - //! a given entity. - //! By default, just calls PrintLabel, can be redefined - Standard_EXPORT virtual void PrintToLog (const Handle(Standard_Transient)& ent, Standard_OStream& S) const; - + Standard_EXPORT virtual void VerifyCheck(Handle(Interface_Check)& ach) const; + //! Returns a string with the label attached to a given entity. //! Warning : While this string may be edited on the spot, if it is a read //! field, the returned value must be copied before. - Standard_EXPORT virtual Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const = 0; - + Standard_EXPORT virtual Handle(TCollection_HAsciiString) StringLabel(const Handle(Standard_Transient)& ent) const; + //! Searches a label which matches with one entity. //! Begins from +1 (default:1) and scans the entities //! until . For the first which matches