#include #include #include #include #include #include #include #include #include #include #include // Entete de fichier : liste d entites StepData_StepModel::StepData_StepModel () { } void StepData_StepModel::Reservate (const Standard_Integer nbent) { Interface_InterfaceModel::Reservate(nbent); if (nbent > theidnums.NbBuckets()) theidnums.ReSize (nbent); } Handle(Standard_Transient) StepData_StepModel::Entity (const Standard_Integer num) const { return Value(num); } // nom plus joli void StepData_StepModel::GetFromAnother (const Handle(Interface_InterfaceModel)& other) { theheader.Clear(); DeclareAndCast(StepData_StepModel,another,other); if (another.IsNull()) return; Interface_EntityIterator iter = another->Header(); // recopier le header. Attention, header distinct du contenu ... Interface_CopyTool TC (this,StepData::HeaderProtocol()); for (; iter.More(); iter.Next()) { Handle(Standard_Transient) newhead; if (!TC.Copy(iter.Value(),newhead,Standard_False,Standard_False)) continue; if (!newhead.IsNull()) theheader.Append(newhead); } } Handle(Interface_InterfaceModel) StepData_StepModel::NewEmptyModel () const { return new StepData_StepModel; } Interface_EntityIterator StepData_StepModel::Header () const { Interface_EntityIterator iter; theheader.FillIterator(iter); return iter; } Standard_Boolean StepData_StepModel::HasHeaderEntity (const Handle(Standard_Type)& atype) const { return (theheader.NbTypedEntities(atype) == 1); } Handle(Standard_Transient) StepData_StepModel::HeaderEntity (const Handle(Standard_Type)& atype) const { return theheader.TypedEntity(atype); } // Remplissage du Header void StepData_StepModel::ClearHeader () { theheader.Clear(); } void StepData_StepModel::AddHeaderEntity (const Handle(Standard_Transient)& ent) { theheader.Append(ent); } void StepData_StepModel::VerifyCheck(Handle(Interface_Check)& ach) const { Interface_GeneralLib lib(StepData::HeaderProtocol()); Interface_ShareTool sh(this,StepData::HeaderProtocol()); Handle(Interface_GeneralModule) module; Standard_Integer CN; for (Interface_EntityIterator iter = Header(); iter.More(); iter.Next()) { Handle(Standard_Transient) head = iter.Value(); if (!lib.Select(head,module,CN)) continue; module->CheckCase(CN,head,sh,ach); } } void StepData_StepModel::DumpHeader (const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const { // NB : level n est pas utilise Handle(StepData_Protocol) stepro = StepData::HeaderProtocol(); Standard_Boolean iapro = !stepro.IsNull(); if (!iapro) S<<" -- WARNING : StepModel DumpHeader, Protocol not defined\n"; Interface_EntityIterator iter = Header(); Standard_Integer nb = iter.NbEntities(); S << " -- Step Model Header : " <DynamicType()->Name() << "\n"; } if (!iapro || nb == 0) return; S << " -- -- STEP MODEL HEADER CONTENT -- --" << endl; S << " -- Dumped with Protocol : " << stepro->DynamicType()->Name() << " --"< 0) S<<"#"< 0) S<<"(#"< 0) sprintf (text, "#%d",nid); else if (num > 0) sprintf (text, "(#%d)",num); else sprintf (text, "(#0..)"); label = new TCollection_HAsciiString(text); return label; }