(const Handle(Interface_Protocol)& protocol) const
{
Handle(StepData_StepModel) stepmodel = new StepData_StepModel;
- stepmodel->SetProtocol (protocol);
+ stepmodel->SetProtocol(protocol);
// - Make Header information
HeaderSection_FileName.hxx
HeaderSection_FileSchema.cxx
HeaderSection_FileSchema.hxx
-HeaderSection_HeaderRecognizer.cxx
-HeaderSection_HeaderRecognizer.hxx
HeaderSection_Protocol.cxx
HeaderSection_Protocol.hxx
#include <HeaderSection.hxx>
#include <HeaderSection_Protocol.hxx>
-//szv_c1:StaticHandle(HeaderSection_Protocol, proto);
-static Handle(HeaderSection_Protocol) proto;
-
const Handle(HeaderSection_Protocol) & HeaderSection::Protocol()
{
- //szv_c1:InitHandleVoid(HeaderSection_Protocol, proto)
- if (proto.IsNull()) proto = new HeaderSection_Protocol;
+ static Handle(HeaderSection_Protocol) proto;
+ if (proto.IsNull())
+ proto = new HeaderSection_Protocol;
return proto;
}
+++ /dev/null
-// Created on: 1994-06-27
-// Created by: Frederic MAUPAS
-// Copyright (c) 1994-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <HeaderSection_FileDescription.hxx>
-#include <HeaderSection_FileName.hxx>
-#include <HeaderSection_FileSchema.hxx>
-#include <HeaderSection_HeaderRecognizer.hxx>
-#include <Standard_Type.hxx>
-#include <TCollection_AsciiString.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
-
-static TCollection_AsciiString reco_FileName ("FILE_NAME");
-static TCollection_AsciiString reco_FileSchema ("FILE_SCHEMA");
-static TCollection_AsciiString reco_FileDescription ("FILE_DESCRIPTION");
-
-
-
-HeaderSection_HeaderRecognizer::HeaderSection_HeaderRecognizer ()
-{ }
-
-void HeaderSection_HeaderRecognizer::Eval
- (const TCollection_AsciiString& key)
-{
- if (key.IsEqual(reco_FileName)) {
- SetOK(new HeaderSection_FileName);
- return;
- }
- if (key.IsEqual(reco_FileSchema)) {
- SetOK(new HeaderSection_FileSchema);
- return;
- }
- if (key.IsEqual(reco_FileDescription)) {
- SetOK(new HeaderSection_FileDescription);
- return;
- }
-}
+++ /dev/null
-// Created on: 1994-06-27
-// Created by: Frederic MAUPAS
-// Copyright (c) 1994-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _HeaderSection_HeaderRecognizer_HeaderFile
-#define _HeaderSection_HeaderRecognizer_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_FileRecognizer.hxx>
-class TCollection_AsciiString;
-
-
-class HeaderSection_HeaderRecognizer;
-DEFINE_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
-
-//! Recognizes STEP Standard Header Entities
-//! (FileName, FileDescription, FileSchema)
-class HeaderSection_HeaderRecognizer : public StepData_FileRecognizer
-{
-
-public:
-
-
- Standard_EXPORT HeaderSection_HeaderRecognizer();
-
-
-
-
- DEFINE_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
-
-protected:
-
-
- //! Recognizes data types of Header STEP Standard
- Standard_EXPORT void Eval (const TCollection_AsciiString& key) Standard_OVERRIDE;
-
-
-
-private:
-
-
-
-
-};
-
-
-
-
-
-
-
-#endif // _HeaderSection_HeaderRecognizer_HeaderFile
#include <IFGraph_AllShared.hxx>
#include <Interface_EntityIterator.hxx>
-#include <Interface_InterfaceModel.hxx>
IFGraph_AllShared::IFGraph_AllShared (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent)
#include <IFGraph_Cumulate.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_Graph.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <Standard_Transient.hxx>
// Calcul de cumul
// Tres simple, on note les entites demandees, et a la fin
#include <Dico_DictionaryOfTransient.hxx>
#include <Message_Messenger.hxx>
#include <Interface_Macros.hxx>
-#include <Interface_GTool.hxx>
#include <Interface_HGraph.hxx>
#include <Interface_MSG.hxx>
#include <Interface_Category.hxx>
: myNames(new Dico_DictionaryOfTransient),
myVars(new IFSelect_Vars)
{
+ errhand = Standard_True;
}
iter = EvalSelection(sel); // appel normal (donc, code pas duplique)
}
catch (Standard_Failure) {
- Handle(Message_Messenger) sout = Message::DefaultMessenger();
+ const Handle(Message_Messenger) &sout = Message::DefaultMessenger();
sout<<" **** Interruption EvalSelection par Exception : ****\n";
sout<<Standard_Failure::Caught()->GetMessageString();
sout<<"\n Abandon"<<endl;
res = SelectionResult(sel); // appel normal (->code unique)
}
catch (Standard_Failure) {
- Handle(Message_Messenger) sout = Message::DefaultMessenger();
+ const Handle(Message_Messenger) &sout = Message::DefaultMessenger();
sout<<" **** Interruption SelectionResult par Exception : ****\n";
sout<<Standard_Failure::Caught()->GetMessageString();
sout<<"\n Abandon"<<endl;
Handle(Interface_Protocol) IGESAppli_Protocol::Resource
(const Standard_Integer num) const
{
- Handle(Interface_Protocol) res;
- if (num == 1) res = IGESDefs::Protocol();
- if (num == 2) res = IGESDraw::Protocol();
- return res;
+ if (num == 1) return IGESDefs::Protocol();
+ if (num == 2) return IGESDraw::Protocol();
+ return NULL;
}
Standard_Integer IGESAppli_Protocol::TypeNumber
Handle(Interface_Protocol) IGESBasic_Protocol::Resource
(const Standard_Integer /*num*/) const
{
- Handle(Interface_Protocol) res = IGESData::Protocol();
- return res;
+ return IGESData::Protocol();
}
Standard_Integer IGESBasic_Protocol::TypeNumber
#include <gp_XYZ.hxx>
#include <IGESControl_Controller.hxx>
#include <IGESControl_Writer.hxx>
+#include <IGESData.hxx>
+#include <IGESData_DirChecker.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_IGESModel.hxx>
#include <IGESData_IGESWriter.hxx>
#include <IGESData_Protocol.hxx>
+#include <IGESData_GeneralModule.hxx>
+#include <IGESData_SpecificModule.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Static.hxx>
+#include <Interface_Graph.hxx>
+#include <Interface_EntityIterator.hxx>
#include <Message_ProgressIndicator.hxx>
#include <OSD_OpenFile.hxx>
#include <ShapeAnalysis_ShapeTolerance.hxx>
#include <errno.h>
IGESControl_Writer::IGESControl_Writer ()
- : myTP (new Transfer_FinderProcess(10000)) ,
- myIsComputed (Standard_False)
+: myTP (new Transfer_FinderProcess(10000)),
+ myIsComputed (Standard_False)
{
-// faudrait aussi (?) prendre les parametres par defaut ... ?
- IGESControl_Controller::Init();
- myEditor.Init(IGESControl_Controller::DefineProtocol());
- myEditor.SetUnitName(Interface_Static::CVal ("write.iges.unit"));
- myEditor.ApplyUnit();
+ InitProtocol();
myWriteMode = Interface_Static::IVal ("write.iges.brep.mode");
- myModel = myEditor.Model();
+ myModel = IGESData::NewModel();
+ SetUnitName(Interface_Static::CVal ("write.iges.unit"));
}
-IGESControl_Writer::IGESControl_Writer
- (const Standard_CString unit, const Standard_Integer modecr)
- : myTP (new Transfer_FinderProcess(10000)) ,
- myWriteMode (modecr) , myIsComputed (Standard_False)
+IGESControl_Writer::IGESControl_Writer (const Standard_CString unit, const Standard_Integer modecr)
+: myTP (new Transfer_FinderProcess(10000)),
+ myWriteMode (modecr), myIsComputed (Standard_False)
{
-// faudrait aussi (?) prendre les parametres par defaut ... ?
- IGESControl_Controller::Init();
- myEditor.Init(IGESControl_Controller::DefineProtocol());
- myEditor.SetUnitName(unit);
- myEditor.ApplyUnit();
- myModel = myEditor.Model();
+ InitProtocol();
+ myModel = IGESData::NewModel();
+ SetUnitName(unit);
}
-IGESControl_Writer::IGESControl_Writer
- (const Handle(IGESData_IGESModel)& model, const Standard_Integer modecr)
- : myTP (new Transfer_FinderProcess(10000)) ,
- myModel (model) ,
- myEditor (model,IGESControl_Controller::DefineProtocol()) ,
- myWriteMode (modecr) , myIsComputed (Standard_False) { }
+IGESControl_Writer::IGESControl_Writer (const Handle(IGESData_IGESModel)& model, const Standard_Integer modecr)
+: myTP (new Transfer_FinderProcess(10000)),
+ myModel (model),
+ myWriteMode (modecr), myIsComputed (Standard_False)
+{
+ InitProtocol();
+}
Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
{
void IGESControl_Writer::ComputeModel ()
{
if (!myIsComputed) {
- myEditor.ComputeStatus();
- myEditor.AutoCorrectModel();
+ ComputeStatus();
+ AutoCorrectModel();
myIsComputed = Standard_True;
}
}
return res;
}
+
+void IGESControl_Writer::InitProtocol ()
+{
+ IGESControl_Controller::Init();
+ const Handle(IGESData_Protocol) &aProtocol = IGESControl_Controller::DefineProtocol();
+ myGLib = Interface_GeneralLib (aProtocol);
+ mySLib = IGESData_SpecificLib (aProtocol);
+}
+
+void IGESControl_Writer::SetUnitName (const Standard_CString name)
+{
+ if (myModel.IsNull()) return;
+
+ const Standard_Integer flag = IGESData::UnitNameFlag (name);
+ IGESData_GlobalSection GS = myModel->GlobalSection();
+ if (GS.UnitFlag() == 3) {
+ char* nam = (char *)name;
+ if (name[1] == 'H') nam = (char *)&name[2];
+ GS.SetUnitName (new TCollection_HAsciiString(nam));
+ myModel->SetGlobalSection (GS);
+ }
+ else if (flag >= 1 && flag <= 11) {
+ //! Set a new unit from its flag (param 14 of Global Section)
+ //! Returns True if done, False if <flag> is incorrect
+ Handle(TCollection_HAsciiString) name = GS.UnitName();
+ Standard_CString nam = IGESData::UnitFlagName (flag);
+ if (nam[0] != '\0') name = new TCollection_HAsciiString (nam);
+ GS.SetUnitFlag (flag);
+ GS.SetUnitName (name);
+ myModel->SetGlobalSection (GS);
+
+ Standard_Real unit = GS.UnitValue();
+ if (unit <= 0.) return;
+ if (unit != 1.) {
+ GS.SetMaxLineWeight (GS.MaxLineWeight () / unit);
+ GS.SetResolution (GS.Resolution () / unit);
+ GS.SetMaxCoord (GS.MaxCoord () / unit);
+ myModel->SetGlobalSection (GS);
+ }
+ }
+}
+
+void IGESControl_Writer::ComputeStatus ()
+{
+ if (myModel.IsNull()) return;
+ Standard_Integer nb = myModel->NbEntities();
+ if (nb == 0) return;
+ TColStd_Array1OfInteger subs (0,nb); subs.Init(0); // gere Subordinate Status
+ Interface_Graph G (myModel); // gere & memorise UseFlag
+ G.ResetStatus();
+
+// 2 phases : d abord on fait un calcul d ensemble. Ensuite on applique
+// Tout le modele est traite, pas de jaloux
+
+// Chaque entite va donner une contribution sur ses descendents propres :
+// pour Subordinate (1 ou 2 cumulables), pour UseFlag (1 a 6 exclusifs)
+// (6 depuis IGES-5.2)
+
+// Pour Subordinate : Drawing et 402 (sauf p-e dimensioned geometry ?) donnent
+// Logical, le reste implique Physical (sur descendants directs propres)
+
+// Pour UseFlag, un peu plus complique :
+// D une part, les UseFlag se propagent aux descendants directs ou non
+// D autre part les cas sont plus compliques (et pas aussi clairs)
+
+// ATTENTION, on ne peut traiter que ce qui se deduit du graphe en s appuyant
+// sur les "IGES Type Number", on n a pas le droit ici d acceder a la
+// description specifique des differents types : traites par AutoCorrect.
+// Exemple : une courbe est 3D ou parametrique 2D(UV), non seulement selon son
+// ascendant, mais selon le role qu elle y joue (ex. pour CurveOnSurface :
+// CurveUV/Curve3D)
+// Traites actuellement (necessaires) :
+// 1(Annotation), aussi 4(pour maillage). 5(ParamUV) traite par AutoCorrect
+
+ Standard_Integer CN;
+ Standard_Integer i; // svv Jan11 2000 : porting on DEC
+ for (i = 1; i <= nb; i ++) {
+// Subordinate (sur directs en propre seulement)
+ Handle(IGESData_IGESEntity) ent = myModel->Entity(i);
+ Standard_Integer igt = ent->TypeNumber();
+ Handle(Interface_GeneralModule) gmodule;
+ if (myGLib.Select (ent,gmodule,CN)) {
+ Handle(IGESData_GeneralModule) gmod =
+ Handle(IGESData_GeneralModule)::DownCast (gmodule);
+ Interface_EntityIterator sh;
+ gmod->OwnSharedCase (CN,ent,sh);
+ for (sh.Start(); sh.More(); sh.Next()) {
+ Standard_Integer nums = myModel->Number(sh.Value());
+ if (igt == 402 || igt == 404) subs.SetValue (nums,subs.Value(nums) | 2);
+ else subs.SetValue (nums,subs.Value(nums) | 1);
+//// cout<<"ComputeStatus : nums = "<<nums<<" ->"<<subs.Value(nums)<<endl;
+ }
+ }
+// UseFlag (a propager)
+ if (igt / 100 == 2) {
+ G.GetFromEntity(ent,Standard_True,1); // Annotation
+ G.GetFromEntity(ent,Standard_False,ent->UseFlag());
+ } else if (igt == 134 || igt == 116 || igt == 132) {
+ Interface_EntityIterator sh = G.Sharings(ent); // Maillage ...
+ if (sh.NbEntities() > 0) G.GetFromEntity(ent,Standard_True,4);
+ }
+ }
+
+// A present, on va appliquer tout cela "de force"
+// Seule exception : des UseFlags non nuls deja en place sont laisses
+
+ for (i = 1; i <= nb; i ++) {
+ Handle(IGESData_IGESEntity) ent = myModel->Entity(i);
+ Standard_Integer bl = ent->BlankStatus();
+ Standard_Integer uf = ent->UseFlag();
+ if (uf == 0) uf = G.Status(i);
+ Standard_Integer hy = ent->HierarchyStatus();
+ ent->InitStatus(bl,subs.Value(i),uf,hy);
+ }
+}
+
+Standard_Boolean IGESControl_Writer::AutoCorrect (const Handle(IGESData_IGESEntity)& ent)
+{
+ if (myModel.IsNull()) return Standard_False;
+ Handle(IGESData_IGESEntity) bof, subent;
+ Handle(IGESData_LineFontEntity) linefont;
+ Handle(IGESData_LevelListEntity) levelist;
+ Handle(IGESData_ViewKindEntity) view;
+ Handle(IGESData_TransfEntity) transf;
+ Handle(IGESData_LabelDisplayEntity) labdisp;
+ Handle(IGESData_ColorEntity) color;
+
+ Standard_Boolean done = Standard_False;
+ if (ent.IsNull()) return done;
+
+// Corrections dans les Assocs (les Props restent attachees a l Entite)
+ Interface_EntityIterator iter = ent->Associativities();
+ for (iter.Start(); iter.More(); iter.Next()) {
+ subent = GetCasted(IGESData_IGESEntity,iter.Value());
+ if (!subent.IsNull() && myModel->Number(subent) == 0)
+ { subent->Dissociate(ent); done = Standard_True; }
+ }
+
+// Corrections specifiques
+ Standard_Integer CN;
+ Handle(Interface_GeneralModule) gmodule;
+ if (myGLib.Select (ent,gmodule,CN)) {
+ Handle(IGESData_GeneralModule) gmod =
+ Handle(IGESData_GeneralModule)::DownCast (gmodule);
+ IGESData_DirChecker DC = gmod->DirChecker(CN,ent);
+ done |= DC.Correct(ent);
+ }
+
+ Handle(IGESData_SpecificModule) smod;
+ if (mySLib.Select (ent,smod,CN)) done |= smod->OwnCorrect (CN,ent);
+
+ return done;
+}
+
+Standard_Integer IGESControl_Writer::AutoCorrectModel ()
+{
+ Standard_Integer res = 0;
+ Standard_Integer nb = myModel->NbEntities();
+ for (Standard_Integer i = 1; i <= nb; i ++) {
+ if (AutoCorrect (myModel->Entity(i))) res ++;
+ }
+ return res;
+}
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
-#include <IGESData_BasicEditor.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_CString.hxx>
#include <Standard_OStream.hxx>
+#include <Interface_GeneralLib.hxx>
+#include <IGESData_SpecificLib.hxx>
+class TopoDS_Shape;
class Transfer_FinderProcess;
class IGESData_IGESModel;
-class TopoDS_Shape;
-class Standard_Transient;
class IGESData_IGESEntity;
Standard_EXPORT Standard_Boolean Write (const Standard_CString file, const Standard_Boolean fnes = Standard_False);
private:
+
+ //! Initialize a Protocol and Libraries
+ Standard_EXPORT void InitProtocol ();
+
+ //! Sets a new unit from its name (param 15 of Global Section)
+ //! Remark : if <flag> has been set to 3 (user defined), <name> is then free
+ Standard_EXPORT void SetUnitName (const Standard_CString name);
+
+ //! Performs the re-computation of status on the whole model
+ //! (Subordinate Status and Use Flag of each IGES Entity), which
+ //! can have required values according the way they are referenced
+ //! (see definitions of Logical use, Physical use, etc...)
+ Standard_EXPORT void ComputeStatus();
+
+ //! Performs auto-correction on an IGESEntity
+ //! Returns True if something has changed, False if nothing done.
+ //!
+ //! Works with the specific IGES Services : DirChecker which
+ //! allows to correct data in "Directory Part" of Entities (such
+ //! as required values for status, or references to be null), and
+ //! the specific IGES service OwnCorrect, which is specialised for
+ //! each type of entity.
+ Standard_EXPORT Standard_Boolean AutoCorrect (const Handle(IGESData_IGESEntity)& ent);
+
+ //! Performs auto-correction on the whole Model
+ //! Returns the count of modified entities
+ Standard_EXPORT Standard_Integer AutoCorrectModel();
Handle(Transfer_FinderProcess) myTP;
Handle(IGESData_IGESModel) myModel;
- IGESData_BasicEditor myEditor;
Standard_Integer myWriteMode;
Standard_Boolean myIsComputed;
+ Interface_GeneralLib myGLib;
+ IGESData_SpecificLib mySLib;
};
#endif // _IGESControl_Writer_HeaderFile
IGESData.hxx
IGESData_Array1OfDirPart.hxx
IGESData_Array1OfIGESEntity.hxx
-IGESData_BasicEditor.cxx
-IGESData_BasicEditor.hxx
IGESData_ColorEntity.cxx
IGESData_ColorEntity.hxx
IGESData_DefaultGeneral.cxx
Handle(IGESData_IGESModel) IGESData::NewModel ()
{
- if (gIGESModel.IsNull()) return NULL;
- Handle(Interface_InterfaceModel) newmod = gIGESModel->NewEmptyModel();
- newmod->GetFromAnother (gIGESModel);
- return Handle(IGESData_IGESModel)::DownCast(newmod);
+ Handle(IGESData_IGESModel) newmod;
+ if (!gIGESModel.IsNull()) {
+ newmod = new IGESData_IGESModel;
+ newmod->GetFromAnother (gIGESModel);
+ }
+ return newmod;
+}
+
+Standard_Integer IGESData::UnitNameFlag (const Standard_CString name)
+{
+ char* nam = (char *)&name[0];
+ if (name[1] == 'H') {
+ nam = (char *)&name[2];
+ }
+ if (!strcmp (nam,"INCH")) return 1;
+ if (!strcmp (nam,"IN")) return 1;
+ if (!strcmp (nam,"MM")) return 2;
+ if (!strcmp (nam,"FT")) return 4;
+ if (!strcmp (nam,"MI")) return 5;
+ if (!strcmp (nam,"M")) return 6;
+ if (!strcmp (nam,"KM")) return 7;
+ if (!strcmp (nam,"MIL")) return 8;
+ if (!strcmp (nam,"UM")) return 9;
+ if (!strcmp (nam,"CM")) return 10;
+ if (!strcmp (nam,"UIN")) return 11;
+ return 0;
+}
+
+Standard_Real IGESData::UnitFlagValue (const Standard_Integer flag)
+{
+ switch (flag) {
+ case 1 : return 0.0254;
+ case 2 : return 0.001;
+ case 3 : return 1.;
+ case 4 : return 0.3048;
+ case 5 : return 1609.27;
+ case 6 : return 1.;
+ case 7 : return 1000.;
+ case 8 : return 0.0000254;
+ case 9 : return 0.000001;
+ case 10 : return 0.01;
+ case 11 : return 0.0000000254;
+ default : break;
+ }
+ return 0.;
+}
+
+Standard_CString IGESData::UnitFlagName (const Standard_Integer flag)
+{
+ Standard_CString name = "";
+ switch (flag) {
+ case 1 : name = "INCH"; break;
+ case 2 : name = "MM"; break;
+ case 4 : name = "FT"; break;
+ case 5 : name = "MI"; break;
+ case 6 : name = "M"; break;
+ case 7 : name = "KM"; break;
+ case 8 : name = "MIL"; break;
+ case 9 : name = "UM"; break;
+ case 10 : name = "CM"; break;
+ case 11 : name = "UIN"; break;
+ default : break;
+ }
+ return name;
+}
+
+Standard_CString IGESData::IGESVersionName (const Standard_Integer flag)
+{
+ switch (flag) {
+ case 1 : return "1.0";
+ case 2 : return "ANSI Y14.26M-1981";
+ case 3 : return "2.0";
+ case 4 : return "3.0";
+ case 5 : return "ANSI Y14.26M-1987";
+ case 6 : return "4.0";
+ case 7 : return "ANSI Y14.26M-1989";
+ case 8 : return "5.0";
+ case 9 : return "5.1";
+ case 10: return "5.2";
+ case 11: return "5.3";
+ default : break;
+ }
+ return "";
+}
+
+Standard_CString IGESData::DraftingName (const Standard_Integer flag)
+{
+ switch (flag) {
+ case 0 : return "(None)";
+ case 1 : return "ISO";
+ case 2 : return "AFNOR";
+ case 3 : return "ANSI";
+ case 4 : return "BSI";
+ case 5 : return "CSA";
+ case 6 : return "DIN";
+ case 7 : return "JIS";
+ default : break;
+ }
+ return "";
}
//! Returns a Protocol from IGESData (avoids to create it)
Standard_EXPORT static Handle(IGESData_IGESModel) NewModel ();
+
+ //! From the name of unit, computes flag number, 0 if incorrect
+ //! (in this case, user defined entity remains possible)
+ Standard_EXPORT static Standard_Integer UnitNameFlag (const Standard_CString name);
+
+ //! From the flag of unit, determines value in MM, 0 if incorrect
+ Standard_EXPORT static Standard_Real UnitFlagValue (const Standard_Integer flag);
+
+ //! From the flag of unit, determines its name, "" if incorrect
+ Standard_EXPORT static Standard_CString UnitFlagName (const Standard_Integer flag);
+
+ //! From the flag of IGES version, returns name, "" if incorrect
+ Standard_EXPORT static Standard_CString IGESVersionName (const Standard_Integer flag);
+
+ //! Returns the maximum allowed value for IGESVersion Flag
+ static Standard_Integer IGESVersionMax () { return 11; }
+
+ //! From the flag of drafting standard, returns name, "" if incorrect
+ Standard_EXPORT static Standard_CString DraftingName (const Standard_Integer flag);
+
+ //! Returns the maximum allowed value for Drafting Flag
+ static Standard_Integer DraftingMax () { return 7; }
};
#endif // _IGESData_HeaderFile
+++ /dev/null
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-//#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection
-
-#include <IGESData.hxx>
-#include <IGESData_BasicEditor.hxx>
-#include <IGESData_ColorEntity.hxx>
-#include <IGESData_DirChecker.hxx>
-#include <IGESData_GeneralModule.hxx>
-#include <IGESData_IGESEntity.hxx>
-#include <IGESData_IGESModel.hxx>
-#include <IGESData_LabelDisplayEntity.hxx>
-#include <IGESData_LevelListEntity.hxx>
-#include <IGESData_LineFontEntity.hxx>
-#include <IGESData_Protocol.hxx>
-#include <IGESData_SpecificModule.hxx>
-#include <IGESData_TransfEntity.hxx>
-#include <IGESData_ViewKindEntity.hxx>
-#include <IGESGeom_Boundary.hxx>
-#include <IGESGeom_CurveOnSurface.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_Graph.hxx>
-#include <Interface_Macros.hxx>
-#include <Interface_Static.hxx>
-#include <TCollection_HAsciiString.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <UnitsMethods.hxx>
-
-IGESData_BasicEditor::IGESData_BasicEditor(const Handle(IGESData_Protocol)& protocol)
-{
- Init(protocol);
-}
-
-IGESData_BasicEditor::IGESData_BasicEditor(const Handle(IGESData_IGESModel)& model,
- const Handle(IGESData_Protocol)& protocol)
-{
- Init(model, protocol);
-}
-
-IGESData_BasicEditor::IGESData_BasicEditor() { }
-
-void IGESData_BasicEditor::Init (const Handle(IGESData_Protocol)& protocol)
-{
- theunit = Standard_False;
- theproto = protocol;
- themodel = IGESData::NewModel();
- theglib = Interface_GeneralLib (protocol);
- theslib = protocol;
-}
-
-void IGESData_BasicEditor::Init (const Handle(IGESData_IGESModel)& model, const Handle(IGESData_Protocol)& protocol)
-{
- theunit = Standard_False;
- theproto = protocol;
- themodel = model;
- theglib = Interface_GeneralLib (protocol);
- theslib = protocol;
-}
-
- Handle(IGESData_IGESModel) IGESData_BasicEditor::Model () const
- { return themodel; }
-
-// #### Travaux sur le Header (GlobalSection) ####
-
- Standard_Boolean IGESData_BasicEditor::SetUnitFlag
- (const Standard_Integer flag)
-{
- if (themodel.IsNull()) return Standard_False;
- if (flag < 1 || flag > 11) return Standard_False;
- IGESData_GlobalSection GS = themodel->GlobalSection();
- Handle(TCollection_HAsciiString) name = GS.UnitName();
- Standard_CString nam = IGESData_BasicEditor::UnitFlagName (flag);
- if (nam[0] != '\0') name = new TCollection_HAsciiString (nam);
- GS.SetUnitFlag (flag);
- GS.SetUnitName (name);
- themodel->SetGlobalSection (GS);
- theunit = Standard_True;
- return Standard_True;
-}
-
- Standard_Boolean IGESData_BasicEditor::SetUnitValue
- (const Standard_Real val)
-{
- if (val <= 0.) return Standard_False;
- Standard_Real vmm = val * UnitsMethods::GetCasCadeLengthUnit(); //abv 20 Feb 00: adding cascade unit factor
- //#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection
- //if (Interface_Static::IVal("read.scale.unit") == 1) vmm = vmm * 1000.;
-// vmm est exprime en MILLIMETRES
- if (vmm >= 25. && vmm <= 26. ) return SetUnitFlag(1);
- if (vmm >= 0.9 && vmm <= 1.1 ) return SetUnitFlag(2);
- if (vmm >= 300. && vmm <= 310. ) return SetUnitFlag(4);
- if (vmm >= 1600000. && vmm <= 1620000. ) return SetUnitFlag(5);
- if (vmm >= 990. && vmm <= 1010. ) return SetUnitFlag(6);
- if (vmm >= 990000. && vmm <= 1010000. ) return SetUnitFlag(7);
- if (vmm >= 0.025 && vmm <= 0.026 ) return SetUnitFlag(8);
- if (vmm >= 0.0009 && vmm <= 0.0011 ) return SetUnitFlag(9);
- if (vmm >= 9. && vmm <= 11. ) return SetUnitFlag(10);
- if (vmm >= 0.000025 && vmm <= 0.000026) return SetUnitFlag(11);
- return Standard_False;
-}
-
-//=======================================================================
-//function : SetUnitName
-//purpose :
-//=======================================================================
-Standard_Boolean IGESData_BasicEditor::SetUnitName (const Standard_CString name)
-{
- if (themodel.IsNull()) return Standard_False;
- Standard_Integer flag = IGESData_BasicEditor::UnitNameFlag (name);
- IGESData_GlobalSection GS = themodel->GlobalSection();
- if (GS.UnitFlag() == 3) {
- char* nam = (char *)name;
- if (name[1] == 'H') nam = (char *)&name[2];
- GS.SetUnitName (new TCollection_HAsciiString(nam));
- themodel->SetGlobalSection (GS);
- return Standard_True;
- }
- if (flag > 0) return SetUnitFlag(flag);
- return (flag > 0);
-}
-
- void IGESData_BasicEditor::ApplyUnit (const Standard_Boolean enforce)
-{
- if (themodel.IsNull()) return;
- if (!enforce && !theunit) return;
- IGESData_GlobalSection GS = themodel->GlobalSection();
- Standard_Real unit = GS.UnitValue();
- if (unit <= 0.) return;
- if (unit != 1.) {
- GS.SetMaxLineWeight (GS.MaxLineWeight () / unit);
- GS.SetResolution (GS.Resolution () / unit);
- GS.SetMaxCoord (GS.MaxCoord () / unit);
- themodel->SetGlobalSection (GS);
- }
- theunit = Standard_False;
-}
-
-
-// #### Travaux globaux sur les entites ####
-
- void IGESData_BasicEditor::ComputeStatus ()
-{
- if (themodel.IsNull()) return;
- Standard_Integer nb = themodel->NbEntities();
- if (nb == 0) return;
- TColStd_Array1OfInteger subs (0,nb); subs.Init(0); // gere Subordinate Status
- Interface_Graph G (themodel); // gere & memorise UseFlag
- G.ResetStatus();
-
-// 2 phases : d abord on fait un calcul d ensemble. Ensuite on applique
-// Tout le modele est traite, pas de jaloux
-
-// Chaque entite va donner une contribution sur ses descendents propres :
-// pour Subordinate (1 ou 2 cumulables), pour UseFlag (1 a 6 exclusifs)
-// (6 depuis IGES-5.2)
-
-// Pour Subordinate : Drawing et 402 (sauf p-e dimensioned geometry ?) donnent
-// Logical, le reste implique Physical (sur descendants directs propres)
-
-// Pour UseFlag, un peu plus complique :
-// D une part, les UseFlag se propagent aux descendants directs ou non
-// D autre part les cas sont plus compliques (et pas aussi clairs)
-
-// ATTENTION, on ne peut traiter que ce qui se deduit du graphe en s appuyant
-// sur les "IGES Type Number", on n a pas le droit ici d acceder a la
-// description specifique des differents types : traites par AutoCorrect.
-// Exemple : une courbe est 3D ou parametrique 2D(UV), non seulement selon son
-// ascendant, mais selon le role qu elle y joue (ex. pour CurveOnSurface :
-// CurveUV/Curve3D)
-// Traites actuellement (necessaires) :
-// 1(Annotation), aussi 4(pour maillage). 5(ParamUV) traite par AutoCorrect
-
- Standard_Integer CN;
- Standard_Integer i; // svv Jan11 2000 : porting on DEC
- for (i = 1; i <= nb; i ++) {
-// Subordinate (sur directs en propre seulement)
- Handle(IGESData_IGESEntity) ent = themodel->Entity(i);
- Standard_Integer igt = ent->TypeNumber();
- Handle(Interface_GeneralModule) gmodule;
- if (theglib.Select (ent,gmodule,CN)) {
- Handle(IGESData_GeneralModule) gmod =
- Handle(IGESData_GeneralModule)::DownCast (gmodule);
- Interface_EntityIterator sh;
- gmod->OwnSharedCase (CN,ent,sh);
- for (sh.Start(); sh.More(); sh.Next()) {
- Standard_Integer nums = themodel->Number(sh.Value());
- if (igt == 402 || igt == 404) subs.SetValue (nums,subs.Value(nums) | 2);
- else subs.SetValue (nums,subs.Value(nums) | 1);
-//// cout<<"ComputeStatus : nums = "<<nums<<" ->"<<subs.Value(nums)<<endl;
- }
- }
-// UseFlag (a propager)
- if (igt / 100 == 2) {
- G.GetFromEntity(ent,Standard_True,1); // Annotation
- G.GetFromEntity(ent,Standard_False,ent->UseFlag());
- } else if (igt == 134 || igt == 116 || igt == 132) {
- Interface_EntityIterator sh = G.Sharings(ent); // Maillage ...
- if (sh.NbEntities() > 0) G.GetFromEntity(ent,Standard_True,4);
-// UV : voir AutoCorrect des classes concernees (Boundary et CurveOnSurface)
-/*
- } else if (ent->IsKind(STANDARD_TYPE(IGESGeom_CurveOnSurface))) {
- DeclareAndCast(IGESGeom_CurveOnSurface,cos,ent); // Curve UV
- G.GetFromEntity (cos->CurveUV(),Standard_True,5);
- } else if (ent->IsKind(STANDARD_TYPE(IGESGeom_Boundary))) {
- DeclareAndCast(IGESGeom_Boundary,bnd,ent); // Curve UV
- Standard_Integer nc = bnd->NbModelSpaceCurves();
- for (Standard_Integer ic = 1; ic <= nc; ic ++) {
- Standard_Integer nuv = bnd->NbParameterCurves(ic);
- for (Standard_Integer juv = 1; juv <= nuv; juv ++)
- G.GetFromEntity(bnd->ParameterCurve(ic,juv),Standard_True,5);
- }
-*/
- }
- }
-
-// A present, on va appliquer tout cela "de force"
-// Seule exception : des UseFlags non nuls deja en place sont laisses
-
- for (i = 1; i <= nb; i ++) {
- Handle(IGESData_IGESEntity) ent = themodel->Entity(i);
- Standard_Integer bl = ent->BlankStatus();
- Standard_Integer uf = ent->UseFlag();
- if (uf == 0) uf = G.Status(i);
- Standard_Integer hy = ent->HierarchyStatus();
-//// cout<<" Ent.n0."<<i<<" Subord="<<subs.Value(i)<<" Use="<<uf<<endl;
- ent->InitStatus(bl,subs.Value(i),uf,hy);
- }
-}
-
-
- Standard_Boolean IGESData_BasicEditor::AutoCorrect
- (const Handle(IGESData_IGESEntity)& ent)
-{
- if (themodel.IsNull()) return Standard_False;
- Handle(IGESData_IGESEntity) bof, subent;
- Handle(IGESData_LineFontEntity) linefont;
- Handle(IGESData_LevelListEntity) levelist;
- Handle(IGESData_ViewKindEntity) view;
- Handle(IGESData_TransfEntity) transf;
- Handle(IGESData_LabelDisplayEntity) labdisp;
- Handle(IGESData_ColorEntity) color;
-
- Standard_Boolean done = Standard_False;
- if (ent.IsNull()) return done;
-// Corrections dans l entete (entites presentes)
-// On ne verifie pas les items "Shared", presents de toute facon
-// Entete : traite par DirChecker pour les cas standard
-/*
- linefont = ent->LineFont();
- if (!linefont.IsNull() && themodel->Number(linefont) == 0) {
- linefont.Nullify();
- ent->InitLineFont(linefont,0);
- done = Standard_True;
- }
- levelist = ent->LevelList();
- if (!levelist.IsNull() && themodel->Number(levelist) == 0) {
- levelist.Nullify();
- ent->InitLevel(levelist,0);
- done = Standard_True;
- }
- view = ent->View();
- if (!view.IsNull() && themodel->Number(view) == 0) {
- view.Nullify();
- ent->InitView(view);
- done = Standard_True;
- }
- transf = ent->Transf();
- if (!transf.IsNull() && themodel->Number(transf) == 0) {
- transf.Nullify();
- ent->InitTransf(transf);
- done = Standard_True;
- }
- labdisp = ent->LabelDisplay();
- if (!labdisp.IsNull() && themodel->Number(labdisp) == 0) {
- labdisp.Nullify();
- ent->InitMisc (ent->Structure(),labdisp,ent->LineWeightNumber());
- done = Standard_True;
- }
- color = ent->Color();
- if (!color.IsNull() && themodel->Number(color) == 0) {
- color.Nullify();
- ent->InitColor(color,0);
- done = Standard_True;
- }
-*/
-
-// Corrections dans les Assocs (les Props restent attachees a l Entite)
- Interface_EntityIterator iter = ent->Associativities();
- for (iter.Start(); iter.More(); iter.Next()) {
- subent = GetCasted(IGESData_IGESEntity,iter.Value());
- if (!subent.IsNull() && themodel->Number(subent) == 0)
- { subent->Dissociate(ent); done = Standard_True; }
- }
-
-// Corrections specifiques
- Standard_Integer CN;
- Handle(Interface_GeneralModule) gmodule;
- if (theglib.Select (ent,gmodule,CN)) {
- Handle(IGESData_GeneralModule) gmod =
- Handle(IGESData_GeneralModule)::DownCast (gmodule);
- IGESData_DirChecker DC = gmod->DirChecker(CN,ent);
- done |= DC.Correct(ent);
- }
-
- Handle(IGESData_SpecificModule) smod;
- if (theslib.Select (ent,smod,CN)) done |= smod->OwnCorrect (CN,ent);
-
- return done;
-}
-
-
- Standard_Integer IGESData_BasicEditor::AutoCorrectModel ()
-{
- Standard_Integer res = 0;
- Standard_Integer nb = themodel->NbEntities();
- for (Standard_Integer i = 1; i <= nb; i ++) {
- if (AutoCorrect (themodel->Entity(i))) res ++;
- }
- return res;
-}
-
-
-
-//=======================================================================
-//function : UnitNameFlag
-//purpose :
-//=======================================================================
-Standard_Integer IGESData_BasicEditor::UnitNameFlag (const Standard_CString name)
-{
- char* nam = (char *)&name[0];
- if (name[1] == 'H') {
- nam = (char *)&name[2];
- }
- if (!strcmp (nam,"INCH")) return 1;
- if (!strcmp (nam,"IN")) return 1;
- if (!strcmp (nam,"MM")) return 2;
- if (!strcmp (nam,"FT")) return 4;
- if (!strcmp (nam,"MI")) return 5;
- if (!strcmp (nam,"M")) return 6;
- if (!strcmp (nam,"KM")) return 7;
- if (!strcmp (nam,"MIL")) return 8;
- if (!strcmp (nam,"UM")) return 9;
- if (!strcmp (nam,"CM")) return 10;
- if (!strcmp (nam,"UIN")) return 11;
- return 0;
-}
-
-Standard_Real IGESData_BasicEditor::UnitFlagValue (const Standard_Integer flag)
-{
- switch (flag) {
- case 1 : return 0.0254;
- case 2 : return 0.001;
- case 3 : return 1.;
- case 4 : return 0.3048;
- case 5 : return 1609.27;
- case 6 : return 1.;
- case 7 : return 1000.;
- case 8 : return 0.0000254;
- case 9 : return 0.000001;
- case 10 : return 0.01;
- case 11 : return 0.0000000254;
- default : break;
- }
- return 0.;
-}
-
-Standard_CString IGESData_BasicEditor::UnitFlagName (const Standard_Integer flag)
-{
- Standard_CString name = "";
- switch (flag) {
- case 1 : name = "INCH"; break;
- case 2 : name = "MM"; break;
- case 4 : name = "FT"; break;
- case 5 : name = "MI"; break;
- case 6 : name = "M"; break;
- case 7 : name = "KM"; break;
- case 8 : name = "MIL"; break;
- case 9 : name = "UM"; break;
- case 10 : name = "CM"; break;
- case 11 : name = "UIN"; break;
- default : break;
- }
- return name;
-}
-
-Standard_CString IGESData_BasicEditor::IGESVersionName (const Standard_Integer flag)
-{
- switch (flag) {
- case 1 : return "1.0";
- case 2 : return "ANSI Y14.26M-1981";
- case 3 : return "2.0";
- case 4 : return "3.0";
- case 5 : return "ANSI Y14.26M-1987";
- case 6 : return "4.0";
- case 7 : return "ANSI Y14.26M-1989";
- case 8 : return "5.0";
- case 9 : return "5.1";
- case 10: return "5.2";
- case 11: return "5.3";
- default : break;
- }
- return "";
-}
-
-Standard_Integer IGESData_BasicEditor::IGESVersionMax ()
- { return 11; }
-
-Standard_CString IGESData_BasicEditor::DraftingName (const Standard_Integer flag)
-{
- switch (flag) {
- case 0 : return "(None)";
- case 1 : return "ISO";
- case 2 : return "AFNOR";
- case 3 : return "ANSI";
- case 4 : return "BSI";
- case 5 : return "CSA";
- case 6 : return "DIN";
- case 7 : return "JIS";
- default : break;
- }
- return "";
-}
-
-Standard_Integer IGESData_BasicEditor::DraftingMax ()
- { return 7; }
+++ /dev/null
-// Created on: 1995-08-25
-// Created by: Christian CAILLET
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _IGESData_BasicEditor_HeaderFile
-#define _IGESData_BasicEditor_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
-#include <Standard_Boolean.hxx>
-#include <Interface_GeneralLib.hxx>
-#include <IGESData_SpecificLib.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_CString.hxx>
-class IGESData_Protocol;
-class IGESData_IGESModel;
-class IGESData_IGESEntity;
-
-
-//! This class provides various functions of basic edition,
-//! such as :
-//! - setting header unit (WARNING : DOES NOT convert entities)
-//! - computation of the status (Subordinate, UseFlag) of entities
-//! of IGES Entities on a whole model
-//! - auto correction of IGES Entities, defined both by DirChecker
-//! and by specific service AutoCorrect
-//! (this auto correction performs non-ambigious, rather logic,
-//! editions)
-class IGESData_BasicEditor
-{
-public:
-
- DEFINE_STANDARD_ALLOC
-
-
- //! Creates an empty Basic Editor which should be initialized via Init() method.
- Standard_EXPORT IGESData_BasicEditor();
-
- //! Creates a Basic Editor, with a new IGESModel, ready to run
- Standard_EXPORT IGESData_BasicEditor(const Handle(IGESData_Protocol)& protocol);
-
- //! Creates a Basic Editor for IGES Data, ready to run
- Standard_EXPORT IGESData_BasicEditor(const Handle(IGESData_IGESModel)& model, const Handle(IGESData_Protocol)& protocol);
-
- //! Initialize a Basic Editor, with a new IGESModel, ready to run
- Standard_EXPORT void Init (const Handle(IGESData_Protocol)& protocol);
-
- //! Initialize a Basic Editor for IGES Data, ready to run
- Standard_EXPORT void Init (const Handle(IGESData_IGESModel)& model, const Handle(IGESData_Protocol)& protocol);
-
- //! Returns the designated model
- Standard_EXPORT Handle(IGESData_IGESModel) Model() const;
-
- //! Sets a new unit from its flag (param 14 of Global Section)
- //! Returns True if done, False if <flag> is incorrect
- Standard_EXPORT Standard_Boolean SetUnitFlag (const Standard_Integer flag);
-
- //! Sets a new unit from its value in meters (rounded to the
- //! closest one, max gap 1%)
- //! Returns True if done, False if <val> is too far from a
- //! suitable value
- Standard_EXPORT Standard_Boolean SetUnitValue (const Standard_Real val);
-
- //! Sets a new unit from its name (param 15 of Global Section)
- //! Returns True if done, False if <name> is incorrect
- //! Remark : if <flag> has been set to 3 (user defined), <name>
- //! is then free
- Standard_EXPORT Standard_Boolean SetUnitName (const Standard_CString name);
-
- //! Applies unit value to convert header data : Resolution,
- //! MaxCoord, MaxLineWeight
- //! Applies unit only once after SetUnit... has been called,
- //! if <enforce> is given as True.
- //! It can be called just before writing the model to a file,
- //! i.e. when definitive values are finally known
- Standard_EXPORT void ApplyUnit (const Standard_Boolean enforce = Standard_False);
-
- //! Performs the re-computation of status on the whole model
- //! (Subordinate Status and Use Flag of each IGES Entity), which
- //! can have required values according the way they are referenced
- //! (see definitions of Logical use, Physical use, etc...)
- Standard_EXPORT void ComputeStatus();
-
- //! Performs auto-correction on an IGESEntity
- //! Returns True if something has changed, False if nothing done.
- //!
- //! Works with the specific IGES Services : DirChecker which
- //! allows to correct data in "Directory Part" of Entities (such
- //! as required values for status, or references to be null), and
- //! the specific IGES service OwnCorrect, which is specialised for
- //! each type of entity.
- Standard_EXPORT Standard_Boolean AutoCorrect (const Handle(IGESData_IGESEntity)& ent);
-
- //! Performs auto-correction on the whole Model
- //! Returns the count of modified entities
- Standard_EXPORT Standard_Integer AutoCorrectModel();
-
- //! From the name of unit, computes flag number, 0 if incorrect
- //! (in this case, user defined entity remains possible)
- Standard_EXPORT static Standard_Integer UnitNameFlag (const Standard_CString name);
-
- //! From the flag of unit, determines value in MM, 0 if incorrect
- Standard_EXPORT static Standard_Real UnitFlagValue (const Standard_Integer flag);
-
- //! From the flag of unit, determines its name, "" if incorrect
- Standard_EXPORT static Standard_CString UnitFlagName (const Standard_Integer flag);
-
- //! From the flag of IGES version, returns name, "" if incorrect
- Standard_EXPORT static Standard_CString IGESVersionName (const Standard_Integer flag);
-
- //! Returns the maximum allowed value for IGESVersion Flag
- Standard_EXPORT static Standard_Integer IGESVersionMax();
-
- //! From the flag of drafting standard, returns name, "" if incorrect
- Standard_EXPORT static Standard_CString DraftingName (const Standard_Integer flag);
-
- //! Returns the maximum allowed value for Drafting Flag
- Standard_EXPORT static Standard_Integer DraftingMax();
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
- Standard_Boolean theunit;
- Handle(IGESData_Protocol) theproto;
- Handle(IGESData_IGESModel) themodel;
- Interface_GeneralLib theglib;
- IGESData_SpecificLib theslib;
-
-
-};
-
-
-
-
-
-
-
-#endif // _IGESData_BasicEditor_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
+class Interface_Protocol;
class IGESData_SpecificModule;
-class IGESData_Protocol;
class IGESData_IGESEntity;
class IGESData_SpecificLib;
class IGESData_NodeOfSpecificLib;
//! nothing if already in the list, THAT IS, Same Type (exact
//! match) and Same State (that is, IsEqual is not required)
//! Once added, stores its attached Protocol in correspondance
- Standard_EXPORT void Add (const Handle(IGESData_SpecificModule)& amodule, const Handle(IGESData_Protocol)& aprotocol);
+ Standard_EXPORT void Add (const Handle(IGESData_SpecificModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
//! Returns the Module stored in a given GlobalNode
Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const;
//! Returns the attached Protocol stored in a given GlobalNode
- Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
//! Returns the Next GlobalNode. If none is defined, returned
//! value is a Null Handle
Handle(IGESData_SpecificModule) themod;
- Handle(IGESData_Protocol) theprot;
+ Handle(Interface_Protocol) theprot;
Handle(IGESData_GlobalNodeOfSpecificLib) thenext;
#include <Standard_Type.hxx>
#include <IGESData_SpecificModule.hxx>
-#include <IGESData_Protocol.hxx>
#include <IGESData_GlobalNodeOfSpecificLib.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_SpecificLib.hxx>
#include <IGESData_NodeOfSpecificLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(IGESData_IGESEntity)
#define TheObject_hxx <IGESData_IGESEntity.hxx>
#define Handle_TheModule Handle(IGESData_SpecificModule)
#define TheModule IGESData_SpecificModule
#define TheModule_hxx <IGESData_SpecificModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib
#define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfSpecificLib.hxx>
#define LibCtl_Node IGESData_NodeOfSpecificLib
#define LibCtl_Library IGESData_SpecificLib
#define LibCtl_Library_hxx <IGESData_SpecificLib.hxx>
#include <LibCtl_GlobalNode.gxx>
-
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
+class Interface_Protocol;
class IGESData_ReadWriteModule;
-class IGESData_Protocol;
class IGESData_IGESEntity;
class IGESData_WriterLib;
class IGESData_NodeOfWriterLib;
//! nothing if already in the list, THAT IS, Same Type (exact
//! match) and Same State (that is, IsEqual is not required)
//! Once added, stores its attached Protocol in correspondance
- Standard_EXPORT void Add (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(IGESData_Protocol)& aprotocol);
+ Standard_EXPORT void Add (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
//! Returns the Module stored in a given GlobalNode
Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const;
//! Returns the attached Protocol stored in a given GlobalNode
- Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
//! Returns the Next GlobalNode. If none is defined, returned
//! value is a Null Handle
Handle(IGESData_ReadWriteModule) themod;
- Handle(IGESData_Protocol) theprot;
+ Handle(Interface_Protocol) theprot;
Handle(IGESData_GlobalNodeOfWriterLib) thenext;
#include <Standard_Type.hxx>
#include <IGESData_ReadWriteModule.hxx>
-#include <IGESData_Protocol.hxx>
#include <IGESData_GlobalNodeOfWriterLib.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_WriterLib.hxx>
#include <IGESData_NodeOfWriterLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(IGESData_IGESEntity)
#define TheObject_hxx <IGESData_IGESEntity.hxx>
#define Handle_TheModule Handle(IGESData_ReadWriteModule)
#define TheModule IGESData_ReadWriteModule
#define TheModule_hxx <IGESData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
#define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib
#define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfWriterLib.hxx>
#define LibCtl_Node IGESData_NodeOfWriterLib
#define LibCtl_Library IGESData_WriterLib
#define LibCtl_Library_hxx <IGESData_WriterLib.hxx>
#include <LibCtl_GlobalNode.gxx>
-
//#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation
#include <gp_XYZ.hxx>
-#include <IGESData_BasicEditor.hxx>
+#include <IGESData.hxx>
#include <IGESData_GlobalSection.hxx>
#include <Interface_Check.hxx>
#include <Interface_FileParameter.hxx>
//default (inches) value taken
corrected = 1;
else
- corrected = IGESData_BasicEditor::UnitNameFlag (theUnitName->ToCString());
+ corrected = IGESData::UnitNameFlag (theUnitName->ToCString());
if (corrected > 0) theUnitFlag = corrected;
else if (theUnitFlag == 3) {
Message_Msg Msg49 ("XSTEP_49");
//#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection
//#13 smh 13.01.2000 : Parsing long year date
-#include <IGESData_BasicEditor.hxx>
+#include <IGESData.hxx>
#include <IGESData_GlobalSection.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_IGESModel.hxx>
if (!str.IsNull()) S<<"[22] Company : "<<str->ToCString()<<"\n";
Standard_Integer num = theheader.IGESVersion();
S << "[23] IGES Version Number : " << num << " -> Name : "
- << IGESData_BasicEditor::IGESVersionName(num);
+ << IGESData::IGESVersionName(num);
num = theheader.DraftingStandard();
S << "\n[24] Drafting Standard : " << num;
- if (num > 0) S<< " -> Name : " << IGESData_BasicEditor::DraftingName(num);
+ if (num > 0) S<< " -> Name : " << IGESData::DraftingName(num);
S<<endl;
if (theheader.HasLastChangeDate()) {
}
-
-//=======================================================================
-//function : GlobalSection
-//purpose :
-//=======================================================================
-
-const IGESData_GlobalSection& IGESData_IGESModel::GlobalSection () const
- { return theheader; }
-
-
-//=======================================================================
-//function : SetGlobalSection
-//purpose :
-//=======================================================================
-
-void IGESData_IGESModel::SetGlobalSection
- (const IGESData_GlobalSection& header)
- { theheader = header; }
-
-
//=======================================================================
//function : ApplyStatic
//purpose :
//purpose :
//=======================================================================
-void IGESData_IGESModel::GetFromAnother
- (const Handle(Interface_InterfaceModel)& other)
+void IGESData_IGESModel::GetFromAnother (const Handle(IGESData_IGESModel)& other)
{
- DeclareAndCast(IGESData_IGESModel,another,other);
- theheader = another->GlobalSection();
+ theheader = other->GlobalSection();
theheader.CopyRefs();
- SetStartSection (another->StartSection(),Standard_True);
+ SetStartSection (other->StartSection(),Standard_True);
}
-//=======================================================================
-//function : NewEmptyModel
-//purpose :
-//=======================================================================
-
-Handle(Interface_InterfaceModel) IGESData_IGESModel::NewEmptyModel () const
- { return new IGESData_IGESModel; }
-
-
//=======================================================================
//function : VerifyCheck
//purpose :
// Sending of message : Version Flag parameter is incorrect.
if (theheader.IGESVersion() < 1 ||
- theheader.IGESVersion() > IGESData_BasicEditor::IGESVersionMax()) {
+ theheader.IGESVersion() > IGESData::IGESVersionMax()) {
Message_Msg Msg53 ("XSTEP_53");
ach->SendWarning(Msg53);
}
// Sending of message : Drafting Standard Flag parameter is incorrect.
if (theheader.DraftingStandard() < 0 ||
- theheader.DraftingStandard() > IGESData_BasicEditor::DraftingMax()) {
+ theheader.DraftingStandard() > IGESData::DraftingMax()) {
Message_Msg Msg54 ("XSTEP_54");
ach->SendWarning(Msg54);
}
Standard_EXPORT void AddStartLine (const Standard_CString line, const Standard_Integer atnum = 0);
//! Returns the Global section of the IGES file.
- Standard_EXPORT const IGESData_GlobalSection& GlobalSection() const;
-
+ const IGESData_GlobalSection& GlobalSection() const { return theheader; }
+
//! Sets the Global section of the IGES file.
- Standard_EXPORT void SetGlobalSection (const IGESData_GlobalSection& header);
-
+ void SetGlobalSection (const IGESData_GlobalSection& header) { theheader = header; }
+
//! Sets some of the Global section
//! parameters with the values defined by the translation
//! parameters. param may be:
//! The default value for param is an empty string.
//! Returns True when done and if param is given, False if param is
//! unknown or empty. Note: Set the unit in the IGES
- //! file Global section via IGESData_BasicEditor class.
+ //! file Global section via IGESData class.
Standard_EXPORT Standard_Boolean ApplyStatic (const Standard_CString param = "");
//! Returns an IGES entity given by its rank number.
Standard_EXPORT Standard_Integer DNum (const Handle(IGESData_IGESEntity)& ent) const;
//! gets Header (GlobalSection) from another Model
- Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE;
-
- //! Returns a New Empty Model, same type as <me> i.e. IGESModel
- Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE;
+ Standard_EXPORT void GetFromAnother (const Handle(IGESData_IGESModel)& other);
//! Checks that the IGES file Global
//! section contains valid data that conforms to the IGES specifications.
return (!ach->HasFailed());
}
ReadProps (ent,igesdat,PR);
-// thestep = IGESData_ReadEnd;
if (!PR.IsCheckEmpty()) ach = PR.Check();
return (!ach->HasFailed());
}
void IGESData_IGESReaderTool::EndRead
(const Handle(Interface_InterfaceModel)& /* amodel */)
{
-/*
- DeclareAndCast(IGESData_IGESModel,amod,amodel);
- DeclareAndCast(IGESData_IGESReaderData,igesdat,Data());
- amod->SetLineWeights(igesdat->DefaultLineWeight());
-*/
}
undent->ReadOwnParams(IR,PR);
// IGESEntity creee puis non reconnue ... (bizarre, non ?)
} else {
-// IGESData_IGESType DT = ent->IGESType();
// Sending of message : Unknown Entity
Message_Msg Msg36 ("XSTEP_36");
Msg36.Arg(thecnum);
//! Parameters are accessed through specific objects, ParamReaders
class IGESData_IGESReaderTool : public Interface_FileReaderTool
{
-public:
+ public:
DEFINE_STANDARD_ALLOC
-
//! creates IGESReaderTool to work with an IGESReaderData and an
//! IGES Protocol.
//! Actually, no Lib is used
//! RQ : Actually, sets DNum into IGES Entities
//! Also loads the list of parameters for ParamReader
Standard_EXPORT void Prepare (const Handle(IGESData_FileRecognizer)& reco);
+
+ private:
//! recognizes records by asking Protocol (on data of DirType)
- Standard_EXPORT Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE;
+ Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE;
//! fills model's header, that is, its GlobalSection
- Standard_EXPORT void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
+ Standard_EXPORT virtual void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
//! fills an entity, given record no; works by calling ReadDirPart
//! then ReadParams (with help of a ParamReader), then if required
//! ReadProps and ReadAssocs, from IGESEntity
//! Returns True if no fail has been recorded
- Standard_EXPORT Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) Standard_OVERRIDE;
+ Standard_EXPORT virtual Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) Standard_OVERRIDE;
//! after reading entities, true line weights can be computed
Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
//! Note that "Associated" entities are not declared "Shared"
Standard_EXPORT void ReadAssocs (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
Handle(Interface_ParamList) thelist;
Handle(IGESData_FileRecognizer) thereco;
Interface_GeneralLib theglib;
Standard_Integer thegradweight;
Standard_Real themaxweight;
Standard_Real thedefweight;
-
-
};
-
-
-
-
-
-
#endif // _IGESData_IGESReaderTool_HeaderFile
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
+class Interface_Protocol;
class IGESData_GlobalNodeOfSpecificLib;
class IGESData_IGESEntity;
class IGESData_SpecificModule;
-class IGESData_Protocol;
class IGESData_SpecificLib;
Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const;
//! Returns the Protocol designated by a precise Node
- Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
//! Returns the Next Node. If none was defined, returned value
//! is a Null Handle
#include <IGESData_NodeOfSpecificLib.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_SpecificModule.hxx>
-#include <IGESData_Protocol.hxx>
#include <IGESData_SpecificLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(IGESData_IGESEntity)
#define TheObject_hxx <IGESData_IGESEntity.hxx>
#define Handle_TheModule Handle(IGESData_SpecificModule)
#define TheModule IGESData_SpecificModule
#define TheModule_hxx <IGESData_SpecificModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib
#define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfSpecificLib.hxx>
#define LibCtl_Node IGESData_NodeOfSpecificLib
#define LibCtl_Library IGESData_SpecificLib
#define LibCtl_Library_hxx <IGESData_SpecificLib.hxx>
#include <LibCtl_Node.gxx>
-
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
+class Interface_Protocol;
class IGESData_GlobalNodeOfWriterLib;
class IGESData_IGESEntity;
class IGESData_ReadWriteModule;
-class IGESData_Protocol;
class IGESData_WriterLib;
Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const;
//! Returns the Protocol designated by a precise Node
- Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
//! Returns the Next Node. If none was defined, returned value
//! is a Null Handle
#include <IGESData_NodeOfWriterLib.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_ReadWriteModule.hxx>
-#include <IGESData_Protocol.hxx>
#include <IGESData_WriterLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(IGESData_IGESEntity)
#define TheObject_hxx <IGESData_IGESEntity.hxx>
#define Handle_TheModule Handle(IGESData_ReadWriteModule)
#define TheModule IGESData_ReadWriteModule
#define TheModule_hxx <IGESData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
#define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib
#define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfWriterLib.hxx>
#define LibCtl_Node IGESData_NodeOfWriterLib
#define LibCtl_Library IGESData_WriterLib
#define LibCtl_Library_hxx <IGESData_WriterLib.hxx>
#include <LibCtl_Node.gxx>
-
IMPLEMENT_STANDARD_RTTIEXT(IGESData_Protocol,Interface_Protocol)
-IGESData_Protocol::IGESData_Protocol () { }
-
-
- Standard_Integer IGESData_Protocol::NbResources () const { return 0; }
-
- Handle(Interface_Protocol) IGESData_Protocol::Resource
- (const Standard_Integer /*num*/) const
- { Handle(Interface_Protocol) nulpro; return nulpro; }
-
-
// TypeNumber : Ici, on reconnait UndefinedEntity (faut bien quelqu un)
Standard_Integer IGESData_Protocol::TypeNumber
//! Undefined-FreeFormat-Entity
class IGESData_Protocol : public Interface_Protocol
{
+ public:
-public:
-
-
- Standard_EXPORT IGESData_Protocol();
-
- //! Gives the count of Resource Protocol. Here, none
- Standard_EXPORT Standard_Integer NbResources() const Standard_OVERRIDE;
-
- //! Returns a Resource, given a rank. Here, none
- Standard_EXPORT Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE;
+ IGESData_Protocol() {}
//! Returns a Case Number, specific of each recognized Type
//! Here, Undefined and Free Format Entities have the Number 1.
class Standard_NoSuchObject;
class IGESData_IGESEntity;
class IGESData_SpecificModule;
-class IGESData_Protocol;
class IGESData_GlobalNodeOfSpecificLib;
-class Standard_Transient;
+class Interface_Protocol;
//! Adds a couple (Module-Protocol) into the global definition set
//! for this class of Library.
- Standard_EXPORT static void SetGlobal (const Handle(IGESData_SpecificModule)& amodule, const Handle(IGESData_Protocol)& aprotocol);
+ Standard_EXPORT static void SetGlobal (const Handle(IGESData_SpecificModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
//! Creates a Library which complies with a Protocol, that is :
//! Same class (criterium IsInstance)
//! This creation gets the Modules from the global set, those
//! which are bound to the given Protocol and its Resources
- Standard_EXPORT IGESData_SpecificLib(const Handle(IGESData_Protocol)& aprotocol);
+ Standard_EXPORT IGESData_SpecificLib(const Handle(Interface_Protocol)& aprotocol);
//! Creates an empty Library : it will later by filled by method
//! AddProtocol
//! Adds a couple (Module-Protocol) to the Library, given the
//! class of a Protocol. Takes Resources into account.
//! (if <aprotocol> is not of type TheProtocol, it is not added)
- Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
+ Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol);
//! Clears the list of Modules of a library (can be used to
//! redefine the order of Modules before action : Clear then
//! refill the Library by calls to AddProtocol)
Standard_EXPORT void Clear();
- //! Sets a library to be defined with the complete Global list
- //! (all the couples Protocol/Modules recorded in it)
- Standard_EXPORT void SetComplete();
-
//! Selects a Module from the Library, given an Object.
//! Returns True if Select has succeeded, False else.
//! Also Returns (as arguments) the selected Module and the Case
Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const;
//! Returns the current Protocol in the Iteration
- Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
#include <Standard_NoSuchObject.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_SpecificModule.hxx>
-#include <IGESData_Protocol.hxx>
#include <IGESData_GlobalNodeOfSpecificLib.hxx>
-#include <Standard_Transient.hxx>
#define TheObject Handle(IGESData_IGESEntity)
#define Handle_TheModule Handle(IGESData_SpecificModule)
#define TheModule IGESData_SpecificModule
#define TheModule_hxx <IGESData_SpecificModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib
#define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfSpecificLib.hxx>
#define LibCtl_Node IGESData_NodeOfSpecificLib
#define LibCtl_Library IGESData_SpecificLib
#define LibCtl_Library_hxx <IGESData_SpecificLib.hxx>
#include <LibCtl_Library.gxx>
-
class Standard_NoSuchObject;
class IGESData_IGESEntity;
class IGESData_ReadWriteModule;
-class IGESData_Protocol;
class IGESData_GlobalNodeOfWriterLib;
-class Standard_Transient;
+class Interface_Protocol;
//! Adds a couple (Module-Protocol) into the global definition set
//! for this class of Library.
- Standard_EXPORT static void SetGlobal (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(IGESData_Protocol)& aprotocol);
+ Standard_EXPORT static void SetGlobal (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
//! Creates a Library which complies with a Protocol, that is :
//! Same class (criterium IsInstance)
//! This creation gets the Modules from the global set, those
//! which are bound to the given Protocol and its Resources
- Standard_EXPORT IGESData_WriterLib(const Handle(IGESData_Protocol)& aprotocol);
+ Standard_EXPORT IGESData_WriterLib(const Handle(Interface_Protocol)& aprotocol);
//! Creates an empty Library : it will later by filled by method
//! AddProtocol
//! Adds a couple (Module-Protocol) to the Library, given the
//! class of a Protocol. Takes Resources into account.
//! (if <aprotocol> is not of type TheProtocol, it is not added)
- Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
+ Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol);
//! Clears the list of Modules of a library (can be used to
//! redefine the order of Modules before action : Clear then
//! refill the Library by calls to AddProtocol)
Standard_EXPORT void Clear();
- //! Sets a library to be defined with the complete Global list
- //! (all the couples Protocol/Modules recorded in it)
- Standard_EXPORT void SetComplete();
-
//! Selects a Module from the Library, given an Object.
//! Returns True if Select has succeeded, False else.
//! Also Returns (as arguments) the selected Module and the Case
Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const;
//! Returns the current Protocol in the Iteration
- Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
#include <Standard_NoSuchObject.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_ReadWriteModule.hxx>
-#include <IGESData_Protocol.hxx>
#include <IGESData_GlobalNodeOfWriterLib.hxx>
-#include <Standard_Transient.hxx>
#define TheObject Handle(IGESData_IGESEntity)
#define Handle_TheModule Handle(IGESData_ReadWriteModule)
#define TheModule IGESData_ReadWriteModule
#define TheModule_hxx <IGESData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
#define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib
#define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfWriterLib.hxx>
#define LibCtl_Node IGESData_NodeOfWriterLib
#define LibCtl_Library IGESData_WriterLib
#define LibCtl_Library_hxx <IGESData_WriterLib.hxx>
#include <LibCtl_Library.gxx>
-
Handle(Interface_Protocol) IGESDefs_Protocol::Resource
(const Standard_Integer /*num*/) const
{
- Handle(Interface_Protocol) res = IGESGraph::Protocol();
- return res;
+ return IGESGraph::Protocol();
}
Standard_Integer IGESDefs_Protocol::TypeNumber
Handle(Interface_Protocol) IGESDimen_Protocol::Resource
(const Standard_Integer num) const
{
- Handle(Interface_Protocol) res;
- if (num == 1) res = IGESGraph::Protocol();
- if (num == 2) res = IGESGeom::Protocol();
- return res;
+ if (num == 1) return IGESGraph::Protocol();
+ if (num == 2) return IGESGeom::Protocol();
+ return NULL;
}
Standard_Integer IGESDimen_Protocol::TypeNumber
Handle(Interface_Protocol) IGESDraw_Protocol::Resource
(const Standard_Integer /*num*/) const
{
- Handle(Interface_Protocol) res = IGESDimen::Protocol();;
- return res;
+ return IGESDimen::Protocol();
}
Standard_Integer IGESDraw_Protocol::TypeNumber
iges_finfile(1);
IGESData_IGESReaderTool IT (IR,protocol);
IT.Prepare(reco);
- IT.SetErrorHandle(Standard_True);
// Sending of message : Loading of Model : Beginning
IT.LoadModel(amodel);
Handle(Interface_Protocol) IGESGeom_Protocol::Resource
(const Standard_Integer /*num*/) const
{
- Handle(Interface_Protocol) res = IGESBasic::Protocol();;
- return res;
+ return IGESBasic::Protocol();
}
Standard_Integer IGESGeom_Protocol::TypeNumber
Handle(Interface_Protocol) IGESGraph_Protocol::Resource
(const Standard_Integer /*num*/) const
{
- Handle(Interface_Protocol) res = IGESBasic::Protocol();;
- return res;
+ return IGESBasic::Protocol();
}
Standard_Integer IGESGraph_Protocol::TypeNumber
Handle(Interface_Protocol) IGESSolid_Protocol::Resource
(const Standard_Integer /*num*/) const
{
- Handle(Interface_Protocol) res = IGESGeom::Protocol();;
- return res;
+ return IGESGeom::Protocol();
}
Standard_Integer IGESSolid_Protocol::TypeNumber
const Handle(Interface_Protocol)& protocol)
: thelib (protocol) , thelst (amodel->NbEntities())
{
- thelst.Init(Standard_False);
- themod = amodel;
- themap = new Interface_CopyMap (amodel);
- therep = new Interface_CopyMap (amodel);
- thelev = 0; theimp = Standard_False;
-}
-
-
- Interface_CopyTool::Interface_CopyTool
- (const Handle(Interface_InterfaceModel)& amodel)
- : thelib (Interface_Protocol::Active()) , thelst (amodel->NbEntities())
-{
- if (Interface_Protocol::Active().IsNull()) Interface_InterfaceError::Raise
- ("Interface CopyTool : Create with Active Protocol undefined");
-
thelst.Init(Standard_False);
themod = amodel;
themap = new Interface_CopyMap (amodel);
Standard_Boolean res = thelib.Select (entfrom,themdu,theCN);
if (res) res = themdu->NewVoid (theCN,entto);
if (!res) res = themdu->NewCopiedCase (theCN,entfrom,entto,*this);
-// if (!res) entto = entfrom->ShallowCopy(); sorry, nothing more possible
return res;
}
}
- void Interface_CopyTool::FillModel
- (const Handle(Interface_InterfaceModel)& bmodel)
-{
-// Travaux preparatoires concernant les modeles
-// On commence : cela implique le Header
- bmodel->Clear();
- bmodel->GetFromAnother(themod);
-
-// Transfert Passe 1 : On prend les Entites prealablement copiees
- Interface_EntityIterator list = CompleteResult(Standard_True);
- bmodel->GetFromTransfer(list);
-
-// Transfert Passe 2 : recuperation des relations non "Share" (mais "Imply")
- RenewImpliedRefs();
-}
-
-
Interface_EntityIterator Interface_CopyTool::CompleteResult
(const Standard_Boolean withreports) const
{
DEFINE_STANDARD_ALLOC
-
//! Creates a CopyTool adapted to work from a Model. Works
//! with a General Service Library, given as an argument
Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib);
//! Same as above, but Library is defined through a Protocol
Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol);
- //! Same as above, but works with the Active Protocol
- Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel);
-
//! Returns the Model on which the CopyTool works
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
//! "back pointers".
Standard_EXPORT void RenewImpliedRefs();
- //! Fills a Model with the result of the transfer (TransferList)
- //! Commands copy of Header too, and calls RenewImpliedRefs
- Standard_EXPORT void FillModel (const Handle(Interface_InterfaceModel)& bmodel);
-
//! Returns the complete list of copied Entities
//! If <withreports> is given True, the entities which were
//! reported in the Starting Model are replaced in the list
#endif
#include <stdio.h>
-// MGE 16/06/98
-// To use Msg class
#include <Message_Msg.hxx>
-// To use TCollectionHAsciiString
#include <TCollection_HAsciiString.hxx>
// Failure pour recuperer erreur en lecture fichier,
//=======================================================================
Interface_FileReaderTool::Interface_FileReaderTool ()
+: themessenger(Message::DefaultMessenger()),
+ thetrace(1),
+ thenbrep0(0),
+ thenbreps(0)
{
- themessenger = Message::DefaultMessenger();
- theerrhand = Standard_True;
- thetrace = 1;
- thenbrep0 = thenbreps = 0;
-}
-
-//=======================================================================
-//function : SetData
-//purpose :
-//=======================================================================
-
-void Interface_FileReaderTool::SetData(const Handle(Interface_FileReaderData)& reader,
- const Handle(Interface_Protocol)& protocol)
-{
- thereader = reader;
- theproto = protocol;
-}
-
-
-//=======================================================================
-//function : Protocol
-//purpose :
-//=======================================================================
-
-Handle(Interface_Protocol) Interface_FileReaderTool::Protocol () const
-{
- return theproto;
-}
-
-
-//=======================================================================
-//function : Data
-//purpose :
-//=======================================================================
-
-Handle(Interface_FileReaderData) Interface_FileReaderTool::Data () const
-{
- return thereader;
-}
-
-
-//=======================================================================
-//function : SetModel
-//purpose :
-//=======================================================================
-
-void Interface_FileReaderTool::SetModel
- (const Handle(Interface_InterfaceModel)& amodel)
-{
- themodel = amodel;
-}
-
-
-//=======================================================================
-//function : Model
-//purpose :
-//=======================================================================
-
-Handle(Interface_InterfaceModel) Interface_FileReaderTool::Model () const
-{
- return themodel;
}
//=======================================================================
void Interface_FileReaderTool::SetMessenger (const Handle(Message_Messenger)& messenger)
{
- if ( messenger.IsNull() )
- themessenger = Message::DefaultMessenger();
- else
- themessenger = messenger;
-}
-
-//=======================================================================
-//function : Messenger
-//purpose :
-//=======================================================================
-
-Handle(Message_Messenger) Interface_FileReaderTool::Messenger () const
-{
- return themessenger;
-}
-
-//=======================================================================
-//function : SetTraceLevel
-//purpose :
-//=======================================================================
-
-void Interface_FileReaderTool::SetTraceLevel (const Standard_Integer tracelev)
-{
- thetrace = tracelev;
-}
-
-//=======================================================================
-//function : TraceLevel
-//purpose :
-//=======================================================================
-
-Standard_Integer Interface_FileReaderTool::TraceLevel () const
-{
- return thetrace;
-}
-
-//=======================================================================
-//function : SetErrorHandle
-//purpose :
-//=======================================================================
-
-void Interface_FileReaderTool::SetErrorHandle(const Standard_Boolean err)
-{
- theerrhand = err;
-}
-
-
-//=======================================================================
-//function : ErrorHandle
-//purpose :
-//=======================================================================
-
-Standard_Boolean Interface_FileReaderTool::ErrorHandle() const
-{
- return theerrhand;
+ themessenger = ( messenger.IsNull()? Message::DefaultMessenger() : messenger );
}
// .... Actions Connexes au CHARGEMENT DU MODELE ....
num = thereader->FindNextRecord(num)) {
Handle(Standard_Transient) newent;
Handle(Interface_Check) ach = new Interface_Check;
- if (!Recognize (num,ach,newent)) {
- newent = UnknownEntity();
- if (thereports.IsNull()) thereports =
- new TColStd_HArray1OfTransient (1,thereader->NbRecords());
- thenbreps ++; thenbrep0 ++;
- thereports->SetValue (num,new Interface_ReportEntity(ach,newent));
- }
- else if ((ach->NbFails() + ach->NbWarnings() > 0) && !newent.IsNull()) {
- if (thereports.IsNull()) thereports =
- new TColStd_HArray1OfTransient (1,thereader->NbRecords());
+ Standard_Boolean res = Recognize (num,ach,newent);
+ if (!res) newent = theproto->UnknownEntity();
+ else res = ((ach->NbFails() + ach->NbWarnings()) == 0) || newent.IsNull();
+ if (!res) {
+ if (thereports.IsNull()) thereports = new TColStd_HArray1OfTransient (1,thereader->NbRecords());
thenbreps ++; thenbrep0 ++;
thereports->SetValue (num,new Interface_ReportEntity(ach,newent));
}
}
-//=======================================================================
-//function : RecognizeByLib
-//purpose :
-//=======================================================================
-
-Standard_Boolean Interface_FileReaderTool::RecognizeByLib(const Standard_Integer num,
- Interface_GeneralLib& glib,
- Interface_ReaderLib& rlib,
- Handle(Interface_Check)& ach,
- Handle(Standard_Transient)& ent) const
-{
- Handle(Interface_GeneralModule) gmod;
- Handle(Interface_ReaderModule) rmod;
- Handle(Interface_Protocol) proto;
- Standard_Integer CN = 0;
-// Chercher dans ReaderLib : Reconnaissance de cas -> CN , proto
- for (rlib.Start(); rlib.More(); rlib.Next()) {
- rmod = rlib.Module();
- if (rmod.IsNull()) continue;
- CN = rmod->CaseNum(thereader,num);
- if (CN > 0) { proto = rlib.Protocol(); break; }
- }
- if (CN <= 0 || proto.IsNull()) return Standard_False;
-// Se recaler dans GeneralLib : Creation de l entite vide
- Handle(Standard_Type) typrot = proto->DynamicType();
- for (glib.Start(); glib.More(); glib.Next()) {
- proto = glib.Protocol();
- if (proto.IsNull()) continue;
- if (proto->DynamicType() != typrot) continue;
- Standard_Boolean res = glib.Module()->NewVoid(CN,ent);
- if (res) return res;
- if (!rmod.IsNull()) return rmod->NewRead (CN,thereader,num,ach,ent);
-// return res;
- }
- return Standard_False;
-}
-
-
-//=======================================================================
-//function : UnknownEntity
-//purpose :
-//=======================================================================
-
-Handle(Standard_Transient) Interface_FileReaderTool::UnknownEntity() const
-{
- return theproto->UnknownEntity();
-}
-
-
-//=======================================================================
-//function : NewModel
-//purpose :
-//=======================================================================
-
-Handle(Interface_InterfaceModel) Interface_FileReaderTool::NewModel() const
-{
- return theproto->NewModel();
-}
-
-
//=======================================================================
//function : EndRead
//purpose :
//purpose :
//=======================================================================
-void Interface_FileReaderTool::LoadModel
- (const Handle(Interface_InterfaceModel)& amodel)
+void Interface_FileReaderTool::LoadModel (const Handle(Interface_InterfaceModel)& amodel)
//
// Methode generale de lecture d un fichier : il est lu via un FileReaderData
// qui doit y donner acces de la facon la plus performante possible
SetModel(amodel);
// .. Demarrage : Lecture du Header ..
- if (theerrhand) {
- try {
- OCC_CATCH_SIGNALS
- BeginRead(amodel); // selon la norme
- }
- catch (Standard_Failure) {
- // Sendinf of message : Internal error during the header reading
- Message_Msg Msg11("XSTEP_11");
- TF->Send (Msg11, Message_Info);
- }
- }
- else
+ try {
+ OCC_CATCH_SIGNALS
BeginRead(amodel); // selon la norme
+ }
+ catch (Standard_Failure) {
+ // Sendinf of message : Internal error during the header reading
+ Message_Msg Msg11("XSTEP_11");
+ TF->Send (Msg11, Message_Info);
+ }
// .. Lecture des Entites ..
thenbreps ++;
Handle(Interface_ReportEntity) rep =
new Interface_ReportEntity(ach,anent);
- Handle(Standard_Transient) undef = UnknownEntity();
+ Handle(Standard_Transient) undef = theproto->UnknownEntity();
AnalyseRecord(num,undef,ach);
rep->SetContent(undef);
}
// Conclusion : peut ne rien faire : selon necessite
- if (theerrhand) {
- try {
- OCC_CATCH_SIGNALS
- EndRead(amodel); // selon la norme
- }
- catch (Standard_Failure) {
- // Sendinf of message : Internal error during the header reading
- Message_Msg Msg11("XSTEP_11");
- TF->Send (Msg11, Message_Info);
- }
- }
- else
+ try {
+ OCC_CATCH_SIGNALS
EndRead(amodel); // selon la norme
+ }
+ catch (Standard_Failure) {
+ // Sendinf of message : Internal error during the header reading
+ Message_Msg Msg11("XSTEP_11");
+ TF->Send (Msg11, Message_Info);
+ }
}
//purpose :
//=======================================================================
-Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity
- (const Standard_Integer num)
+Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity (const Standard_Integer num)
{
Handle(Standard_Transient) anent = thereader->BoundEntity(num);
Handle(Interface_Check) ach = new Interface_Check(anent);
// Rechargement ? si oui, dans une UnknownEntity fournie par le protocole
if (thereader->IsErrorLoad()) nbf = (thereader->ResetErrorLoad() ? 1 : 0);
if (nbf > 0) {
- Handle(Standard_Transient) undef = UnknownEntity();
+ Handle(Standard_Transient) undef = theproto->UnknownEntity();
AnalyseRecord(num,undef,ach);
rep->SetContent(undef);
}
-// Conclusion (Unknown : traite en externe because traitement Raise)
-//// if (irep > 0) themodel->SetReportEntity (nbe,rep); en bloc a la fin
-
return anent;
}
//=======================================================================
-//function : ~Interface_FileReaderTool
+//function : RecognizeByLib
//purpose :
//=======================================================================
-Interface_FileReaderTool::~Interface_FileReaderTool()
-{}
-
-void Interface_FileReaderTool::Clear()
+Standard_Boolean Interface_FileReaderTool::RecognizeByLib(const Standard_Integer num,
+ Interface_GeneralLib& glib,
+ Interface_ReaderLib& rlib,
+ Handle(Interface_Check)& ach,
+ Handle(Standard_Transient)& ent) const
{
- theproto.Nullify();
- thereader.Nullify();
- themodel.Nullify();
- thereports.Nullify();
+ Handle(Interface_GeneralModule) gmod;
+ Handle(Interface_ReaderModule) rmod;
+ Handle(Interface_Protocol) proto;
+ Standard_Integer CN = 0;
+// Chercher dans ReaderLib : Reconnaissance de cas -> CN , proto
+ for (rlib.Start(); rlib.More(); rlib.Next()) {
+ rmod = rlib.Module();
+ if (rmod.IsNull()) continue;
+ CN = rmod->CaseNum(thereader,num);
+ if (CN > 0) { proto = rlib.Protocol(); break; }
+ }
+ if (CN <= 0 || proto.IsNull()) return Standard_False;
+// Se recaler dans GeneralLib : Creation de l entite vide
+ Handle(Standard_Type) typrot = proto->DynamicType();
+ for (glib.Start(); glib.More(); glib.Next()) {
+ proto = glib.Protocol();
+ if (proto.IsNull()) continue;
+ if (proto->DynamicType() != typrot) continue;
+ Standard_Boolean res = glib.Module()->NewVoid(CN,ent);
+ if (res) return res;
+ if (!rmod.IsNull()) return rmod->NewRead (CN,thereader,num,ach,ent);
+ }
+ return Standard_False;
}
DEFINE_STANDARD_ALLOC
-
//! Sets Data to a FileReaderData. Works with a Protocol
- Standard_EXPORT void SetData (const Handle(Interface_FileReaderData)& reader, const Handle(Interface_Protocol)& protocol);
+ void SetData (const Handle(Interface_FileReaderData)& reader, const Handle(Interface_Protocol)& protocol)
+ {
+ thereader = reader;
+ theproto = protocol;
+ }
//! Returns the Protocol given at creation time
- Standard_EXPORT Handle(Interface_Protocol) Protocol() const;
+ const Handle(Interface_Protocol) & Protocol() const { return theproto; }
//! Returns the FileReaderData which is used to work
- Standard_EXPORT Handle(Interface_FileReaderData) Data() const;
+ const Handle(Interface_FileReaderData) & Data() const { return thereader; }
//! Stores a Model. Used when the Model has been loaded
- Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& amodel);
+ void SetModel (const Handle(Interface_InterfaceModel)& amodel) { themodel = amodel; }
//! Returns the stored Model
- Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
+ const Handle(Interface_InterfaceModel) & Model() const { return themodel; }
//! Sets Messenger used for outputting messages
Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger);
//! Returns Messenger used for outputting messages.
//! The returned object is guaranteed to be non-null;
//! default is Message::Messenger().
- Standard_EXPORT Handle(Message_Messenger) Messenger() const;
+ const Handle(Message_Messenger) & Messenger() const { return themessenger; }
//! Sets trace level used for outputting messages
//! - 0: no trace at all
//! - 2: errors and warnings
//! - 3: all messages
//! Default is 1 : Errors traced
- Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev);
+ void SetTraceLevel (const Standard_Integer tracelev) { thetrace = tracelev; }
//! Returns trace level used for outputting messages.
- Standard_EXPORT Standard_Integer TraceLevel() const;
-
- //! Allows controlling whether exception raisings are handled
- //! If err is False, they are not (hence, dbx can take control)
- //! If err is True, they are, and they are traced
- //! (by putting on messenger Entity's Number and file record num)
- //! Default given at Model's creation time is True
- Standard_EXPORT void SetErrorHandle (const Standard_Boolean err);
-
- //! Returns ErrorHandle flag
- Standard_EXPORT Standard_Boolean ErrorHandle() const;
+ Standard_Integer TraceLevel() const { return thetrace; }
//! Fills records with empty entities; once done, each entity can
//! ask the FileReaderTool for any entity referenced through an
//! type of FileReaderTool
Standard_EXPORT void SetEntities();
- //! Recognizes a record, given its number. Specific to each
- //! Interface; called by SetEntities. It can call the basic method
- //! RecognizeByLib.
- //! Returns False if recognition has failed, True else.
- //! <ach> has not to be filled if simply Recognition has failed :
- //! it must record true error messages : RecognizeByLib can
- //! generate error messages if NewRead is called
- //!
- //! Note that it works thru a Recognizer (method Evaluate) which
- //! has to be memorized before starting
- Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) = 0;
-
- //! Recognizes a record with the help of Libraries. Can be used
- //! to implement the method Recognize.
- //! <rlib> is used to find Protocol and CaseNumber to apply
- //! <glib> performs the creation (by service NewVoid, or NewRead
- //! if NewVoid gave no result)
- //! <ach> is a check, which is transmitted to NewRead if it is
- //! called, gives a result but which is false
- //! <ent> is the result
- //! Returns False if recognition has failed, True else
- Standard_EXPORT Standard_Boolean RecognizeByLib (const Standard_Integer num, Interface_GeneralLib& glib, Interface_ReaderLib& rlib, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const;
-
- //! Provides an unknown entity, specific to the Interface
- //! called by SetEntities when Recognize has failed (Unknown alone)
- //! or by LoadModel when an Entity has caused a Fail on reading
- //! (to keep at least its literal description)
- //! Uses Protocol to do it
- Standard_EXPORT Handle(Standard_Transient) UnknownEntity() const;
-
- //! Creates an empty Model of the norm. Uses Protocol to do it
- Standard_EXPORT Handle(Interface_InterfaceModel) NewModel() const;
-
//! Reads and fills Entities from the FileReaderData set by
//! SetData to an InterfaceModel.
//! It enchains required operations, the specific ones correspond
//! Warning, by producing a ReportEntyty plus , for a Fail, a
//! literal Content (as an UnknownEntity). Performs also Trace
Standard_EXPORT Handle(Standard_Transient) LoadedEntity (const Standard_Integer num);
+
+ protected:
+
+ //! Constructor; sets default fields
+ Standard_EXPORT Interface_FileReaderTool();
+
+ //! Recognizes a record with the help of Libraries. Can be used
+ //! to implement the method Recognize.
+ //! <rlib> is used to find Protocol and CaseNumber to apply
+ //! <glib> performs the creation (by service NewVoid, or NewRead
+ //! if NewVoid gave no result)
+ //! <ach> is a check, which is transmitted to NewRead if it is
+ //! called, gives a result but which is false
+ //! <ent> is the result
+ //! Returns False if recognition has failed, True else
+ Standard_EXPORT Standard_Boolean RecognizeByLib (const Standard_Integer num, Interface_GeneralLib& glib, Interface_ReaderLib& rlib, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const;
+
+ //! Recognizes a record, given its number. Specific to each
+ //! Interface; called by SetEntities. It can call the basic method
+ //! RecognizeByLib.
+ //! Returns False if recognition has failed, True else.
+ //! <ach> has not to be filled if simply Recognition has failed :
+ //! it must record true error messages : RecognizeByLib can
+ //! generate error messages if NewRead is called
+ //!
+ //! Note that it works thru a Recognizer (method Evaluate) which
+ //! has to be memorized before starting
+ Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) = 0;
//! Fills model's header; each Interface defines for its Model its
//! own file header; this method fills it from FileReaderTool.+
//! else (in case of syntactic fail)
Standard_EXPORT virtual Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) = 0;
- Standard_EXPORT virtual ~Interface_FileReaderTool();
-
//! Ends file reading after reading all the entities
//! default is doing nothing; redefinable as necessary
- Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel);
-
- //! Clear filelds
- Standard_EXPORT void Clear();
-
-
-
-
-protected:
-
-
- //! Constructor; sets default fields
- Standard_EXPORT Interface_FileReaderTool();
-
-
-
-
-private:
-
+ Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) = 0;
+ private:
Handle(Interface_Protocol) theproto;
Handle(Interface_FileReaderData) thereader;
Handle(Interface_InterfaceModel) themodel;
Handle(Message_Messenger) themessenger;
Standard_Integer thetrace;
- Standard_Boolean theerrhand;
Standard_Integer thenbrep0;
Standard_Integer thenbreps;
Handle(TColStd_HArray1OfTransient) thereports;
-
-
};
-
-
-
-
-
-
#endif // _Interface_FileReaderTool_HeaderFile
IMPLEMENT_STANDARD_RTTIEXT(Interface_GTool,MMgt_TShared)
-Interface_GTool::Interface_GTool () { }
-
Interface_GTool::Interface_GTool
(const Handle(Interface_Protocol)& proto, const Standard_Integer nb)
: theproto (proto) , thelib (proto)
{ if (nb > 0) { thentnum.ReSize(nb); thentmod.ReSize(nb); } }
-
- void Interface_GTool::SetSignType (const Handle(Interface_SignType)& sign)
- { thesign = sign; }
-
- Handle(Interface_SignType) Interface_GTool::SignType () const
- { return thesign; }
-
Standard_CString Interface_GTool::SignValue
(const Handle(Standard_Transient)& ent,
const Handle(Interface_InterfaceModel)& model) const
return thesign->Name();
}
-
void Interface_GTool::SetProtocol
(const Handle(Interface_Protocol)& proto, const Standard_Boolean enforce)
{
thelib.AddProtocol (proto);
}
- Handle(Interface_Protocol) Interface_GTool::Protocol () const
- { return theproto; }
-
- Interface_GeneralLib& Interface_GTool::Lib ()
- { return thelib; }
-
void Interface_GTool::Reservate
(const Standard_Integer nb, const Standard_Boolean enforce)
{
//! Shareable between several users : as a Handle
class Interface_GTool : public MMgt_TShared
{
+ public:
-public:
-
-
//! Creates an empty, not set, GTool
- Standard_EXPORT Interface_GTool();
+ Interface_GTool() {}
//! Creates a GTool from a Protocol
//! Optional starting count of entities
Standard_EXPORT Interface_GTool(const Handle(Interface_Protocol)& proto, const Standard_Integer nbent = 0);
//! Sets a new SignType
- Standard_EXPORT void SetSignType (const Handle(Interface_SignType)& sign);
+ void SetSignType (const Handle(Interface_SignType)& sign) { thesign = sign; }
//! Returns the SignType. Can be null
- Standard_EXPORT Handle(Interface_SignType) SignType() const;
+ const Handle(Interface_SignType) & SignType() const { return thesign; }
//! Returns the Signature for a Transient Object in a Model
//! It calls SignType to do that
Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto, const Standard_Boolean enforce = Standard_False);
//! Returns the Protocol. Warning : it can be Null
- Standard_EXPORT Handle(Interface_Protocol) Protocol() const;
-
+ const Handle(Interface_Protocol) & Protocol() const { return theproto; }
+
//! Returns the GeneralLib itself
- Standard_EXPORT Interface_GeneralLib& Lib();
-
+ Interface_GeneralLib& Lib() { return thelib; }
+
//! Reservates maps for a count of entities
//! <enforce> False : minimum count
//! <enforce> True : clears former reservations
#include <Standard_Integer.hxx>
class Interface_NodeOfGeneralLib;
class Standard_NoSuchObject;
-class Standard_Transient;
+class Interface_Protocol;
class Interface_GeneralModule;
class Interface_Protocol;
class Interface_GlobalNodeOfGeneralLib;
//! Adds a couple (Module-Protocol) to the Library, given the
//! class of a Protocol. Takes Resources into account.
//! (if <aprotocol> is not of type TheProtocol, it is not added)
- Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
+ Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol);
//! Clears the list of Modules of a library (can be used to
//! redefine the order of Modules before action : Clear then
//! refill the Library by calls to AddProtocol)
Standard_EXPORT void Clear();
- //! Sets a library to be defined with the complete Global list
- //! (all the couples Protocol/Modules recorded in it)
- Standard_EXPORT void SetComplete();
-
//! Selects a Module from the Library, given an Object.
//! Returns True if Select has succeeded, False else.
//! Also Returns (as arguments) the selected Module and the Case
#include <Standard_NoSuchObject.hxx>
#include <Standard_Transient.hxx>
#include <Interface_GeneralModule.hxx>
-#include <Interface_Protocol.hxx>
#include <Interface_GlobalNodeOfGeneralLib.hxx>
#define Handle_TheModule Handle(Interface_GeneralModule)
#define TheModule Interface_GeneralModule
#define TheModule_hxx <Interface_GeneralModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
#define LibCtl_Node Interface_NodeOfGeneralLib
#include <Standard_Type.hxx>
#include <Interface_GeneralModule.hxx>
-#include <Interface_Protocol.hxx>
#include <Interface_GlobalNodeOfGeneralLib.hxx>
#include <Standard_Transient.hxx>
#include <Interface_GeneralLib.hxx>
#include <Interface_NodeOfGeneralLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(Standard_Transient)
#define TheObject_hxx <Standard_Transient.hxx>
#define Handle_TheModule Handle(Interface_GeneralModule)
#define TheModule Interface_GeneralModule
#define TheModule_hxx <Interface_GeneralModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
#define LibCtl_Node Interface_NodeOfGeneralLib
#define LibCtl_Library Interface_GeneralLib
#define LibCtl_Library_hxx <Interface_GeneralLib.hxx>
#include <LibCtl_GlobalNode.gxx>
-
#include <Standard_Type.hxx>
#include <Interface_ReaderModule.hxx>
-#include <Interface_Protocol.hxx>
#include <Interface_GlobalNodeOfReaderLib.hxx>
#include <Standard_Transient.hxx>
#include <Interface_ReaderLib.hxx>
#include <Interface_NodeOfReaderLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(Standard_Transient)
#define TheObject_hxx <Standard_Transient.hxx>
#define Handle_TheModule Handle(Interface_ReaderModule)
#define TheModule Interface_ReaderModule
#define TheModule_hxx <Interface_ReaderModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
#define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
#define LibCtl_Node Interface_NodeOfReaderLib
#define LibCtl_Library Interface_ReaderLib
#define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
#include <LibCtl_GlobalNode.gxx>
-
if (themodel.IsNull()) return str;
if (themodel->Number(ent)) return str;
- Handle(Interface_GTool) gtool = themodel->GTool();
+ const Handle(Interface_GTool) >ool = themodel->GTool();
if (gtool.IsNull()) return str;
Handle(Interface_GeneralModule) module;
class Interface_GeneralLib;
class Interface_Protocol;
-class Interface_GTool;
class Standard_Transient;
class Interface_BitMap;
class Interface_EntityIterator;
void Interface_InterfaceModel::SetProtocol(const Handle(Interface_Protocol)& proto)
{
- thegtool = new Interface_GTool(proto);
+ myGTool = new Interface_GTool(proto);
}
//purpose :
//=======================================================================
-Handle(Interface_Protocol) Interface_InterfaceModel::Protocol () const
+const Handle(Interface_Protocol) & Interface_InterfaceModel::Protocol () const
{
- Handle(Interface_Protocol) proto;
- if (!thegtool.IsNull()) return thegtool->Protocol();
+ static const Handle(Interface_Protocol) proto;
+ if (!myGTool.IsNull()) return myGTool->Protocol();
return proto;
}
therepch.Clear();
haschecksem = Standard_False;
- if (!thegtool.IsNull()) {
- thegtool->ClearEntities(); //smh#14 FRA62479
+ if (!myGTool.IsNull()) {
+ myGTool->ClearEntities(); //smh#14 FRA62479
}
isdispatch = Standard_False;
theentities.Clear();
Standard_Integer Interface_InterfaceModel::NbTypes (const Handle(Standard_Transient)& ent) const
{
- if (Protocol().IsNull()) return 1;
- return Protocol()->NbTypes(ent);
+ if (myGTool.IsNull() || myGTool->Protocol().IsNull()) return 1;
+ return myGTool->Protocol()->NbTypes(ent);
}
Handle(Standard_Type) Interface_InterfaceModel::Type
(const Handle(Standard_Transient)& ent, const Standard_Integer nt) const
{
- if (Protocol().IsNull()) return ent->DynamicType();
- return Protocol()->Type(ent,nt);
+ if (myGTool.IsNull() || myGTool->Protocol().IsNull()) return ent->DynamicType();
+ return myGTool->Protocol()->Type(ent,nt);
}
Standard_CString Interface_InterfaceModel::TypeName
(const Handle(Standard_Transient)& ent, const Standard_Boolean complet) const
{
- if (!thegtool.IsNull()) return thegtool->SignValue (ent,this);
+ if (!myGTool.IsNull()) return myGTool->SignValue (ent,this);
Standard_CString tn = ent->DynamicType()->Name();
if (complet) return tn;
return Interface_InterfaceModel::ClassName(tn);
}
Interface_GeneralLib lib(proto);
AddWithRefs (anent,lib,level,listall);
- if (Protocol().IsNull() && !proto.IsNull()) SetProtocol(proto);
+ if ((myGTool.IsNull() || myGTool->Protocol().IsNull()) && !proto.IsNull())
+ SetProtocol(proto);
}
const Standard_Integer level,
const Standard_Boolean listall)
{
- Handle(Interface_Protocol) proto = Protocol();
- if (proto.IsNull()) Interface_InterfaceMismatch::Raise
- ("InterfaceModel : AddWithRefs");
- AddWithRefs (anent,proto,level,listall);
+ if (myGTool.IsNull() || myGTool->Protocol().IsNull())
+ Interface_InterfaceMismatch::Raise ("InterfaceModel : AddWithRefs");
+ AddWithRefs (anent,myGTool->Protocol(),level,listall);
}
//! Returns the Protocol which has been set by SetProtocol, or
//! AddWithRefs with Protocol
- Standard_EXPORT virtual Handle(Interface_Protocol) Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol) & Protocol() const;
//! Sets a GTool for this model, which already defines a Protocol
- void SetGTool (const Handle(Interface_GTool)& gtool) { thegtool = gtool; }
+ void SetGTool (const Handle(Interface_GTool)& gtool) { myGTool = gtool; }
//! Returns the GTool, set by SetProtocol or by SetGTool
- const Handle(Interface_GTool) & GTool() const { return thegtool; }
+ const Handle(Interface_GTool) & GTool() const { return myGTool; }
//! Returns the Dispatch Status, either for get or set
//! A Model which is produced from Dispatch may share entities
//! Transfer tool (e.g TransferCopy). Starts from clear
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;
-
- //! Returns a New Empty Model, same type as <me> (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;
-
//! Records a category number for an entity number
//! Returns True when done, False if <num> is out of range
Standard_EXPORT Standard_Boolean SetCategoryNumber (const Standard_Integer num, const Standard_Integer val);
Standard_Boolean haschecksem;
Standard_Boolean isdispatch;
Handle(TCollection_HAsciiString) thecategory;
- Handle(Interface_GTool) thegtool;
+ Handle(Interface_GTool) myGTool;
};
#endif // _Interface_InterfaceModel_HeaderFile
#include <Interface_NodeOfGeneralLib.hxx>
#include <Standard_Transient.hxx>
#include <Interface_GeneralModule.hxx>
-#include <Interface_Protocol.hxx>
#include <Interface_GeneralLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(Standard_Transient)
#define TheObject_hxx <Standard_Transient.hxx>
#define Handle_TheModule Handle(Interface_GeneralModule)
#define TheModule Interface_GeneralModule
#define TheModule_hxx <Interface_GeneralModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
#define LibCtl_Node Interface_NodeOfGeneralLib
#include <Interface_NodeOfReaderLib.hxx>
#include <Standard_Transient.hxx>
#include <Interface_ReaderModule.hxx>
-#include <Interface_Protocol.hxx>
#include <Interface_ReaderLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(Standard_Transient)
#define TheObject_hxx <Standard_Transient.hxx>
#define Handle_TheModule Handle(Interface_ReaderModule)
#define TheModule Interface_ReaderModule
#define TheModule_hxx <Interface_ReaderModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
#define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
#define LibCtl_Node Interface_NodeOfReaderLib
#define LibCtl_Library Interface_ReaderLib
#define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
#include <LibCtl_Node.gxx>
-
// commercial license or contractual agreement.
-#include <Interface_Check.hxx>
-#include <Interface_Graph.hxx>
-#include <Interface_InterfaceError.hxx>
-#include <Interface_InterfaceModel.hxx>
#include <Interface_Protocol.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Interface_Protocol,MMgt_TShared)
-// Gestion du Protocol actif : tres simple, une variable statique
-static Handle(Interface_Protocol)& theactive()
-{
- static Handle(Interface_Protocol) theact;
- return theact;
-}
-
-
-//=======================================================================
-//function : Active
-//purpose :
-//=======================================================================
-
-Handle(Interface_Protocol) Interface_Protocol::Active ()
-{
- return theactive();
-}
-
-
+
//=======================================================================
-//function : SetActive
+//function : NbResources
//purpose :
//=======================================================================
-void Interface_Protocol::SetActive(const Handle(Interface_Protocol)& aprotocol)
+Standard_Integer Interface_Protocol::NbResources() const
{
- theactive() = aprotocol;
+ return 0;
}
//=======================================================================
-//function : ClearActive
+//function : Resource
//purpose :
//=======================================================================
-void Interface_Protocol::ClearActive ()
+Handle(Interface_Protocol) Interface_Protocol::Resource (const Standard_Integer) const
{
- theactive().Nullify();
+ return NULL;
}
-// === Typage (formules fournies par defaut)
-
-
//=======================================================================
//function : CaseNumber
//purpose :
//! like multi-typing, may involve another way
class Interface_Protocol : public MMgt_TShared
{
-
-public:
-
-
- //! Returns the Active Protocol, if defined (else, returns a
- //! Null Handle, which means "no defined active protocol")
- Standard_EXPORT static Handle(Interface_Protocol) Active();
-
- //! Sets a given Protocol to be the Active one (for the users of
- //! Active, see just above). Applies to every sub-type of Protocol
- Standard_EXPORT static void SetActive (const Handle(Interface_Protocol)& aprotocol);
-
- //! Erases the Active Protocol (hence it becomes undefined)
- Standard_EXPORT static void ClearActive();
+ public:
//! Returns count of Protocol used as Resources (level one)
- Standard_EXPORT virtual Standard_Integer NbResources() const = 0;
+ Standard_EXPORT virtual Standard_Integer NbResources() const;
//! Returns a Resource, given its rank (between 1 and NbResources)
- Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const = 0;
+ Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const;
//! Returns a unique positive CaseNumber for each Recognized
//! Object. By default, recognition is based on Type(1)
//! (for an Entity out of the Norm, answer can be unpredicable)
Standard_EXPORT virtual Standard_Boolean IsUnknownEntity (const Handle(Standard_Transient)& ent) const = 0;
-
-
-
DEFINE_STANDARD_RTTIEXT(Interface_Protocol,MMgt_TShared)
-
-protected:
-
-
-
-
-private:
-
-
-
-
};
-
-
-
-
-
-
#endif // _Interface_Protocol_HeaderFile
#include <Standard_Integer.hxx>
class Interface_NodeOfReaderLib;
class Standard_NoSuchObject;
-class Standard_Transient;
class Interface_ReaderModule;
class Interface_Protocol;
class Interface_GlobalNodeOfReaderLib;
//! Adds a couple (Module-Protocol) to the Library, given the
//! class of a Protocol. Takes Resources into account.
//! (if <aprotocol> is not of type TheProtocol, it is not added)
- Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
+ Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol);
//! Clears the list of Modules of a library (can be used to
//! redefine the order of Modules before action : Clear then
//! refill the Library by calls to AddProtocol)
Standard_EXPORT void Clear();
- //! Sets a library to be defined with the complete Global list
- //! (all the couples Protocol/Modules recorded in it)
- Standard_EXPORT void SetComplete();
-
//! Selects a Module from the Library, given an Object.
//! Returns True if Select has succeeded, False else.
//! Also Returns (as arguments) the selected Module and the Case
#include <Standard_NoSuchObject.hxx>
#include <Standard_Transient.hxx>
#include <Interface_ReaderModule.hxx>
-#include <Interface_Protocol.hxx>
#include <Interface_GlobalNodeOfReaderLib.hxx>
#define Handle_TheModule Handle(Interface_ReaderModule)
#define TheModule Interface_ReaderModule
#define TheModule_hxx <Interface_ReaderModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
#define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
#define LibCtl_Node Interface_NodeOfReaderLib
#define LibCtl_Library Interface_ReaderLib
#define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
#include <LibCtl_Library.gxx>
-
// commercial license or contractual agreement.
-#include <Interface_Check.hxx>
-#include <Interface_FileReaderData.hxx>
#include <Interface_ReaderModule.hxx>
-#include <Standard_DomainError.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Interface_ReaderModule,MMgt_TShared)
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-class Standard_DomainError;
class Interface_FileReaderData;
class Interface_Check;
-class Standard_Transient;
class Interface_ReaderModule;
//! ReaderModule reads it according to this Case Number
class Interface_ReaderModule : public MMgt_TShared
{
+ public:
-public:
-
-
//! Translates the type of record <num> in <data> to a positive
//! Case Number. If Recognition fails, must return 0
Standard_EXPORT virtual Standard_Integer CaseNum (const Handle(Interface_FileReaderData)& data, const Standard_Integer num) const = 0;
//! treated as "Unrecognized case" by reader tool.
Standard_EXPORT virtual Standard_Boolean NewRead (const Standard_Integer casenum, const Handle(Interface_FileReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const;
-
-
-
DEFINE_STANDARD_RTTIEXT(Interface_ReaderModule,MMgt_TShared)
-
-protected:
-
-
-
-
-private:
-
-
-
-
};
-
-
-
-
-
-
#endif // _Interface_ReaderModule_HeaderFile
(const Handle(Interface_InterfaceModel)& amodel)
: theflags (amodel->NbEntities())
{
- Handle(Interface_GTool) gtool = themodel->GTool();
+ const Handle(Interface_GTool) >ool = themodel->GTool();
gtool->Reservate(amodel->NbEntities());
themodel = amodel;
Evaluate (gtool->Lib(),gtool);
#include <Interface_GeneralLib.hxx>
#include <Interface_GeneralModule.hxx>
#include <Interface_Graph.hxx>
-#include <Interface_GTool.hxx>
#include <Interface_HGraph.hxx>
#include <Interface_InterfaceError.hxx>
#include <Interface_InterfaceModel.hxx>
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-//#include <LibCtl_GlobalNode.ixx>
-
// Classe generique imbriquee dans Library : utilisee pour construire les
// listes globales de Modules attaches a une classe instanciee de Library
// (cf Library pour plus de details)
+#include <Interface_Protocol.hxx>
LibCtl_GlobalNode::LibCtl_GlobalNode () { }
// ATTENTION, Add agit en substitution : pour un Protocol donne, c est le
// dernier appel qui l emporte
void LibCtl_GlobalNode::Add
- (const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol)
+ (const Handle(TheModule)& amodule, const Handle(Interface_Protocol)& aprotocol)
{
if (themod == amodule) return;
if (theprot == aprotocol) themod = amodule;
const Handle(TheModule)& LibCtl_GlobalNode::Module () const
{ return themod; }
- const Handle(TheProtocol)& LibCtl_GlobalNode::Protocol () const
+ const Handle(Interface_Protocol)& LibCtl_GlobalNode::Protocol () const
{ return theprot; }
const Handle(LibCtl_GlobalNode)& LibCtl_GlobalNode::Next () const
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-//#include <LibCtl_Library.ixx>
+#include <Interface_Protocol.hxx>
#include <Standard_NoSuchObject.hxx>
// Donnees pour optimisation (dernier Protocole demande)
-static Handle(TheProtocol) theprotocol;
+static Handle(Interface_Protocol) theprotocol;
static Handle(LibCtl_Node) thelast;
// ATTENTION : SetGlobal fait de la substitution, c-a-d que c est le dernier
// qui a raison pour un Protocol donne
void LibCtl_Library::SetGlobal
- (const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol)
+ (const Handle(TheModule)& amodule, const Handle(Interface_Protocol)& aprotocol)
{
if (theglobal.IsNull()) theglobal = new LibCtl_GlobalNode;
theglobal->Add(amodule,aprotocol);
}
// Constructeur d apres Protocole
- LibCtl_Library::LibCtl_Library (const Handle(TheProtocol)& aprotocol)
+ LibCtl_Library::LibCtl_Library (const Handle(Interface_Protocol)& aprotocol)
{
Standard_Boolean last = Standard_False;
if (aprotocol.IsNull()) return; // PAS de protocole = Lib VIDE
// Ajout d un Protocol : attention, desoptimise (sinon risque de confusion !)
void LibCtl_Library::AddProtocol
- (const Handle(Standard_Transient)& aprotocol)
+ (const Handle(Interface_Protocol)& aprotocol)
{
-// DownCast car Protocol->Resources, meme redefini et utilise dans d autres
-// librairies, doit toujours renvoyer le type le plus haut
- Handle(TheProtocol) aproto = Handle(TheProtocol)::DownCast(aprotocol);
- if (aproto.IsNull()) return;
+ if (aprotocol.IsNull()) return;
// D abord, ajouter celui-ci a la liste : chercher le Node
Handle(LibCtl_GlobalNode) curr;
for (curr = theglobal; !curr.IsNull(); ) { // curr->Next : plus loin
- const Handle(TheProtocol)& protocol = curr->Protocol();
+ const Handle(Interface_Protocol)& protocol = curr->Protocol();
if (!protocol.IsNull()) {
// Match Protocol ?
if (protocol->DynamicType() == aprotocol->DynamicType()) {
curr = curr->Next(); // cette formule est refusee dans "for"
}
// Ensuite, Traiter les ressources
- Standard_Integer nb = aproto->NbResources();
+ Standard_Integer nb = aprotocol->NbResources();
for (Standard_Integer i = 1; i <= nb; i ++) {
- AddProtocol (aproto->Resource(i));
+ AddProtocol (aprotocol->Resource(i));
}
// Ne pas oublier de desoptimiser
theprotocol.Nullify();
void LibCtl_Library::Clear ()
{ thelist = new LibCtl_Node; }
- void LibCtl_Library::SetComplete ()
-{
- thelist = new LibCtl_Node;
-// On prend chacun des Protocoles de la Liste Globale et on l ajoute
- Handle(LibCtl_GlobalNode) curr;
- for (curr = theglobal; !curr.IsNull(); ) { // curr->Next : plus loin
- const Handle(TheProtocol)& protocol = curr->Protocol();
-// Comme on prend tout tout tout, on ne se preoccupe pas des Ressources !
- if (!protocol.IsNull()) thelist->AddNode(curr);
- curr = curr->Next(); // cette formule est refusee dans "for"
- }
-}
-
-
// Selection : Tres fort, on retourne le Module correspondant a un Type
// (ainsi que le CaseNumber retourne par le protocole correspondant)
if (thelist.IsNull()) return Standard_False;
Handle(LibCtl_Node) curr = thelist;
for (curr = thelist; !curr.IsNull(); ) { // curr->Next : plus loin
- const Handle(TheProtocol)& protocol = curr->Protocol();
+ const Handle(Interface_Protocol)& protocol = curr->Protocol();
if (!protocol.IsNull()) {
CN = protocol->CaseNumber(obj);
if (CN > 0) {
return thecurr->Module();
}
- const Handle(TheProtocol)& LibCtl_Library::Protocol () const
+ const Handle(Interface_Protocol)& LibCtl_Library::Protocol () const
{
if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl");
return thecurr->Protocol();
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-//#include <LibCtl_Node.ixx>
-
-
// Classe generique imbriquee dans Library : utilisee pour construire la
// listes de Modules d une librairie (cf Library pour plus de details)
// (En fait : Liste de Global Nodes -> Module + Protocol)
const Handle(TheModule)& LibCtl_Node::Module () const
{ return thenode->Module(); }
- const Handle(TheProtocol)& LibCtl_Node::Protocol () const
+ const Handle(Interface_Protocol)& LibCtl_Node::Protocol () const
{ return thenode->Protocol(); }
const Handle(LibCtl_Node)& LibCtl_Node::Next () const
#include <RWHeaderSection.hxx>
#include <RWHeaderSection_GeneralModule.hxx>
#include <RWHeaderSection_ReadWriteModule.hxx>
-#include <StepData.hxx>
+#include <HeaderSection.hxx>
static Handle(RWHeaderSection_ReadWriteModule) rwm;
static Handle(RWHeaderSection_GeneralModule) rwg;
void RWHeaderSection::Init()
{
- const Handle(StepData_Protocol) &hp = StepData::HeaderProtocol();
if (rwm.IsNull()) rwm = new RWHeaderSection_ReadWriteModule;
if (rwg.IsNull()) rwg = new RWHeaderSection_GeneralModule;
}
// commercial license or contractual agreement.
+#include <HeaderSection.hxx>
#include <HeaderSection_FileDescription.hxx>
#include <HeaderSection_FileName.hxx>
#include <HeaderSection_FileSchema.hxx>
RWHeaderSection_ReadWriteModule::RWHeaderSection_ReadWriteModule ()
{
- Handle(HeaderSection_Protocol) protocol = new HeaderSection_Protocol;
- StepData_WriterLib::SetGlobal(this,protocol);
- Interface_ReaderLib::SetGlobal(this,protocol);
+ const Handle(HeaderSection_Protocol) &protocol = HeaderSection::Protocol();
+ StepData_WriterLib::SetGlobal(this,protocol);
+ Interface_ReaderLib::SetGlobal(this,protocol);
}
// --- Case Recognition ---
#include <StepAP214_Protocol.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
-#include <StepData_WriterLib.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
{
-// Handle(StepAP214_Protocol) protocol = new StepAP214_Protocol;
-// StepData_WriterLib::SetGlobal(Handle(RWStepAP214_ReadWriteModule)::DownCast(This()),protocol);
-// Interface_ReaderLib::SetGlobal(Handle(RWStepAP214_ReadWriteModule)::DownCast(This()),protocol);
if (!typenums.IsNull()) return;
typenums = new Dico_DictionaryOfInteger;
typenums->SetItem (Reco_CartesianPoint, 59);
IMPLEMENT_STANDARD_RTTIEXT(STEPSelections_SelectDerived,StepSelect_StepType)
-STEPSelections_SelectDerived::STEPSelections_SelectDerived():StepSelect_StepType()
-{
-}
-
static Handle(Standard_Type) GetStepType(const Handle(StepData_ReadWriteModule)& module,
const TCollection_AsciiString& type)
{
#ifndef _STEPSelections_SelectDerived_HeaderFile
#define _STEPSelections_SelectDerived_HeaderFile
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
#include <StepSelect_StepType.hxx>
-#include <Standard_Boolean.hxx>
-class Standard_Transient;
-class Interface_InterfaceModel;
-class TCollection_AsciiString;
-
class STEPSelections_SelectDerived;
DEFINE_STANDARD_HANDLE(STEPSelections_SelectDerived, StepSelect_StepType)
class STEPSelections_SelectDerived : public StepSelect_StepType
{
+ public:
-public:
+ STEPSelections_SelectDerived() {}
-
- Standard_EXPORT STEPSelections_SelectDerived();
-
Standard_EXPORT virtual Standard_Boolean Matches (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model, const TCollection_AsciiString& text, const Standard_Boolean exact) const Standard_OVERRIDE;
-
-
-
DEFINE_STANDARD_RTTIEXT(STEPSelections_SelectDerived,StepSelect_StepType)
-
-protected:
-
-
-
-
-private:
-
-
-
-
};
-
-
-
-
-
-
#endif // _STEPSelections_SelectDerived_HeaderFile
for (Standard_Integer j = 1; j <= 4; j ++)
gtrsf.SetValue (i,j, coefs->Value(i,j));
- //try { //szv#4:S4163:12Mar99 waste try
- //// trsf = gtrsf.Trsf();
- // --- Prec et Unit ont ete lues suite aux StepFile_Read
- // Valables pour tous les composants d un assemblage transmis
- //trsf = gp_Trsf(); // Identite forcee au depart //szv#4:S4163:12Mar99 not needed
- // On prend le contenu de <gtrsf>. Attention a l adressage
- gp_XYZ v1 ( gtrsf.Value(1,1), gtrsf.Value(2,1), gtrsf.Value(3,1) );
- gp_XYZ v2 ( gtrsf.Value(1,2), gtrsf.Value(2,2), gtrsf.Value(3,2) );
- gp_XYZ v3 ( gtrsf.Value(1,3), gtrsf.Value(2,3), gtrsf.Value(3,3) );
- // A-t-on affaire a une similitude ?
- Standard_Real m1 = v1.Modulus();
- Standard_Real m2 = v2.Modulus();
- Standard_Real m3 = v3.Modulus();
-
- // D abord est-elle singuliere cette matrice ?
- if (m1 < prec || m2 < prec || m3 < prec) return Standard_False;
- Standard_Real mm = (m1+m2+m3)/3.; // voici la Norme moyenne, cf Scale
- //szv#4:S4163:12Mar99 optimized
- Standard_Real pmm = prec*mm;
- if ( Abs(m1 - mm) > pmm || Abs(m2 - mm) > pmm || Abs(m3 - mm) > pmm )
- return Standard_False;
- //szv#4:S4163:12Mar99 warning
- v1.Divide(m1);
- v2.Divide(m2);
- v3.Divide(m3);
- //szv#4:S4163:12Mar99 optimized
- if ( Abs(v1.Dot(v2)) > prec || Abs(v2.Dot(v3)) > prec || Abs(v3.Dot(v1)) > prec )
- return Standard_False;
-
- // Ici, Orthogonale et memes normes. En plus on l a Normee
- // On isole le cas de l Identite (tellement facile et avantageux)
- if (v1.X() != 1 || v1.Y() != 0 || v1.Z() != 0 ||
- v2.X() != 0 || v2.Y() != 1 || v2.Z() != 0 ||
- v3.X() != 0 || v3.Y() != 0 || v3.Z() != 1 ) {
+ // On prend le contenu de <gtrsf>. Attention a l adressage
+ gp_XYZ v1 ( gtrsf.Value(1,1), gtrsf.Value(2,1), gtrsf.Value(3,1) );
+ gp_XYZ v2 ( gtrsf.Value(1,2), gtrsf.Value(2,2), gtrsf.Value(3,2) );
+ gp_XYZ v3 ( gtrsf.Value(1,3), gtrsf.Value(2,3), gtrsf.Value(3,3) );
+ // A-t-on affaire a une similitude ?
+ Standard_Real m1 = v1.Modulus();
+ Standard_Real m2 = v2.Modulus();
+ Standard_Real m3 = v3.Modulus();
+
+ // D abord est-elle singuliere cette matrice ?
+ if (m1 < prec || m2 < prec || m3 < prec) return Standard_False;
+ Standard_Real mm = (m1+m2+m3)/3.; // voici la Norme moyenne, cf Scale
+ Standard_Real pmm = prec*mm;
+ if ( Abs(m1 - mm) > pmm || Abs(m2 - mm) > pmm || Abs(m3 - mm) > pmm )
+ return Standard_False;
+ v1.Divide(m1);
+ v2.Divide(m2);
+ v3.Divide(m3);
+ if ( Abs(v1.Dot(v2)) > prec || Abs(v2.Dot(v3)) > prec || Abs(v3.Dot(v1)) > prec )
+ return Standard_False;
+
+ // Ici, Orthogonale et memes normes. En plus on l a Normee
+ // On isole le cas de l Identite (tellement facile et avantageux)
+ if (v1.X() != 1 || v1.Y() != 0 || v1.Z() != 0 ||
+ v2.X() != 0 || v2.Y() != 1 || v2.Z() != 0 ||
+ v3.X() != 0 || v3.Y() != 0 || v3.Z() != 1 ) {
// Pas Identite : vraie construction depuis un Ax3
- gp_Dir d1(v1);
- gp_Dir d2(v2);
- gp_Dir d3(v3);
- gp_Ax3 axes (gp_Pnt(0,0,0),d3,d1);
- d3.Cross(d1);
- if (d3.Dot(d2) < 0) axes.YReverse();
- trsf.SetTransformation(axes);
- }
+ gp_Dir d1(v1);
+ gp_Dir d2(v2);
+ gp_Dir d3(v3);
+ gp_Ax3 axes (gp_Pnt(0,0,0),d3,d1);
+ d3.Cross(d1);
+ if (d3.Dot(d2) < 0) axes.YReverse();
+ trsf.SetTransformation(axes);
+ }
- // Restent les autres caracteristiques :
- if ( Abs(mm - 1.) > prec ) trsf.SetScale(gp_Pnt(0,0,0), mm); //szv#4:S4163:12Mar99 optimized
- gp_Vec tp (gtrsf.TranslationPart());
- if (unit != 1.) tp.Multiply(unit);
- if (tp.X() != 0 || tp.Y() != 0 || tp.Z() != 0) trsf.SetTranslationPart(tp);
- /* }
- catch(Standard_Failure) {
- trsf = gp_Trsf();
- result = Standard_False;
- } */
+ // Restent les autres caracteristiques :
+ if ( Abs(mm - 1.) > prec ) trsf.SetScale(gp_Pnt(0,0,0), mm); //szv#4:S4163:12Mar99 optimized
+ gp_Vec tp (gtrsf.TranslationPart());
+ if (unit != 1.) tp.Multiply(unit);
+ if (tp.X() != 0 || tp.Y() != 0 || tp.Z() != 0) trsf.SetTranslationPart(tp);
return result;
}
StepData.cxx
StepData.hxx
StepData_Array1OfField.hxx
-StepData_DefaultGeneral.cxx
-StepData_DefaultGeneral.hxx
-StepData_DescrGeneral.cxx
-StepData_DescrGeneral.hxx
StepData_Described.cxx
StepData_Described.hxx
-StepData_DescrReadWrite.cxx
-StepData_DescrReadWrite.hxx
StepData_ECDescr.cxx
StepData_ECDescr.hxx
StepData_EDescr.cxx
StepData_FieldListD.hxx
StepData_FieldListN.cxx
StepData_FieldListN.hxx
-StepData_FileRecognizer.hxx
-StepData_FileRecognizer_0.cxx
StepData_FreeFormEntity.cxx
StepData_FreeFormEntity.hxx
StepData_GeneralModule.cxx
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// abv 09.04.99 S4136: eliminate parameter step.readaccept.void
-// svv #2 23.02.00: porting on SIL
-
#include <StepData.hxx>
-#include <Interface_Macros.hxx>
#include <HeaderSection.hxx>
#include <HeaderSection_Protocol.hxx>
-#include <StepData_Protocol.hxx>
-
-//szv_c1:StaticHandle(StepData_Protocol,proto);
-static Handle(StepData_Protocol) proto;
-
-//szv_c1:StaticHandleA(StepData_Protocol,theheader);
-static Handle(StepData_Protocol) theheader;
-
-const Handle(StepData_Protocol) & StepData::Protocol ()
-{
- //szv_c1:InitHandleVoid(StepData_Protocol,proto);// svv #2
- if (proto.IsNull()) proto = new StepData_Protocol;
- return proto;
-}
const Handle(StepData_Protocol) & StepData::HeaderProtocol ()
{
- /*szv_c1:UseHandle(StepData_Protocol,theheader);
- return theheader;*/
return HeaderSection::Protocol();
}
class StepData
{
public:
-
- //! Returns a Protocol from StepData
- Standard_EXPORT static const Handle(StepData_Protocol) & Protocol();
//! Returns the recorded HeaderProtocol, which can be :
//! - a Null Handle if no Header Protocol was yet defined
+++ /dev/null
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_Check.hxx>
-#include <Interface_CopyTool.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_GeneralLib.hxx>
-#include <Interface_Macros.hxx>
-#include <Interface_ParamType.hxx>
-#include <Interface_ShareTool.hxx>
-#include <Interface_UndefinedContent.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData.hxx>
-#include <StepData_DefaultGeneral.hxx>
-#include <StepData_Protocol.hxx>
-#include <StepData_UndefinedEntity.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(StepData_DefaultGeneral,StepData_GeneralModule)
-
-// DefaultGeneral de StepData reconnait UN SEUL TYPE : UndefinedEntity
-StepData_DefaultGeneral::StepData_DefaultGeneral ()
-{
- Interface_GeneralLib::SetGlobal (this, StepData::Protocol());
-}
-
- void StepData_DefaultGeneral::FillSharedCase
- (const Standard_Integer casenum, const Handle(Standard_Transient)& ent,
- Interface_EntityIterator& iter) const
-{
- if (casenum != 1) return;
- DeclareAndCast(StepData_UndefinedEntity,undf,ent);
- Handle(Interface_UndefinedContent) cont = undf->UndefinedContent();
- Standard_Integer nb = cont->NbParams();
- for (Standard_Integer i = 1; i <= nb; i ++) {
- Interface_ParamType ptype = cont->ParamType(i);
- if (ptype == Interface_ParamSub) {
- DeclareAndCast(StepData_UndefinedEntity,subent,cont->ParamEntity(i));
- FillSharedCase(casenum,cont->ParamEntity(i),iter);
- } else if (ptype == Interface_ParamIdent) {
- iter.GetOneItem(cont->ParamEntity(i));
- }
- }
-}
-
-
-void StepData_DefaultGeneral::CheckCase(const Standard_Integer,
- const Handle(Standard_Transient)&,
- const Interface_ShareTool&,
- Handle(Interface_Check)&) const
-{
-} // pas de Check sur une UndefinedEntity
-
-
- Standard_Boolean StepData_DefaultGeneral::NewVoid
- (const Standard_Integer CN, Handle(Standard_Transient)& ent) const
-{
- if (CN != 1) return Standard_False;
- ent = new StepData_UndefinedEntity;
- return Standard_True;
-}
-
- void StepData_DefaultGeneral::CopyCase
- (const Standard_Integer casenum, const Handle(Standard_Transient)& entfrom,
- const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const
-{
- if (casenum != 1) return;
- DeclareAndCast(StepData_UndefinedEntity,undfrom,entfrom);
- DeclareAndCast(StepData_UndefinedEntity,undto,entto);
- undto->GetFromAnother(undfrom,TC); // On pourrait rapatrier cela
-}
+++ /dev/null
-// Created on: 1993-03-26
-// Created by: Christian CAILLET
-// Copyright (c) 1993-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_DefaultGeneral_HeaderFile
-#define _StepData_DefaultGeneral_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_GeneralModule.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-class Standard_Transient;
-class Interface_EntityIterator;
-class Interface_ShareTool;
-class Interface_Check;
-class Interface_CopyTool;
-
-
-class StepData_DefaultGeneral;
-DEFINE_STANDARD_HANDLE(StepData_DefaultGeneral, StepData_GeneralModule)
-
-//! DefaultGeneral defines a GeneralModule which processes
-//! Unknown Entity from StepData only
-class StepData_DefaultGeneral : public StepData_GeneralModule
-{
-
-public:
-
-
- //! Creates a Default General Module
- Standard_EXPORT StepData_DefaultGeneral();
-
- //! Specific filling of the list of Entities shared by an Entity
- //! <ent>, which is an UnknownEntity from StepData.
- Standard_EXPORT void FillSharedCase (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE;
-
- //! Specific Checking of an Entity <ent>
- Standard_EXPORT void CheckCase (const Standard_Integer casenum, const Handle(Standard_Transient)& 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;
-
- //! Specific Copy ("Deep") from <entfrom> to <entto> (same type)
- //! by using a CopyTool which provides its working Map.
- //! Use method Transferred from TransferControl to work
- Standard_EXPORT void CopyCase (const Standard_Integer casenum, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE;
-
-
-
-
- DEFINE_STANDARD_RTTIEXT(StepData_DefaultGeneral,StepData_GeneralModule)
-
-protected:
-
-
-
-
-private:
-
-
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_DefaultGeneral_HeaderFile
+++ /dev/null
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_Check.hxx>
-#include <Interface_CopyTool.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_ShareTool.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_DescrGeneral.hxx>
-#include <StepData_Described.hxx>
-#include <StepData_EDescr.hxx>
-#include <StepData_Protocol.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrGeneral,StepData_GeneralModule)
-
-StepData_DescrGeneral::StepData_DescrGeneral
- (const Handle(StepData_Protocol)& proto)
- : theproto (proto) { }
-
-
- void StepData_DescrGeneral::FillSharedCase
- (const Standard_Integer, const Handle(Standard_Transient)& ent,
- Interface_EntityIterator& iter) const
-{
- Handle(StepData_Described) ds = Handle(StepData_Described)::DownCast(ent);
- if (!ds.IsNull()) ds->Shared (iter);
-}
-
-
-void StepData_DescrGeneral::CheckCase(const Standard_Integer ,
- const Handle(Standard_Transient)&,
- const Interface_ShareTool&,
- Handle(Interface_Check)&) const
-{
-} // pour l instant
-
-
-void StepData_DescrGeneral::CopyCase(const Standard_Integer,
- const Handle(Standard_Transient)&,
- const Handle(Standard_Transient)&,
- Interface_CopyTool&) const
-{
-} // pour l instant
-
-Standard_Boolean StepData_DescrGeneral::NewVoid
- (const Standard_Integer CN, Handle(Standard_Transient)& ent) const
-{
- ent = theproto->Descr(CN)->NewEntity();
- return (!ent.IsNull());
-}
+++ /dev/null
-// Created on: 1997-05-21
-// Created by: Christian CAILLET
-// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_DescrGeneral_HeaderFile
-#define _StepData_DescrGeneral_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_GeneralModule.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-class StepData_Protocol;
-class Standard_Transient;
-class Interface_EntityIterator;
-class Interface_ShareTool;
-class Interface_Check;
-class Interface_CopyTool;
-
-
-class StepData_DescrGeneral;
-DEFINE_STANDARD_HANDLE(StepData_DescrGeneral, StepData_GeneralModule)
-
-//! Works with a Protocol by considering its entity descriptions
-class StepData_DescrGeneral : public StepData_GeneralModule
-{
-
-public:
-
-
- Standard_EXPORT StepData_DescrGeneral(const Handle(StepData_Protocol)& proto);
-
- Standard_EXPORT void FillSharedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE;
-
- Standard_EXPORT void CheckCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE;
-
- Standard_EXPORT void CopyCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE;
-
- Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
-
-
-
-
- DEFINE_STANDARD_RTTIEXT(StepData_DescrGeneral,StepData_GeneralModule)
-
-protected:
-
-
-
-
-private:
-
-
- Handle(StepData_Protocol) theproto;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_DescrGeneral_HeaderFile
+++ /dev/null
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_Check.hxx>
-#include <Interface_Macros.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_DescrReadWrite.hxx>
-#include <StepData_ECDescr.hxx>
-#include <StepData_EDescr.hxx>
-#include <StepData_ESDescr.hxx>
-#include <StepData_FieldListN.hxx>
-#include <StepData_Plex.hxx>
-#include <StepData_Protocol.hxx>
-#include <StepData_Simple.hxx>
-#include <StepData_StepReaderData.hxx>
-#include <StepData_StepWriter.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TColStd_HSequenceOfAsciiString.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrReadWrite,StepData_ReadWriteModule)
-
-static TCollection_AsciiString nocp("?");
-
-
- StepData_DescrReadWrite::StepData_DescrReadWrite
- (const Handle(StepData_Protocol)& proto)
- : theproto (proto) { }
-
- Standard_Integer StepData_DescrReadWrite::CaseStep
- (const TCollection_AsciiString& atype) const
-{
- Handle(StepData_ESDescr) descr = theproto->ESDescr (atype.ToCString(),Standard_False);
- if (descr.IsNull()) return 0;
- return theproto->DescrNumber (descr);
-}
-
- Standard_Integer StepData_DescrReadWrite::CaseStep
- (const TColStd_SequenceOfAsciiString& types) const
-{
- Handle(StepData_ECDescr) descr = theproto->ECDescr (types,Standard_False);
- if (descr.IsNull()) return 0;
- return theproto->DescrNumber (descr);
-}
-
-
- Standard_Boolean StepData_DescrReadWrite::IsComplex
- (const Standard_Integer CN) const
-{
- Handle(StepData_EDescr) descr = theproto->Descr (CN);
- if (descr.IsNull()) return Standard_False;
- return descr->IsComplex();
-}
-
- const TCollection_AsciiString& StepData_DescrReadWrite::StepType
- (const Standard_Integer CN) const
-{
- Handle(StepData_ESDescr) descr = Handle(StepData_ESDescr)::DownCast
- (theproto->Descr (CN));
- if (descr.IsNull()) return nocp;
- return descr->StepType();
-}
-
- Standard_Boolean StepData_DescrReadWrite::ComplexType
- (const Standard_Integer CN, TColStd_SequenceOfAsciiString& types) const
-{
- Handle(StepData_ECDescr) descr = Handle(StepData_ECDescr)::DownCast
- (theproto->Descr (CN));
- if (descr.IsNull()) return Standard_False;
- Handle(TColStd_HSequenceOfAsciiString) list = descr->TypeList();
- if (list.IsNull()) return Standard_False;
- Standard_Integer i, nb = list->Length();
- for (i = 1; i <= nb; i ++) types.Append (list->Value(i));
- return Standard_True;
-}
-
-
-void StepData_DescrReadWrite::ReadStep(const Standard_Integer CN,
- const Handle(StepData_StepReaderData)& data,
- const Standard_Integer num,
- Handle(Interface_Check)& ach,
- const Handle(Standard_Transient)&ent) const
-{
- if (CN == 0) return;
- DeclareAndCast(StepData_Simple,sent,ent);
- if (!sent.IsNull()) {
- Handle(StepData_ESDescr) sdescr = sent->ESDescr();
- StepData_FieldListN& fl = sent->CFields();
- data->ReadList (num,ach,sdescr,fl);
- return;
- }
-
- DeclareAndCast(StepData_Plex,cent,ent);
- Standard_Integer i, nb=0;
- if (!cent.IsNull()) nb = cent->NbMembers();
- Standard_Integer n0 = num;
- for (i = 1; i <= nb; i ++) {
- Handle(StepData_Simple) si = cent->Member(i);
- Handle(StepData_ESDescr) sdescr = si->ESDescr();
- StepData_FieldListN& fl = si->CFields();
- data->ReadList (n0,ach,sdescr,fl);
- if (i < nb) n0 = data->NextForComplex(n0);
- }
-}
-
-
- void StepData_DescrReadWrite::WriteStep
- (const Standard_Integer CN,
- StepData_StepWriter& SW,
- const Handle(Standard_Transient)&ent) const
-{
- if (CN == 0) return;
-
- DeclareAndCast(StepData_Simple,sent,ent);
- if (!sent.IsNull()) {
- Handle(StepData_ESDescr) sdescr = sent->ESDescr();
- const StepData_FieldListN& fl = sent->Fields();
- SW.SendList (fl,sdescr);
- return;
- }
-
- DeclareAndCast(StepData_Plex,cent,ent);
- Standard_Integer i, nb=0;
- if (!cent.IsNull()) nb = cent->NbMembers();
- for (i = 1; i <= nb; i ++) {
- Handle(StepData_Simple) si = cent->Member(i);
- Handle(StepData_ESDescr) sdescr = si->ESDescr();
- const StepData_FieldListN& fl = si->Fields();
- SW.StartEntity (sdescr->TypeName());
- SW.SendList (fl,sdescr);
- }
-}
+++ /dev/null
-// Created on: 1997-05-21
-// Created by: Christian CAILLET
-// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_DescrReadWrite_HeaderFile
-#define _StepData_DescrReadWrite_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_ReadWriteModule.hxx>
-#include <Standard_Integer.hxx>
-#include <TColStd_SequenceOfAsciiString.hxx>
-#include <Standard_Boolean.hxx>
-class StepData_Protocol;
-class TCollection_AsciiString;
-class StepData_StepReaderData;
-class Interface_Check;
-class Standard_Transient;
-class StepData_StepWriter;
-
-
-class StepData_DescrReadWrite;
-DEFINE_STANDARD_HANDLE(StepData_DescrReadWrite, StepData_ReadWriteModule)
-
-
-class StepData_DescrReadWrite : public StepData_ReadWriteModule
-{
-
-public:
-
-
- Standard_EXPORT StepData_DescrReadWrite(const Handle(StepData_Protocol)& proto);
-
- Standard_EXPORT Standard_Integer CaseStep (const TCollection_AsciiString& atype) const Standard_OVERRIDE;
-
- Standard_EXPORT virtual Standard_Integer CaseStep (const TColStd_SequenceOfAsciiString& types) const Standard_OVERRIDE;
-
- Standard_EXPORT virtual Standard_Boolean IsComplex (const Standard_Integer CN) const Standard_OVERRIDE;
-
- Standard_EXPORT const TCollection_AsciiString& StepType (const Standard_Integer CN) const Standard_OVERRIDE;
-
- Standard_EXPORT virtual Standard_Boolean ComplexType (const Standard_Integer CN, TColStd_SequenceOfAsciiString& types) const Standard_OVERRIDE;
-
- Standard_EXPORT void ReadStep (const Standard_Integer CN, const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
-
- Standard_EXPORT void WriteStep (const Standard_Integer CN, StepData_StepWriter& SW, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
-
-
-
-
- DEFINE_STANDARD_RTTIEXT(StepData_DescrReadWrite,StepData_ReadWriteModule)
-
-protected:
-
-
-
-
-private:
-
-
- Handle(StepData_Protocol) theproto;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_DescrReadWrite_HeaderFile
+++ /dev/null
-// Created on: 1992-02-11
-// Created by: Christian CAILLET
-// Copyright (c) 1992-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_FileRecognizer_HeaderFile
-#define _StepData_FileRecognizer_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <Standard_Boolean.hxx>
-#include <Standard_Transient.hxx>
-class Standard_Transient;
-class Standard_NoSuchObject;
-class TCollection_AsciiString;
-
-
-class StepData_FileRecognizer;
-DEFINE_STANDARD_HANDLE(StepData_FileRecognizer, Standard_Transient)
-
-
-class StepData_FileRecognizer : public Standard_Transient
-{
-
-public:
-
-
- //! Evaluates if recognition has a result, returns it if yes
- //! In case of success, Returns True and puts result in "res"
- //! In case of Failure, simply Returns False
- //! Works by calling deferred method Eval, and in case of failure,
- //! looks for Added Recognizers to work
- Standard_EXPORT Standard_Boolean Evaluate (const TCollection_AsciiString& akey, Handle(Standard_Transient)& res);
-
- //! Returns result of last recognition (call of Evaluate)
- Standard_EXPORT Handle(Standard_Transient) Result() const;
-
- //! Adds a new Recognizer to the Compound, at the end
- //! Several calls to Add work by adding in the order of calls :
- //! Hence, when Eval has failed to recognize, Evaluate will call
- //! Evaluate from the first added Recognizer if there is one,
- //! and to the second if there is still no result, and so on
- Standard_EXPORT void Add (const Handle(StepData_FileRecognizer)& reco);
-
-
-
-
- DEFINE_STANDARD_RTTI_INLINE(StepData_FileRecognizer,Standard_Transient)
-
-protected:
-
-
- //! Assumes that no result has yet been recognized
- Standard_EXPORT StepData_FileRecognizer();
-
- //! Records the result of the recognition. Called by specific
- //! method Eval to record a result : after calling it, Eval has
- //! finished and can return
- Standard_EXPORT void SetOK (const Handle(Standard_Transient)& aresult);
-
- //! Records that recognition gives no result
- Standard_EXPORT void SetKO();
-
- //! THIS METHOD DEFINES THE RECOGNITION PROTOCOL, it is proper to
- //! each precise type of Recognizer
- //! For a suitable type of akey, it calls SetOK(result) where
- //! result is an empty result of appropriate type, then returns
- Standard_EXPORT virtual void Eval (const TCollection_AsciiString& akey) = 0;
-
-
-
-private:
-
-
- Handle(Standard_Transient) theres;
- Standard_Boolean hasnext;
- Handle(StepData_FileRecognizer) thenext;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_FileRecognizer_HeaderFile
+++ /dev/null
-// Created on: 1992-02-11
-// Created by: Christian CAILLET
-// Copyright (c) 1992-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <StepData_FileRecognizer.hxx>
-
-#include <Standard_Type.hxx>
-
-#include <Standard_Transient.hxx>
-#include <StepData_FileRecognizer.hxx>
-#include <Standard_NoSuchObject.hxx>
-#include <TCollection_AsciiString.hxx>
-
-
-
-
-
-
-
-
-
-
-#define TheKey TCollection_AsciiString
-#define TheKey_hxx <TCollection_AsciiString.hxx>
-#define Handle_TheResul Handle(Standard_Transient)
-#define TheResul Standard_Transient
-#define TheResul_hxx <Standard_Transient.hxx>
-#define Interface_Recognizer StepData_FileRecognizer
-#define Interface_Recognizer_hxx <StepData_FileRecognizer.hxx>
-#define Handle_Interface_Recognizer Handle(StepData_FileRecognizer)
-#include <Interface_Recognizer.gxx>
-
// commercial license or contractual agreement.
-#include <Interface_Check.hxx>
-#include <Interface_CopyTool.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_ShareTool.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
#include <StepData_GeneralModule.hxx>
-IMPLEMENT_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule)
\ No newline at end of file
+IMPLEMENT_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule)
//! Specific features for General Services adapted to STEP
class StepData_GeneralModule : public Interface_GeneralModule
{
+ public:
-public:
-
-
//! Specific filling of the list of Entities shared by an Entity
//! <ent>. Can use the internal utility method Share, below
Standard_EXPORT virtual void FillSharedCase (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE = 0;
//! Specific Checking of an Entity <ent>
Standard_EXPORT virtual void CheckCase (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE = 0;
-
- //! Specific Copy ("Deep") from <entfrom> to <entto> (same type)
- //! by using a TransferControl which provides its working Map.
- //! Use method Transferred from TransferControl to work
- //! Specific Copying of Implied References
- //! A Default is provided which does nothing (must current case !)
- //! Already copied references (by CopyFrom) must remain unchanged
- //! Use method Search from TransferControl to work
- Standard_EXPORT virtual void CopyCase (const Standard_Integer casenum, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE = 0;
-
-
-
DEFINE_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule)
-
-protected:
-
-
-
-
-private:
-
-
-
-
};
-
-
-
-
-
-
#endif // _StepData_GeneralModule_HeaderFile
#include <Standard_Transient.hxx>
class StepData_ReadWriteModule;
-class StepData_Protocol;
+class Interface_Protocol;
class Standard_Transient;
class StepData_WriterLib;
class StepData_NodeOfWriterLib;
//! nothing if already in the list, THAT IS, Same Type (exact
//! match) and Same State (that is, IsEqual is not required)
//! Once added, stores its attached Protocol in correspondance
- Standard_EXPORT void Add (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol);
+ Standard_EXPORT void Add (const Handle(StepData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
//! Returns the Module stored in a given GlobalNode
Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const;
//! Returns the attached Protocol stored in a given GlobalNode
- Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
//! Returns the Next GlobalNode. If none is defined, returned
//! value is a Null Handle
Handle(StepData_ReadWriteModule) themod;
- Handle(StepData_Protocol) theprot;
+ Handle(Interface_Protocol) theprot;
Handle(StepData_GlobalNodeOfWriterLib) thenext;
#include <Standard_Type.hxx>
#include <StepData_ReadWriteModule.hxx>
-#include <StepData_Protocol.hxx>
#include <StepData_GlobalNodeOfWriterLib.hxx>
#include <Standard_Transient.hxx>
#include <StepData_WriterLib.hxx>
#include <StepData_NodeOfWriterLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(Standard_Transient)
#define TheObject_hxx <Standard_Transient.hxx>
#define Handle_TheModule Handle(StepData_ReadWriteModule)
#define TheModule StepData_ReadWriteModule
#define TheModule_hxx <StepData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(StepData_Protocol)
-#define TheProtocol StepData_Protocol
-#define TheProtocol_hxx <StepData_Protocol.hxx>
#define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib
#define LibCtl_GlobalNode_hxx <StepData_GlobalNodeOfWriterLib.hxx>
#define LibCtl_Node StepData_NodeOfWriterLib
#define LibCtl_Library StepData_WriterLib
#define LibCtl_Library_hxx <StepData_WriterLib.hxx>
#include <LibCtl_GlobalNode.gxx>
-
class StepData_GlobalNodeOfWriterLib;
class Standard_Transient;
class StepData_ReadWriteModule;
-class StepData_Protocol;
+class Interface_Protocol;
class StepData_WriterLib;
Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const;
//! Returns the Protocol designated by a precise Node
- Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const;
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
//! Returns the Next Node. If none was defined, returned value
//! is a Null Handle
#include <Standard_Type.hxx>
+#include <Interface_Protocol.hxx>
#include <StepData_GlobalNodeOfWriterLib.hxx>
#include <StepData_NodeOfWriterLib.hxx>
#include <Standard_Transient.hxx>
#include <StepData_ReadWriteModule.hxx>
-#include <StepData_Protocol.hxx>
#include <StepData_WriterLib.hxx>
-
-
-
-
-
-
-
-
-
#define TheObject Handle(Standard_Transient)
#define TheObject_hxx <Standard_Transient.hxx>
#define Handle_TheModule Handle(StepData_ReadWriteModule)
#define TheModule StepData_ReadWriteModule
#define TheModule_hxx <StepData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(StepData_Protocol)
-#define TheProtocol StepData_Protocol
-#define TheProtocol_hxx <StepData_Protocol.hxx>
#define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib
#define LibCtl_GlobalNode_hxx <StepData_GlobalNodeOfWriterLib.hxx>
#define LibCtl_Node StepData_NodeOfWriterLib
//static TCollection_AsciiString thename("(DEFAULT)");
static Standard_CString thename = "(DEFAULT)";
-StepData_Protocol::StepData_Protocol ()
-{
-}
-
-Standard_Integer StepData_Protocol::NbResources () const
-{
- return 0;
-}
-
-
-Handle(Interface_Protocol) StepData_Protocol::Resource
- (const Standard_Integer /*num*/) const
-{
- Handle(Interface_Protocol) nulproto;
- return nulproto;
-}
-
-
Standard_Integer StepData_Protocol::CaseNumber
(const Handle(Standard_Transient)& obj) const
{
//! NbResources and Resources.
class StepData_Protocol : public Interface_Protocol
{
+ public:
-public:
-
-
- Standard_EXPORT StepData_Protocol();
-
- //! Gives the count of Protocols used as Resource (can be zero)
- //! Here, No resource
- Standard_EXPORT Standard_Integer NbResources() const Standard_OVERRIDE;
-
- //! Returns a Resource, given a rank. Here, none
- Standard_EXPORT Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE;
+ StepData_Protocol() {}
//! Returns a unique positive number for any recognized entity
//! Redefined to work by calling both TypeNumber and, for a
(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
{
//! Same as InterfaceEntity, but with a shorter name
Standard_EXPORT Handle(Standard_Transient) Entity (const Standard_Integer num) const;
- //! gets header from another Model (uses Header Protocol)
- Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE;
-
- //! Returns a New Empty Model, same type as <me>, i.e. StepModel
- Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE;
-
//! returns Header entities under the form of an iterator
Standard_EXPORT Interface_EntityIterator Header() const;
#include <Message_Messenger.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
-#include <Standard_Transient.hxx>
-#include <StepData_FileRecognizer.hxx>
#include <StepData_Protocol.hxx>
#include <StepData_ReadWriteModule.hxx>
#include <StepData_StepModel.hxx>
}
-//=======================================================================
-//function : Recognize
-//purpose :
-//=======================================================================
-
-Standard_Boolean StepData_StepReaderTool::Recognize(const Standard_Integer num,
- Handle(Interface_Check)& ach,
- Handle(Standard_Transient)& ent)
-{
-// Handle(Standard_Transient) bid; // pas exploite
-// return thereco->Evaluate(thetypes.Value(num),bid);
-
-// Recognizer : C est lui qui assure la Reconnaissance (-> Liste limitative)
- if (!thereco.IsNull()) {
- DeclareAndCast(StepData_StepReaderData,stepdat,Data());
- return thereco->Evaluate(stepdat->RecordType(num),ent);
- }
-
-// Pas de Recognizer : Reconnaissance par la librairie
- return RecognizeByLib (num,theglib,therlib,ach,ent);
-}
-
-
// .... Methodes de preparations propres a StepReaderTool ....
//purpose :
//=======================================================================
-void StepData_StepReaderTool::Prepare
- (const Handle(StepData_FileRecognizer)& reco, const Standard_Boolean optim)
-{
- thereco = reco;
- Prepare(optim);
-}
-
-
-//=======================================================================
-//function : Prepare
-//purpose :
-//=======================================================================
-
-void StepData_StepReaderTool::Prepare (const Standard_Boolean optim)
+void StepData_StepReaderTool::Prepare ()
{
// SetEntityNumbers a ete mis du cote de ReaderData, because beaucoup acces
- Standard_Boolean erh = ErrorHandle();
DeclareAndCast(StepData_StepReaderData,stepdat,Data());
- if (erh) {
- try {
- OCC_CATCH_SIGNALS
- stepdat->SetEntityNumbers(optim);
- SetEntities();
- }
- catch(Standard_Failure) {
- Handle(Message_Messenger) sout = Message::DefaultMessenger();
- sout << " Exception Raised during Preparation :\n";
- sout << Standard_Failure::Caught()->GetMessageString();
- sout << "\n Now, trying to continue, but with presomption of failure\n";
- }
- }
- else {
- stepdat->SetEntityNumbers(optim);
+ try {
+ OCC_CATCH_SIGNALS
+ stepdat->SetEntityNumbers(Standard_True);
SetEntities();
}
+ catch(Standard_Failure) {
+ const Handle(Message_Messenger) &sout = Message::DefaultMessenger();
+ sout << " Exception Raised during Preparation :\n";
+ sout << Standard_Failure::Caught()->GetMessageString();
+ sout << "\n Now, trying to continue, but with presomption of failure\n";
+ }
}
//purpose :
//=======================================================================
-void StepData_StepReaderTool::PrepareHeader
- (const Handle(StepData_FileRecognizer)& reco)
+void StepData_StepReaderTool::PrepareHeader ()
{
Standard_Integer i = 0;
DeclareAndCast(StepData_StepReaderData,stepdat,Data());
while ( (i = stepdat->FindNextHeaderRecord(i)) != 0) {
Handle(Standard_Transient) ent;
-// On a donne un Recognizer : il fixe une liste limitative de types reconnus
- if (!reco.IsNull()) {
- if (!reco->Evaluate(stepdat->RecordType(i),ent)) {
- ent = Protocol()->UnknownEntity();
- }
- } else {
-// Pas de Recognizer : Reconnaissance par la librairie
- Handle(Interface_Check) ach = new Interface_Check; // faudrait le lister ... ?
- RecognizeByLib (i,theglib,therlib,ach,ent);
- }
+// Reconnaissance par la librairie
+ Handle(Interface_Check) ach = new Interface_Check; // faudrait le lister ... ?
+ RecognizeByLib (i,theglib,therlib,ach,ent);
if (ent.IsNull()) ent = Protocol()->UnknownEntity();
stepdat->BindEntity(i,ent);
}
}
+//=======================================================================
+//function : Recognize
+//purpose :
+//=======================================================================
+
+Standard_Boolean StepData_StepReaderTool::Recognize(const Standard_Integer num,
+ Handle(Interface_Check)& ach,
+ Handle(Standard_Transient)& ent)
+{
+// Reconnaissance par la librairie
+ return RecognizeByLib (num,theglib,therlib,ach,ent);
+}
+
+
// .... Methodes pour la lecture du Modele (apres preparation) .... //
//purpose :
//=======================================================================
-void StepData_StepReaderTool::BeginRead
- (const Handle(Interface_InterfaceModel)& amodel)
+void StepData_StepReaderTool::BeginRead (const Handle(Interface_InterfaceModel)& amodel)
{
Handle(Message_Messenger) sout = Message::DefaultMessenger();
DeclareAndCast(StepData_StepModel,model,amodel);
//purpose :
//=======================================================================
-void StepData_StepReaderTool::EndRead
- (const Handle(Interface_InterfaceModel)& amodel)
+void StepData_StepReaderTool::EndRead (const Handle(Interface_InterfaceModel)& amodel)
{
DeclareAndCast(StepData_StepReaderData,stepdat,Data());
DeclareAndCast(StepData_StepModel,stepmodel,amodel);
#include <Interface_GeneralLib.hxx>
#include <Interface_ReaderLib.hxx>
#include <Interface_FileReaderTool.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
-class StepData_FileRecognizer;
class StepData_StepReaderData;
class StepData_Protocol;
class Interface_Check;
-class Standard_Transient;
class Interface_InterfaceModel;
//! Remarks : works with a ReaderLib to load Entities
class StepData_StepReaderTool : public Interface_FileReaderTool
{
-public:
+ public:
DEFINE_STANDARD_ALLOC
-
//! creates StepReaderTool to work with a StepReaderData according
//! to a Step Protocol. Defines the ReaderLib at this time
Standard_EXPORT StepData_StepReaderTool(const Handle(StepData_StepReaderData)& reader, const Handle(StepData_Protocol)& protocol);
- //! Bounds empty entities to records, uses default Recognition
- //! provided by ReaderLib and ReaderModule. Also calls computation
- //! of references (SetEntityNumbers from StepReaderData)
+ //! Bounds empty entities to records
//! Works only on data entities (skips header)
- //! <optimize> given False allows to test some internal algorithms
- //! which are normally avoided (see also StepReaderData)
- Standard_EXPORT void Prepare (const Standard_Boolean optimize = Standard_True);
+ Standard_EXPORT void Prepare ();
- //! Bounds empty entities to records, works with a specific
- //! FileRecognizer, stored and later used in Recognize
- //! Works only on data entities (skips header)
- //! <optimize : same as above
- Standard_EXPORT void Prepare (const Handle(StepData_FileRecognizer)& reco, const Standard_Boolean optimize = Standard_True);
+ //! Bounds empty entities and sub-lists to header records
+ //! works like Prepare + SetEntityNumbers, but for header
+ //! (N.B.: in Header, no Ident and no reference)
+ Standard_EXPORT void PrepareHeader ();
+
+ private:
//! recognizes records, by asking either ReaderLib (default) or
//! FileRecognizer (if defined) to do so. <ach> is to call
//! RecognizeByLib
- Standard_EXPORT Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE;
-
- //! bounds empty entities and sub-lists to header records
- //! works like Prepare + SetEntityNumbers, but for header
- //! (N.B.: in Header, no Ident and no reference)
- //! FileRecognizer is to specify Entities which are allowed to be
- //! defined in the Header (not every type can be)
- Standard_EXPORT void PrepareHeader (const Handle(StepData_FileRecognizer)& reco);
+ Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE;
//! fills model's header; that is, gives to it Header entities
//! and commands their loading. Also fills StepModel's Global
//! Check from StepReaderData's GlobalCheck
- Standard_EXPORT void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
+ Standard_EXPORT virtual void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
//! fills an entity, given record no; works by using a ReaderLib
//! to load each entity, which must be a Transient
//! Here, it binds in the model, Idents to Entities (for checks)
Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
- Handle(StepData_FileRecognizer) thereco;
Interface_GeneralLib theglib;
Interface_ReaderLib therlib;
-
-
};
-
-
-
-
-
-
#endif // _StepData_StepReaderTool_HeaderFile
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
+class Interface_Protocol;
class StepData_NodeOfWriterLib;
-class Standard_NoSuchObject;
-class Standard_Transient;
class StepData_ReadWriteModule;
-class StepData_Protocol;
class StepData_GlobalNodeOfWriterLib;
class StepData_WriterLib
{
-public:
+ public:
DEFINE_STANDARD_ALLOC
-
//! Adds a couple (Module-Protocol) into the global definition set
//! for this class of Library.
- Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol);
+ Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
//! Creates a Library which complies with a Protocol, that is :
//! Same class (criterium IsInstance)
//! This creation gets the Modules from the global set, those
//! which are bound to the given Protocol and its Resources
- Standard_EXPORT StepData_WriterLib(const Handle(StepData_Protocol)& aprotocol);
+ Standard_EXPORT StepData_WriterLib(const Handle(Interface_Protocol)& aprotocol);
//! Creates an empty Library : it will later by filled by method
//! AddProtocol
//! Adds a couple (Module-Protocol) to the Library, given the
//! class of a Protocol. Takes Resources into account.
//! (if <aprotocol> is not of type TheProtocol, it is not added)
- Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
+ Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol);
//! Clears the list of Modules of a library (can be used to
//! redefine the order of Modules before action : Clear then
//! refill the Library by calls to AddProtocol)
Standard_EXPORT void Clear();
- //! Sets a library to be defined with the complete Global list
- //! (all the couples Protocol/Modules recorded in it)
- Standard_EXPORT void SetComplete();
-
//! Selects a Module from the Library, given an Object.
//! Returns True if Select has succeeded, False else.
//! Also Returns (as arguments) the selected Module and the Case
Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const;
//! Returns the current Protocol in the Iteration
- Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const;
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
+ Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
+ private:
Handle(StepData_NodeOfWriterLib) thelist;
Handle(StepData_NodeOfWriterLib) thecurr;
-
-
};
-
-
-
-
-
-
#endif // _StepData_WriterLib_HeaderFile
#include <Standard_NoSuchObject.hxx>
#include <Standard_Transient.hxx>
#include <StepData_ReadWriteModule.hxx>
-#include <StepData_Protocol.hxx>
#include <StepData_GlobalNodeOfWriterLib.hxx>
#define Handle_TheModule Handle(StepData_ReadWriteModule)
#define TheModule StepData_ReadWriteModule
#define TheModule_hxx <StepData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(StepData_Protocol)
-#define TheProtocol StepData_Protocol
-#define TheProtocol_hxx <StepData_Protocol.hxx>
#define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib
#define LibCtl_GlobalNode_hxx <StepData_GlobalNodeOfWriterLib.hxx>
#define LibCtl_Node StepData_NodeOfWriterLib
modepr = mode; // recfile_modeprint est rappele a chaque lecture de fichier
}
-
-static Standard_Integer StepFile_Read
- (char* nomfic,
- const Handle(StepData_StepModel)& stepmodel,
- const Handle(StepData_Protocol)& protocol,
- const Handle(StepData_FileRecognizer)& recoheader,
- const Handle(StepData_FileRecognizer)& recodata);
-
-
-Standard_Integer StepFile_Read
- (char* nomfic,
- const Handle(StepData_StepModel)& stepmodel,
- const Handle(StepData_FileRecognizer)& recoheader,
- const Handle(StepData_FileRecognizer)& recodata)
-{
- return StepFile_Read
- (nomfic,stepmodel,
- Handle(StepData_Protocol)::DownCast(Interface_Protocol::Active()),
- recoheader,recodata);
-}
-
-Standard_Integer StepFile_Read
- (char* nomfic,
- const Handle(StepData_StepModel)& stepmodel,
- const Handle(StepData_FileRecognizer)& recoheader,
- const Handle(StepData_Protocol)& protocol)
-{
- Handle(StepData_FileRecognizer) nulreco;
- return StepFile_Read (nomfic,stepmodel,protocol,recoheader,nulreco);
-}
-
-Standard_Integer StepFile_Read
- (char* nomfic,
- const Handle(StepData_StepModel)& stepmodel,
- const Handle(StepData_Protocol)& protocol)
-{
- Handle(StepData_FileRecognizer) nulreco;
- return StepFile_Read (nomfic,stepmodel,protocol,nulreco,nulreco);
-}
-
// ## ## ## ## ## ## Corps de la Routine ## ## ## ## ## ##
static Interface_ParamType LesTypes[10]; // passage types (recstep/Interface)
Standard_Integer StepFile_Read
(char* nomfic,
const Handle(StepData_StepModel)& stepmodel,
- const Handle(StepData_Protocol)& protocol,
- const Handle(StepData_FileRecognizer)& recoheader,
- const Handle(StepData_FileRecognizer)& recodata)
+ const Handle(StepData_Protocol)& protocol)
{
Handle(Message_Messenger) sout = Message::DefaultMessenger();
return 1;
}
// Continue reading of file despite of possible fails
- //if (checkread->HasFailed()) { lir_file_fin(3); stepread_endinput (newin,ficnom); return 1; }
#ifdef CHRONOMESURE
sout << " ... STEP File Read ... " << endl;
c.Show();
// Analyse : par StepReaderTool
StepData_StepReaderTool readtool (undirec,protocol);
- readtool.SetErrorHandle (Standard_True);
- readtool.PrepareHeader(recoheader); // Header. reco nul -> pour Protocol
- readtool.Prepare(recodata); // Data. reco nul -> pour Protocol
+ readtool.PrepareHeader();
+ readtool.Prepare();
#ifdef CHRONOMESURE
sout << " ... Parameters prepared ... ";
if (stepmodel->Protocol().IsNull()) stepmodel->SetProtocol (protocol);
lir_file_fin(2);
- readtool.Clear();
undirec.Nullify();
#ifdef CHRONOMESURE
sout << " ... Objets analysed ... " << endl;
//# include <stepread.h> : sauf recfile_modeprint, declare ici
# include <StepData_StepModel.hxx>
-# include <StepData_FileRecognizer.hxx>
# include <StepData_Protocol.hxx>
-
Standard_EXPORT void StepFile_ReadTrace (const Standard_Integer mode);
// Modal : 0 pas de trace, 1 trace LoadModel, 2 & 3 + trace interne lex-yac
-Standard_EXPORT Standard_Integer StepFile_Read
- (char* nomfic,
- const Handle(StepData_StepModel)& stepmodel,
- const Handle(StepData_FileRecognizer)& recoheader, // Reconnait le Header
- const Handle(StepData_FileRecognizer)& recodata); // Entites du Data
-
-Standard_EXPORT Standard_Integer StepFile_Read
- (char* nomfic,
- const Handle(StepData_StepModel)& stepmodel,
- const Handle(StepData_FileRecognizer)& recoheader, // Reconnait le Header
- const Handle(StepData_Protocol)& protocol); // Entites du Data
-
Standard_EXPORT Standard_Integer StepFile_Read
(char* nomfic,
const Handle(StepData_StepModel)& stepmodel,
#include <Interface_InterfaceError.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
-#include <Interface_Protocol.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_Protocol.hxx>
#include <StepData_ReadWriteModule.hxx>
#include <StepData_UndefinedEntity.hxx>
+#include <StepAP214.hxx>
+#include <StepAP214_Protocol.hxx>
#include <StepSelect_StepType.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
static TCollection_AsciiString lastvalue;
- StepSelect_StepType::StepSelect_StepType ()
- : IFSelect_Signature ("Step Type") { }
-
- void StepSelect_StepType::SetProtocol
- (const Handle(Interface_Protocol)& proto)
+StepSelect_StepType::StepSelect_StepType ()
+: IFSelect_Signature ("Step Type")
{
- DeclareAndCast(StepData_Protocol,newproto,proto);
- if (newproto.IsNull()) Interface_InterfaceError::Raise("StepSelect_StepType");
- theproto = newproto;
+ const Handle(StepAP214_Protocol) &proto = StepAP214::Protocol();
+ if (proto.IsNull()) Interface_InterfaceError::Raise("StepSelect_StepType");
+ theproto = proto;
thelib.Clear();
thelib.AddProtocol (theproto);
thename.Clear();
thename.AssignCat (")");
}
- Standard_CString StepSelect_StepType::Value
+Standard_CString StepSelect_StepType::Value
(const Handle(Standard_Transient)& ent,
const Handle(Interface_InterfaceModel)& /*model*/) const
{
#include <IFSelect_Signature.hxx>
#include <Standard_CString.hxx>
class StepData_Protocol;
-class Interface_InterfaceError;
-class Interface_Protocol;
-class Standard_Transient;
class Interface_InterfaceModel;
//! Write time only), StepType produces : "(..COMPLEX TYPE..)"
class StepSelect_StepType : public IFSelect_Signature
{
+ public:
-public:
-
-
//! Creates a Signature for Step Type. Protocol is undefined here,
//! hence no Signature may yet be produced. The StepType signature
//! requires a Protocol before working
Standard_EXPORT StepSelect_StepType();
- //! Sets the StepType signature to work with a Protocol : this
- //! initialises the library
- Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto);
-
//! Returns the Step Type defined from the Protocol (see above).
//! If <ent> is not recognised, produces "..NOT FROM SCHEMA <name>.."
Standard_EXPORT Standard_CString Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
-
-
-
DEFINE_STANDARD_RTTIEXT(StepSelect_StepType,IFSelect_Signature)
-protected:
-
+ protected:
StepData_WriterLib thelib;
-
-
-private:
-
-
Handle(StepData_Protocol) theproto;
-
-
};
-
-
-
-
-
-
#endif // _StepSelect_StepType_HeaderFile
#define Flag_Incorrect 2
// (Bit Map n0 2)
-static Standard_Boolean errhand; // pb : un seul a la fois, mais ca va si vite
-
// #################################################################
//=======================================================================
myReaderProcess(new Transfer_TransientProcess),
myWriterProcess(new Transfer_FinderProcess)
{
- errhand = Standard_True;
}
void XSControl_WorkSession::SetModel (const Handle(Interface_InterfaceModel)& model)
{
- if (myModel != model)
+ if (myModel != model) {
theloaded.Clear();
- else
myModel = model;
+ }
if (!thegtool.IsNull()) thegtool->ClearEntities(); //smh#14 FRA62479
myModel->SetGTool (thegtool);
- thegraph.Nullify();
- ComputeGraph(); // fait qqchose si Protocol present. Sinon, ne fait rien
+ ComputeGraph(Standard_True);
thecheckdone = Standard_False; // RAZ CheckList, a refaire
myController = ctl;
const Handle(Interface_Protocol) &aProtocol = myController->Protocol();
- Interface_Protocol::SetActive(aProtocol);
thegtool->SetProtocol(aProtocol);
- /*szv_c1:ClearItems();
- ClearShareOut();*/
-
// Set worksession parameters from the controller
Handle(XSControl_WorkSession) aWorkSession(this);
myController->Customise (aWorkSession);
Interface_ReturnStatus XSControl_WorkSession::ReadFile (const Standard_CString theFileName)
{
- if (myController.IsNull()) return Interface_RetVoid;
- if (myController->Protocol().IsNull()) return Interface_RetVoid;
+ if (myController.IsNull() || myController->Protocol().IsNull())
+ return Interface_RetVoid;
Handle(Interface_InterfaceModel) model;
Interface_ReturnStatus status = Interface_RetVoid;
}
catch(Standard_Failure) {
const Handle(Message_Messenger) &sout = Message::DefaultMessenger();
- sout<<" **** Interruption ReadFile par Exception : ****\n";
+ sout<<" **** Exception in XSControl_WorkSession::ReadFile : ****\n";
sout << Standard_Failure::Caught()->GetMessageString();
sout<<"\n Abandon"<<endl;
status = Interface_RetFail;
}
if (status != Interface_RetDone) return status;
if (model.IsNull()) return Interface_RetVoid;
+
SetModel (model);
- SetLoadedFile (theFileName);
+
+ theloaded = theFileName;
+
return status;
}
Interface_ReturnStatus XSControl_WorkSession::WriteFile (const Standard_CString theFileName)
{
- if (myController.IsNull())
+ if (myController.IsNull() || myController->Protocol().IsNull())
return Interface_RetVoid;
- ComputeGraph(Standard_True);
- if (!IsLoaded())
- return Interface_RetVoid;
+ const Handle(Message_Messenger) &sout = Message::DefaultMessenger();
Interface_CheckIterator checks;
- if (errhand) {
- errhand = Standard_False;
- try {
- OCC_CATCH_SIGNALS
- CopySendAll(theFileName,checks);
- }
- catch (Standard_Failure) {
- const Handle(Message_Messenger) &sout = Message::DefaultMessenger();
- sout<<" **** Exception in XSControl_WorkSession::WriteFile : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
- sout<<"\n Abandon"<<endl;
- errhand = Standard_True;
- return Interface_RetFail;
- }
+ try {
+ OCC_CATCH_SIGNALS
+ sout << "** WorkSession : Writing all data" << endl;
+ ComputeGraph(Standard_True);
+ if (!IsLoaded())
+ return Interface_RetVoid;
+
+ checks.SetName ("X-STEP WorkSession : WriteFile");
+ Interface_CheckIterator checklst;
+ const Standard_Boolean res = myController->WriteFile(theFileName,myModel,checklst);
+ checks.Merge(checklst);
+ if (!res) checks.CCheck(0)->AddFail ("WriteFile has failed");
+ }
+ catch (Standard_Failure) {
+ sout<<" **** Exception in XSControl_WorkSession::WriteFile : ****\n";
+ sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<"\n Abandon"<<endl;
+ return Interface_RetFail;
}
- else CopySendAll(theFileName,checks);
Handle(Interface_Check) aMainFail = checks.CCheck(0);
if (!aMainFail.IsNull() && aMainFail->HasFailed ())
return newmod;
}
-
-//=======================================================================
-//function : CopySendAll
-//purpose :
-//=======================================================================
-
-void XSControl_WorkSession::CopySendAll (const Standard_CString theFileName, Interface_CheckIterator &theChecks)
-{
- theChecks.SetName ("X-STEP WorkSession : Send All");
- Message::DefaultMessenger() << "** WorkSession : Sending all data"<<endl;
-
- const Handle(Interface_Protocol)& aProtocol = myController->Protocol();
- const Handle(Interface_InterfaceModel) &aModel = thegraph->Graph().Model();
- if (aModel.IsNull() || aProtocol.IsNull()) return;
-
- Interface_CheckIterator checklst;
- const Standard_Boolean res = myController->WriteFile(theFileName,aModel,checklst);
- theChecks.Merge(checklst);
- if (!res) theChecks.CCheck(0)->AddFail ("SendAll (WriteFile) has failed");
-}
protected:
- Standard_EXPORT void CopySendAll (const Standard_CString filename, Interface_CheckIterator &checks);
-
Handle(XSControl_Controller) myController; // thelibrary;
Handle(Interface_InterfaceModel) myModel;
#include <IGESControl_Reader.hxx>
#include <IGESControl_Writer.hxx>
#include <IGESData.hxx>
-#include <IGESData_BasicEditor.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_IGESModel.hxx>
#include <IGESData_Protocol.hxx>
#include <IFSelect_SelectSignature.hxx>
#include <IFSelect_SelectModelEntities.hxx>
#include <IFSelect_SelectModelRoots.hxx>
-#include <StepAP214.hxx>
-#include <StepAP214_Protocol.hxx>
#include <STEPSelections_SelectDerived.hxx>
#include <STEPSelections_SelectFaces.hxx>
#include <STEPSelections_SelectInstances.hxx>
static Handle(StepSelect_StepType) sty;
if (!sty.IsNull()) return sty;
sty = new StepSelect_StepType;
- sty->SetProtocol (StepAP214::Protocol());
return sty;
}
gSessionItems.AddItem (new IFSelect_SignAncestor(),"xst-derived");
Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived();
- stdvar->SetProtocol(StepAP214::Protocol());
gSessionItems.AddItem (stdvar,"step-derived");
Handle(IFSelect_SelectSignature) selsdr = NewSelectSDR();
//pdn S4133 18.02.99
WS->AddNamedItem ("xst-derived",new IFSelect_SignAncestor());
Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived();
- stdvar->SetProtocol(StepAP214::Protocol());
WS->AddNamedItem ("step-derived",stdvar);
Handle(IFSelect_SelectSignature) selsdr = NewSelectSDR();