Shape from TopoDS,
IGESEntity from IGESData,
IGESModel from IGESData,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
is
---Purpose : Returns the value of the UnitFlag of the header of the model
-- in meters.
- SetTransferProcess(me : in out; TP : FinderProcess from Transfer);
+ SetTransferProcess(me : in out; TP : FinderProcess_Handle from Transfer);
---Purpose : Set the value of "TheMap"
GetTransferProcess(me)
- returns FinderProcess from Transfer;
+ returns FinderProcess_Handle from Transfer;
---Purpose : Returns the value of "TheMap"
TransferShape(me : in out; start : Shape from TopoDS)
myConvSurface : Boolean;
myPCurveMode : Boolean;
- TheMap : FinderProcess from Transfer;
+ TheMap : FinderProcess_Handle from Transfer;
end BREntity;
#include <Transfer_FinderProcess.hxx>
#include <TransferBRep_ShapeMapper.hxx>
-#include <TransferBRep_OrientedShapeMapper.hxx>
#include <Transfer_TransientMapper.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
Shell from IGESSolid,
ManifoldSolid from IGESSolid,
CString from Standard,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
is
#include <Transfer_FinderProcess.hxx>
#include <TransferBRep_ShapeMapper.hxx>
-#include <TransferBRep_OrientedShapeMapper.hxx>
#include <Transfer_TransientMapper.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Interface_Static.hxx>
--- /dev/null
+HeaderSection_HeaderRecognizer.hxx
+HeaderSection_HeaderRecognizer.cxx
class FileDescription;
class FileSchema;
-class HeaderRecognizer;
+imported HeaderRecognizer;
--class Array1OfHAsciiString instantiates Array1(HAsciiString);
--class HArray1OfHAsciiString instantiates HArray1(HAsciiString,Array1OfHAsciiString from HeaderSection);
+++ /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 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.
-
-class HeaderRecognizer from HeaderSection
- inherits FileRecognizer from StepData
-
- ---Purpose : Recognizes STEP Standard Header Entities
- -- (FileName, FileDescription, FileSchema)
-
-uses AsciiString from TCollection
-
-is
-
- Create returns mutable HeaderRecognizer ;
-
- Eval (me : mutable ; key : AsciiString from TCollection) is protected;
- ---Purpose: Recognizes data types of Header STEP Standard
-
-end HeaderRecognizer;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <HeaderSection_HeaderRecognizer.ixx>
-
+#include <HeaderSection_HeaderRecognizer.hxx>
#include <HeaderSection_FileName.hxx>
#include <HeaderSection_FileSchema.hxx>
#include <HeaderSection_FileDescription.hxx>
-
-
-static TCollection_AsciiString reco_FileName ("FILE_NAME");
-static TCollection_AsciiString reco_FileSchema ("FILE_SCHEMA");
+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)
+void HeaderSection_HeaderRecognizer::Eval (const TCollection_AsciiString& key)
{
- if (key.IsEqual(reco_FileName)) {
+ if (key.IsEqual(reco_FileName))
+ {
SetOK(new HeaderSection_FileName);
return;
}
- if (key.IsEqual(reco_FileSchema)) {
+ if (key.IsEqual(reco_FileSchema))
+ {
SetOK(new HeaderSection_FileSchema);
return;
}
- if (key.IsEqual(reco_FileDescription)) {
+ if (key.IsEqual(reco_FileDescription))
+ {
SetOK(new HeaderSection_FileDescription);
return;
}
}
+
+ IMPLEMENT_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
+ IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
--- /dev/null
+// Copyright (c) 1998-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 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_DefineHandle.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <StepData_FileRecognizer.hxx>
+
+class TCollection_AsciiString;
+
+//! Recognizes STEP Standard Header Entities <br>
+//! (FileName, FileDescription, FileSchema) <br>
+class HeaderSection_HeaderRecognizer : public StepData_FileRecognizer
+{
+public:
+ Standard_EXPORT HeaderSection_HeaderRecognizer();
+
+ DEFINE_STANDARD_RTTI(HeaderSection_HeaderRecognizer)
+
+protected:
+
+ //! Recognizes data types of Header STEP Standard <br>
+ Standard_EXPORT void Eval(const TCollection_AsciiString& key);
+
+};
+
+ DEFINE_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
+
+#endif
class SelectSharing; -- directly sharing entities
deferred class SelectAnyList; -- from a list in an entity
deferred class SelectInList; -- from a list of single entities
- generic class SelectList; -- from an entity as a list
class SelectSuite; -- macro-select-deduct
deferred class SelectExtract; -- sorted lists (can be inverted) :
deferred class Modifier; -- defines modifying actions on transferred model
class ModifReorder; -- reorder whole model from roots
class ModifEditForm; -- applies an EditForm
- deferred generic class FileModifier; -- defines actions on file sending
- deferred generic class ModelModifier; -- specific actions on model
-- -- Session Management -- --
+++ /dev/null
--- Created on: 1994-03-21
--- Created by: Christian CAILLET
--- 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 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.
-
-deferred generic class FileModifier from IFSelect
- (Writer as any) -- according each Interface
- inherits GeneralModifier
-
- ---Purpose : Allows to precise the frame work for File Modifiers able to
- -- run with an Interface (such as STEP, VDA, IGES ...)
- --
- -- Remember that File Modifiers are activated by a WorkLibrary :
- -- if they inherit from an instantiation of FileModifier with the
- -- data from this Interface, this will be easier to do.
- -- They are activated before sending the file, in the order
- -- given by the ModielCopier.
- --
- -- For each Interface on which File Modifiers have to be defined,
- -- The way to follow is firstly to instantiate FileModifier with
- -- its specific data :
- -- Model is the InterfaceModel specific to the considered norm
- -- Writer is the Writer specific to the considered norm
- -- Then to define the various classes which inherit from it and
- -- define their method Perform
-
-uses ContextWrite
-
-is
-
- Initialize;
- ---Purpose : Sets a File Modifier to keep the graph of dependences
- -- unchanges (because it works on the model already produced)
-
- Perform (me; ctx : in out ContextWrite; writer : in out Writer)
- is deferred;
- ---Purpose : Perform the action specific to each class of File Modifier
- -- <ctx> is the ContextWrite, which brings : the model, the
- -- protocol, the file name, plus the object AppliedModifiers
- -- (not used here) and the CheckList
- -- Remark that the model has to be casted for specific access
- --
- -- <writer> is the Writer and is specific to each norm, on which
- -- to act
-
-
-end FileModifier;
+++ /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 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 <IFSelect_FileModifier.ixx>
-
-
-
-IFSelect_FileModifier::IFSelect_FileModifier ()
- : IFSelect_GeneralModifier (Standard_False) { }
+++ /dev/null
--- Created on: 1994-03-21
--- Created by: Christian CAILLET
--- 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 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.
-
-deferred generic class ModelModifier from IFSelect
- (Model as InterfaceModel; Proto as Protocol from Interface)
- inherits Modifier
-
- ---Purpose : Allows to precise the frame work for Model Modifiers able to
- -- run with an Interface (such as STEP, VDA, IGES ...)
- --
- -- Acts as a Modifier but properly casts Model and Protocol
- -- according to each Interface, and refuses to work if cast
- -- has failed (i.e. if it is not used in good context)
- --
- -- Then, it is finer to make specific Model Modifier inherit
- -- from an instantiated ModelModifier, instead of Modifier itself
- -- (though it is not mandatory)
- --
- -- For each Interface on which Model Modifiers have to be defined,
- -- The way to follow is firstly to instantiate ModelModifier with
- -- its specific data :
- -- Model is the InterfaceModel specific to the considered norm
- -- Then to define the various classes which inherit from it and
- -- define their method Perform
-
-uses CString, InterfaceModel, Protocol from Interface, CopyTool, ContextModif
-
-is
-
- Initialize (maychangegraph : Boolean);
- ---Purpose : Calls inherited Initialize, transmits to it the information
- -- <maychangegraph>
-
- Perform (me; ctx : in out ContextModif;
- target : mutable InterfaceModel;
- protocol : Protocol from Interface;
- TC : in out CopyTool);
- ---Purpose : The inherited Perform does the required cast (and refuses to
- -- go further if cast has failed) then calls the instantiated
- -- Performing
-
- PerformProtocol (me; ctx : in out ContextModif;
- target : mutable Model;
- proto : Proto;
- TC : in out CopyTool) is virtual;
- ---Purpose : Specific Perform with Protocol. It is defined to let the
- -- Protocol unused and to call Performing without Protocol
- -- (most current case). It can be redefined if specific action
- -- requires Protocol.
-
- Performing (me; ctx : in out ContextModif;
- target : mutable Model;
- TC : in out CopyTool) is deferred;
- ---Purpose : Specific Perform, without Protocol. If Performing with
- -- Protocol is redefined, Performing without Protocol must
- -- though be defined to do nothing (not called, but demanded
- -- by the linker)
-
-end ModelModifier;
+++ /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 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 <IFSelect_ModelModifier.ixx>
-#include <Interface_Check.hxx>
-
-IFSelect_ModelModifier::IFSelect_ModelModifier (const Standard_Boolean grf)
- : IFSelect_Modifier (grf) { }
-
- void IFSelect_ModelModifier::Perform
- (IFSelect_ContextModif& ctx,
- const Handle(Interface_InterfaceModel)& target,
- const Handle(Interface_Protocol)& protocol,
- Interface_CopyTool& TC) const
-{
- ctx.TraceModifier(this);
- Handle(Model) targ = Handle(Model)::DownCast(target);
- Handle(Proto) prot = Handle(Proto)::DownCast(protocol);
- if (targ.IsNull()) {
- ctx.CCheck()->AddFail("Model to Modify : unproper type");
- return;
- }
- PerformProtocol (ctx,targ,prot,TC);
-}
-
- void IFSelect_ModelModifier::PerformProtocol
- (IFSelect_ContextModif& ctx,
- const Handle(Model)& target,
- const Handle(Proto)& protocol,
- Interface_CopyTool& TC) const
-{ ctx.SetProtocol(protocol); Performing (ctx,target,TC); }
+++ /dev/null
--- Created on: 1992-11-18
--- 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 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.
-
-generic class SelectList from IFSelect (Entity as Transient)
- inherits SelectInList
-
-
- ---Purpose : A SelectList kind Selection selects a part of an Entity, as
- -- well as this Entity can be described as an ordered List.
- -- That is to say, it must have two methods :
- --
- -- NbEntities (me) returns Integer;
- -- Entity (me; num : Integer) returns Transient;
- --
- -- For each class of Entity for which we want to define a
- -- SelectList, we will instanciate this class with the
- -- desired class of Entity as definition parameter : the deferred
- -- methods NbEntities and ListedEntity are now defined to call
- -- the required methods from <Entity>
- --
- -- SelectList works as SelectInList, beeing a sub-class of it
-
-uses AsciiString from TCollection, Transient, EntityIterator, IntParam
-
-raises OutOfRange
-
-is
-
- Create returns mutable SelectList;
- ---Purpose : Creates a SelectList (with no limit);
-
- KeepInputEntity (me; iter : in out EntityIterator);
- ---Purpose : Keeps Input Entity, as having required type <Entity>
-
- NbItems (me; ent : Transient) returns Integer;
- ---Purpose : Returns count of Entities in the list in the Entity <ent>
- -- by calling method NbEntity from parameter class Entity
-
- ListedEntity (me; num : Integer; ent : Transient)
- returns Transient raises OutOfRange;
- ---Purpose : Returns an Entity of the list in the Entity <ent>, by calling
- -- method Entity from parameter class Entity
- -- Error if <ent> has not required type, or if <num> is not in
- -- the right range (1,NbEntities),
-
- ListLabel (me) returns AsciiString from TCollection;
- ---Purpose : Returns the specific label for the list
- -- then, following cases :
- -- " From .. Until .." or "From .." or "Until .." or "Rank no .."
- -- Warning : it is not possible to give a character constant to instantiate
- -- a generic class, thus "List From Entity" is not adapted :
- -- redefine Label if judged necessary
-
-end SelectList;
+++ /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 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 <IFSelect_SelectList.ixx>
-
-// .... Instanciation avec "Handle(Entity)" qui offre ces deux methodes :
-// nb = ent->NbEntities() et ent_i = ent->InterfaceEntity(i)
-
-
-IFSelect_SelectList::IFSelect_SelectList () { }
-
- void IFSelect_SelectType::KeepInputEntity (Interface_EntityIterator& iter)
- { iter.SelectType(STANDARD_TYPE(Entity)); }
-
- Standard_Integer IFSelect_SelectList::NbItems
- (const Handle(Standard_Transient)& ent)
-{
- Handle(Entity) anent = Handle(Entity)::DownCast(ent);
- if (anent.IsNull()) return 0;
- return anent->NbEntities();
-}
-
- Handle(Standard_Transient) IFSelect_SelectList::ListedEntity
- (const Standard_Integer num, const Handle(Standard_Transient)& ent)
-{
- Handle(Entity) anent = Handle(Entity)::DownCast(ent);
- if (anent.IsNull()) Standard_OutOfRange::Raise
- ("IFSelect SelectType : ListedEntity");
- return anent->InterfacebEntity(num);
-}
-
-
- TCollection_AsciiString IFSelect_SelectList::ListLabel () const
- { return TCollection_AsciiString(STANDARD_TYPE(Entity)->Name()); }
uses
- GeneralNote from IGESDimen,
- FiniteElement from IGESAppli,
- HAsciiString from TCollection,
- HArray1OfFiniteElement from IGESAppli,
- HArray1OfInteger from TColStd,
- HArray1OfReal from TColStd,
- HArray1OfHArray1OfInteger from IGESBasic,
- HArray1OfHArray1OfReal from IGESBasic
+ GeneralNote from IGESDimen,
+ FiniteElement from IGESAppli,
+ HAsciiString from TCollection,
+ HArray1OfFiniteElement from IGESAppli,
+ HArray1OfInteger from TColStd,
+ HArray1OfReal from TColStd,
+ HArray1OfHArray1OfInteger_Handle from IGESBasic,
+ HArray1OfHArray1OfReal_Handle from IGESBasic
raises DimensionMismatch, OutOfRange
nbLayers : HArray1OfInteger;
allDataLayerFlags : HArray1OfInteger;
allnbResDataLocs : HArray1OfInteger;
- allResDataLocs : HArray1OfHArray1OfInteger;
- allResults : HArray1OfHArray1OfReal)
+ allResDataLocs : HArray1OfHArray1OfInteger_Handle;
+ allResults : HArray1OfHArray1OfReal_Handle)
---Purpose : This method is used to set the fields of the class
-- ElementResults
-- - aNote : GeneralNote Entity describing analysis
theNbLayers : HArray1OfInteger;
theDataLayerFlags : HArray1OfInteger;
theNbResultDataLocs : HArray1OfInteger;
- theResultDataLocs : HArray1OfHArray1OfInteger;
- theResultData : HArray1OfHArray1OfReal;
+ theResultDataLocs : HArray1OfHArray1OfInteger_Handle;
+ theResultData : HArray1OfHArray1OfReal_Handle;
end ElementResults;
uses
- GeneralNote from IGESDimen,
- Node from IGESAppli,
- HArray1OfGeneralNote from IGESDimen,
- HArray1OfNode from IGESAppli,
- HArray1OfReal from TColStd,
- XYZ from gp,
- HArray1OfInteger from TColStd,
- HArray1OfXYZ from TColgp,
- HArray1OfHArray1OfXYZ from IGESBasic
+ GeneralNote from IGESDimen,
+ Node from IGESAppli,
+ HArray1OfGeneralNote from IGESDimen,
+ HArray1OfNode from IGESAppli,
+ HArray1OfReal from TColStd,
+ XYZ from gp,
+ HArray1OfInteger from TColStd,
+ HArray1OfXYZ from TColgp,
+ HArray1OfHArray1OfXYZ_Handle from IGESBasic
raises DimensionMismatch, OutOfRange
allNotes : HArray1OfGeneralNote;
allIdentifiers : HArray1OfInteger;
allNodes : HArray1OfNode;
- allRotParams : HArray1OfHArray1OfXYZ;
- allTransParams : HArray1OfHArray1OfXYZ)
+ allRotParams : HArray1OfHArray1OfXYZ_Handle;
+ allTransParams : HArray1OfHArray1OfXYZ_Handle)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- NodalDisplAndRot
theNotes : HArray1OfGeneralNote;
theNodeIdentifiers : HArray1OfInteger;
theNodes : HArray1OfNode;
- theTransParam : HArray1OfHArray1OfXYZ;
- theRotParam : HArray1OfHArray1OfXYZ;
+ theTransParam : HArray1OfHArray1OfXYZ_Handle;
+ theRotParam : HArray1OfHArray1OfXYZ_Handle;
end NodalDisplAndRot;
--- /dev/null
+IGESBasic_HArray1OfHArray1OfIGESEntity.hxx
+IGESBasic_HArray1OfHArray1OfIGESEntity.cxx
+IGESBasic_HArray1OfHArray1OfInteger.hxx
+IGESBasic_HArray1OfHArray1OfInteger.cxx
+IGESBasic_HArray1OfHArray1OfReal.hxx
+IGESBasic_HArray1OfHArray1OfReal.cxx
+IGESBasic_HArray1OfHArray1OfXYZ.hxx
+IGESBasic_HArray1OfHArray1OfXYZ.cxx
+IGESBasic_HArray1OfHArray1OfIGESEntity_Handle.hxx
+IGESBasic_HArray1OfHArray1OfInteger_Handle.hxx
+IGESBasic_HArray1OfHArray1OfReal_Handle.hxx
+IGESBasic_HArray1OfHArray1OfXYZ_Handle.hxx
\ No newline at end of file
class Array1OfLineFontEntity instantiates
Array1 from TCollection (LineFontEntity from IGESData);
- class HArray1OfHArray1OfInteger instantiates
- -- HArray1 from TCollection (HArray1OfInteger from TColStd,Array1OfHArray1OfInteger);
- JaggedArray from Interface (HArray1OfInteger from TColStd);
- class HArray1OfHArray1OfReal instantiates
- -- HArray1 from TCollection (HArray1OfReal from TColStd,Array1OfHArray1OfReal);
- JaggedArray from Interface (HArray1OfReal from TColStd);
- class HArray1OfHArray1OfXY instantiates
- -- HArray1 from TCollection (HArray1OfXY from TColgp, Array1OfHArray1OfXY);
- JaggedArray from Interface (HArray1OfXY from TColgp);
- class HArray1OfHArray1OfXYZ instantiates
- -- HArray1 from TCollection (HArray1OfXYZ from TColgp, Array1OfHArray1OfXYZ);
- JaggedArray from Interface (HArray1OfXYZ from TColgp);
+ -- Instantiation of template class Interface_JaggedArray
+ imported HArray1OfHArray1OfIGESEntity;
+ imported HArray1OfHArray1OfInteger;
+ imported HArray1OfHArray1OfReal;
+ imported HArray1OfHArray1OfXYZ;
+
+ --Workaround to use in cdl classes handles of none-cdl classes
+ imported HArray1OfHArray1OfIGESEntity_Handle;
+ imported HArray1OfHArray1OfInteger_Handle;
+ imported HArray1OfHArray1OfReal_Handle;
+ imported HArray1OfHArray1OfXYZ_Handle;
class HArray2OfHArray1OfReal instantiates HArray2 from TCollection
(HArray1OfReal from TColStd,Array2OfHArray1OfReal);
-
- class HArray1OfHArray1OfIGESEntity instantiates
- -- HArray1 from TCollection (HArray1OfIGESEntity from IGESData,Array1OfHArray1OfIGESEntity);
- JaggedArray from Interface (HArray1OfIGESEntity from IGESData);
-
class HArray1OfLineFontEntity instantiates HArray1 from TCollection
(LineFontEntity from IGESData,Array1OfLineFontEntity);
--- /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 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 <IGESBasic_HArray1OfHArray1OfIGESEntity.hxx>
+
+ IMPLEMENT_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfIGESEntity, MMgt_TShared)
+ IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_HArray1OfHArray1OfIGESEntity, MMgt_TShared)
+
+
+
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESBasic_HArray1OfHArray1OfIGESEntity_HeaderFile
+#define _IGESBasic_HArray1OfHArray1OfIGESEntity_HeaderFile
+
+#include <Standard_DefineHandle.hxx>
+#include <Interface_JaggedArray.hxx>
+#include <Handle_IGESData_HArray1OfIGESEntity.hxx>
+
+class IGESData_HArray1OfIGESEntity;
+
+class IGESBasic_HArray1OfHArray1OfIGESEntity : public Interface_JaggedArray <Handle(IGESData_HArray1OfIGESEntity)>
+{
+public:
+ Standard_EXPORT IGESBasic_HArray1OfHArray1OfIGESEntity
+ (const Standard_Integer theLowerIndex,
+ const Standard_Integer theUpperIndex)
+ :Interface_JaggedArray<Handle(IGESData_HArray1OfIGESEntity)>(theLowerIndex, theUpperIndex)
+ {}
+ DEFINE_STANDARD_RTTI(IGESBasic_HArray1OfHArray1OfIGESEntity );
+};
+
+ DEFINE_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfIGESEntity, MMgt_TShared)
+
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+// Workaround: Handles for none-cdl classes.
+// Delete this file after transformation all classes to none-cdl ones.
+
+#ifndef _IGESBasic_HArray1OfHArray1IGESEntity_Handle_HeaderFile
+#define _IGESBasic_HArray1OfHArray1IGESEntity_Handle_HeaderFile
+
+#include <IGESBasic_HArray1OfHArray1OfIGESEntity.hxx>
+
+typedef Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) IGESBasic_HArray1OfHArray1OfIGESEntity_Handle;
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IGESBasic_HArray1OfHArray1OfInteger.hxx>
+
+IMPLEMENT_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfInteger, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_HArray1OfHArray1OfInteger, MMgt_TShared)
+
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESBasic_HArray1OfHArray1OfInteger_HeaderFile
+#define _IGESBasic_HArray1OfHArray1OfInteger_HeaderFile
+
+#include <Standard_DefineHandle.hxx>
+#include <Interface_JaggedArray.hxx>
+#include <Handle_TColStd_HArray1OfInteger.hxx>
+
+class TColStd_HArray1OfInteger;
+
+class IGESBasic_HArray1OfHArray1OfInteger : public Interface_JaggedArray <Handle(TColStd_HArray1OfInteger)>
+{
+public:
+ Standard_EXPORT IGESBasic_HArray1OfHArray1OfInteger
+ (const Standard_Integer theLowerIndex,
+ const Standard_Integer theUpperIndex)
+ :Interface_JaggedArray<Handle(TColStd_HArray1OfInteger)>(theLowerIndex, theUpperIndex)
+ {}
+ DEFINE_STANDARD_RTTI(IGESBasic_HArray1OfHArray1OfInteger);
+};
+
+DEFINE_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfInteger, MMgt_TShared)
+
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+// Workaround: Handles for none-cdl classes.
+// Delete this file after transformation all classes to none-cdl ones.
+
+#ifndef _IGESBasic_HArray1OfHArray1Integer_Handle_HeaderFile
+#define _IGESBasic_HArray1OfHArray1Integer_Handle_HeaderFile
+
+#include <IGESBasic_HArray1OfHArray1OfInteger.hxx>
+
+typedef Handle(IGESBasic_HArray1OfHArray1OfInteger) IGESBasic_HArray1OfHArray1OfInteger_Handle;
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IGESBasic_HArray1OfHArray1OfReal.hxx>
+
+IMPLEMENT_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfReal, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_HArray1OfHArray1OfReal, MMgt_TShared)
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESBasic_HArray1OfHArray1OfReal_HeaderFile
+#define _IGESBasic_HArray1OfHArray1OfReal_HeaderFile
+
+#include <Standard_DefineHandle.hxx>
+#include <Interface_JaggedArray.hxx>
+#include <Handle_TColStd_HArray1OfReal.hxx>
+class TColStd_HArray1OfReal;
+
+class IGESBasic_HArray1OfHArray1OfReal : public Interface_JaggedArray <Handle(TColStd_HArray1OfReal)>
+{
+public:
+ Standard_EXPORT IGESBasic_HArray1OfHArray1OfReal
+ (const Standard_Integer theLowerIndex,
+ const Standard_Integer theUpperIndex)
+ :Interface_JaggedArray <Handle(TColStd_HArray1OfReal)>(theLowerIndex, theUpperIndex)
+ {}
+ DEFINE_STANDARD_RTTI(IGESBasic_HArray1OfHArray1OfReal);
+};
+
+DEFINE_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfReal, MMgt_TShared)
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+// Workaround: Handles for none-cdl classes.
+// Delete this file after transformation all classes to none-cdl ones.
+
+#ifndef _IGESBasic_HArray1OfHArray1Real_Handle_HeaderFile
+#define _IGESBasic_HArray1OfHArray1Real_Handle_HeaderFile
+
+#include <IGESBasic_HArray1OfHArray1OfReal.hxx>
+
+typedef Handle(IGESBasic_HArray1OfHArray1OfReal) IGESBasic_HArray1OfHArray1OfReal_Handle;
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IGESBasic_HArray1OfHArray1OfXYZ.hxx>
+
+IMPLEMENT_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfXYZ, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(IGESBasic_HArray1OfHArray1OfXYZ, MMgt_TShared)
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESBasic_HArray1OfHArray1OfXYZ_HeaderFile
+#define _IGESBasic_HArray1OfHArray1OfXYZ_HeaderFile
+
+#include <Standard_DefineHandle.hxx>
+#include <Interface_JaggedArray.hxx>
+#include <Handle_TColgp_HArray1OfXYZ.hxx>
+
+class TColgp_HArray1OfXYZ;
+
+class IGESBasic_HArray1OfHArray1OfXYZ : public Interface_JaggedArray <Handle(TColgp_HArray1OfXYZ)>
+{
+public:
+ Standard_EXPORT IGESBasic_HArray1OfHArray1OfXYZ
+ (const Standard_Integer theLowerIndex,
+ const Standard_Integer theUpperIndex)
+ :Interface_JaggedArray <Handle(TColgp_HArray1OfXYZ)>(theLowerIndex, theUpperIndex)
+ {}
+ DEFINE_STANDARD_RTTI(IGESBasic_HArray1OfHArray1OfXYZ);
+};
+
+DEFINE_STANDARD_HANDLE(IGESBasic_HArray1OfHArray1OfXYZ,MMgt_TShared)
+
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+// Workaround: Handles for none-cdl classes.
+// Delete this file after transformation all classes to none-cdl ones.
+
+#ifndef _IGESBasic_HArray1OfHArray1XYZ_Handle_HeaderFile
+#define _IGESBasic_HArray1OfHArray1XYZ_Handle_HeaderFile
+
+#include <IGESBasic_HArray1OfHArray1OfXYZ.hxx>
+
+typedef Handle(IGESBasic_HArray1OfHArray1OfXYZ) IGESBasic_HArray1OfHArray1OfXYZ_Handle;
+
+#endif
\ No newline at end of file
--- /dev/null
+IGESCAFControl_Reader.hxx
+IGESCAFControl_Reader.cxx
+IGESCAFControl_Writer.hxx
+IGESCAFControl_Writer.cxx
\ No newline at end of file
is
- class Reader;
+ imported Reader;
---Purpose: Provides a tool for reading IGES file
- class Writer;
+ imported Writer;
---Purpose: Provides a tool for writing IGES file
DecodeColor (col: Integer) returns Color from Quantity;
+++ /dev/null
--- Created on: 2000-08-15
--- Created by: Andrey BETENEV
--- Copyright (c) 2000-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 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.
-
-class Reader from IGESCAFControl inherits Reader from IGESControl
-
- ---Purpose: Provides a tool to read IGES file and put it into
- -- DECAF document. Besides transfer of shapes (including
- -- assemblies) provided by IGESControl, supports also
- -- colors and part names
- -- IGESCAFControl_Reader reader; Methods for translation of an IGES file:
- -- reader.ReadFile("filename");
- -- reader.Transfer(Document); or
- -- reader.Perform("filename",doc);
- -- Methods for managing reading attributes.
- -- Colors
- -- reader.SetColorMode(colormode);
- -- Standard_Boolean colormode = reader.GetColorMode();
- -- Layers
- -- reader.SetLayerMode(layermode);
- -- Standard_Boolean layermode = reader.GetLayerMode();
- -- Names
- -- reader.SetNameMode(namemode);
- -- Standard_Boolean namemode = reader.GetNameMode();
-
-uses
- AsciiString from TCollection,
- WorkSession from XSControl,
- Document from TDocStd
-
-is
-
- Create returns Reader;
- ---Purpose: Creates a reader with an empty
- -- IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Reader;
- ---Purpose: Creates a reader tool and attaches it to an already existing Session
- -- Clears the session if it was not yet set for IGES
-
- Transfer (me: in out; doc: in out Document from TDocStd)
- returns Boolean;
- ---Purpose: Translates currently loaded IGES file into the document
- -- Returns True if succeeded, and False in case of fail
-
- Perform (me: in out; filename: AsciiString from TCollection;
- doc: in out Document from TDocStd) returns Boolean;
-
- Perform (me: in out; filename: CString; doc: in out Document from TDocStd)
- returns Boolean;
- ---Purpose: Translate IGES file given by filename into the document
- -- Return True if succeeded, and False in case of fail
-
- ---Scope: protected methods
-
- ReadColors (me; doc: in out Document from TDocStd)
- returns Boolean is protected;
- ---Purpose: Reads colors of IGES entities and sets
- -- corresponding color assignments in the DECAF document
-
- ReadNames (me; doc: in out Document from TDocStd)
- returns Boolean is protected;
- ---Purpose: Reads Names of IGES entities and sets
- -- corresponding name to label with shape in the DECAF document
-
- ReadLayers (me; doc: in out Document from TDocStd)
- returns Boolean is protected;
- ---Purpose: Reads layers of parts defined in the IGES model and
- -- set reference between shape and layers in the DECAF document
-
- --- Work with fileds for different mode of reading IGES file.
-
- SetColorMode(me: in out; colormode: Boolean from Standard);
- ---Purpose: Set ColorMode for indicate read Colors or not.
-
- GetColorMode(me) returns Boolean;
-
- SetNameMode(me: in out; namemode: Boolean from Standard);
- ---Purpose: Set NameMode for indicate read Name or not.
-
- GetNameMode(me) returns Boolean;
-
- SetLayerMode(me: in out; layermode: Boolean from Standard);
- ---Purpose: Set LayerMode for indicate read Layers or not.
-
- GetLayerMode(me) returns Boolean;
-
-fields
-
- myColorMode: Boolean;
- myNameMode: Boolean;
- myLayerMode: Boolean;
-
-end Reader;
-
// commercial license or contractual agreement.
#include <TDF_Label.hxx>
-#include <IGESCAFControl_Reader.ixx>
+#include <IGESCAFControl_Reader.hxx>
#include <TopoDS_Shape.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <XSControl_TransferReader.hxx>
#include <TCollection_HAsciiString.hxx>
#include <XCAFDoc_ShapeMapTool.hxx>
#include <IGESBasic_SubfigureDef.hxx>
+
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <TDocStd_Document.hxx>
+#include <TCollection_AsciiString.hxx>
+
//=======================================================================
//function : IGESCAFControl_Reader
//purpose :
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESCAFControl_Reader_HeaderFile
+#define _IGESCAFControl_Reader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_Boolean.hxx>
+#include <IGESControl_Reader.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Handle_TDocStd_Document.hxx>
+#include <Standard_CString.hxx>
+
+class XSControl_WorkSession;
+class TDocStd_Document;
+class TCollection_AsciiString;
+
+//! Provides a tool to read IGES file and put it into <br>
+//! DECAF document. Besides transfer of shapes (including <br>
+//! assemblies) provided by IGESControl, supports also <br>
+//! colors and part names <br>
+//! IGESCAFControl_Reader reader; Methods for translation of an IGES file: <br>
+//! reader.ReadFile("filename"); <br>
+//! reader.Transfer(Document); or <br>
+//! reader.Perform("filename",doc); <br>
+//! Methods for managing reading attributes. <br>
+//! Colors <br>
+//! reader.SetColorMode(colormode); <br>
+//! Standard_Boolean colormode = reader.GetColorMode(); <br>
+//! Layers <br>
+//! reader.SetLayerMode(layermode); <br>
+//! Standard_Boolean layermode = reader.GetLayerMode(); <br>
+//! Names <br>
+//! reader.SetNameMode(namemode); <br>
+//! Standard_Boolean namemode = reader.GetNameMode(); <br>
+class IGESCAFControl_Reader : public IGESControl_Reader
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a reader with an empty <br>
+ //! IGES model and sets ColorMode, LayerMode and NameMode to Standard_True. <br>
+ Standard_EXPORT IGESCAFControl_Reader();
+ //! Creates a reader tool and attaches it to an already existing Session <br>
+ //! Clears the session if it was not yet set for IGES <br>
+ Standard_EXPORT IGESCAFControl_Reader(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+ //! Translates currently loaded IGES file into the document <br>
+ //! Returns True if succeeded, and False in case of fail <br>
+ Standard_EXPORT Standard_Boolean Transfer(Handle(TDocStd_Document)& doc) ;
+
+ Standard_EXPORT Standard_Boolean Perform(const TCollection_AsciiString& filename,Handle(TDocStd_Document)& doc) ;
+ //! Translate IGES file given by filename into the document <br>
+ //! Return True if succeeded, and False in case of fail <br>
+ Standard_EXPORT Standard_Boolean Perform(const Standard_CString filename,Handle(TDocStd_Document)& doc) ;
+ //! Set ColorMode for indicate read Colors or not. <br>
+ Standard_EXPORT void SetColorMode(const Standard_Boolean colormode) ;
+
+ Standard_EXPORT Standard_Boolean GetColorMode() const;
+ //! Set NameMode for indicate read Name or not. <br>
+ Standard_EXPORT void SetNameMode(const Standard_Boolean namemode) ;
+
+ Standard_EXPORT Standard_Boolean GetNameMode() const;
+ //! Set LayerMode for indicate read Layers or not. <br>
+ Standard_EXPORT void SetLayerMode(const Standard_Boolean layermode) ;
+
+ Standard_EXPORT Standard_Boolean GetLayerMode() const;
+
+protected:
+ //! Reads colors of IGES entities and sets <br>
+ //! corresponding color assignments in the DECAF document <br>
+ Standard_EXPORT Standard_Boolean ReadColors(Handle(TDocStd_Document)& doc) const;
+ //! Reads Names of IGES entities and sets <br>
+ //! corresponding name to label with shape in the DECAF document <br>
+ Standard_EXPORT Standard_Boolean ReadNames(Handle(TDocStd_Document)& doc) const;
+ //! Reads layers of parts defined in the IGES model and <br>
+ //! set reference between shape and layers in the DECAF document <br>
+ Standard_EXPORT Standard_Boolean ReadLayers(Handle(TDocStd_Document)& doc) const;
+
+private:
+ Standard_Boolean myColorMode;
+ Standard_Boolean myNameMode;
+ Standard_Boolean myLayerMode;
+
+};
+#endif
+++ /dev/null
--- Created on: 2000-08-17
--- Created by: Andrey BETENEV
--- Copyright (c) 2000-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 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.
-
-class Writer from IGESCAFControl inherits Writer from IGESControl
-
- ---Purpose: Provides a tool to write DECAF document to the
- -- IGES file. Besides transfer of shapes (including
- -- assemblies) provided by IGESControl, supports also
- -- colors and part names
- -- IGESCAFControl_Writer writer();
- -- Methods for writing IGES file:
- -- writer.Transfer (Document);
- -- writer.Write("filename") or writer.Write(OStream) or
- -- writer.Perform(Document,"filename");
- -- Methods for managing the writing of attributes.
- -- Colors
- -- writer.SetColorMode(colormode);
- -- Standard_Boolean colormode = writer.GetColorMode();
- -- Layers
- -- writer.SetLayerMode(layermode);
- -- Standard_Boolean layermode = writer.GetLayerMode();
- -- Names
- -- writer.SetNameMode(namemode);
- -- Standard_Boolean namemode = writer.GetNameMode();
-
-uses
- AsciiString from TCollection,
- Shape from TopoDS,
- MapOfShape from TopTools,
- WorkSession from XSControl,
- Document from TDocStd,
- LabelSequence from TDF,
- Style from XCAFPrs,
- DataMapOfShapeStyle from XCAFPrs,
- DataMapOfStyleTransient from XCAFPrs
-is
-
- Create returns Writer;
- ---Purpose: Creates a writer with an empty
- -- IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Writer;
- ---Purpose: Creates a reader tool and attaches it to an already existing Session
- -- Clears the session if it was not yet set for IGES
-
- Transfer (me : in out; doc : Document from TDocStd)
- returns Boolean;
- ---Purpose: Transfers a document to a IGES model
- -- Returns True if translation is OK
-
- Perform (me : in out; doc : Document from TDocStd;
- filename: AsciiString from TCollection)
- returns Boolean;
-
- Perform (me : in out; doc : Document from TDocStd; filename: CString)
- returns Boolean;
- ---Purpose : Transfers a document and writes it to a IGES file
- -- Returns True if translation is OK
-
- ---Scope: Internal methods
-
- Transfer (me : in out; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Transfers labels to a IGES model
- -- Returns True if translation is OK
-
- WriteAttributes (me: in out; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Reads colors from DECAF document and assigns them
- -- to corresponding IGES entities
-
- MakeColors (me: in out; S: Shape from TopoDS; settings: DataMapOfShapeStyle from XCAFPrs;
- colors: in out DataMapOfStyleTransient from XCAFPrs;
- Map: in out MapOfShape from TopTools;
- inherit: Style from XCAFPrs) is private;
- ---Purpose: Recursively iterates on subshapes and assigns colors
- -- to faces and edges (if set)
-
- WriteLayers (me: in out; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Reads layers from DECAF document and assigns them
- -- to corresponding IGES entities
-
- WriteNames (me: in out; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Recursivile iterates on subshapes and assign names
- -- to IGES entity
-
- --- Work with fileds for different mode of writing IGES file.
-
- SetColorMode(me: in out; colormode: Boolean from Standard);
- ---Purpose: Set ColorMode for indicate write Colors or not.
-
- GetColorMode(me) returns Boolean;
-
- SetNameMode(me: in out; namemode: Boolean from Standard);
- ---Purpose: Set NameMode for indicate write Name or not.
-
- GetNameMode(me) returns Boolean;
-
- SetLayerMode(me: in out; layermode: Boolean from Standard);
- ---Purpose: Set LayerMode for indicate write Layers or not.
-
- GetLayerMode(me) returns Boolean;
-
-fields
-
- myColorMode: Boolean;
- myNameMode: Boolean;
- myLayerMode: Boolean;
-
-end Writer;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <IGESCAFControl_Writer.ixx>
+#include <IGESCAFControl_Writer.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <TDF_LabelSequence.hxx>
#include <TopoDS_Shape.hxx>
#include <IGESData_NameEntity.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TColStd_HSequenceOfExtendedString.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <TDocStd_Document.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TDF_LabelSequence.hxx>
+#include <TopoDS_Shape.hxx>
+#include <XCAFPrs_DataMapOfShapeStyle.hxx>
+#include <XCAFPrs_DataMapOfStyleTransient.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <XCAFPrs_Style.hxx>
+#include <IGESCAFControl_Writer.hxx>
//=======================================================================
//function : IGESCAFControl_Writer
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESCAFControl_Writer_HeaderFile
+#define _IGESCAFControl_Writer_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_Boolean.hxx>
+#include <IGESControl_Writer.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Handle_TDocStd_Document.hxx>
+#include <Standard_CString.hxx>
+
+class XSControl_WorkSession;
+class TDocStd_Document;
+class TCollection_AsciiString;
+class TDF_LabelSequence;
+class TopoDS_Shape;
+class XCAFPrs_DataMapOfShapeStyle;
+class XCAFPrs_DataMapOfStyleTransient;
+class TopTools_MapOfShape;
+class XCAFPrs_Style;
+
+
+//! Provides a tool to write DECAF document to the <br>
+//! IGES file. Besides transfer of shapes (including <br>
+//! assemblies) provided by IGESControl, supports also <br>
+//! colors and part names <br>
+//! IGESCAFControl_Writer writer(); <br>
+//! Methods for writing IGES file: <br>
+//! writer.Transfer (Document); <br>
+//! writer.Write("filename") or writer.Write(OStream) or <br>
+//! writer.Perform(Document,"filename"); <br>
+//! Methods for managing the writing of attributes. <br>
+//! Colors <br>
+//! writer.SetColorMode(colormode); <br>
+//! Standard_Boolean colormode = writer.GetColorMode(); <br>
+//! Layers <br>
+//! writer.SetLayerMode(layermode); <br>
+//! Standard_Boolean layermode = writer.GetLayerMode(); <br>
+//! Names <br>
+//! writer.SetNameMode(namemode); <br>
+//! Standard_Boolean namemode = writer.GetNameMode(); <br>
+class IGESCAFControl_Writer : public IGESControl_Writer {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a writer with an empty <br>
+ //! IGES model and sets ColorMode, LayerMode and NameMode to Standard_True. <br>
+ Standard_EXPORT IGESCAFControl_Writer();
+ //! Creates a reader tool and attaches it to an already existing Session <br>
+ //! Clears the session if it was not yet set for IGES <br>
+ Standard_EXPORT IGESCAFControl_Writer(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+ //! Transfers a document to a IGES model <br>
+ //! Returns True if translation is OK <br>
+ Standard_EXPORT Standard_Boolean Transfer(const Handle(TDocStd_Document)& doc) ;
+
+ Standard_EXPORT Standard_Boolean Perform(const Handle(TDocStd_Document)& doc,const TCollection_AsciiString& filename) ;
+ //! Transfers a document and writes it to a IGES file <br>
+ //! Returns True if translation is OK <br>
+ Standard_EXPORT Standard_Boolean Perform(const Handle(TDocStd_Document)& doc,const Standard_CString filename) ;
+ //! Set ColorMode for indicate write Colors or not. <br>
+ Standard_EXPORT void SetColorMode(const Standard_Boolean colormode) ;
+
+ Standard_EXPORT Standard_Boolean GetColorMode() const;
+ //! Set NameMode for indicate write Name or not. <br>
+ Standard_EXPORT void SetNameMode(const Standard_Boolean namemode) ;
+
+ Standard_EXPORT Standard_Boolean GetNameMode() const;
+ //! Set LayerMode for indicate write Layers or not. <br>
+ Standard_EXPORT void SetLayerMode(const Standard_Boolean layermode) ;
+
+ Standard_EXPORT Standard_Boolean GetLayerMode() const;
+
+protected:
+
+ //! Transfers labels to a IGES model <br>
+ //! Returns True if translation is OK <br>
+ Standard_EXPORT Standard_Boolean Transfer(const TDF_LabelSequence& labels) ;
+ //! Reads colors from DECAF document and assigns them <br>
+ //! to corresponding IGES entities <br>
+ Standard_EXPORT Standard_Boolean WriteAttributes(const TDF_LabelSequence& labels) ;
+ //! Reads layers from DECAF document and assigns them <br>
+ //! to corresponding IGES entities <br>
+ Standard_EXPORT Standard_Boolean WriteLayers(const TDF_LabelSequence& labels) ;
+ //! Recursivile iterates on subshapes and assign names <br>
+ //! to IGES entity <br>
+ Standard_EXPORT Standard_Boolean WriteNames(const TDF_LabelSequence& labels) ;
+
+private:
+
+ //! Recursively iterates on subshapes and assigns colors <br>
+ //! to faces and edges (if set) <br>
+ Standard_EXPORT void MakeColors(const TopoDS_Shape& S,const XCAFPrs_DataMapOfShapeStyle& settings,XCAFPrs_DataMapOfStyleTransient& colors,TopTools_MapOfShape& Map,const XCAFPrs_Style& inherit) ;
+
+ Standard_Boolean myColorMode;
+ Standard_Boolean myNameMode;
+ Standard_Boolean myLayerMode;
+
+};
+#endif
--- /dev/null
+IGESControl_ActorWrite.hxx
+IGESControl_ActorWrite.cxx
+IGESControl_Controller.hxx
+IGESControl_Controller.cxx
+IGESControl_Reader.hxx
+IGESControl_Reader.lxx
+IGESControl_Reader.cxx
+IGESControl_Writer.hxx
+IGESControl_Writer.cxx
\ No newline at end of file
is
- class Controller;
- class Writer;
- class Reader;
- class ActorWrite;
+ imported Controller;
+ imported Writer;
+ imported Reader;
class IGESBoundary;
class AlgoContainer;
class ToolContainer;
+
+ imported ActorWrite;
end;
+++ /dev/null
--- Created on: 1998-09-07
--- Created by: Christian CAILLET
--- Copyright (c) 1998-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 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.
-
-class ActorWrite from IGESControl
- inherits ActorOfFinderProcess from Transfer
-
- ---Purpose : Actor to write Shape to IGES
-
-uses
-
- Finder from Transfer,
- FinderProcess from Transfer,
- Binder from Transfer
-
-is
-
- Create returns ActorWrite;
-
- Recognize (me : mutable; start : Finder from Transfer) returns Boolean
- is redefined;
- ---Purpose : Recognizes a ShapeMapper
-
- Transfer (me : mutable; start : Finder from Transfer;
- FP : mutable FinderProcess) returns Binder is redefined;
- ---Purpose : Transfers Shape to IGES Entities
- --
- -- ModeTrans may be : 0 -> groups of Faces
- -- or 1 -> BRep
-
-end ActorWrite;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <IGESControl_ActorWrite.ixx>
+
#include <TransferBRep_ShapeMapper.hxx>
#include <Interface_Macros.hxx>
#include <IGESData_IGESModel.hxx>
-
+#include <IGESControl_ActorWrite.hxx>
#include <BRepToIGES_BREntity.hxx>
#include <BRepToIGESBRep_Entity.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <Interface_Static.hxx>
+IMPLEMENT_STANDARD_TYPE(IGESControl_ActorWrite)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_ActorOfFinderProcess),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(IGESControl_ActorWrite)
+
+
+IMPLEMENT_DOWNCAST(IGESControl_ActorWrite,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(IGESControl_ActorWrite)
+
IGESControl_ActorWrite::IGESControl_ActorWrite () { ModeTrans() = 0; }
Standard_Boolean IGESControl_ActorWrite::Recognize
DeclareAndCast(IGESData_IGESModel,modl,FP->Model());
if (modl.IsNull()) return NullResult();
- if (themodetrans < 0 || themodetrans > 1) return NullResult();
+ if (myModeTrans < 0 || myModeTrans > 1) return NullResult();
Handle(Standard_Transient) ent;
DeclareAndCast(TransferBRep_ShapeMapper,shmap,start);
BRepToIGES_BREntity BR0; BR0.SetModel(modl); BR0.SetTransferProcess(FP);
BRepToIGESBRep_Entity BR1; BR1.SetModel(modl); BR1.SetTransferProcess(FP);
- if (themodetrans == 0) ent = BR0.TransferShape(shape);
- if (themodetrans == 1) ent = BR1.TransferShape(shape);
+ if (myModeTrans == 0) ent = BR0.TransferShape(shape);
+ if (myModeTrans == 1) ent = BR1.TransferShape(shape);
// modified by NIZHNY-EAP Tue Aug 29 11:37:18 2000 ___BEGIN___
XSAlgo::AlgoContainer()->MergeTransferInfo(FP, info);
// modified by NIZHNY-EAP Tue Aug 29 11:37:25 2000 ___END___
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESControl_ActorWrite_HeaderFile
+#define _IGESControl_ActorWrite_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Transfer_ActorOfFinderProcess.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Transfer_Finder.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Transfer_FinderProcess.hxx>
+
+class Transfer_Finder;
+class Transfer_Binder;
+class Transfer_FinderProcess;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Transfer_ActorOfFinderProcess);
+class IGESControl_ActorWrite;
+
+DEFINE_STANDARD_HANDLE(IGESControl_ActorWrite,Transfer_ActorOfFinderProcess)
+
+//! Actor to write Shape to IGES <br>
+class IGESControl_ActorWrite : public Transfer_ActorOfFinderProcess {
+
+public:
+
+ Standard_EXPORT IGESControl_ActorWrite();
+
+ //! Recognizes a ShapeMapper <br>
+ Standard_EXPORT virtual Standard_Boolean Recognize(const Handle(Transfer_Finder)& start);
+
+ //! Transfers Shape to IGES Entities <br>
+ //! <br>
+ //! ModeTrans may be : 0 -> groups of Faces <br>
+ //! or 1 -> BRep <br>
+ Standard_EXPORT virtual Handle_Transfer_Binder Transfer(const Handle(Transfer_Finder)& start,
+ const Handle(Transfer_FinderProcess)& FP);
+
+
+ DEFINE_STANDARD_RTTI(IGESControl_ActorWrite)
+
+};
+#endif
+++ /dev/null
--- Created on: 1995-03-15
--- 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 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.
-
-class Controller from IGESControl inherits Controller from XSControl
-
- ---Purpose : Controller for IGES-5.1
-
-uses
-
- CString,
- Protocol from Interface,
- InterfaceModel from Interface,
- WorkLibrary from IFSelect,
- ReturnStatus from IFSelect,
- ActorOfTransientProcess from Transfer,
- FinderProcess from Transfer,
- ActorOfFinderProcess from Transfer,
- WorkSession from XSControl,
- Shape from TopoDS
-
-is
-
- Create (modefnes : Boolean = Standard_False)
- returns mutable Controller from IGESControl;
- ---Purpose : Initializes the use of IGES Norm (the first time) and returns
- -- a Controller for IGES-5.1
- -- If <modefnes> is True, sets it to internal FNES format
-
- NewModel (me) returns mutable InterfaceModel from Interface;
- ---Purpose : Creates a new empty Model ready to receive data of the Norm.
- -- It is taken from IGES Template Model
-
- ActorRead (me; model : InterfaceModel)
- returns mutable ActorOfTransientProcess from Transfer;
- ---Purpose : Returns the Actor for Read attached to the pair (norm,appli)
- -- It is an Actor from IGESToBRep, adapted from an IGESModel :
- -- Unit, tolerances
-
- TransferWriteShape (me; shape : Shape from TopoDS;
- FP : mutable FinderProcess from Transfer;
- model : mutable InterfaceModel from Interface;
- modetrans : Integer = 0)
- returns ReturnStatus is redefined;
- ---Purpose : Takes one Shape and transfers it to the InterfaceModel
- -- (already created by NewModel for instance)
- -- <modetrans> is to be interpreted by each kind of XstepAdaptor
- -- Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape
- -- -2 bad model (requires an IGESModel)
- -- modeshape : 0 groupe of face (version < 5.1)
- -- 1 BREP-version 5.1 of IGES
-
- Init (myclass) returns Boolean;
- ---Purpose : Standard Initialisation. It creates a Controller for IGES and
- -- records it to various names, available to select it later
- -- Returns True when done, False if could not be done
- -- Also, it creates and records an Adaptor for FNES
- Customise (me: mutable; WS : in out WorkSession from XSControl) is redefined;
-fields
-
- themode : Boolean;
-
-end Controller;
//#58 rln 28.12.98 changing default values for Global Section
//sln 14.01.2002 OCC51 : verifying whether entry model of method ActorRead is IGESDatat_IGESModel
-#include <IGESControl_Controller.ixx>
+#include <IGESControl_Controller.hxx>
#include <IGESSelect_WorkLibrary.hxx>
#include <IGESToBRep_Actor.hxx>
#include <IGESData_IGESModel.hxx>
#include <IGESSelect_IGESName.hxx>
#include <IFSelect_SignType.hxx>
#include <IFSelect_SignMultiple.hxx>
+#include <IFSelect_SelectModelEntities.hxx>
+#include <IFSelect_SelectModelRoots.hxx>
#include <IGESSelect_CounterOfLevelNumber.hxx>
#include <IFSelect_SignCounter.hxx>
#include <IGESSelect_EditHeader.hxx>
#include <XSAlgo.hxx>
#include <Interface_Macros.hxx>
#include <IGESToBRep.hxx>
-#include <IFSelect_SelectModelEntities.hxx>
-#include <IFSelect_SelectModelEntities.hxx>
-#include <IFSelect_SelectModelRoots.hxx>
+
#include <XSControl_SelectForTransfer.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <IGESControl_Controller.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(IGESControl_Controller)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(XSControl_Controller),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(IGESControl_Controller)
+
+
+IMPLEMENT_DOWNCAST(IGESControl_Controller,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(IGESControl_Controller)
//szv#4:S4163:12Mar99 never referenced
//static const Standard_CString thelong = "IGES";
//JR/Hp
: XSControl_Controller ((Standard_CString ) (mod ? "FNES" : "IGES") , (Standard_CString ) (mod ? "fnes" : "iges") ) ,
// : XSControl_Controller ( (mod ? "FNES" : "iges") , (mod ? "fnes" : "iges") ) ,
- themode (mod)
+ myMode (mod)
{
static Standard_Boolean init = Standard_False;
if (!init) {
TraceStatic ("write.iges.unit",6);
TraceStatic ("write.iges.brep.mode",6);
- theAdaptorLibrary = new IGESSelect_WorkLibrary(themode);
+ theAdaptorLibrary = new IGESSelect_WorkLibrary(myMode);
theAdaptorProtocol = IGESSelect_WorkLibrary::DefineProtocol();
Handle(IGESToBRep_Actor) anactiges = new IGESToBRep_Actor;
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESControl_Controller_HeaderFile
+#define _IGESControl_Controller_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <XSControl_Controller.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <Standard_Integer.hxx>
+#include <XSControl_WorkSession.hxx>
+
+class Interface_InterfaceModel;
+class Transfer_ActorOfTransientProcess;
+class TopoDS_Shape;
+class Transfer_FinderProcess;
+class XSControl_WorkSession;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(XSControl_Controller);
+class IGESControl_Controller;
+
+DEFINE_STANDARD_HANDLE(IGESControl_Controller,XSControl_Controller)
+
+//! Controller for IGES-5.1 <br>
+class IGESControl_Controller : public XSControl_Controller
+{
+
+public:
+
+ //! Initializes the use of IGES Norm (the first time) and returns <br>
+ //! a Controller for IGES-5.1 <br>
+ //! If <modefnes> is True, sets it to internal FNES format <br>
+ Standard_EXPORT IGESControl_Controller(const Standard_Boolean modefnes = Standard_False);
+ //! Creates a new empty Model ready to receive data of the Norm. <br>
+ //! It is taken from IGES Template Model <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel NewModel() const;
+ //! Returns the Actor for Read attached to the pair (norm,appli) <br>
+ //! It is an Actor from IGESToBRep, adapted from an IGESModel : <br>
+ //! Unit, tolerances <br>
+ Standard_EXPORT Handle_Transfer_ActorOfTransientProcess ActorRead(const Handle(Interface_InterfaceModel)& model) const;
+ //! Takes one Shape and transfers it to the InterfaceModel <br>
+ //! (already created by NewModel for instance) <br>
+ //! <modetrans> is to be interpreted by each kind of XstepAdaptor <br>
+ //! Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape <br>
+ //! -2 bad model (requires an IGESModel) <br>
+ //! modeshape : 0 groupe of face (version < 5.1) <br>
+ //! 1 BREP-version 5.1 of IGES <br>
+ Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape,const Handle(Transfer_FinderProcess)& FP,const Handle(Interface_InterfaceModel)& model,const Standard_Integer modetrans = 0) const;
+ //! Standard Initialisation. It creates a Controller for IGES and <br>
+ //! records it to various names, available to select it later <br>
+ //! Returns True when done, False if could not be done <br>
+ //! Also, it creates and records an Adaptor for FNES <br>
+ Standard_EXPORT static Standard_Boolean Init() ;
+
+ Standard_EXPORT virtual void Customise(Handle(XSControl_WorkSession)& WS) ;
+
+ DEFINE_STANDARD_RTTI(IGESControl_Controller)
+
+private:
+
+ Standard_Boolean myMode;
+
+};
+#endif
+++ /dev/null
--- Created on: 1996-09-06
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class Reader from IGESControl inherits Reader from XSControl
-
- ---Purpose :
- -- Reads IGES files, checks them and translates their contents into Open CASCADE models.
- -- The IGES data can be that of a whole model or that of a specific list of entities in the model.
- -- As in XSControl_Reader, you specify the list using a selection.
- -- For translation of iges files it is possible to use the following sequence:
- -- To change parameters of translation
- -- class Interface_Static should be used before the beginning of translation
- -- (see IGES Parameters and General Parameters)
- -- Creation of reader
- -- IGESControl_Reader reader;
- -- To load a file in a model use method:
- -- reader.ReadFile("filename.igs")
- -- To check a loading file use method Check:
- -- reader.Check(failsonly); where failsonly is equal to Standard_True or
- -- Standard_False;
- -- To print the results of load:
- -- reader.PrintCheckLoad(failsonly,mode) where mode is equal to the value of
- -- enumeration IFSelect_PrintCount
- -- To transfer entities from a model the following methods can be used:
- -- for the whole model
- -- reader.TransferRoots(onlyvisible); where onlyvisible is equal to
- -- Standard_True or Standard_False;
- -- To transfer a list of entities:
- -- reader.TransferList(list);
- -- To transfer one entity
- -- reader.TransferEntity(ent) or reader.Transfer(num);
- -- To obtain a result the following method can be used:
- -- reader.IsDone()
- -- reader.NbShapes() and reader.Shape(num); or reader.OneShape();
- -- To print the results of transfer use method:
- -- reader.PrintTransferInfo(failwarn,mode); where printfail is equal to the
- -- value of enumeration IFSelect_PrintFail, mode see above.
- -- Gets correspondence between an IGES entity and a result shape obtained therefrom.
- -- reader.TransientProcess();
- -- TopoDS_Shape shape =
- -- TransferBRep::ShapeResult(reader.TransientProcess(),ent);
-
-
-uses CString, HSequenceOfTransient from TColStd,
- IGESModel from IGESData,
- PrintFail from IFSelect,
- PrintCount from IFSelect,
- ReturnStatus from IFSelect,
- WorkSession from XSControl
-
-is
-
- Create returns Reader from IGESControl;
- ---Purpose : Creates a Reader from scratch
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True)
- returns Reader from IGESControl;
- ---Purpose : Creates a Reader from an already existing Session
-
- SetReadVisible(me: in out; ReadRoot: Boolean from Standard);
- ---Purpose : Set the transion of ALL Roots (if theReadOnlyVisible is False)
- -- or of Visible Roots (if theReadOnlyVisible is True)
- ---C++: inline
-
- GetReadVisible(me) returns Boolean;
- ---C++: inline
-
- IGESModel (me) returns IGESModel;
- ---Purpose : Returns the model as a IGESModel.
- -- It can then be consulted (header, product)
-
-
- NbRootsForTransfer (me : in out) returns Integer is redefined;
- ---Purpose : Determines the list of root entities from Model which are candidate for
- -- a transfer to a Shape (type of entities is PRODUCT)
- -- <theReadOnlyVisible> is taken into account to define roots
-
- PrintTransferInfo(me; failwarn: PrintFail from IFSelect; mode: PrintCount from IFSelect);
- ---Purpose : Prints Statistics and check list for Transfer
-
- -- other methods are inherited from Reader in IGESToBRep
-
-fields
-
- theReadOnlyVisible : Boolean from Standard;
-
-end Reader;
//gka 06.01.99 S3767
//abv 10.04.99 S4136: eliminate using BRepAPI::Precision()
-#include <IGESControl_Reader.ixx>
+#include <IGESControl_Reader.hxx>
#include <IGESControl_Controller.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferReader.hxx>
#include <TransferBRep.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <BRepLib.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <IGESData_IGESModel.hxx>
// add of stdio.h for NT compilation
#include <stdio.h>
IGESControl_Controller::Init();
SetWS (new XSControl_WorkSession);
SetNorm("IGES");
- theReadOnlyVisible = Standard_False;
+ myReadOnlyVisible = Standard_False;
}
IGESControl_Controller::Init();
SetWS (WS,scratch);
SetNorm ("IGES");
- theReadOnlyVisible = Standard_False;
+ myReadOnlyVisible = Standard_False;
}
Interface_ShareFlags SH (model,protocol);
// sln 11.06.2002 OCC448
- Interface_Static::SetIVal("read.iges.onlyvisible",theReadOnlyVisible);
+ Interface_Static::SetIVal("read.iges.onlyvisible",myReadOnlyVisible);
Standard_Integer nb = model->NbEntities();
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) ent = model->Entity(i);
if ( SH.IsShared(ent) || ! actor->Recognize (ent) ) continue;
// on ajoute un traitement pour ne prendre que les entites visibles
- if ( ! theReadOnlyVisible || ent->BlankStatus() == 0 ) {
+ if ( ! myReadOnlyVisible || ent->BlankStatus() == 0 ) {
theroots.Append(ent);
}
}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESControl_Reader_HeaderFile
+#define _IGESControl_Reader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_Boolean.hxx>
+#include <XSControl_Reader.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Handle_IGESData_IGESModel.hxx>
+#include <Standard_Integer.hxx>
+#include <IFSelect_PrintFail.hxx>
+#include <IFSelect_PrintCount.hxx>
+
+class XSControl_WorkSession;
+class IGESData_IGESModel;
+
+
+
+//! Reads IGES files, checks them and translates their contents into Open CASCADE models. <br>
+//! The IGES data can be that of a whole model or that of a specific list of entities in the model. <br>
+//! As in XSControl_Reader, you specify the list using a selection. <br>
+//! For translation of iges files it is possible to use the following sequence: <br>
+//! To change parameters of translation <br>
+//! class Interface_Static should be used before the beginning of translation <br>
+//! (see IGES Parameters and General Parameters) <br>
+//! Creation of reader <br>
+//! IGESControl_Reader reader; <br>
+//! To load a file in a model use method: <br>
+//! reader.ReadFile("filename.igs") <br>
+//! To check a loading file use method Check: <br>
+//! reader.Check(failsonly); where failsonly is equal to Standard_True or <br>
+//! Standard_False; <br>
+//! To print the results of load: <br>
+//! reader.PrintCheckLoad(failsonly,mode) where mode is equal to the value of <br>
+//! enumeration IFSelect_PrintCount <br>
+//! To transfer entities from a model the following methods can be used: <br>
+//! for the whole model <br>
+//! reader.TransferRoots(onlyvisible); where onlyvisible is equal to <br>
+//! Standard_True or Standard_False; <br>
+//! To transfer a list of entities: <br>
+//! reader.TransferList(list); <br>
+//! To transfer one entity <br>
+//! reader.TransferEntity(ent) or reader.Transfer(num); <br>
+//! To obtain a result the following method can be used: <br>
+//! reader.IsDone() <br>
+//! reader.NbShapes() and reader.Shape(num); or reader.OneShape(); <br>
+//! To print the results of transfer use method: <br>
+//! reader.PrintTransferInfo(failwarn,mode); where printfail is equal to the <br>
+//! value of enumeration IFSelect_PrintFail, mode see above. <br>
+//! Gets correspondence between an IGES entity and a result shape obtained therefrom. <br>
+//! reader.TransientProcess(); <br>
+//! TopoDS_Shape shape = <br>
+//! TransferBRep::ShapeResult(reader.TransientProcess(),ent); <br>
+class IGESControl_Reader : public XSControl_Reader
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a Reader from scratch <br>
+ Standard_EXPORT IGESControl_Reader();
+
+ //! Creates a Reader from an already existing Session <br>
+ Standard_EXPORT IGESControl_Reader(const Handle(XSControl_WorkSession)& WS,
+ const Standard_Boolean scratch = Standard_True);
+
+ //! Set the transion of ALL Roots (if myReadOnlyVisible is False) <br>
+ //! or of Visible Roots (if myReadOnlyVisible is True) <br>
+ void SetReadVisible(const Standard_Boolean ReadRoot) ;
+
+ Standard_Boolean GetReadVisible() const;
+
+ //! Returns the model as a IGESModel. <br>
+ //! It can then be consulted (header, product) <br>
+ Standard_EXPORT Handle_IGESData_IGESModel IGESModel() const;
+
+ //! Determines the list of root entities from Model which are candidate for <br>
+ //! a transfer to a Shape (type of entities is PRODUCT) <br>
+ //! <myReadOnlyVisible> is taken into account to define roots <br>
+ Standard_EXPORT virtual Standard_Integer NbRootsForTransfer();
+
+ //! Prints Statistics and check list for Transfer <br>
+ Standard_EXPORT void PrintTransferInfo (const IFSelect_PrintFail failwarn,
+ const IFSelect_PrintCount mode) const;
+
+
+private:
+ Standard_Boolean myReadOnlyVisible;
+};
+
+#include <IGESControl_Reader.lxx>
+
+#endif
inline void IGESControl_Reader::SetReadVisible (const Standard_Boolean ReadRoot)
{
- theReadOnlyVisible = ReadRoot;
+ myReadOnlyVisible = ReadRoot;
}
inline Standard_Boolean IGESControl_Reader::GetReadVisible ()const
{
- return theReadOnlyVisible;
+ return myReadOnlyVisible;
}
+++ /dev/null
--- Created on: 1996-01-30
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class Writer from IGESControl
-
- ---Purpose : This class creates and writes
- -- IGES files from CAS.CADE models. An IGES file can be written to
- -- an existing IGES file or to a new one.
- -- The translation can be performed in one or several
- -- operations. Each translation operation
- -- outputs a distinct root entity in the IGES file.
- -- To write an IGES file it is possible to use the following sequence:
- -- To modify the IGES file header or to change translation
- -- parameters it is necessary to use class Interface_Static (see
- -- IGESParameters and GeneralParameters).
-
-uses CString, OStream, Transient, Shape from TopoDS,
- FinderProcess, BasicEditor from IGESData, IGESModel, IGESEntity
-
-is
-
- Create returns Writer;
- ---Purpose : Creates a writer object with the
- -- default unit (millimeters) and write mode (Face).
- -- IGESControl_Writer (const Standard_CString unit,
- -- const Standard_Integer modecr = 0);
-
- Create (unit : CString; modecr : Integer = 0) returns Writer;
- ---Purpose : Creates a writer with given
- -- values for units and for write mode.
- -- unit may be any unit that is accepted by the IGES standard.
- -- By default, it is the millimeter.
- -- modecr defines the write mode and may be:
- -- - 0: Faces (default)
- -- - 1: BRep.
-
- Create (model : mutable IGESModel; modecr : Integer = 0) returns Writer;
- ---Purpose : Creates a writer object with the
- -- prepared IGES model model in write mode.
- -- modecr defines the write mode and may be:
- -- - 0: Faces (default)
- -- - 1: BRep.
-
- Model (me) returns IGESModel;
- ---Purpose : Returns the IGES model to be written in output.
-
- TransferProcess (me) returns mutable FinderProcess;
- SetTransferProcess (me : in out; TP : mutable FinderProcess);
- ---Purpose : Returns/Sets the TransferProcess : it contains final results
- -- and if some, check messages
-
- AddShape (me : in out; sh : Shape) returns Boolean;
- ---Purpose : Translates a Shape to IGES Entities and adds them to the model
- -- Returns True if done, False if Shape not suitable for IGES or null
-
- AddGeom (me : in out; geom : Transient) returns Boolean;
- ---Purpose : Translates a Geometry (Surface or Curve) to IGES Entities and
- -- adds them to the model
- -- Returns True if done, False if geom is neither a Surface or
- -- a Curve suitable for IGES or is null
-
- AddEntity (me : in out; ent : IGESEntity) returns Boolean;
- ---Purpose : Adds an IGES entity (and the ones it references) to the model
-
- ComputeModel (me : in out);
- ---Purpose : Computes the entities found in
- -- the model, which is ready to be written.
- -- This contrasts with the default computation of headers only.
-
- Write (me : in out; S : in out OStream; fnes : Boolean = Standard_False)
- returns Boolean;
- ---Purpose : Computes then writes the model to an OStream
- -- Returns True when done, false in case of error
-
- Write (me : in out; file : CString; fnes : Boolean = Standard_False)
- returns Boolean;
- ---Purpose : Prepares and writes an IGES model
- -- either to an OStream, S or to a file name,CString.
- -- Returns True if the operation was performed correctly and
- -- False if an error occurred (for instance,
- -- if the processor could not create the file).
-
- PrintStatsTransfer (me; what : Integer; mode : Integer = 0);
- ---Purpose : Prints Statistics about Transfer
-
-fields
-
- theTP : FinderProcess;
- themod : IGESModel;
- thedit : BasicEditor from IGESData;
- thecr : Integer; -- mode ecr
- thest : Boolean; -- computed ?
-
-end Writer;
#include <Standard_Stream.hxx>
-#include <IGESControl_Writer.ixx>
+#include <IGESControl_Writer.hxx>
#include <IGESControl_Controller.hxx>
#include <IGESSelect_WorkLibrary.hxx>
#include <BRepToIGES_BREntity.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <TopExp_Explorer.hxx>
#include <Message_ProgressIndicator.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <IGESData_IGESModel.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Standard_Transient.hxx>
+#include <IGESData_IGESEntity.hxx>
#include <errno.h>
IGESControl_Writer::IGESControl_Writer ()
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESControl_Writer_HeaderFile
+#define _IGESControl_Writer_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <Handle_IGESData_IGESModel.hxx>
+#include <IGESData_BasicEditor.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_CString.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_IGESData_IGESEntity.hxx>
+#include <Standard_OStream.hxx>
+
+class Transfer_FinderProcess;
+class IGESData_IGESModel;
+class TopoDS_Shape;
+class Standard_Transient;
+class IGESData_IGESEntity;
+
+
+//! This class creates and writes <br>
+//! IGES files from CAS.CADE models. An IGES file can be written to <br>
+//! an existing IGES file or to a new one. <br>
+//! The translation can be performed in one or several <br>
+//! operations. Each translation operation <br>
+//! outputs a distinct root entity in the IGES file. <br>
+//! To write an IGES file it is possible to use the following sequence: <br>
+//! To modify the IGES file header or to change translation <br>
+//! parameters it is necessary to use class Interface_Static (see <br>
+//! IGESParameters and GeneralParameters). <br>
+class IGESControl_Writer {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a writer object with the <br>
+ //! default unit (millimeters) and write mode (Face). <br>
+ //! IGESControl_Writer (const Standard_CString unit, <br>
+ //! const Standard_Integer modecr = 0); <br>
+ Standard_EXPORT IGESControl_Writer();
+ //! Creates a writer with given <br>
+ //! values for units and for write mode. <br>
+ //! unit may be any unit that is accepted by the IGES standard. <br>
+ //! By default, it is the millimeter. <br>
+ //! modecr defines the write mode and may be: <br>
+ //! - 0: Faces (default) <br>
+ //! - 1: BRep. <br>
+ Standard_EXPORT IGESControl_Writer(const Standard_CString unit,const Standard_Integer modecr = 0);
+ //! Creates a writer object with the <br>
+ //! prepared IGES model model in write mode. <br>
+ //! modecr defines the write mode and may be: <br>
+ //! - 0: Faces (default) <br>
+ //! - 1: BRep. <br>
+ Standard_EXPORT IGESControl_Writer(const Handle(IGESData_IGESModel)& model,const Standard_Integer modecr = 0);
+ //! Returns the IGES model to be written in output. <br>
+ Standard_EXPORT Handle_IGESData_IGESModel Model() const;
+
+ Standard_EXPORT Handle_Transfer_FinderProcess TransferProcess() const;
+ //! Returns/Sets the TransferProcess : it contains final results <br>
+ //! and if some, check messages <br>
+ Standard_EXPORT void SetTransferProcess(const Handle(Transfer_FinderProcess)& TP) ;
+ //! Translates a Shape to IGES Entities and adds them to the model <br>
+ //! Returns True if done, False if Shape not suitable for IGES or null <br>
+ Standard_EXPORT Standard_Boolean AddShape(const TopoDS_Shape& sh) ;
+ //! Translates a Geometry (Surface or Curve) to IGES Entities and <br>
+ //! adds them to the model <br>
+ //! Returns True if done, False if geom is neither a Surface or <br>
+ //! a Curve suitable for IGES or is null <br>
+ Standard_EXPORT Standard_Boolean AddGeom(const Handle(Standard_Transient)& geom) ;
+ //! Adds an IGES entity (and the ones it references) to the model <br>
+ Standard_EXPORT Standard_Boolean AddEntity(const Handle(IGESData_IGESEntity)& ent) ;
+ //! Computes the entities found in <br>
+ //! the model, which is ready to be written. <br>
+ //! This contrasts with the default computation of headers only. <br>
+ Standard_EXPORT void ComputeModel() ;
+ //! Computes then writes the model to an OStream <br>
+ //! Returns True when done, false in case of error <br>
+ Standard_EXPORT Standard_Boolean Write(Standard_OStream& S,const Standard_Boolean fnes = Standard_False) ;
+ //! Prepares and writes an IGES model <br>
+ //! either to an OStream, S or to a file name,CString. <br>
+ //! Returns True if the operation was performed correctly and <br>
+ //! False if an error occurred (for instance, <br>
+ //! if the processor could not create the file). <br>
+ Standard_EXPORT Standard_Boolean Write(const Standard_CString file,const Standard_Boolean fnes = Standard_False) ;
+ //! Prints Statistics about Transfer <br>
+ Standard_EXPORT void PrintStatsTransfer(const Standard_Integer what,const Standard_Integer mode = 0) const;
+
+private:
+
+ Handle_Transfer_FinderProcess theTP;
+ Handle_IGESData_IGESModel themod;
+ IGESData_BasicEditor thedit;
+ Standard_Integer thecr;
+ Standard_Boolean thest;
+};
+#endif
IGESData_Dump.hxx
+IGESData_FileRecognizer.hxx
+IGESData_FileRecognizer.cxx
+IGESData_IGESReaderTool.hxx
+IGESData_IGESReaderTool.cxx
+IGESData_SpecificLib.hxx
+IGESData_SpecificLib.cxx
+IGESData_WriterLib.hxx
+IGESData_WriterLib.cxx
\ No newline at end of file
class DirChecker;
class IGESReaderData;
- class IGESReaderTool;
+ imported IGESReaderTool;
class ParamReader;
class ParamCursor;
class DirPart; -- litteral description
class IGESType;
- deferred class FileRecognizer instantiates
- Recognizer from Interface (IGESType, IGESEntity);
+ imported FileRecognizer;
class IGESWriter;
class IGESDumper;
class DefaultSpecific;
class FileProtocol;
- class WriterLib instantiates Library from LibCtl
- (IGESEntity, ReadWriteModule, Protocol from IGESData);
- class SpecificLib instantiates Library from LibCtl
- (IGESEntity, SpecificModule, Protocol from IGESData);
+ imported WriterLib;
+ imported SpecificLib;
-- -- Enumerations -- --
enumeration Status is
--- /dev/null
+// Copyright (c) 1998-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 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.
+//
+
+#include <IGESData_FileRecognizer.hxx>
+
+ IMPLEMENT_STANDARD_HANDLE(IGESData_FileRecognizer, Standard_Transient)
+ IMPLEMENT_STANDARD_RTTIEXT(IGESData_FileRecognizer, Standard_Transient)
+
+
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESData_FileRecognizer_HeaderFile
+#define _IGESData_FileRecognizer_HeaderFile
+
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_Recognizer.hxx>
+#include <Handle_IGESData_IGESEntity.hxx>
+
+class IGESData_IGESEntity;
+class Standard_NoSuchObject;
+class IGESData_IGESType;
+class Standard_Transient;
+
+DEFINE_STANDARD_HANDLE(IGESData_FileRecognizer, Standard_Transient)
+
+class IGESData_FileRecognizer : public Interface_Recognizer <IGESData_IGESType, Handle(IGESData_IGESEntity), Handle(IGESData_FileRecognizer)>
+{
+public:
+ Standard_EXPORT IGESData_FileRecognizer():
+ Interface_Recognizer <IGESData_IGESType, Handle(IGESData_IGESEntity),Handle(IGESData_FileRecognizer)>()
+ {}
+
+
+ DEFINE_STANDARD_RTTI(IGESData_FileRecognizer);
+};
+
+
+
+#endif
+++ /dev/null
--- Created on: 1992-04-06
--- 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 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.
-
-class IGESReaderTool from IGESData inherits FileReaderTool
-
- ---Purpose : specific FileReaderTool for IGES
- -- Parameters are accessed through specific objects, ParamReaders
-
-uses Integer, Boolean, Transient,
- Check, InterfaceModel, GeneralLib, ReaderLib, ParamList,
- IGESReaderData, Protocol from IGESData, FileRecognizer,
- IGESType, IGESEntity, DirPart, ReadStage, ParamReader
-
-is
-
- Create (reader : mutable IGESReaderData; protocol : Protocol from IGESData)
- returns IGESReaderTool;
- ---Purpose : creates IGESReaderTool to work with an IGESReaderData and an
- -- IGES Protocol.
- -- Actually, no Lib is used
-
- -- -- General -- --
-
- Prepare (me : in out; reco : mutable FileRecognizer);
- ---Purpose : binds empty entities to records, works with the Protocol
- -- (from IGESData) stored and later used
- -- RQ : Actually, sets DNum into IGES Entities
- -- Also loads the list of parameters for ParamReader
-
- Recognize (me : in out; num : Integer;
- ach : in out Check; ent : out mutable Transient)
- returns Boolean;
- ---Purpose : recognizes records by asking Protocol (on data of DirType)
-
- -- Loading the IGESModel --
-
- BeginRead (me : in out; amodel : mutable InterfaceModel);
- ---Purpose : fills model's header, that is, its GlobalSection
-
- AnalyseRecord (me : in out;
- num : Integer; anent : mutable Transient; acheck : in out Check)
- returns Boolean;
- ---Purpose : 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
-
- EndRead (me : in out; amodel : mutable InterfaceModel) is redefined;
- ---Purpose : after reading entities, true line weights can be computed
-
- -- For each IGESEntity --
-
- ReadDir (me; ent : mutable IGESEntity; IR : IGESReaderData;
- DP : DirPart; ach : in out Check);
- ---Purpose : Reads directory part componants from file; DP is the litteral
- -- directory part, IR detains entities referenced by DP
-
- ReadOwnParams (me; ent : mutable IGESEntity;
- IR : IGESReaderData; PR : in out ParamReader);
- ---Purpose : Performs Reading of own Parameters for each IGESEntity
- -- Works with the ReaderLib loaded with ReadWriteModules for IGES
- -- In case of failure, tries UndefinedEntity from IGES
-
- ReadProps (me; ent : mutable IGESEntity; IR : IGESReaderData;
- PR : in out ParamReader);
- ---Purpose : Reads Property List, if there is (if not, does nothing)
- -- criterium is : current parameter of PR remains inside params
- -- list, and Stage is "Own"
- -- Current parameter must be a positive integer, which value
- -- gives the length of the list; else, a Fail is produced (into
- -- Check of PR) and reading process is stopped
-
- ReadAssocs (me; ent : mutable IGESEntity; IR : IGESReaderData;
- PR : in out ParamReader);
- ---Purpose : Reads Associativity List, if there is (if not, does nothing)
- -- criterium is : current parameter of PR remains inside params
- -- list, and Stage is "Own"
- -- Same conditions as above; in addition, no parameter must be
- -- let after the list once read
- -- Note that "Associated" entities are not declared "Shared"
-
-fields
-
- thelist : ParamList; -- (loaded once, allows optimization)
- thereco : FileRecognizer;
- theglib : GeneralLib;
- therlib : ReaderLib;
- thecnum : Integer; -- current entity number for recognize
- thectyp : IGESType; -- its IGESType (for purpose of optimization)
- thestep : ReadStage; -- to continue an interrupted party
- thechk : Check; -- check on header (kept by IGESModel)
- thegradweight : Integer;
- themaxweight : Real;
- thedefweight : Real;
-
-end IGESReaderTool;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <IGESData_IGESReaderTool.ixx>
+#include <Interface_ParamList.hxx>
+#include <Interface_Check.hxx>
+#include <IGESData_IGESReaderData.hxx>
+#include <IGESData_Protocol.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <IGESData_IGESEntity.hxx>
+#include <IGESData_DirPart.hxx>
+#include <IGESData_ParamReader.hxx>
+#include <IGESData_IGESReaderTool.hxx>
#include <IGESData_IGESReaderData.hxx>
#include <IGESData_ParamCursor.hxx>
#include <Interface_ReaderModule.hxx>
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESData_IGESReaderTool_HeaderFile
+#define _IGESData_IGESReaderTool_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Handle_Interface_ParamList.hxx>
+#include <IGESData_FileRecognizer.hxx>
+#include <Interface_GeneralLib.hxx>
+#include <Interface_ReaderLib.hxx>
+#include <Standard_Integer.hxx>
+#include <IGESData_IGESType.hxx>
+#include <IGESData_ReadStage.hxx>
+#include <Handle_Interface_Check.hxx>
+#include <Standard_Real.hxx>
+#include <Interface_FileReaderTool.hxx>
+#include <Handle_IGESData_IGESReaderData.hxx>
+#include <Handle_IGESData_Protocol.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Handle_IGESData_IGESEntity.hxx>
+
+class Interface_ParamList;
+class IGESData_FileRecognizer;
+class Interface_Check;
+class IGESData_IGESReaderData;
+class IGESData_Protocol;
+class Standard_Transient;
+class Interface_InterfaceModel;
+class IGESData_IGESEntity;
+class IGESData_DirPart;
+class IGESData_ParamReader;
+
+
+//! specific FileReaderTool for IGES <br>
+//! Parameters are accessed through specific objects, ParamReaders <br>
+class IGESData_IGESReaderTool : public Interface_FileReaderTool
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! creates IGESReaderTool to work with an IGESReaderData and an <br>
+//! IGES Protocol. <br>
+//! Actually, no Lib is used <br>
+ Standard_EXPORT IGESData_IGESReaderTool(const Handle(IGESData_IGESReaderData)& reader,const Handle(IGESData_Protocol)& protocol);
+ //! binds empty entities to records, works with the Protocol <br>
+//! (from IGESData) stored and later used <br>
+//! RQ : Actually, sets DNum into IGES Entities <br>
+//! Also loads the list of parameters for ParamReader <br>
+ Standard_EXPORT void Prepare(const Handle(IGESData_FileRecognizer)& reco) ;
+ //! recognizes records by asking Protocol (on data of DirType) <br>
+ Standard_EXPORT Standard_Boolean Recognize(const Standard_Integer num,Handle(Interface_Check)& ach,Handle(Standard_Transient)& ent) ;
+ //! fills model's header, that is, its GlobalSection <br>
+ Standard_EXPORT void BeginRead(const Handle(Interface_InterfaceModel)& amodel) ;
+ //! fills an entity, given record no; works by calling ReadDirPart <br>
+//! then ReadParams (with help of a ParamReader), then if required <br>
+//! ReadProps and ReadAssocs, from IGESEntity <br>
+//! Returns True if no fail has been recorded <br>
+ Standard_EXPORT Standard_Boolean AnalyseRecord(const Standard_Integer num,const Handle(Standard_Transient)& anent,Handle(Interface_Check)& acheck) ;
+ //! after reading entities, true line weights can be computed <br>
+ Standard_EXPORT virtual void EndRead(const Handle(Interface_InterfaceModel)& amodel) ;
+ //! Reads directory part componants from file; DP is the litteral <br>
+//! directory part, IR detains entities referenced by DP <br>
+ Standard_EXPORT void ReadDir(const Handle(IGESData_IGESEntity)& ent,const Handle(IGESData_IGESReaderData)& IR,const IGESData_DirPart& DP,Handle(Interface_Check)& ach) const;
+ //! Performs Reading of own Parameters for each IGESEntity <br>
+//! Works with the ReaderLib loaded with ReadWriteModules for IGES <br>
+//! In case of failure, tries UndefinedEntity from IGES <br>
+ Standard_EXPORT void ReadOwnParams(const Handle(IGESData_IGESEntity)& ent,const Handle(IGESData_IGESReaderData)& IR,IGESData_ParamReader& PR) const;
+ //! Reads Property List, if there is (if not, does nothing) <br>
+//! criterium is : current parameter of PR remains inside params <br>
+//! list, and Stage is "Own" <br>
+//! Current parameter must be a positive integer, which value <br>
+//! gives the length of the list; else, a Fail is produced (into <br>
+//! Check of PR) and reading process is stopped <br>
+ Standard_EXPORT void ReadProps(const Handle(IGESData_IGESEntity)& ent,const Handle(IGESData_IGESReaderData)& IR,IGESData_ParamReader& PR) const;
+ //! Reads Associativity List, if there is (if not, does nothing) <br>
+//! criterium is : current parameter of PR remains inside params <br>
+//! list, and Stage is "Own" <br>
+//! Same conditions as above; in addition, no parameter must be <br>
+//! let after the list once read <br>
+//! Note that "Associated" entities are not declared "Shared" <br>
+ 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;
+Interface_ReaderLib therlib;
+Standard_Integer thecnum;
+IGESData_IGESType thectyp;
+IGESData_ReadStage thestep;
+Handle_Interface_Check thechk;
+Standard_Integer thegradweight;
+Standard_Real themaxweight;
+Standard_Real thedefweight;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IGESData_SpecificLib.hxx>
+
+typedef LibCtl_GlobalNode <Handle(IGESData_SpecificModule),
+ Handle(IGESData_Protocol)>
+ IGESData_GlobalNodeOfSpecificLib;
+
+template<>
+Standard_EXPORT NCollection_Handle< IGESData_GlobalNodeOfSpecificLib >&
+IGESData_SpecificLib::GetGlobal()
+{
+ static NCollection_Handle< IGESData_GlobalNodeOfSpecificLib > aGlobal;
+ return aGlobal;
+}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESData_SpecificLib_HeaderFile
+#define _IGESData_SpecificLib_HeaderFile
+
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <LibCtl_Library.hxx>
+#include <Handle_IGESData_IGESEntity.hxx>
+#include <Handle_IGESData_SpecificModule.hxx>
+#include <IGESData_Protocol.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <MMgt_TShared.hxx>
+
+class Standard_NoSuchObject;
+class Standard_Transient;
+class IGESData_IGESEntity;
+class IGESData_IGESEntity;
+class IGESData_SpecificModule;
+class IGESData_Protocol;
+
+typedef LibCtl_Library<Handle(IGESData_IGESEntity),
+ Handle(IGESData_SpecificModule),
+ Handle(IGESData_Protocol)>
+ IGESData_SpecificLib;
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IGESData_WriterLib.hxx>
+
+typedef LibCtl_GlobalNode <Handle(IGESData_ReadWriteModule),
+ Handle(IGESData_Protocol)>
+ IGESData_GlobalNodeOfWriterLib;
+
+template<>
+Standard_EXPORT NCollection_Handle< IGESData_GlobalNodeOfWriterLib >&
+IGESData_WriterLib::GetGlobal()
+{
+ static NCollection_Handle< IGESData_GlobalNodeOfWriterLib > aGlobal;
+ return aGlobal;
+}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESData_WriterLib_HeaderFile
+#define _IGESData_WriterLib_HeaderFile
+
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <LibCtl_Library.hxx>
+#include <Handle_IGESData_IGESEntity.hxx>
+#include <Handle_IGESData_ReadWriteModule.hxx>
+#include <Handle_IGESData_Protocol.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Standard_Transient.hxx>
+#include <IGESData_Protocol.hxx>
+#include <MMgt_TShared.hxx>
+
+class Standard_NoSuchObject;
+class IGESData_IGESEntity;
+class IGESData_ReadWriteModule;
+class IGESData_Protocol;
+class Standard_Transient;
+
+
+typedef LibCtl_Library<Handle(IGESData_IGESEntity),
+ Handle(IGESData_ReadWriteModule),
+ Handle(IGESData_Protocol)>
+ IGESData_WriterLib;
+
+#endif
--- /dev/null
+IGESDefs_HArray1OfHArray1OfTextDisplayTemplate.hxx
+IGESDefs_HArray1OfHArray1OfTextDisplayTemplate.cxx
+IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_Handle.hxx
+
class HArray1OfTabularData instantiates HArray1 from TCollection
(TabularData,Array1OfTabularData);
- class HArray1OfHArray1OfTextDisplayTemplate instantiates
- -- HArray1 (HArray1OfTextDisplayTemplate,Array1OfHArray1OfTextDisplayTemplate);
- JaggedArray from Interface (HArray1OfTextDisplayTemplate from IGESGraph);
+
+ imported HArray1OfHArray1OfTextDisplayTemplate;
+ imported HArray1OfHArray1OfTextDisplayTemplate_Handle;
-- Package Methods
uses
- HArray1OfInteger from TColStd,
- HArray1OfHArray1OfInteger from IGESBasic
+ HArray1OfInteger from TColStd,
+ HArray1OfHArray1OfInteger_Handle from IGESBasic
raises DimensionMismatch, OutOfRange
requirements : HArray1OfInteger;
orders : HArray1OfInteger;
numItems : HArray1OfInteger;
- items : HArray1OfHArray1OfInteger)
+ items : HArray1OfHArray1OfInteger_Handle)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- AssociativityDef
theBackPointerReqs : HArray1OfInteger;
theClassOrders : HArray1OfInteger;
theNbItemsPerClass : HArray1OfInteger;
- theItems : HArray1OfHArray1OfInteger;
+ theItems : HArray1OfHArray1OfInteger_Handle;
end AssociativityDef;
HArray1OfIGESEntity from IGESData,
TextDisplayTemplate from IGESGraph,
HArray1OfTextDisplayTemplate from IGESGraph,
- HArray1OfHArray1OfTextDisplayTemplate from IGESDefs
+ HArray1OfHArray1OfTextDisplayTemplate_Handle from IGESDefs
raises DimensionMismatch, OutOfRange, NullObject
attrValueDataTypes : HArray1OfInteger;
attrValueCounts : HArray1OfInteger;
attrValues : HArray1OfTransient from TColStd;
- attrValuePointers : HArray1OfHArray1OfTextDisplayTemplate)
+ attrValuePointers : HArray1OfHArray1OfTextDisplayTemplate_Handle)
raises DimensionMismatch;
-- This method is used to set the fields of the
-- class AttributeDef
theAttrValueDataTypes : HArray1OfInteger;
theAttrValueCounts : HArray1OfInteger;
theAttrValues : HArray1OfTransient from TColStd;
- theAttrValuePointers : HArray1OfHArray1OfTextDisplayTemplate;
+ theAttrValuePointers : HArray1OfHArray1OfTextDisplayTemplate_Handle;
end AttributeDef;
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IGESDefs_HArray1OfHArray1OfTextDisplayTemplate.hxx>
+
+IMPLEMENT_STANDARD_HANDLE(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate, MMgt_TShared)
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_H__
+#define _IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_H__
+
+#include <Standard_DefineHandle.hxx>
+#include <Interface_JaggedArray.hxx>
+#include <Handle_IGESGraph_HArray1OfTextDisplayTemplate.hxx>
+
+class IGESGraph_HArray1OfTextDisplayTemplate;
+
+class IGESDefs_HArray1OfHArray1OfTextDisplayTemplate : public Interface_JaggedArray <Handle(IGESGraph_HArray1OfTextDisplayTemplate)>
+{
+public:
+ Standard_EXPORT IGESDefs_HArray1OfHArray1OfTextDisplayTemplate
+ (const Standard_Integer theLowerIndex,
+ const Standard_Integer theUpperIndex)
+ :Interface_JaggedArray <Handle(IGESGraph_HArray1OfTextDisplayTemplate)> (theLowerIndex, theUpperIndex)
+ {}
+ DEFINE_STANDARD_RTTI(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate);
+};
+
+DEFINE_STANDARD_HANDLE(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate, MMgt_TShared)
+
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_Handle_H__
+#define _IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_Handle_H__
+
+#include <IGESDefs_HArray1OfHArray1OfTextDisplayTemplate.hxx>
+
+typedef Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate)
+ IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_Handle;
+
+#endif
\ No newline at end of file
uses
- HArray1OfInteger from TColStd,
- HArray1OfReal from TColStd,
- HArray1OfHArray1OfReal from IGESBasic
+ HArray1OfInteger from TColStd,
+ HArray1OfReal from TColStd,
+ HArray1OfHArray1OfReal_Handle from IGESBasic
raises DimensionMismatch, OutOfRange
propType : Integer;
typesInd : HArray1OfInteger;
nbValuesInd : HArray1OfInteger;
- valuesInd : HArray1OfHArray1OfReal;
- valuesDep : HArray1OfHArray1OfReal)
+ valuesInd : HArray1OfHArray1OfReal_Handle;
+ valuesDep : HArray1OfHArray1OfReal_Handle)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- TabularData
thePropertyType : Integer;
theTypeOfIndependentVariables : HArray1OfInteger;
theNbValues : HArray1OfInteger;
- theIndependentValues : HArray1OfHArray1OfReal;
- theDependentValues : HArray1OfHArray1OfReal;
+ theIndependentValues : HArray1OfHArray1OfReal_Handle;
+ theDependentValues : HArray1OfHArray1OfReal_Handle;
end TabularData;
uses
- HArray1OfInteger from TColStd,
- HArray1OfIGESEntity from IGESData,
- HArray1OfHArray1OfIGESEntity from IGESBasic
+ HArray1OfInteger from TColStd,
+ HArray1OfIGESEntity from IGESData,
+ HArray1OfHArray1OfIGESEntity_Handle from IGESBasic
raises DimensionMismatch, OutOfRange
aSurface : IGESEntity;
allModelCurves : HArray1OfIGESEntity;
allSenses : HArray1OfInteger;
- allParameterCurves : HArray1OfHArray1OfIGESEntity)
+ allParameterCurves : HArray1OfHArray1OfIGESEntity_Handle)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- Boundary
theSurface : IGESEntity;
theModelCurves : HArray1OfIGESEntity;
theSenses : HArray1OfInteger;
- theParameterCurves : HArray1OfHArray1OfIGESEntity;
+ theParameterCurves : HArray1OfHArray1OfIGESEntity_Handle;
end Boundary;
uses
- HAsciiString from TCollection,
- HArray1OfInteger from TColStd,
- HArray1OfHArray1OfInteger from IGESBasic
+ HAsciiString from TCollection,
+ HArray1OfInteger from TColStd,
+ HArray1OfHArray1OfInteger_Handle from IGESBasic
raises DimensionMismatch, OutOfRange
allNextCharX : HArray1OfInteger;
allNextCharY : HArray1OfInteger;
allPenMotions : HArray1OfInteger;
- allPenFlags : HArray1OfHArray1OfInteger;
- allMovePenToX : HArray1OfHArray1OfInteger;
- allMovePenToY : HArray1OfHArray1OfInteger)
+ allPenFlags : HArray1OfHArray1OfInteger_Handle;
+ allMovePenToX : HArray1OfHArray1OfInteger_Handle;
+ allMovePenToY : HArray1OfHArray1OfInteger_Handle)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class
-- TextFontDef
-- Number of pen motions for each character(Length = NbCharacters)
-- is (NM1 ,NM2 ....... NMn)
- thePenMotions : HArray1OfHArray1OfInteger;
+ thePenMotions : HArray1OfHArray1OfInteger_Handle;
-- Status of Pen up/down flag for each character
-- flag : 0 = Down(Default)
-- 1 = Up
-- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively
- thePenMovesToX : HArray1OfHArray1OfInteger;
- thePenMovesToY : HArray1OfHArray1OfInteger;
+ thePenMovesToX : HArray1OfHArray1OfInteger_Handle;
+ thePenMovesToY : HArray1OfHArray1OfInteger_Handle;
-- For each character, Grid location to which the pen is to move
-- Note : Inner HArray1 are of lengths NM1, NM2... NMn respectively
#include <TColgp_HArray1OfXY.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESBasic_HArray1OfHArray1OfInteger.hxx>
-#include <IGESBasic_HArray1OfHArray1OfXY.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
--- /dev/null
+IGESSelect_FileModifier.hxx
+IGESSelect_FileModifier.cxx
+IGESSelect_AddFileComment.hxx
+IGESSelect_AddFileComment.cxx
+IGESSelect_FloatFormat.hxx
+IGESSelect_FloatFormat.cxx
\ No newline at end of file
class SelectFaces; -- Select some geometries : Faces
class SelectPCurves; -- Select PCurves of Faces
+ imported FileModifier;
+
+ deferred class ModelModifier;
- deferred class ModelModifier instantiates
- ModelModifier from IFSelect (IGESModel from IGESData, Protocol from IGESData);
- deferred class FileModifier instantiates
- FileModifier from IFSelect (IGESWriter from IGESData);
-
- class FloatFormat; -- File Modifier to control Float Format
- class AddFileComment; -- " " to add comment start lines
+ imported FloatFormat; -- File Modifier to control Float Format
+ imported AddFileComment; -- " " to add comment start lines
class UpdateFileName; -- Set new file name
class UpdateCreationDate; -- Set new creation date
+++ /dev/null
--- Created on: 1994-08-26
--- Created by: Christian CAILLET
--- 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 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.
-
-class AddFileComment from IGESSelect inherits FileModifier from IGESSelect
-
- ---Purpose : This class allows to add comment lines on writing an IGES File
- -- These lines are added to Start Section, instead of the only
- -- one blank line written by default.
-
-uses CString, AsciiString from TCollection,
- HSequenceOfHAsciiString from TColStd,
- IGESWriter , ContextWrite
-
-is
-
- Create returns mutable AddFileComment;
- ---Purpose : Creates a new emoty AddFileComment. Use AddLine to complete it
-
- Clear (me : mutable);
- ---Purpose : Clears the list of file comment lines already stored
-
- AddLine (me : mutable; line : CString);
- ---Purpose : Adds a line for file comment
- -- Remark : Lines are limited to 72 useful char.s . A line of more than
- -- 72 char.s will be splited into several ones of 72 max each.
-
- AddLines (me : mutable; lines : HSequenceOfHAsciiString from TColStd);
- ---Purpose : Adds a list of lines for file comment
- -- Each of them must comply with demand of AddLine
-
- NbLines (me) returns Integer;
- ---Purpose : Returns the count of stored lines
-
- Line (me; num : Integer) returns CString;
- ---Purpose : Returns a stored line given its rank
-
- Lines (me) returns HSequenceOfHAsciiString from TColStd;
- ---Purpose : Returns the complete list of lines in once
-
- Perform (me; ctx : in out ContextWrite;
- writer : in out IGESWriter);
- ---Purpose : Sends the comment lines to the file (Start Section)
-
- Label (me) returns AsciiString from TCollection;
- ---Purpose : Returns specific Label, which is
- -- "Add <nn> Comment Lines (Start Section)"
-
-fields
-
- thelist : HSequenceOfHAsciiString from TColStd;
-
-end AddFileComment;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <IGESSelect_AddFileComment.ixx>
+#include <IGESSelect_AddFileComment.hxx>
#include <TCollection_HAsciiString.hxx>
+#include <Standard_Type.hxx>
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+#include <IFSelect_ContextWrite.hxx>
+#include <IGESData_IGESWriter.hxx>
+#include <TCollection_AsciiString.hxx>
#include <stdio.h>
+IMPLEMENT_STANDARD_TYPE(IGESSelect_AddFileComment)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IGESSelect_FileModifier),
+ STANDARD_TYPE(IFSelect_GeneralModifier),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(IGESSelect_AddFileComment)
+
+
+IMPLEMENT_DOWNCAST(IGESSelect_AddFileComment,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(IGESSelect_AddFileComment)
+
IGESSelect_AddFileComment::IGESSelect_AddFileComment ()
{ thelist = new TColStd_HSequenceOfHAsciiString(); }
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESSelect_AddFileComment_HeaderFile
+#define _IGESSelect_AddFileComment_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Handle_TColStd_HSequenceOfHAsciiString.hxx>
+#include <IGESSelect_FileModifier.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Integer.hxx>
+
+class TColStd_HSequenceOfHAsciiString;
+class IFSelect_ContextWrite;
+class IGESData_IGESWriter;
+class TCollection_AsciiString;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(IGESSelect_FileModifier);
+class IGESSelect_AddFileComment;
+
+DEFINE_STANDARD_HANDLE(IGESSelect_AddFileComment,IGESSelect_FileModifier)
+
+//! This class allows to add comment lines on writing an IGES File <br>
+//! These lines are added to Start Section, instead of the only <br>
+//! one blank line written by default. <br>
+class IGESSelect_AddFileComment : public IGESSelect_FileModifier
+{
+
+public:
+
+ //! Creates a new emoty AddFileComment. Use AddLine to complete it <br>
+ Standard_EXPORT IGESSelect_AddFileComment();
+ //! Clears the list of file comment lines already stored <br>
+ Standard_EXPORT void Clear() ;
+ //! Adds a line for file comment <br>
+ //! Remark : Lines are limited to 72 useful char.s . A line of more than <br>
+ //! 72 char.s will be splited into several ones of 72 max each. <br>
+ Standard_EXPORT void AddLine(const Standard_CString line) ;
+ //! Adds a list of lines for file comment <br>
+ //! Each of them must comply with demand of AddLine <br>
+ Standard_EXPORT void AddLines(const Handle(TColStd_HSequenceOfHAsciiString)& lines) ;
+ //! Returns the count of stored lines <br>
+ Standard_EXPORT Standard_Integer NbLines() const;
+ //! Returns a stored line given its rank <br>
+ Standard_EXPORT Standard_CString Line(const Standard_Integer num) const;
+ //! Returns the complete list of lines in once <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfHAsciiString Lines() const;
+ //! Sends the comment lines to the file (Start Section) <br>
+ Standard_EXPORT void Perform(IFSelect_ContextWrite& ctx,IGESData_IGESWriter& writer) const;
+ //! Returns specific Label, which is <br>
+ //! "Add <nn> Comment Lines (Start Section)" <br>
+ Standard_EXPORT TCollection_AsciiString Label() const;
+
+
+ DEFINE_STANDARD_RTTI(IGESSelect_AddFileComment)
+
+private:
+ Handle_TColStd_HSequenceOfHAsciiString thelist;
+};
+#endif
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IGESSelect_FileModifier.hxx>
+#include <Standard_Type.hxx>
+#include <IGESData_IGESWriter.hxx>
+#include <IFSelect_ContextWrite.hxx>
+
+IMPLEMENT_STANDARD_TYPE(IGESSelect_FileModifier)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IFSelect_GeneralModifier),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(IGESSelect_FileModifier)
+
+
+IMPLEMENT_DOWNCAST(IGESSelect_FileModifier,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(IGESSelect_FileModifier)
\ No newline at end of file
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESSelect_FileModifier_HeaderFile
+#define _IGESSelect_FileModifier_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <IFSelect_GeneralModifier.hxx>
+
+class IGESData_IGESWriter;
+class IFSelect_ContextWrite;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(IFSelect_GeneralModifier);
+class IGESSelect_FileModifier;
+
+DEFINE_STANDARD_HANDLE(IGESSelect_FileModifier,IFSelect_GeneralModifier)
+
+class IGESSelect_FileModifier : public IFSelect_GeneralModifier
+{
+
+public:
+ Standard_EXPORT virtual void Perform(IFSelect_ContextWrite& ctx,IGESData_IGESWriter& writer) const = 0;
+
+ DEFINE_STANDARD_RTTI(IGESSelect_FileModifier)
+protected:
+
+ Standard_EXPORT IGESSelect_FileModifier ()
+ : IFSelect_GeneralModifier (Standard_False)
+ { }
+
+};
+#endif
+++ /dev/null
--- Created on: 1994-06-01
--- Created by: Christian CAILLET
--- 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 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.
-
-class FloatFormat from IGESSelect inherits FileModifier from IGESSelect
-
- ---Purpose : This class gives control out format for floatting values :
- -- ZeroSuppress or no, Main Format, Format in Range (for values
- -- around 1.), as IGESWriter allows to manage it.
- -- Formats are given under C-printf form
-
-uses CString, AsciiString from TCollection,
- IGESWriter , ContextWrite
-
-is
-
- Create returns mutable FloatFormat;
- ---Purpose : Creates a new FloatFormat, with standard options :
- -- ZeroSuppress, Main Format = %E,
- -- Format between 0.001 and 1000. = %f
-
- SetDefault (me : mutable; digits : Integer = 0);
- ---Purpose : Sets FloatFormat to default value (see Create) but if <digits>
- -- is given positive, it commands Formats (main and range) to
- -- ensure <digits> significant digits to be displayed
-
- SetZeroSuppress (me : mutable; mode : Boolean);
- ---Purpose : Sets ZeroSuppress mode to a new value
-
- SetFormat (me : mutable; format : CString = "%E");
- ---Purpose : Sets Main Format to a new value
- -- Remark : SetFormat, SetZeroSuppress and SetFormatForRange are
- -- independant
-
- SetFormatForRange (me : mutable; format : CString = "%f";
- Rmin : Real = 0.1; Rmax : Real = 1000.0);
- ---Purpose : Sets Format for Range to a new value with its range of
- -- application.
- -- To cancel it, give format as "" (empty string)
- -- Remark that if the condition (0. < Rmin < Rmax) is not
- -- verified, this secondary format will be ignored.
- -- Moreover, this secondary format is intended to be used in a
- -- range around 1.
-
-
- Format (me; zerosup : out Boolean;
- mainform : out AsciiString from TCollection;
- hasrange : out Boolean;
- forminrange : out AsciiString from TCollection;
- rangemin, rangemax : out Real);
- ---Purpose : Returns all recorded parameters :
- -- zerosup : ZeroSuppress status
- -- mainform : Main Format (which applies out of the range, or
- -- for every real if no range is set)
- -- hasrange : True if a FormatInRange is set, False else
- -- (following parameters do not apply if it is False)
- -- forminrange : Secondary Format (it applies inside the range)
- -- rangemin, rangemax : the range in which the secondary format
- -- applies
-
-
- Perform (me; ctx : in out ContextWrite;
- writer : in out IGESWriter);
- ---Purpose : Sets the Floatting Formats of IGESWriter to the recorded
- -- parameters
-
- Label (me) returns AsciiString from TCollection;
- ---Purpose : Returns specific Label : for instance,
- -- "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]"
-
-fields
-
- thezerosup : Boolean;
- themainform : AsciiString from TCollection;
- theformrange : AsciiString from TCollection;
- therangemin : Real;
- therangemax : Real;
-
-end FloatFormat;
-
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <IGESSelect_FloatFormat.ixx>
+#include <IGESSelect_FloatFormat.hxx>
#include <Interface_FloatWriter.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <IFSelect_ContextWrite.hxx>
+#include <IGESData_IGESWriter.hxx>
+#include <Standard_Type.hxx>
#include <stdio.h>
+IMPLEMENT_STANDARD_TYPE(IGESSelect_FloatFormat)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IGESSelect_FileModifier),
+ STANDARD_TYPE(IFSelect_GeneralModifier),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(IGESSelect_FloatFormat)
+
+
+IMPLEMENT_DOWNCAST(IGESSelect_FloatFormat,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(IGESSelect_FloatFormat)
IGESSelect_FloatFormat::IGESSelect_FloatFormat ()
: thezerosup (Standard_True) , themainform ("%E") ,
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESSelect_FloatFormat_HeaderFile
+#define _IGESSelect_FloatFormat_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <Standard_Real.hxx>
+#include <IGESSelect_FileModifier.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_CString.hxx>
+
+class TCollection_AsciiString;
+class IFSelect_ContextWrite;
+class IGESData_IGESWriter;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(IGESSelect_FileModifier);
+class IGESSelect_FloatFormat;
+
+DEFINE_STANDARD_HANDLE(IGESSelect_FloatFormat,IGESSelect_FileModifier)
+
+//! This class gives control out format for floatting values : <br>
+//! ZeroSuppress or no, Main Format, Format in Range (for values <br>
+//! around 1.), as IGESWriter allows to manage it. <br>
+//! Formats are given under C-printf form <br>
+class IGESSelect_FloatFormat : public IGESSelect_FileModifier
+{
+
+public:
+
+ //! Creates a new FloatFormat, with standard options : <br>
+ //! ZeroSuppress, Main Format = %E, <br>
+ //! Format between 0.001 and 1000. = %f <br>
+ Standard_EXPORT IGESSelect_FloatFormat();
+ //! Sets FloatFormat to default value (see Create) but if <digits> <br>
+ //! is given positive, it commands Formats (main and range) to <br>
+ //! ensure <digits> significant digits to be displayed <br>
+ Standard_EXPORT void SetDefault(const Standard_Integer digits = 0) ;
+ //! Sets ZeroSuppress mode to a new value <br>
+ Standard_EXPORT void SetZeroSuppress(const Standard_Boolean mode) ;
+ //! Sets Main Format to a new value <br>
+ //! Remark : SetFormat, SetZeroSuppress and SetFormatForRange are <br>
+ //! independant <br>
+ Standard_EXPORT void SetFormat(const Standard_CString format = "%E") ;
+ //! Sets Format for Range to a new value with its range of <br>
+ //! application. <br>
+ //! To cancel it, give format as "" (empty string) <br>
+ //! Remark that if the condition (0. < Rmin < Rmax) is not <br>
+ //! verified, this secondary format will be ignored. <br>
+ //! Moreover, this secondary format is intended to be used in a <br>
+ //! range around 1. <br>
+ Standard_EXPORT void SetFormatForRange(const Standard_CString format = "%f",const Standard_Real Rmin = 0.1,const Standard_Real Rmax = 1000.0) ;
+ //! Returns all recorded parameters : <br>
+ //! zerosup : ZeroSuppress status <br>
+ //! mainform : Main Format (which applies out of the range, or <br>
+ //! for every real if no range is set) <br>
+ //! hasrange : True if a FormatInRange is set, False else <br>
+ //! (following parameters do not apply if it is False) <br>
+ //! forminrange : Secondary Format (it applies inside the range) <br>
+ //! rangemin, rangemax : the range in which the secondary format <br>
+ //! applies <br>
+ Standard_EXPORT void Format(Standard_Boolean& zerosup,TCollection_AsciiString& mainform,Standard_Boolean& hasrange,TCollection_AsciiString& forminrange,Standard_Real& rangemin,Standard_Real& rangemax) const;
+ //! Sets the Floatting Formats of IGESWriter to the recorded <br>
+ //! parameters <br>
+ Standard_EXPORT void Perform(IFSelect_ContextWrite& ctx,IGESData_IGESWriter& writer) const;
+ //! Returns specific Label : for instance, <br>
+ //! "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]" <br>
+ Standard_EXPORT TCollection_AsciiString Label() const;
+
+ DEFINE_STANDARD_RTTI(IGESSelect_FloatFormat)
+
+private:
+
+ Standard_Boolean thezerosup;
+ TCollection_AsciiString themainform;
+ TCollection_AsciiString theformrange;
+ Standard_Real therangemin;
+ Standard_Real therangemax;
+};
+#endif
--- /dev/null
+-- Copyright (c) 1999-2012 OPEN CASCADE SAS
+--
+-- The content of this file is subject to the Open CASCADE Technology Public
+-- License Version 6.5 (the "License"). You may not use the content of this file
+-- except in compliance with the License. Please obtain a copy of the License
+-- at http://www.opencascade.org and read it completely before using this file.
+--
+-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+--
+-- The Original Code and all software distributed under the License is
+-- distributed on an "AS IS" basis, without warranty of any kind, and the
+-- Initial Developer hereby disclaims all such warranties, including without
+-- limitation, any warranties of merchantability, fitness for a particular
+-- purpose or non-infringement. Please see the License for the specific terms
+-- and conditions governing the rights and limitations under the License.
+
+deferred class ModelModifier from IGESSelect inherits Modifier from IFSelect
+uses CString,
+ InterfaceModel,
+ Protocol from Interface,
+ Protocol from IGESData,
+ IGESModel from IGESData,
+ CopyTool from Interface,
+ ContextModif
+
+is
+ Initialize(mayChangeGraph : Boolean);
+ ---Purpose : Calls inherited Initialize, transmits to it the information
+ -- <mayChangeGraph>
+
+ Perform (me; theContext : in out ContextModif from IFSelect;
+ theTarget : mutable InterfaceModel from Interface;
+ theProtocol : Protocol from Interface;
+ theCopyTool : in out CopyTool from Interface);
+ ---Purpose : The inherited Perform does the required cast (and refuses to
+ -- go further if cast has failed) then calls the instantiated
+ -- Performing
+
+ PerformProtocol (me; theContext : in out ContextModif from IFSelect;
+ theTarget : mutable IGESModel from IGESData;
+ theProtocol : Protocol from IGESData;
+ theCopyTool : in out CopyTool from Interface) is virtual;
+ ---Purpose : Specific Perform with Protocol. It is defined to let the
+ -- Protocol unused and to call Performing without Protocol
+ -- (most current case). It can be redefined if specific action
+ -- requires Protocol.
+
+ Performing (me; theContext : in out ContextModif from IFSelect;
+ theTarget : mutable IGESModel from IGESData;
+ theCopyTool : in out CopyTool from Interface) is deferred;
+ ---Purpose : Specific Perform, without Protocol. If Performing with
+ -- Protocol is redefined, Performing without Protocol must
+ -- though be defined to do nothing (not called, but demanded
+ -- by the linker)
+
+end ModelModifier;
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <IFSelect_ContextModif.hxx>
+#include <Interface_Check.hxx>
+#include <IGESSelect_ModelModifier.hxx>
+#include <IGESData_IGESModel.hxx>
+
+ IMPLEMENT_STANDARD_HANDLE(IGESSelect_ModelModifier, IFSelect_Modifier)
+ IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_ModelModifier, IFSelect_Modifier)
+
+IGESSelect_ModelModifier::IGESSelect_ModelModifier (const Standard_Boolean mayChangeGraph)
+ : IFSelect_Modifier (mayChangeGraph)
+{}
+
+void IGESSelect_ModelModifier::Perform
+ (IFSelect_ContextModif& theContext,
+ const Handle(Interface_InterfaceModel)& theTarget,
+ const Handle(Interface_Protocol)& theProtocol,
+ Interface_CopyTool& theCopyTool) const
+{
+ theContext.TraceModifier(this);
+ Handle(IGESData_IGESModel) aTarget = Handle(IGESData_IGESModel)::DownCast(theTarget);
+ Handle(IGESData_Protocol) aProtocol
+ = Handle(IGESData_Protocol)::DownCast(theProtocol);
+ if (aTarget.IsNull())
+ {
+ theContext.CCheck()->AddFail("Model to Modify : unproper type");
+ return;
+ }
+ PerformProtocol (theContext,aTarget,aProtocol,theCopyTool);
+}
+
+void IGESSelect_ModelModifier::PerformProtocol
+ (IFSelect_ContextModif& theContext,
+ const Handle(IGESData_IGESModel)& theTarget,
+ const Handle(IGESData_Protocol)& theProtocol,
+ Interface_CopyTool& theCopyTool) const
+{
+ theContext.SetProtocol(theProtocol);
+ Performing (theContext,theTarget,theCopyTool);
+}
Standard,
TCollection,
- TColStd,
- TColgp,
+ TColStd,
+ TColgp,
gp,
- Message,
+ Message,
Interface,
IGESData,
IGESBasic,
uses
- HArray1OfIGESEntity from IGESData,
- HArray1OfInteger from TColStd,
- HArray1OfHArray1OfInteger from IGESBasic,
- HArray1OfHArray1OfIGESEntity from IGESBasic
+ HArray1OfIGESEntity from IGESData,
+ HArray1OfInteger from TColStd,
+ HArray1OfHArray1OfInteger from IGESBasic,
+ HArray1OfHArray1OfInteger_Handle from IGESBasic,
+ HArray1OfHArray1OfIGESEntity_Handle from IGESBasic
raises DimensionMismatch, OutOfRange
index : HArray1OfInteger;
orient : HArray1OfInteger;
nbParameterCurves : HArray1OfInteger;
- isoparametricFlags : HArray1OfHArray1OfInteger;
- curves : HArray1OfHArray1OfIGESEntity from
+ isoparametricFlags : HArray1OfHArray1OfInteger_Handle;
+ curves : HArray1OfHArray1OfIGESEntity_Handle from
IGESBasic)
raises DimensionMismatch;
---Purpose : This method is used to set the fields of the class Loop
theNbParameterCurves : HArray1OfInteger;
-- no. of underlying parameter space curves
- theIsoparametricFlags : HArray1OfHArray1OfInteger;
+ theIsoparametricFlags : HArray1OfHArray1OfInteger_Handle;
-- Isoparametric flags of the space curves
- theCurves : HArray1OfHArray1OfIGESEntity
+ theCurves : HArray1OfHArray1OfIGESEntity_Handle
from IGESBasic;
-- parameter space curves corresponding to the edges
+IGESToBRep_Actor.hxx
+IGESToBRep_Actor.cxx
+IGESToBRep_Reader.hxx
+IGESToBRep_Reader.cxx
project.pxx
class BRepEntity;
class IGESBoundary;
- class Reader;
- class Actor;
+ imported Reader;
+ imported Actor;
class AlgoContainer;
class ToolContainer;
+++ /dev/null
--- Created on: 1994-11-03
--- Created by: Marie Jose MARTZ
--- 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 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.
-
-class Actor from IGESToBRep
- inherits ActorOfTransientProcess from Transfer
-
- ---Purpose : This class performs the transfer of an Entity from
- -- IGESToBRep
- --
- -- I.E. for each type of Entity, it invokes the appropriate Tool
- -- then returns the Binder which contains the Result
-
-uses TransientProcess, Binder, InterfaceModel from Interface
-
-is
-
- Create returns mutable Actor from IGESToBRep;
-
- SetModel (me : mutable; model : InterfaceModel from Interface);
-
- SetContinuity (me : mutable; continuity : Integer from Standard = 0);
- ---Purpose By default continuity = 0
- -- if continuity = 1 : try C1
- -- if continuity = 2 : try C2
-
- GetContinuity (me) returns Integer from Standard;
- ---Purpose : Return "thecontinuity"
-
- Recognize (me : mutable; start : Transient) returns Boolean is redefined;
-
- Transfer (me : mutable; start : Transient; TP : mutable TransientProcess)
- returns mutable Binder is redefined;
-
- UsedTolerance (me) returns Real;
- ---Purpose : Returns the tolerance which was actually used, either from
- -- the file or from statics
-
-fields
-
- themodel : InterfaceModel from Interface;
- thecontinuity : Integer;
- theeps : Real;
-
-end Actor;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <IGESToBRep_Actor.ixx>
+#include <IGESToBRep_Actor.hxx>
+#include <Standard_Type.hxx>
#include <IGESToBRep.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_IGESModel.hxx>
#include <Standard_ErrorHandler.hxx>
#include <ShapeExtend_Explorer.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
-
+#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Static.hxx>
-
#include <Message_ProgressSentry.hxx>
-
+#include <Standard_Transient.hxx>
#include <TopoDS_Shape.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
+IMPLEMENT_STANDARD_TYPE(IGESToBRep_Actor)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_ActorOfTransientProcess),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(IGESToBRep_Actor)
+
+
+IMPLEMENT_DOWNCAST(IGESToBRep_Actor,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(IGESToBRep_Actor)
+
//=======================================================================
//function : IGESToBRep_Actor
//purpose :
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESToBRep_Actor_HeaderFile
+#define _IGESToBRep_Actor_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Real.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Transfer_TransientProcess.hxx>
+
+class Interface_InterfaceModel;
+class Standard_Transient;
+class Transfer_Binder;
+class Transfer_TransientProcess;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Transfer_ActorOfTransientProcess);
+class IGESToBRep_Actor;
+
+DEFINE_STANDARD_HANDLE(IGESToBRep_Actor,Transfer_ActorOfTransientProcess)
+
+//! This class performs the transfer of an Entity from <br>
+//! IGESToBRep <br>
+//! <br>
+//! I.E. for each type of Entity, it invokes the appropriate Tool <br>
+//! then returns the Binder which contains the Result <br>
+class IGESToBRep_Actor : public Transfer_ActorOfTransientProcess {
+
+public:
+
+ Standard_EXPORT IGESToBRep_Actor();
+
+ Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& model) ;
+ //!---Purpose By default continuity = 0 <br>
+ //! if continuity = 1 : try C1 <br>
+ //! if continuity = 2 : try C2 <br>
+ Standard_EXPORT void SetContinuity(const Standard_Integer continuity = 0);
+
+ //! Return "thecontinuity" <br>
+ Standard_EXPORT Standard_Integer GetContinuity() const;
+
+ Standard_EXPORT virtual Standard_Boolean Recognize(const Handle(Standard_Transient)& start);
+
+ Standard_EXPORT virtual Handle_Transfer_Binder Transfer(const Handle(Standard_Transient)& start,
+ const Handle(Transfer_TransientProcess)& TP);
+
+ //! Returns the tolerance which was actually used, either from <br>
+ //! the file or from statics <br>
+ Standard_EXPORT Standard_Real UsedTolerance() const;
+
+ DEFINE_STANDARD_RTTI(IGESToBRep_Actor)
+
+private:
+
+
+Handle_Interface_InterfaceModel themodel;
+Standard_Integer thecontinuity;
+Standard_Real theeps;
+
+
+};
+#endif
IGESEntity from IGESData,
IGESModel from IGESData,
CString from Standard,
- TransientProcess from Transfer,
+ TransientProcess_Handle from Transfer,
Surface from Geom,
Msg from Message
is
---C++: inline
---Purpose: Returns the value of "myContinuity"
- SetTransferProcess(me: in out; TP: TransientProcess from Transfer);
+ SetTransferProcess(me: in out; TP: TransientProcess_Handle from Transfer);
---C++: inline
---Purpose: Set the value of "myMsgReg"
- GetTransferProcess(me) returns TransientProcess from Transfer;
+ GetTransferProcess(me) returns TransientProcess_Handle from Transfer;
---C++: inline
---Purpose: Returns the value of "myMsgReg"
myModel : IGESModel from IGESData ;
- myTP : TransientProcess from Transfer;
+ myTP : TransientProcess_Handle from Transfer;
end CurveAndSurface;
+++ /dev/null
--- Created on: 1994-09-01
--- Created by: Marie Jose MARTZ
--- 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 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.
-
-class Reader from IGESToBRep
-
- ---Purpose : A simple way to read geometric IGES data.
- -- Encapsulates reading file and calling transfer tools
-
-uses
- IGESModel from IGESData,
- ShareFlags from Interface,
- TransientProcess from Transfer,
- Shape from TopoDS,
- SequenceOfShape from TopTools,
- Actor from IGESToBRep
-
-is
-
- Create returns Reader;
- ---Purpose : Creates a Reader
-
- LoadFile (me : in out; filename : CString) returns Integer;
- ---Purpose : Loads a Model from a file.Returns 0 if success.
- -- returns 1 if the file could not be opened,
- -- returns -1 if an error occurred while the file was being loaded.
-
- SetModel (me : in out; model : IGESModel);
- ---Purpose : Specifies a Model to work on
- -- Also clears the result and Done status, sets TransientProcess
-
- Model (me) returns IGESModel;
- ---Purpose : Returns the Model to be worked on.
-
- SetTransientProcess (me : in out; TP : mutable TransientProcess);
- ---Purpose : Allows to set an already defined TransientProcess
- -- (to be called after LoadFile or SetModel)
-
- TransientProcess (me) returns TransientProcess;
- ---Purpose : Returns the TransientProcess
-
- Actor (me) returns Actor from IGESToBRep;
- ---Purpose : Returns "theActor"
-
- Clear (me : in out);
- ---Purpose : Clears the results between two translation operations.
-
- Check (me; withprint : Boolean) returns Boolean;
- ---Purpose : Checks the IGES file that was
--- loaded into memory. Displays error messages in the default
--- message file if withprint is true. Returns True if no fail
--- message was found and False if there was at least one fail message.
-
- TransferRoots (me : in out; onlyvisible : Boolean = Standard_True);
- ---Purpose : Translates root entities in an
--- IGES file. Standard_True is the default value and means that only
--- visible root entities are translated. Standard_False
--- translates all of the roots (visible and invisible).
-
- Transfer (me : in out; num : Integer) returns Boolean;
- ---Purpose : Transfers an Entity given its rank in the Model (Root or not)
- -- Returns True if it is recognized as Geom-Topol.
- -- (But it can have failed : see IsDone)
-
- IsDone (me) returns Boolean;
- ---Purpose : Returns True if the LAST Transfer/TransferRoots was a success
-
- UsedTolerance (me) returns Real;
- ---Purpose : Returns the Tolerance which has been actually used, converted
- -- in millimeters
- -- (either that from File or that from Session, according the mode)
-
- NbShapes (me) returns Integer;
- ---Purpose : Returns the number of shapes produced by the translation.
-
- Shape (me; num : Integer = 1) returns Shape from TopoDS;
- ---Purpose : Returns the num the resulting shape in a translation operation.
-
- OneShape (me) returns Shape from TopoDS;
- ---Purpose : Returns all of the results in a
--- single shape which is:
--- - a null shape if there are no results,
--- - a shape if there is one result,
--- - a compound containing the resulting shapes if there are several.
-
-
-
-fields
-
- theModel : IGESModel from IGESData;
- theDone : Boolean;
- theShapes : SequenceOfShape from TopTools;
- theActor : Actor from IGESToBRep;
- theProc : TransientProcess from Transfer;
-
-end Reader;
//#70 rln 03.03.99 syntax correction
// sln 11.06.2002 OCC448 : Initialize "read.onlyvisiable" parameter to control transfering invisiable sub entities which logicaly depend on the grouping entities
#include <stdio.h>
-#include <IGESToBRep_Reader.ixx>
+#include <IGESToBRep_Reader.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <OSD_Timer.hxx>
-
#include <gp_Trsf.hxx>
-
#include <TopAbs.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Shape.hxx>
#include <BRep_Builder.hxx>
#include <BRepLib.hxx>
#include <BRepTools_Modifier.hxx>
-
#include <Message_Msg.hxx>
#include <Message_Messenger.hxx>
-
#include <IGESFile_Read.hxx>
#include <IGESData_FileProtocol.hxx>
#include <IGESData_GlobalSection.hxx>
#include <IGESSolid_Protocol.hxx>
#include <IGESAppli.hxx>
#include <IGESAppli_Protocol.hxx>
-
#include <Interface_Macros.hxx>
#include <Interface_CheckTool.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_ShareFlags.hxx>
#include <Interface_Static.hxx>
#include <Interface_Check.hxx>
-
#include <IGESToBRep.hxx>
#include <IGESToBRep_Actor.hxx>
#include <IGESToBRep_CurveAndSurface.hxx>
-
-//#include <ShapeCustom.hxx>
#include <ShapeExtend_Explorer.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
-
#include <Transfer_TransferOutput.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeListBinder.hxx>
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
-
#include <ShapeAlgo.hxx>
#include <ShapeAlgo_AlgoContainer.hxx>
#include <Message_ProgressSentry.hxx>
+#include <IGESData_IGESModel.hxx>
#ifdef WNT
#include <stdlib.h>
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _IGESToBRep_Reader_HeaderFile
+#define _IGESToBRep_Reader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Handle_IGESData_IGESModel.hxx>
+#include <Standard_Boolean.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+#include <IGESToBRep_Actor.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Real.hxx>
+
+class IGESData_IGESModel;
+class TopoDS_Shape;
+
+
+//! A simple way to read geometric IGES data. <br>
+//! Encapsulates reading file and calling transfer tools <br>
+class IGESToBRep_Reader
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a Reader <br>
+ Standard_EXPORT IGESToBRep_Reader();
+
+ //! Loads a Model from a file.Returns 0 if success. <br>
+ //! returns 1 if the file could not be opened, <br>
+ //! returns -1 if an error occurred while the file was being loaded. <br>
+ Standard_EXPORT Standard_Integer LoadFile(const Standard_CString filename);
+
+ //! Specifies a Model to work on <br>
+ //! Also clears the result and Done status, sets TransientProcess <br>
+ Standard_EXPORT void SetModel(const Handle(IGESData_IGESModel)& model);
+
+ //! Returns the Model to be worked on. <br>
+ Standard_EXPORT Handle(IGESData_IGESModel) Model() const;
+
+ //! Allows to set an already defined TransientProcess <br>
+//! (to be called after LoadFile or SetModel) <br>
+ Standard_EXPORT void SetTransientProcess(const Handle(Transfer_TransientProcess)& TP);
+
+ //! Returns the TransientProcess <br>
+ Standard_EXPORT Transfer_TransientProcess_Handle TransientProcess() const;
+
+ //! Returns "theActor" <br>
+ Standard_EXPORT Handle(IGESToBRep_Actor) Actor() const;
+
+ //! Clears the results between two translation operations. <br>
+ Standard_EXPORT void Clear();
+
+ //! Checks the IGES file that was <br>
+ //! loaded into memory. Displays error messages in the default <br>
+ //! message file if withprint is true. Returns True if no fail <br>
+ //! message was found and False if there was at least one fail message. <br>
+ Standard_EXPORT Standard_Boolean Check(const Standard_Boolean withprint) const;
+
+ //! Translates root entities in an <br>
+ //! IGES file. Standard_True is the default value and means that only <br>
+ //! visible root entities are translated. Standard_False <br>
+ //! translates all of the roots (visible and invisible). <br>
+ Standard_EXPORT void TransferRoots(const Standard_Boolean onlyvisible = Standard_True);
+
+ //! Transfers an Entity given its rank in the Model (Root or not) <br>
+ //! Returns True if it is recognized as Geom-Topol. <br>
+ //! (But it can have failed : see IsDone) <br>
+ Standard_EXPORT Standard_Boolean Transfer(const Standard_Integer num);
+
+ //! Returns True if the LAST Transfer/TransferRoots was a success <br>
+ Standard_EXPORT Standard_Boolean IsDone() const;
+
+ //! Returns the Tolerance which has been actually used, converted <br>
+ //! in millimeters <br>
+ //! (either that from File or that from Session, according the mode) <br>
+ Standard_EXPORT Standard_Real UsedTolerance() const;
+
+ //! Returns the number of shapes produced by the translation. <br>
+ Standard_EXPORT Standard_Integer NbShapes() const;
+
+ //! Returns the num the resulting shape in a translation operation. <br>
+ Standard_EXPORT TopoDS_Shape Shape(const Standard_Integer num = 1) const;
+
+ //! Returns all of the results in a <br>
+ //! single shape which is: <br>
+ //! - a null shape if there are no results, <br>
+ //! - a shape if there is one result, <br>
+ //! - a compound containing the resulting shapes if there are several. <br>
+ Standard_EXPORT TopoDS_Shape OneShape() const;
+
+private:
+
+ Handle(IGESData_IGESModel) theModel;
+ Standard_Boolean theDone;
+ TopTools_SequenceOfShape theShapes;
+ Handle(IGESToBRep_Actor) theActor;
+ Handle(Transfer_TransientProcess) theProc;
+
+};
+#endif
Interface_StaticStandards.cxx
Interface_Version.hxx
Interface_VectorOfFileParameter.hxx
+Interface_JaggedArray.hxx
+Interface_Recognizer.hxx
+Interface_ReaderLib.hxx
+Interface_ReaderLib.cxx
+Interface_GeneralLib.hxx
+Interface_GeneralLib.cxx
class EntityList; -- for an (ordered) little list of Entities
private class EntityCluster; -- ancillary class for the former
- generic class JaggedArray; -- to turn arround limitation on Array(Array)
+ imported JaggedArray; -- to turn arround limitation on Array(Array)
-- -- Auxiliary Classes (results, working data) -- --
deferred class Protocol; -- manages also Active Protocol
deferred class GeneralModule; -- (Shareds,Check,Copy,Trace)
- class GeneralLib instantiates Library from LibCtl
- (Transient, GeneralModule, Protocol from Interface);
+ imported GeneralLib;
class GTool;
imported StaticSatisfies;
-- Function to be added to a Static for specific Satisfies
- deferred generic class Recognizer; -- aimed to create Interface Entities
+ imported Recognizer; -- aimed to create Interface Entities
-- -- File Access (Read & Write) -- --
deferred class ReaderModule;
- class ReaderLib instantiates Library from LibCtl
- (Transient, ReaderModule, Protocol from Interface);
+ imported ReaderLib;
imported VectorOfFileParameter;
class FileParameter;
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <Interface_GeneralLib.hxx>
+
+typedef LibCtl_GlobalNode <Handle(Interface_GeneralModule),
+ Handle(Interface_Protocol)>
+ Interface_GlobalNodeOfGeneralLib;
+
+template<>
+Standard_EXPORT NCollection_Handle< Interface_GlobalNodeOfGeneralLib >&
+Interface_GeneralLib::GetGlobal()
+{
+ static NCollection_Handle< Interface_GlobalNodeOfGeneralLib > aGlobal;
+ return aGlobal;
+}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Interface_GeneralLib_HeaderFile
+#define _Interface_GeneralLib_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Transient.hxx>
+#include <LibCtl_Library.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Interface_GeneralModule.hxx>
+#include <Interface_Protocol.hxx>
+#include <MMgt_TShared.hxx>
+
+
+class Standard_NoSuchObject;
+class Standard_Transient;
+class Interface_GeneralModule;
+class Interface_Protocol;
+
+typedef LibCtl_Library <Handle(Standard_Transient),
+ Handle(Interface_GeneralModule),
+ Handle(Interface_Protocol)>
+ Interface_GeneralLib;
+
+#endif
+++ /dev/null
--- Created on: 1995-05-30
--- 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 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.
-
-generic class JaggedArray from Interface
- (TheKey as TShared)
- inherits TShared
-
- ---Purpose : This class allows to define an HArray1 Of HArray1 ...
- -- which is not possible with the actual system of
- -- genericity supported by CasCade
-
-uses Array1OfTransient
-
-is
-
- Create (low, up : Integer) returns mutable JaggedArray;
-
- Lower (me) returns Integer;
- Upper (me) returns Integer;
- Length (me) returns Integer;
-
- SetValue (me : mutable; num : Integer; val : any TheKey);
-
- Value (me; num : Integer) returns any TheKey;
- -- C++ : return const & (NO , DownCast required)
-
--- ChangeValue (me : mutable; num : Integer) returns any TheKey;
- -- C++ : return & (NO , DownCast required !)
-
-fields
-
- thelist : Array1OfTransient;
-
-end JaggedArray;
+++ /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 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_JaggedArray.ixx>
-
-Interface_JaggedArray::Interface_JaggedArray
- (const Standard_Integer low, const Standard_Integer up)
-: thelist (low,up) { Handle(Standard_Transient) nulo; thelist.Init(nulo); }
-
- Standard_Integer Interface_JaggedArray::Lower () const
- { return thelist.Lower(); }
-
- Standard_Integer Interface_JaggedArray::Upper () const
- { return thelist.Upper(); }
-
- Standard_Integer Interface_JaggedArray::Length () const
- { return thelist.Length(); }
-
- void Interface_JaggedArray::SetValue
- (const Standard_Integer num, const Handle(TheKey)& val)
- { thelist.SetValue(num,val); }
-
- Handle(TheKey) Interface_JaggedArray::Value
- (const Standard_Integer num) const
- { return Handle(TheKey)::DownCast(thelist.Value(num)); }
-
-// Handle(TheKey)& Interface_JaggedArray::ChangeValue
-// (const Standard_Integer num)
-// { return thelist.ChangeValue(num); }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Interface_JaggedArray_H__
+#define _Interface_JaggedArray_H__
+
+#include <MMgt_TShared.hxx>
+#include <NCollection_Array1.hxx>
+
+template <class KeyType>
+class Interface_JaggedArray: public MMgt_TShared
+{
+private:
+ NCollection_Array1<Handle(Standard_Transient)> myList;
+public:
+ Standard_EXPORT Interface_JaggedArray (const Standard_Integer theLowerIndex,
+ const Standard_Integer theUpperIndex)
+ : myList (theLowerIndex, theUpperIndex)
+ {
+ Handle(Standard_Transient) aNullObj;
+ myList.Init(aNullObj);
+ }
+
+ Standard_EXPORT Standard_Integer Lower() const
+ {
+ return myList.Lower();
+ }
+
+ Standard_EXPORT Standard_Integer Upper() const
+ {
+ return myList.Upper();
+ }
+
+ Standard_EXPORT Standard_Integer Length() const
+ {
+ return myList.Length();
+ }
+
+ Standard_EXPORT void SetValue (const Standard_Integer theNum,
+ const KeyType& theVal)
+ {
+ myList.SetValue(theNum, theVal);
+ }
+
+ Standard_EXPORT KeyType Value (const Standard_Integer theNum) const
+ {
+ return KeyType::DownCast(myList.Value(theNum));
+ }
+};
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <Interface_ReaderLib.hxx>
+
+typedef LibCtl_GlobalNode <Handle(Interface_ReaderModule),
+ Handle(Interface_Protocol)>
+ Interface_GlobalNodeOfReaderLib;
+
+template<>
+Standard_EXPORT NCollection_Handle< Interface_GlobalNodeOfReaderLib >&
+Interface_ReaderLib::GetGlobal()
+{
+ static NCollection_Handle< Interface_GlobalNodeOfReaderLib > aGlobal;
+ return aGlobal;
+}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Interface_ReaderLib_HeaderFile
+#define _Interface_ReaderLib_HeaderFile
+
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <LibCtl_Library.hxx>
+#include <MMgt_TShared.hxx>
+#include <Handle_Interface_ReaderModule.hxx>
+#include <Interface_Protocol.hxx>
+#include <Standard_Transient.hxx>
+
+class Interface_ReaderModule;
+class Interface_Protocol;
+class Standard_NoSuchObject;
+
+typedef LibCtl_Library <Handle(Standard_Transient),
+ Handle(Interface_ReaderModule),
+ Handle(Interface_Protocol)>
+ Interface_ReaderLib;
+
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1992-02-03
--- 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 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.
-
-deferred generic class Recognizer from Interface
- (TheKey as any;
- TheResul as Transient)
- inherits Transient
-
- ---Purpose : Defines a correspondance between an object to be recognized,
- -- of type (Kind) TheKey, and a result of the recognition. There
- -- can be no correspondance. When an object is recognized, the
- -- returned result is empty : a Recognizer is not aimed to make
- -- a transfer but to initiate it by giving a correspondant
- --
- -- A Recognizer can be compound, that is, in addition to its own
- -- Eval method if this one has failed, it can ask another
- -- Recognizer to work, and so on : See method Add
-
-raises NoSuchObject
-
-
-is
-
- Initialize;
- ---Purpose : Assumes that no result has yet been recognized
-
- Evaluate (me : mutable; akey : TheKey; res : out mutable TheResul)
- returns Boolean;
- ---Purpose : 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
-
- Result (me) returns mutable TheResul raises NoSuchObject;
- ---Purpose : Returns result of last recognition (call of Evaluate)
-
- Add (me : mutable; reco : mutable Recognizer);
- ---Purpose : 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
-
- SetOK (me : mutable; aresult : mutable TheResul) is protected;
- ---Purpose : Records the result of the recognition. Called by specific
- -- method Eval to record a result : after calling it, Eval has
- -- finished and can return
-
- SetKO (me : mutable) is protected;
- ---Purpose : Records that recognition gives no result
-
- Eval (me : mutable; akey : TheKey) is deferred protected;
- ---Purpose : 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
-
-fields
-
- theres : TheResul; -- storing result of last evaluation
-
- hasnext : Boolean;
- thenext : Recognizer; -- managing compound definition
-
-end Recognizer;
+++ /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 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_Recognizer.ixx>
-#include <Standard_NoSuchObject.hxx>
-
-// ATTENTION : TransRecognizer a exactement le meme code ...
-// Mais produit un Transient au lieu d un Persistent
-
-// Principe : a un objet de depart (cle), un Recognizer tente d'associer un
-// resultat. La classe Recognizer offre le mecanisme general gerant cela
-// Chaque classe particuliere (une fois definie l'instanciation) doit fournir
-// une methode specifique Eval, qui opere la correspondance
-// Eval considere l'objet par tous moyens appropries, et en cas de succes,
-// appelle SetOK(result) puis sort (return)
-// en cas d'echec, suite au retour d'Eval, Recognizer sait que SetOK n'a pas
-// ete appele
-
-Interface_Recognizer::Interface_Recognizer ()
- { hasnext = Standard_False; }
- //thekey.Nullify(); inutile, fait par le constructeur ...
-
- Standard_Boolean Interface_Recognizer::Evaluate
- (const TheKey& akey, Handle(TheResul)& res)
-{
- theres.Nullify();
- Eval(akey);
- if (!theres.IsNull()) {
- res = theres;
- return Standard_True;
- }
- else if (hasnext) return thenext->Evaluate(akey,res);
- return Standard_False;
-}
-
- Handle(TheResul) Interface_Recognizer::Result () const
-{
- if (!theres.IsNull()) return theres;
- if (hasnext) return thenext->Result();
- Standard_NoSuchObject::Raise ("Recognizer evaluation has failed");
- return theres; // pour calmer le compilateur
-}
-
- void Interface_Recognizer::Add (const Handle(Interface_Recognizer)& reco)
- { thenext = reco; hasnext = Standard_True; }
-
- void Interface_Recognizer::SetOK (const Handle(TheResul)& aresult)
- { theres = aresult; }
-
- void Interface_Recognizer::SetKO ()
- { theres.Nullify(); }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Interface_Recognizer_HeaderFile
+#define _Interface_Recognizer_HeaderFile
+
+#include <Standard_Transient.hxx>
+#include <Standard_NoSuchObject.hxx>
+
+
+template <class KeyType, class ResultType, class HandleType>
+class Interface_Recognizer : public Standard_Transient
+{
+private:
+ // Storing result of last evaluation
+ ResultType myRes;
+
+protected:
+ Standard_Boolean myHasNext;
+
+ // Managing compound definition
+ HandleType myNext;
+
+public:
+
+ Standard_EXPORT Standard_Boolean Evaluate (const KeyType& theKey,
+ ResultType& theRes)
+ {
+ myRes.Nullify();
+ Eval(theKey);
+ if (!myRes.IsNull())
+ {
+ theRes = myRes;
+ return Standard_True;
+ }
+ else if (myHasNext) return myNext->Evaluate(theKey, theRes);
+ return Standard_False;
+ }
+
+ Standard_EXPORT ResultType Result () const
+ {
+ if (!myRes.IsNull()) return myRes;
+ if (myHasNext) return myNext->Result();
+ Standard_NoSuchObject::Raise ("Recognizer evaluation has failed");
+ return myRes;
+ }
+
+ Standard_EXPORT void Add (const HandleType& theRecognizer)
+ {
+ myNext = theRecognizer;
+ myHasNext = Standard_True;
+ }
+protected:
+
+ Standard_EXPORT Interface_Recognizer ()
+ {
+ myHasNext = Standard_False;
+ }
+
+ Standard_EXPORT void SetOK (const ResultType& theResult)
+ {
+ myRes = theResult;
+ }
+ Standard_EXPORT void SetKO ()
+ {
+ myRes.Nullify();
+ }
+ Standard_EXPORT virtual void Eval(const KeyType& akey) = 0;
+};
+
+#endif
\ No newline at end of file
LibCtl.cdl
-LibCtl_GlobalNode.gxx
-LibCtl_Library.cdl
-LibCtl_Library.gxx
-LibCtl_Node.gxx
-LibCtl_ProtocolTemplate.cdl
+LibCtl_Library.hxx
+
+
is
- generic class Library,GlobalNode,Node;
- deferred generic class ProtocolTemplate; -- take it as a Template
+ imported Library;
end LibCtl;
+++ /dev/null
-// Copyright (c) 1998-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 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 <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)
-
-
-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)
-{
- if (themod == amodule) return;
- if (theprot == aprotocol) themod = amodule;
- else if (thenext.IsNull()) {
- if (themod.IsNull()) { themod = amodule; theprot = aprotocol; }
- else {
- thenext = new LibCtl_GlobalNode;
- thenext->Add (amodule,aprotocol);
- }
- }
- else thenext->Add (amodule,aprotocol);
-}
-
- const Handle(TheModule)& LibCtl_GlobalNode::Module () const
- { return themod; }
-
- const Handle(TheProtocol)& LibCtl_GlobalNode::Protocol () const
- { return theprot; }
-
- const Handle(LibCtl_GlobalNode)& LibCtl_GlobalNode::Next () const
- { return thenext; }
+++ /dev/null
--- Created on: 1993-01-29
--- 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 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.
-
-generic class Library from LibCtl
- (TheObject as any;
- TheModule as Transient;
- TheProtocol as Transient) -- must comply with Protocol template
-
- ---Purpose : Manages a list of Execution Modules attached to Protocols
- -- to perform a specific set of functionnalities.
- --
- -- Each instantiated class of Library has a global set a Modules.
- -- These Modules are put in this set before working, for instance
- -- by static construction (using method SetGlobal). One Module
- -- is bound which each Protocol (considered as a class).
- --
- -- To work, a Library is created by taking the Modules which
- -- comply with a Protocol (bound with its class and the classes
- -- of its Resources), given as parameter of its creation.
- --
- -- Thus, any tool can use it to get the suitable Modules
- ---Warning : The order of the Modules in the Library has assumed to be
- -- useless, and is not managed.
-
-raises NoSuchObject
-
- -- -- Nested class : Node of Module -- --
-
- private class GlobalNode inherits Transient
- ---Purpose : Manages a (possibly static) Global List of Modules bound to
- -- Protocols.
- -- Remark that it requires independance from Memory Management
- -- (because a Global List of Modules can be build through static
- -- declarations, i.e. before any sequential execution)
- -- Remark there will not be many many GlobalNodes created
-
- is
-
- Create returns mutable GlobalNode;
- ---Purpose : Creates an empty GlobalNode, with no Next
-
- Add (me : mutable; amodule : TheModule; aprotocol : TheProtocol)
- is static;
- ---Purpose : Adds a Module bound with a Protocol to the list : does
- -- 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
-
- Module (me) returns any TheModule is static;
- ---Purpose : Returns the Module stored in a given GlobalNode
- ---C++ : return const &
-
- Protocol (me) returns any TheProtocol is static;
- ---Purpose : Returns the attached Protocol stored in a given GlobalNode
- ---C++ : return const &
-
- Next (me) returns any GlobalNode is static;
- ---Purpose : Returns the Next GlobalNode. If none is defined, returned
- -- value is a Null Handle
- ---C++ : return const &
-
- fields
-
- themod : TheModule;
- theprot : TheProtocol;
- thenext : GlobalNode;
-
- end GlobalNode;
-
-
- private class Node inherits TShared
-
- ---Purpose : Manages a list of Modules for a Library (as an instance) :
- -- Designates a GlobalNode (couple Module-Protocol)
-
- is
-
- Create returns mutable Node;
- ---Purpose : Creates an empty Node, with no Next
-
- AddNode (me : mutable; anode : any GlobalNode) is static;
- ---Purpose : Adds a couple (Module,Protocol), that is, stores it into
- -- itself if not yet done, else creates a Next Node to do it
-
- Module (me) returns any TheModule is static;
- ---Purpose : Returns the Module designated by a precise Node
- ---C++ : return const &
-
- Protocol (me) returns any TheProtocol is static;
- ---Purpose : Returns the Protocol designated by a precise Node
- ---C++ : return const &
-
- Next (me) returns mutable Node is static;
- ---Purpose : Returns the Next Node. If none was defined, returned value
- -- is a Null Handle
- ---C++ : return const &
-
- fields
-
- thenode : GlobalNode;
- thenext : Node;
-
- end Node;
-
-
-is
-
- SetGlobal (myclass; amodule : TheModule; aprotocol : TheProtocol);
- ---Purpose : Adds a couple (Module-Protocol) into the global definition set
- -- for this class of Library.
-
- Create (aprotocol : TheProtocol) returns Library;
- ---Purpose : 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
-
- Create returns Library;
- ---Purpose : Creates an empty Library : it will later by filled by method
- -- AddProtocol
-
- AddProtocol (me : in out; aprotocol : Transient) is static;
- ---Purpose : 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)
-
- Clear (me : in out) is static;
- ---Purpose : 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)
-
- SetComplete (me : in out);
- ---Purpose : Sets a library to be defined with the complete Global list
- -- (all the couples Protocol/Modules recorded in it)
-
-
- Select (me; obj : any TheObject; module : out any TheModule; CN : out Integer)
- returns Boolean;
- ---Purpose : 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
- -- Number determined by the associated Protocol.
- -- If Select has failed, <module> is Null Handle and CN is zero.
- -- (Select can work on any criterium, such as Object DynamicType)
-
-
- Start (me : in out) is static;
- ---Purpose : Starts Iteration on the Modules (sets it on the first one)
-
- More (me) returns Boolean is static;
- ---Purpose : Returns True if there are more Modules to iterate on
-
- Next (me : in out) is static;
- ---Purpose : Iterates by getting the next Module in the list
- -- If there is none, the exception will be raised by Value
-
- Module (me) returns any TheModule
- ---Purpose : Returns the current Module in the Iteration
- raises NoSuchObject is static;
- -- Error if there is no current Module to iterate on
- ---C++ : return const &
-
- Protocol (me) returns any TheProtocol
- ---Purpose : Returns the current Protocol in the Iteration
- raises NoSuchObject is static;
- -- Error if there is no current Protocol to iterate on
- ---C++ : return const &
-
-fields
-
- thelist : Node;
- thecurr : Node; -- for iteration
- -- there are also "class variables" which describe global set
-
-end Library;
+++ /dev/null
-// Copyright (c) 1998-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 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 <LibCtl_Library.ixx>
-#include <Standard_NoSuchObject.hxx>
-
-
-// Liste Globale des Modules, dans laquelle on va se servir
-
-static Handle(LibCtl_GlobalNode) theglobal;
-
-// Donnees pour optimisation (dernier Protocole demande)
-
-static Handle(TheProtocol) theprotocol;
-static Handle(LibCtl_Node) thelast;
-
-
-// Alimentation de la liste globale
-// 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)
-{
- if (theglobal.IsNull()) theglobal = new LibCtl_GlobalNode;
- theglobal->Add(amodule,aprotocol);
-}
-
-// Constructeur d apres Protocole
- LibCtl_Library::LibCtl_Library (const Handle(TheProtocol)& aprotocol)
-{
- Standard_Boolean last = Standard_False;
- if (aprotocol.IsNull()) return; // PAS de protocole = Lib VIDE
- if (!theprotocol.IsNull()) last =
- (theprotocol == aprotocol);
-
- if (last) thelist = thelast;
-// Si Pas d optimisation disponible : construire la liste
- else {
- AddProtocol(aprotocol);
-// Ceci definit l optimisation (pour la fois suivante)
- thelast = thelist;
- theprotocol = aprotocol;
- }
-}
-
-// Constructeur vide
- LibCtl_Library::LibCtl_Library () { }
-
-
-// Ajout d un Protocol : attention, desoptimise (sinon risque de confusion !)
- void LibCtl_Library::AddProtocol
- (const Handle(Standard_Transient)& 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;
-
-// 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();
- if (!protocol.IsNull()) {
-// Match Protocol ?
- if (protocol->DynamicType() == aprotocol->DynamicType()) {
- if (thelist.IsNull()) thelist = new LibCtl_Node;
- thelist->AddNode(curr);
- break; // UN SEUL MODULE PAR PROTOCOLE
- }
- }
- curr = curr->Next(); // cette formule est refusee dans "for"
- }
-// Ensuite, Traiter les ressources
- Standard_Integer nb = aproto->NbResources();
- for (Standard_Integer i = 1; i <= nb; i ++) {
- AddProtocol (aproto->Resource(i));
- }
-// Ne pas oublier de desoptimiser
- theprotocol.Nullify();
- thelast.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)
-
- Standard_Boolean LibCtl_Library::Select
- (const TheObject& obj,
- Handle(TheModule)& module, Standard_Integer& CN) const
-{
- module.Nullify(); CN = 0; // Reponse "pas trouve"
- 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();
- if (!protocol.IsNull()) {
- CN = protocol->CaseNumber(obj);
- if (CN > 0) {
- module = curr->Module();
- return Standard_True;
- }
- }
- curr = curr->Next(); // cette formule est refusee dans "for"
- }
- return Standard_False; // ici, pas trouce
-}
-
-
-// .... Iteration ....
-
- void LibCtl_Library::Start ()
- { thecurr = thelist; }
-
- Standard_Boolean LibCtl_Library::More () const
- { return (!thecurr.IsNull()); }
-
- void LibCtl_Library::Next ()
- { if (!thecurr.IsNull()) thecurr = thecurr->Next(); }
-
- const Handle(TheModule)& LibCtl_Library::Module () const
-{
- if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl");
- return thecurr->Module();
-}
-
- const Handle(TheProtocol)& LibCtl_Library::Protocol () const
-{
- if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl");
- return thecurr->Protocol();
-}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _LibCtl_Library_HeaderFile
+#define _LibCtl_Library_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_NoSuchObject.hxx>
+#include <NCollection_Handle.hxx>
+
+template <class ModuleType, class ProtocolType> class LibCtl_GlobalNode;
+
+//! Manages a list of Modules for a Library (as an instance) :
+//! Designates a GlobalNode (couple Module-Protocol)
+template <class ModuleType, class ProtocolType>
+class LibCtl_Node
+{
+private:
+
+ NCollection_Handle < LibCtl_GlobalNode<ModuleType, ProtocolType> > myNode;
+ NCollection_Handle < LibCtl_Node > myNext;
+
+public:
+
+ Standard_EXPORT LibCtl_Node ();
+ Standard_EXPORT void AddNode (const NCollection_Handle< LibCtl_GlobalNode<ModuleType, ProtocolType> >& theNode);
+ Standard_EXPORT const ModuleType& Module () const;
+ Standard_EXPORT const ProtocolType& Protocol () const;
+ Standard_EXPORT const NCollection_Handle< LibCtl_Node >& Next () const;
+};
+
+//! Creates an empty Node, with no Next
+template<class ModuleType, class ProtocolType>
+LibCtl_Node<ModuleType,ProtocolType>
+::LibCtl_Node () { }
+
+//! Adds a couple (Module,Protocol), that is, stores it into
+//! itself if not yet done, else creates a Next Node to do it.
+template<class ModuleType, class ProtocolType>
+void LibCtl_Node<ModuleType,ProtocolType>::AddNode (const NCollection_Handle< LibCtl_GlobalNode<ModuleType, ProtocolType> >& theNode)
+{
+ if (myNode == theNode) return;
+ if (myNext.IsNull()) {
+ if (myNode.IsNull()) myNode = theNode;
+ else {
+ myNext = new LibCtl_Node;
+ myNext->AddNode (theNode);
+ }
+ }
+ else myNext->AddNode (theNode);
+}
+
+//! Returns the Module designated by a precise Node.
+template<class ModuleType, class ProtocolType>
+const ModuleType& LibCtl_Node<ModuleType,ProtocolType>::Module () const
+{
+ return myNode->Module();
+}
+
+//! Returns the Protocol designated by a precise Node.
+template<class ModuleType, class ProtocolType>
+const ProtocolType& LibCtl_Node<ModuleType,ProtocolType>::Protocol () const
+{
+ return myNode->Protocol();
+}
+
+//! Returns the next Node.
+//! If none was defined, returned value is a null handle.
+template<class ModuleType, class ProtocolType>
+const NCollection_Handle< LibCtl_Node<ModuleType,ProtocolType> >& LibCtl_Node<ModuleType,ProtocolType>::Next () const
+{
+ return myNext;
+}
+
+//! Manages a (possibly static) Global List of Modules bound to protocols.
+//! Remark that it requires independance from Memory Management
+//! (because a Global List of Modules can be build through static
+//! declarations, i.e. before any sequential execution)
+//! Remark there will not be many many GlobalNodes created
+template<class ModuleType, class ProtocolType>
+class LibCtl_GlobalNode
+{
+private:
+ ModuleType myMod;
+ ProtocolType myProt;
+ NCollection_Handle <LibCtl_GlobalNode> myNext;
+public:
+ Standard_EXPORT LibCtl_GlobalNode ();
+ Standard_EXPORT void Add (const ModuleType& theModule, const ProtocolType& theProtocol);
+ Standard_EXPORT const ModuleType& Module () const;
+ Standard_EXPORT const ProtocolType& Protocol () const;
+ Standard_EXPORT const NCollection_Handle <LibCtl_GlobalNode >& Next () const;
+};
+
+//! Creates an empty GlobalNode, with no Next
+template<class ModuleType, class ProtocolType>
+LibCtl_GlobalNode<ModuleType,ProtocolType>
+::LibCtl_GlobalNode () { }
+
+//! Adds a Module bound with a Protocol to the list : does
+//! 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.
+template<class ModuleType, class ProtocolType>
+void LibCtl_GlobalNode <ModuleType,ProtocolType>::Add
+(const ModuleType& theModule, const ProtocolType& theProtocol)
+{
+ if (myMod == theModule) return;
+ if (myProt == theProtocol) myMod = theModule;
+ else if (myNext.IsNull())
+ {
+ if (myMod.IsNull())
+ {
+ myMod = theModule;
+ myProt = theProtocol;
+ }
+ else
+ {
+ myNext = new LibCtl_GlobalNode;
+ myNext->Add (theModule,theProtocol);
+ }
+ }
+ else myNext->Add (theModule,theProtocol);
+}
+
+//! Returns the Module stored in a given GlobalNode.
+template<class ModuleType, class ProtocolType>
+const ModuleType& LibCtl_GlobalNode <ModuleType,ProtocolType>::Module () const
+{
+ return myMod;
+}
+
+//! Returns the attached Protocol stored in a given GlobalNode.
+template<class ModuleType, class ProtocolType>
+const ProtocolType& LibCtl_GlobalNode <ModuleType,ProtocolType>::Protocol () const
+{
+ return myProt;
+}
+
+//! Returns the next GlobalNode.
+//! If none is defined, returned value is a null handle.
+template<class ModuleType, class ProtocolType>
+const NCollection_Handle <LibCtl_GlobalNode<ModuleType,ProtocolType> >&
+LibCtl_GlobalNode <ModuleType,ProtocolType>::Next () const
+{
+ return myNext;
+}
+
+// Library
+//! Manages a list of Execution Modules attached to Protocols
+//! to perform a specific set of functionnalities.
+//!
+//! Each instantiated class of Library has a global set a Modules.
+//! These Modules are put in this set before working, for instance
+//! by static construction (using method SetGlobal). One Module
+//! is bound which each Protocol (considered as a class).
+//!
+//! To work, a Library is created by taking the Modules which
+//! comply with a Protocol (bound with its class and the classes
+//! of its Resources), given as parameter of its creation.
+//!
+//! Thus, any tool can use it to get the suitable Modules
+//! Warning : The order of the Modules in the Library has assumed to be
+//! useless, and is not managed.
+template <class ObjectType, class ModuleType, class ProtocolType>
+class LibCtl_Library
+{
+public:
+ // Basic data for optimization (Protocol last request)
+ static ProtocolType myProtocol;
+ static NCollection_Handle< LibCtl_Node<ModuleType, ProtocolType> > myLast;
+
+ DEFINE_STANDARD_ALLOC
+
+private:
+ NCollection_Handle< LibCtl_Node<ModuleType, ProtocolType> > myList;
+ NCollection_Handle< LibCtl_Node<ModuleType, ProtocolType> > myCurr;
+public:
+
+ //! Gets global list of modules
+ static NCollection_Handle< LibCtl_GlobalNode<ModuleType, ProtocolType> >& GetGlobal();
+
+ //! Supply the global list
+ Standard_EXPORT static void SetGlobal (const ModuleType& theModule, const ProtocolType& theProtocol)
+ {
+ if (GetGlobal().IsNull()) GetGlobal() = new LibCtl_GlobalNode<ModuleType, ProtocolType>;
+ GetGlobal()->Add(theModule,theProtocol);
+ }
+
+ Standard_EXPORT LibCtl_Library (const ProtocolType& theProtocol)
+ {
+ Standard_Boolean last = Standard_False;
+ // No protocol = empty library
+ if (theProtocol.IsNull()) return;
+ if (!myProtocol.IsNull()) last =
+ (myProtocol == theProtocol);
+
+ if (last)
+ myList = myLast;
+ // If no optimization available: list building
+ else
+ {
+ AddProtocol(theProtocol);
+ // This defines the optimization (for the next time)
+ myLast = myList;
+ myProtocol = theProtocol;
+ }
+ }
+
+ Standard_EXPORT LibCtl_Library ()
+ { }
+
+ //! Add a Protocol: attention: it is desoptimise (if not confusion!)
+ Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& theProtocol)
+ {
+ // Downcast as Protocol-> Resources, and even redefined to use in other
+ // Library must always return the type highest
+ ProtocolType aProtocol = ProtocolType::DownCast(theProtocol);
+ if (aProtocol.IsNull()) return;
+
+ NCollection_Handle< LibCtl_GlobalNode<ModuleType, ProtocolType> > curr;
+ for (curr = GetGlobal(); !curr.IsNull(); )
+ {
+ const ProtocolType& aProtocol = curr->Protocol();
+ if (!aProtocol.IsNull())
+ {
+ // Match Protocol ?
+ if (aProtocol->DynamicType() == theProtocol->DynamicType())
+ {
+ if (myList.IsNull())
+ myList = new LibCtl_Node<ModuleType, ProtocolType>;
+
+ myList->AddNode(curr);
+ break; // UN SEUL MODULE PAR PROTOCOLE
+ }
+ }
+ curr = curr->Next();
+ }
+ // Treat resources
+ Standard_Integer nb = aProtocol->NbResources();
+ for (Standard_Integer i = 1; i <= nb; i++)
+ {
+ AddProtocol (aProtocol->Resource(i));
+ }
+
+ myProtocol.Nullify();
+ myLast.Nullify();
+ }
+
+ Standard_EXPORT void Clear ()
+ {
+ myList = new LibCtl_Node <ModuleType, ProtocolType>;
+ }
+
+ Standard_EXPORT void SetComplete ()
+ {
+ myList = new LibCtl_Node <ModuleType, ProtocolType>;
+ // Take each of the protocols of the Global list
+ NCollection_Handle< LibCtl_GlobalNode<ModuleType, ProtocolType> > curr;
+ for (curr = GetGlobal(); !curr.IsNull(); )
+ {
+ const ProtocolType& aProtocol = curr->Protocol();
+ // As we take all , it is not preoccupied resources
+ if (!aProtocol.IsNull()) myList->AddNode(curr);
+ curr = curr->Next();
+ }
+ }
+
+ //! Selection: the corresponding theModule is returned to a Type
+ //! (as well as CaseNumber returns the corresponding protocol)
+ Standard_EXPORT Standard_Boolean Select (const ObjectType& theObj,
+ ModuleType& theModule,
+ Standard_Integer& theCN) const
+ {
+ // Reponse: "not found"
+ theModule.Nullify(); theCN = 0;
+ if (myList.IsNull())
+ return Standard_False;
+ NCollection_Handle< LibCtl_Node<ModuleType, ProtocolType> > curr = myList;
+ for (curr = myList; !curr.IsNull(); )
+ {
+ const ProtocolType& aProtocol = curr->Protocol();
+ if (!aProtocol.IsNull())
+ {
+ theCN = aProtocol->CaseNumber(theObj);
+ if (theCN > 0)
+ {
+ theModule = curr->Module();
+ return Standard_True;
+ }
+ }
+ curr = curr->Next();
+ }
+ return Standard_False;
+ }
+
+ //! Initialization for iteration through the library
+ Standard_EXPORT void Start ()
+ {
+ myCurr = myList;
+ }
+
+ Standard_EXPORT Standard_Boolean More () const
+ {
+ return (!myCurr.IsNull());
+ }
+
+ Standard_EXPORT void Next ()
+ {
+ if (!myCurr.IsNull())
+ myCurr = myCurr->Next();
+ }
+
+ Standard_EXPORT const ModuleType& Module () const
+ {
+ if (myCurr.IsNull())
+ Standard_NoSuchObject::Raise("Library from LibCtl");
+ return myCurr->Module();
+ }
+
+ Standard_EXPORT const ProtocolType& Protocol () const
+ {
+ if (myCurr.IsNull())
+ Standard_NoSuchObject::Raise("Library from LibCtl");
+ return myCurr->Protocol();
+ }
+};
+
+//! Basic data for optimization (Protocol last request)
+template <class ObjectType, class ModuleType, class ProtocolType>
+ProtocolType LibCtl_Library<ObjectType, ModuleType, ProtocolType>::myProtocol;
+
+template <class ObjectType, class ModuleType, class ProtocolType>
+NCollection_Handle <LibCtl_Node <ModuleType, ProtocolType> >
+LibCtl_Library<ObjectType, ModuleType, ProtocolType>::myLast;
+
+#endif
+++ /dev/null
-// Copyright (c) 1998-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 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 <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)
-
-LibCtl_Node::LibCtl_Node () { }
-
- void LibCtl_Node::AddNode (const Handle(LibCtl_GlobalNode)& anode)
-{
- if (thenode == anode) return;
- if (thenext.IsNull()) {
- if (thenode.IsNull()) thenode = anode;
- else {
- thenext = new LibCtl_Node;
- thenext->AddNode (anode);
- }
- }
- else thenext->AddNode (anode);
-}
-
-
- const Handle(TheModule)& LibCtl_Node::Module () const
- { return thenode->Module(); }
-
- const Handle(TheProtocol)& LibCtl_Node::Protocol () const
- { return thenode->Protocol(); }
-
- const Handle(LibCtl_Node)& LibCtl_Node::Next () const
- { return thenext; }
+++ /dev/null
--- Created on: 1993-03-17
--- 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 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.
-
-deferred generic class ProtocolTemplate from LibCtl
- (TheObject as any)
- inherits Transient
-
- ---Purpose : This class is a Template class for Library : there is no
- -- obligation to inherit it for instantiate a Library class.
- --
- -- A Protocol class defines a data scheme by gathering a set of
- -- Object Classes. This set is made of :
- -- - As necessary, other sets already defined by other Protocols.
- -- These Protocols are the Resources of <myclass>
- -- This definition can be recurrent : each Protocol class
- -- defines its Resources at immediate level
- -- - The list of Object Classes it identifies DIRECTLY (itself),
- -- i.e. not through its Resources.
- --
- -- A classic Selection criterium is DynamicType (for a Transient
- -- or Persistent Object), this gives a Case Number per Class. If
- -- another criterium is taken, it must assume unique and non-
- -- ambiguous binding between an object state and a Cse Number.
- --
- -- For each Object Class (or recognized state) it identifies
- -- directly, it provides a unique positive Number, which can be
- -- used as Case Number.
- --
- -- A Module bound with a Protocol class is assumed to accept any
- -- Object of a Class it defines DIRECTLY (not its Resources).
-
-uses Type
-
-is
-
- NbResources (me) returns Integer is deferred;
- ---Purpose : Gives the count of Protocols used as Resource (can be zero)
-
- Resource (me; num : Integer) returns ProtocolTemplate is deferred;
- ---Purpose : Returns a Resource, given a rank.
-
- CaseNumber (me; obj : any TheObject) returns Integer is deferred;
- ---Purpose : Returns a Case Number, specific of each recognized Object
- -- This is a positive number. Zero means "<obj> not recognized"
-
-end ProtocolTemplate;
+++ /dev/null
-// Copyright (c) 1998-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 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.
Message, Dico, OSD
is
-
- -- Element, generic Elem, and instance for Transient
- class DataInfo; -- used in Elem : this one is for Transient
deferred class Element;
- generic class Elem;
- class TransientElem instantiates Elem
- (Transient, MapTransientHasher from TColStd, DataInfo);
class ElemHasher;
-
-
+
class IntVal;
class RealVal;
class AttrList;
+++ /dev/null
--- Created on: 1996-09-04
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class DataInfo from MoniTool
-
- ---Purpose : Gives informations on an object
- -- Used as template to instantiate Elem, etc
- -- This class is for Transient
-
-uses CString, Transient, Type
-
-is
-
- Type (myclass; ent : Transient) returns Type;
- ---Purpose : Returns the Type attached to an object
- -- Here, the Dynamic Type of a Transient. Null Type if unknown
-
- TypeName (myclass; ent : Transient) returns CString;
- ---Purpose : Returns Type Name (string)
- -- Allows to name type of non-handled objects
-
-end DataInfo;
+++ /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 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 <MoniTool_DataInfo.ixx>
-
-Handle(Standard_Type) MoniTool_DataInfo::Type
- (const Handle(Standard_Transient)& ent)
- { return ent->DynamicType(); }
-
- Standard_CString MoniTool_DataInfo::TypeName
- (const Handle(Standard_Transient)& ent)
- { return ent->DynamicType()->Name(); }
+++ /dev/null
--- Created on: 1994-11-04
--- Created by: Christian CAILLET
--- 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 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.
-
-generic class Elem from MoniTool
- (TheKey as any;
- TheHasher as any;
- TheInfo as any)
- inherits Element
-
- ---Purpose : an Elem defines an Element for a specific input class
- -- its definition includes the value of the Key to be mapped,
- -- and the HashCoder associated to the class of the Key
- --
- -- TheKey defines the class to be keyed
- -- TheHasher is the associated Hasher
- -- TheInfo is an additionnal class which helps to provide
- -- informations on the value (template : see DataInfo)
-
-uses CString
-
-is
-
- Create (akey : any TheKey) returns mutable Elem;
- ---Purpose : Creates a Elem with a Value. This Value can then not be
- -- changed. It is used by the Hasher to compute the HashCode,
- -- which will then be stored for an immediate reading.
-
- Value (me) returns any TheKey is static;
- ---Purpose : Returns the contained value
- ---C++ : return const &
-
- Equates (me; other : Element) returns Boolean;
- ---Purpose : Specific testof equallity : defined as False if <other> has
- -- not the same true Type, else contents are compared (by
- -- C++ operator ==)
-
- ValueType (me) returns Type is redefined;
- ---Purpose : Returns the Type of the Value. By default, returns the
- -- DynamicType of <me>, but can be redefined
-
- ValueTypeName (me) returns CString is redefined;
- ---Purpose : Returns the name of the Type of the Value. Default is name
- -- of ValueType, unless it is for a non-handled object
-
-fields
-
- theval : TheKey;
-
-end Elem;
+++ /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 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 <MoniTool_Elem.ixx>
-#include <Standard_Integer.hxx>
-
-
-MoniTool_Elem::MoniTool_Elem (const TheKey& akey)
- : theval (akey)
-{ SetHashCode ( TheHasher::HashCode (akey, IntegerLast() ) ); }
-
-
- const TheKey& MoniTool_Elem::Value () const
- { return theval; }
-
- Standard_Boolean MoniTool_Elem::Equates
- (const Handle(MoniTool_Element)& other) const
-{
- if (other.IsNull()) return Standard_False;
- if (GetHashCode() != other->GetHashCode()) return Standard_False;
- if (other->DynamicType() != DynamicType()) return Standard_False;
- Handle(MoniTool_Elem) another = Handle(MoniTool_Elem)::DownCast(other);
-// return (theval == another->Value());
- return TheHasher::IsEqual (theval,another->Value());
-}
-
- Handle(Standard_Type) MoniTool_Elem::ValueType () const
- { return TheInfo::Type(theval); }
-
- Standard_CString MoniTool_Elem::ValueTypeName () const
- { return TheInfo::TypeName(theval); }
--- /dev/null
+STEPCAFControl_ActorWrite.hxx
+STEPCAFControl_ActorWrite.cxx
+STEPCAFControl_Writer.hxx
+STEPCAFControl_Writer.cxx
+STEPCAFControl_Reader.hxx
+STEPCAFControl_Reader.cxx
+STEPCAFControl_Controller.hxx
+STEPCAFControl_Controller.cxx
is
- class Reader;
+ imported Reader;
---Purpose: Reader for DECAF documents
- class Writer;
+ imported Writer;
---Purpose: Writer for DECAF documents
class ExternFile;
---Purpose: Auxiliary class to store results of translation of external file
- class ActorWrite;
- class Controller;
+ imported ActorWrite;
+ imported Controller;
---Purpose: Extensions of standard STEP tools for DECAF specifics
class DictionaryOfExternFile instantiates
+++ /dev/null
--- Created on: 2000-10-05
--- Created by: Andrey BETENEV
--- Copyright (c) 2000-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 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.
-
-class ActorWrite from STEPCAFControl inherits ActorWrite from STEPControl
-
- ---Purpose: Extends ActorWrite from STEPControl by analysis of
- -- whether shape is assembly (based on information from DECAF)
-
-uses
- Shape from TopoDS,
- MapOfShape from TopTools
-
-is
-
- Create returns mutable ActorWrite;
-
- IsAssembly (me; S: in out Shape from TopoDS) returns Boolean is redefined;
- ---Purpose: Check whether shape S is assembly
- -- Returns True if shape is registered in assemblies map
-
- SetStdMode (me: mutable; stdmode: Boolean = Standard_True);
- ---Purpose: Set standard mode of work
- -- In standard mode Actor (default) behaves exactly as its
- -- ancestor, also map is cleared
-
- ClearMap (me: mutable);
- ---Purpose: Clears map of shapes registered as assemblies
-
- RegisterAssembly (me: mutable; S: Shape from TopoDS);
- ---Purpose: Registers shape to be written as assembly
- -- The shape should be TopoDS_Compound (else does nothing)
-
-fields
-
- myStdMode: Boolean;
- myMap: MapOfShape from TopTools;
-
-end ActorWrite;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <STEPCAFControl_ActorWrite.ixx>
+#include <STEPCAFControl_ActorWrite.hxx>
+#include <Standard_Type.hxx>
+#include <TopoDS_Shape.hxx>
+
+IMPLEMENT_STANDARD_TYPE(STEPCAFControl_ActorWrite)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(STEPControl_ActorWrite),
+ STANDARD_TYPE(Transfer_ActorOfFinderProcess),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(STEPCAFControl_ActorWrite)
+
+
+IMPLEMENT_DOWNCAST(STEPCAFControl_ActorWrite,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(STEPCAFControl_ActorWrite)
//=======================================================================
//function : STEPCAFControl_ActorWrite
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPCAFControl_ActorWrite_HeaderFile
+#define _STEPCAFControl_ActorWrite_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <STEPControl_ActorWrite.hxx>
+
+class TopoDS_Shape;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(STEPControl_ActorWrite);
+class STEPCAFControl_ActorWrite;
+
+DEFINE_STANDARD_HANDLE(STEPCAFControl_ActorWrite,STEPControl_ActorWrite)
+
+
+//! Extends ActorWrite from STEPControl by analysis of <br>
+//! whether shape is assembly (based on information from DECAF) <br>
+class STEPCAFControl_ActorWrite : public STEPControl_ActorWrite
+{
+
+public:
+
+ Standard_EXPORT STEPCAFControl_ActorWrite();
+
+ //! Check whether shape S is assembly <br>
+ //! Returns True if shape is registered in assemblies map <br>
+ Standard_EXPORT virtual Standard_Boolean IsAssembly(TopoDS_Shape& S) const;
+
+ //! Set standard mode of work <br>
+ //! In standard mode Actor (default) behaves exactly as its <br>
+ //! ancestor, also map is cleared <br>
+ Standard_EXPORT void SetStdMode(const Standard_Boolean stdmode = Standard_True);
+
+ //! Clears map of shapes registered as assemblies <br>
+ Standard_EXPORT void ClearMap();
+
+ //! Registers shape to be written as assembly <br>
+ //! The shape should be TopoDS_Compound (else does nothing) <br>
+ Standard_EXPORT void RegisterAssembly(const TopoDS_Shape& S);
+
+ DEFINE_STANDARD_RTTI(STEPCAFControl_ActorWrite)
+
+private:
+
+ Standard_Boolean myStdMode;
+ TopTools_MapOfShape myMap;
+};
+#endif
+++ /dev/null
--- Created on: 2000-10-05
--- Created by: Andrey BETENEV
--- Copyright (c) 2000-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 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.
-
-class Controller from STEPCAFControl inherits Controller from STEPControl
-
- ---Purpose: Extends Controller from STEPControl in order to provide
- -- ActorWrite adapted for writing assemblies from DECAF
- -- Note that ActorRead from STEPControl is used for reading
- -- (inherited automatically)
-
-uses
- ActorWrite from STEPCAFControl
-
-is
-
- Create returns mutable Controller;
- ---Purpose : Initializes the use of STEP Norm (the first time)
-
- Init (myclass) returns Boolean;
- ---Purpose : Standard Initialisation. It creates a Controller for STEP-XCAF
- -- and records it to various names, available to select it later
- -- Returns True when done, False if could not be done
-
-end Controller;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <STEPCAFControl_Controller.ixx>
+#include <STEPCAFControl_Controller.hxx>
#include <STEPCAFControl_ActorWrite.hxx>
#include <XSAlgo.hxx>
#include <Interface_Static.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(STEPCAFControl_Controller)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(STEPControl_Controller),
+ STANDARD_TYPE(XSControl_Controller),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(STEPCAFControl_Controller)
+
+
+IMPLEMENT_DOWNCAST(STEPCAFControl_Controller,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(STEPCAFControl_Controller)
+
//=======================================================================
//function : STEPCAFControl_Controller
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPCAFControl_Controller_HeaderFile
+#define _STEPCAFControl_Controller_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <STEPControl_Controller.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(STEPControl_Controller);
+class STEPCAFControl_Controller;
+
+DEFINE_STANDARD_HANDLE(STEPCAFControl_Controller,STEPControl_Controller)
+
+//! Extends Controller from STEPControl in order to provide <br>
+//! ActorWrite adapted for writing assemblies from DECAF <br>
+//! Note that ActorRead from STEPControl is used for reading <br>
+//! (inherited automatically) <br>
+class STEPCAFControl_Controller : public STEPControl_Controller
+{
+
+public:
+
+ //! Initializes the use of STEP Norm (the first time) <br>
+ Standard_EXPORT STEPCAFControl_Controller();
+
+ //! Standard Initialisation. It creates a Controller for STEP-XCAF <br>
+ //! and records it to various names, available to select it later <br>
+ //! Returns True when done, False if could not be done <br>
+ Standard_EXPORT static Standard_Boolean Init() ;
+
+ DEFINE_STANDARD_RTTI(STEPCAFControl_Controller)
+};
+#endif
uses
HAsciiString from TCollection,
ReturnStatus from IFSelect,
- WorkSession from XSControl,
+ WorkSession_Handle from XSControl,
Shape from TopoDS,
Label from TDF
Create returns ExternFile;
---Purpose: Creates an empty structure
- SetWS (me: mutable; WS: WorkSession from XSControl);
+ SetWS (me: mutable; WS: WorkSession_Handle from XSControl);
---C++: inline
- GetWS (me) returns WorkSession from XSControl;
+ GetWS (me) returns WorkSession_Handle from XSControl;
---C++: inline
SetLoadStatus (me: mutable; stat: ReturnStatus from IFSelect);
fields
- myWS : WorkSession from XSControl;
+ myWS : WorkSession_Handle from XSControl;
myLoadStatus: ReturnStatus from IFSelect;
myTransferStatus: Boolean;
+++ /dev/null
--- Created on: 2000-08-15
--- Created by: Andrey BETENEV
--- Copyright (c) 2000-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 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.
-
-class Reader from STEPCAFControl
--- inherits Reader from STEPControl
-
- ---Purpose: Provides a tool to read STEP file and put it into
- -- DECAF document. Besides transfer of shapes (including
- -- assemblies) provided by STEPControl, supports also
- -- colors and part names
- --
- -- This reader supports reading files with external references
- -- i.e. multifile reading
- -- It behaves as usual Reader (from STEPControl) for the main
- -- file (e.g. if it is single file)
- -- Results of reading other files can be accessed by name of the
- -- file or by iterating on a readers
-
-uses
- AsciiString from TCollection,
- WorkSession from XSControl,
- ReturnStatus from IFSelect,
- Shape from TopoDS,
- Document from TDocStd,
- Reader from STEPControl,
- NextAssemblyUsageOccurrence from StepRepr,
- DictionaryOfExternFile from STEPCAFControl,
- ExternFile from STEPCAFControl,
- ExternRefs from STEPConstruct,
- Tool from STEPConstruct,
- DataMapOfShapePD from STEPCAFControl,
- DataMapOfPDExternFile from STEPCAFControl,
- DataMapOfShapeLabel from XCAFDoc,
- MapOfShape from TopTools,
- ShapeTool from XCAFDoc,
- Label from TDF,
- LabelSequence from TDF,
- HSequenceOfTransient from TColStd,
- RepresentationItem from StepRepr,
- TransientProcess from Transfer,
- ConnectedFaceSet from StepShape
-
-is
-
- Create returns Reader;
- ---Purpose: Creates a reader with an empty
--- STEP model and sets ColorMode, LayerMode, NameMode and
--- PropsMode to Standard_True.
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Reader;
- ---Purpose: Creates a reader tool and attaches it to an already existing Session
- -- Clears the session if it was not yet set for STEP
-
- Init (me: in out; WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True);
- ---Purpose: Clears the internal data structures and attaches to a new session
- -- Clears the session if it was not yet set for STEP
-
- ReadFile (me : in out; filename : CString)
- returns ReturnStatus from IFSelect;
- ---Purpose: Loads a file and returns the read status
- -- Provided for use like single-file reader
-
- NbRootsForTransfer (me: in out) returns Integer;
- ---Purpose: Returns number of roots recognized for transfer
- -- Shortcut for Reader().NbRootsForTransfer()
-
- TransferOneRoot (me: in out; num: Integer; doc: in out Document from TDocStd)
- returns Boolean;
- ---Purpose: Translates currently loaded STEP file into the document
- -- Returns True if succeeded, and False in case of fail
- -- Provided for use like single-file reader
-
- Transfer (me: in out; doc: in out Document from TDocStd)
- returns Boolean;
- ---Purpose: Translates currently loaded STEP file into the document
- -- Returns True if succeeded, and False in case of fail
- -- Provided for use like single-file reader
-
- Perform (me: in out; filename: AsciiString from TCollection;
- doc: in out Document from TDocStd) returns Boolean;
-
- Perform (me: in out; filename: CString; doc: in out Document from TDocStd)
- returns Boolean;
- ---Purpose: Translate STEP file given by filename into the document
- -- Return True if succeeded, and False in case of fail
-
- ---Scope: Access to fields
-
- ExternFiles (me) returns DictionaryOfExternFile from STEPCAFControl;
- ---Purpose: Returns data on external files
- -- Returns Null handle if no external files are read
- ---C++: return const &
-
- ExternFile (me; name: CString; ef: out ExternFile from STEPCAFControl)
- returns Boolean;
- ---Purpose: Returns data on external file by its name
- -- Returns False if no external file with given name is read
-
- ChangeReader (me: in out) returns Reader from STEPControl;
- ---Purpose: Returns basic reader
- ---C++: return &
-
- Reader (me) returns Reader from STEPControl;
- ---Purpose: Returns basic reader as const
- ---C++: return const &
-
- ---Scope: Internal methods
-
- Transfer (me: in out; rd: in out Reader from STEPControl;
- num: Integer;
- doc: in out Document from TDocStd;
- Lseq: out LabelSequence from TDF;
- asOne: Boolean = Standard_False)
- returns Boolean is protected;
- ---Purpose: Translates STEP file already loaded into the reader
- -- into the document
- -- If num==0, translates all roots, else only root number num
- -- Returns True if succeeded, and False in case of fail
- -- If asOne is True, in case of multiple results composes
- -- them into assembly. Fills sequence of produced labels
-
- AddShape (me; S: Shape from TopoDS; STool: ShapeTool from XCAFDoc;
- NewShapesMap : MapOfShape from TopTools;
- ShapePDMap: DataMapOfShapePD from STEPCAFControl;
- PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
- ShapeLabelMap: in out DataMapOfShapeLabel from XCAFDoc)
- returns Label from TDF is protected;
- ---Purpose: Add a shape to a document
- -- Depending on a case, this shape can be added as one, or
- -- as assembly, or (in case if it is associated with external
- -- reference) taken as that referred shape
-
- ReadExternFile (me: in out; file, fullpath: CString; doc: in out Document from TDocStd)
- returns ExternFile from STEPCAFControl is protected;
- ---Purpose: Reads (or if returns already read) extern file with
- -- given name
-
- ReadColors (me; WS: WorkSession from XSControl;
- doc: in out Document from TDocStd;
- PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
- ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
- returns Boolean is protected;
- ---Purpose: Reads style assignments from STEP model and sets
- -- corresponding color assignments in the DECAF document
-
- ReadNames (me; WS: WorkSession from XSControl;
- doc: in out Document from TDocStd;
- PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
- ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
- returns Boolean is protected;
- ---Purpose: Reads names of parts defined in the STEP model and
- -- assigns them to corresponding labels in the DECAF document
-
- ReadValProps (me; WS: WorkSession from XSControl;
- doc: in out Document from TDocStd;
- PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
- ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
- returns Boolean is protected;
- ---Purpose: Reads validation properties assigned to shapes in the STEP
- -- model and assigns them to corresponding labels in the DECAF
- -- document
-
- ReadLayers (me; WS: WorkSession from XSControl;
- doc: in out Document from TDocStd)
- returns Boolean is protected;
- ---Purpose: Reads layers of parts defined in the STEP model and
- -- set reference between shape and layers in the DECAF document
-
- ReadSHUOs (me; WS: WorkSession from XSControl;
- doc: in out Document from TDocStd;
- PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
- ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
- returns Boolean is protected;
- ---Purpose: Reads SHUO for instances defined in the STEP model and
- -- set reference between shape instances from different assemblyes
-
- ReadGDTs (me; WS: WorkSession from XSControl;
- doc: in out Document from TDocStd)
- returns Boolean is protected;
- ---Purpose: Reads D> for instances defined in the STEP model and
- -- set reference between shape instances from different assemblyes
-
- ReadMaterials (me; WS: WorkSession from XSControl;
- doc: in out Document from TDocStd;
- SeqPDS : HSequenceOfTransient from TColStd)
- returns Boolean is protected;
- ---Purpose: Reads materials for instances defined in the STEP model and
- -- set reference between shape instances from different assemblyes
-
- SettleShapeData(me; theItem: RepresentationItem from StepRepr;
- theLab: out Label from TDF;
- theShapeTool: ShapeTool from XCAFDoc;
- theTP: TransientProcess from Transfer)
- returns Label from TDF is protected;
- --- Purpose: Populates the sub-Label of the passed TDF Label with shape
- -- data associated with the given STEP Representation Item,
- -- including naming and topological information.
-
- ExpandSubShapes(me; theShapeTool: ShapeTool from XCAFDoc;
- theShapeLabelMap: DataMapOfShapeLabel from XCAFDoc;
- theShapePDMap: DataMapOfShapePD from STEPCAFControl)
- is protected;
- --- Purpose: Given the maps of already translated shapes, this method
- -- expands their correspondent Labels in XDE Document so that
- -- to have a dedicated sub-Label for each sub-shape coming
- -- with associated name in its STEP Representation Item.
-
- ExpandManifoldSolidBrep(me; theLab: out Label from TDF;
- theItem: RepresentationItem from StepRepr;
- theTP: TransientProcess from Transfer;
- theShapeTool: ShapeTool from XCAFDoc)
- is protected;
- --- Purpose: Expands the topological structure of Manifold Solid BRep
- -- STEP entity to OCAF sub-tree. Entities having no names
- -- associated via their Representation Items are skipped.
-
- ExpandSBSM(me; theLab: out Label from TDF;
- theItem: RepresentationItem from StepRepr;
- theTP: TransientProcess from Transfer;
- theShapeTool: ShapeTool from XCAFDoc)
- is protected;
- --- Purpose: Expands the topological structure of Shell-Based Surface
- -- Model STEP entity to OCAF sub-tree. Entities having no names
- -- associated via their Representation Items are skipped.
-
- ExpandShell(me; theShell: ConnectedFaceSet from StepShape;
- theLab: out Label from TDF;
- theTP: TransientProcess from Transfer;
- theShapeTool: ShapeTool from XCAFDoc)
- is protected;
- --- Purpose: Expands STEP Shell structure to OCAF sub-tree. Entities
- -- having no names associated via their Representation Items
- -- are skipped.
-
- FindInstance (myclass; NAUO: NextAssemblyUsageOccurrence from StepRepr;
- STool: ShapeTool from XCAFDoc;
- Tool: Tool from STEPConstruct;
- PDRFileMap : DataMapOfPDExternFile from STEPCAFControl;
- ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
- returns Label from TDF;
- ---Purpose: Returns label of instance of an assembly component
- -- corresponding to a given NAUO
-
- --- Work with fileds for different mode of reading STEP file.
-
- SetColorMode(me: in out; colormode: Boolean from Standard);
- ---Purpose: Set ColorMode for indicate read Colors or not.
-
- GetColorMode(me) returns Boolean;
-
- SetNameMode(me: in out; namemode: Boolean from Standard);
- ---Purpose: Set NameMode for indicate read Name or not.
-
- GetNameMode(me) returns Boolean;
-
- SetLayerMode(me: in out; layermode: Boolean from Standard);
- ---Purpose: Set LayerMode for indicate read Layers or not.
-
- GetLayerMode(me) returns Boolean;
-
-
- SetPropsMode(me: in out; propsmode: Boolean from Standard);
- ---Purpose: PropsMode for indicate read Validation properties or not.
-
- GetPropsMode(me) returns Boolean;
-
- SetSHUOMode(me: in out; shuomode: Boolean from Standard);
- ---Purpose: Set SHUO mode for indicate write SHUO or not.
-
- GetSHUOMode(me) returns Boolean;
-
- SetGDTMode(me: in out; gdtmode: Boolean from Standard);
- ---Purpose: Set GDT mode for indicate write GDT or not.
-
- GetGDTMode(me) returns Boolean;
-
- SetMatMode(me: in out; matmode: Boolean from Standard);
- ---Purpose: Set Material mode
-
- GetMatMode(me) returns Boolean;
-
-fields
-
- myReader : Reader from STEPControl;
- myFiles : DictionaryOfExternFile from STEPCAFControl;
- myColorMode : Boolean;
- myNameMode : Boolean;
- myLayerMode : Boolean;
- myPropsMode : Boolean;
- mySHUOMode : Boolean;
- myGDTMode : Boolean;
- myMatMode : Boolean;
-
-end Reader;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <STEPCAFControl_Reader.ixx>
+#include <STEPCAFControl_Reader.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_HAsciiString.hxx>
#include <StepShape_EdgeLoop.hxx>
#include <StepShape_HArray1OfOrientedEdge.hxx>
#include <StepShape_HArray1OfShell.hxx>
+#include <STEPCAFControl_DictionaryOfExternFile.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <TDocStd_Document.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <STEPCAFControl_ExternFile.hxx>
+#include <STEPControl_Reader.hxx>
+#include <TDF_LabelSequence.hxx>
+#include <TDF_Label.hxx>
+#include <TopoDS_Shape.hxx>
+#include <XCAFDoc_ShapeTool.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <STEPCAFControl_DataMapOfShapePD.hxx>
+#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
+#include <XCAFDoc_DataMapOfShapeLabel.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <StepRepr_RepresentationItem.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <StepShape_ConnectedFaceSet.hxx>
+#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
+#include <STEPConstruct_Tool.hxx>
+#include <STEPCAFControl_Reader.hxx>
#ifdef DEB
//! Converts address of the passed shape (TShape) to string.
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPCAFControl_Reader_HeaderFile
+#define _STEPCAFControl_Reader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <STEPControl_Reader.hxx>
+#include <Handle_STEPCAFControl_DictionaryOfExternFile.hxx>
+#include <Standard_Boolean.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_TDocStd_Document.hxx>
+#include <Handle_STEPCAFControl_ExternFile.hxx>
+#include <Handle_XCAFDoc_ShapeTool.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Handle_StepRepr_RepresentationItem.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Handle_StepShape_ConnectedFaceSet.hxx>
+#include <Handle_StepRepr_NextAssemblyUsageOccurrence.hxx>
+
+class STEPCAFControl_DictionaryOfExternFile;
+class XSControl_WorkSession;
+class TDocStd_Document;
+class TCollection_AsciiString;
+class STEPCAFControl_ExternFile;
+class STEPControl_Reader;
+class TDF_LabelSequence;
+class TDF_Label;
+class TopoDS_Shape;
+class XCAFDoc_ShapeTool;
+class TopTools_MapOfShape;
+class STEPCAFControl_DataMapOfShapePD;
+class STEPCAFControl_DataMapOfPDExternFile;
+class XCAFDoc_DataMapOfShapeLabel;
+class TColStd_HSequenceOfTransient;
+class StepRepr_RepresentationItem;
+class Transfer_TransientProcess;
+class StepShape_ConnectedFaceSet;
+class StepRepr_NextAssemblyUsageOccurrence;
+class STEPConstruct_Tool;
+
+
+//! Provides a tool to read STEP file and put it into <br>
+//! DECAF document. Besides transfer of shapes (including <br>
+//! assemblies) provided by STEPControl, supports also <br>
+//! colors and part names <br>
+//! <br>
+//! This reader supports reading files with external references <br>
+//! i.e. multifile reading <br>
+//! It behaves as usual Reader (from STEPControl) for the main <br>
+//! file (e.g. if it is single file) <br>
+//! Results of reading other files can be accessed by name of the <br>
+//! file or by iterating on a readers <br>
+class STEPCAFControl_Reader {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a reader with an empty <br>
+//! STEP model and sets ColorMode, LayerMode, NameMode and <br>
+//! PropsMode to Standard_True. <br>
+ Standard_EXPORT STEPCAFControl_Reader();
+ //! Creates a reader tool and attaches it to an already existing Session <br>
+//! Clears the session if it was not yet set for STEP <br>
+ Standard_EXPORT STEPCAFControl_Reader(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+ //! Clears the internal data structures and attaches to a new session <br>
+//! Clears the session if it was not yet set for STEP <br>
+ Standard_EXPORT void Init(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True) ;
+ //! Loads a file and returns the read status <br>
+//! Provided for use like single-file reader <br>
+ Standard_EXPORT IFSelect_ReturnStatus ReadFile(const Standard_CString filename) ;
+ //! Returns number of roots recognized for transfer <br>
+//! Shortcut for Reader().NbRootsForTransfer() <br>
+ Standard_EXPORT Standard_Integer NbRootsForTransfer() ;
+ //! Translates currently loaded STEP file into the document <br>
+//! Returns True if succeeded, and False in case of fail <br>
+//! Provided for use like single-file reader <br>
+ Standard_EXPORT Standard_Boolean TransferOneRoot(const Standard_Integer num,Handle(TDocStd_Document)& doc) ;
+ //! Translates currently loaded STEP file into the document <br>
+//! Returns True if succeeded, and False in case of fail <br>
+//! Provided for use like single-file reader <br>
+ Standard_EXPORT Standard_Boolean Transfer(Handle(TDocStd_Document)& doc) ;
+
+ Standard_EXPORT Standard_Boolean Perform(const TCollection_AsciiString& filename,Handle(TDocStd_Document)& doc) ;
+ //! Translate STEP file given by filename into the document <br>
+//! Return True if succeeded, and False in case of fail <br>
+ Standard_EXPORT Standard_Boolean Perform(const Standard_CString filename,Handle(TDocStd_Document)& doc) ;
+ //! Returns data on external files <br>
+//! Returns Null handle if no external files are read <br>
+ Standard_EXPORT const Handle_STEPCAFControl_DictionaryOfExternFile& ExternFiles() const;
+ //! Returns data on external file by its name <br>
+//! Returns False if no external file with given name is read <br>
+ Standard_EXPORT Standard_Boolean ExternFile(const Standard_CString name,Handle(STEPCAFControl_ExternFile)& ef) const;
+ //! Returns basic reader <br>
+ Standard_EXPORT STEPControl_Reader& ChangeReader() ;
+ //! Returns basic reader as const <br>
+ Standard_EXPORT const STEPControl_Reader& Reader() const;
+ //! Returns label of instance of an assembly component <br>
+//! corresponding to a given NAUO <br>
+ Standard_EXPORT static TDF_Label FindInstance(const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,const Handle(XCAFDoc_ShapeTool)& STool,const STEPConstruct_Tool& Tool,const STEPCAFControl_DataMapOfPDExternFile& PDRFileMap,const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) ;
+ //! Set ColorMode for indicate read Colors or not. <br>
+ Standard_EXPORT void SetColorMode(const Standard_Boolean colormode) ;
+
+ Standard_EXPORT Standard_Boolean GetColorMode() const;
+ //! Set NameMode for indicate read Name or not. <br>
+ Standard_EXPORT void SetNameMode(const Standard_Boolean namemode) ;
+
+ Standard_EXPORT Standard_Boolean GetNameMode() const;
+ //! Set LayerMode for indicate read Layers or not. <br>
+ Standard_EXPORT void SetLayerMode(const Standard_Boolean layermode) ;
+
+ Standard_EXPORT Standard_Boolean GetLayerMode() const;
+ //! PropsMode for indicate read Validation properties or not. <br>
+ Standard_EXPORT void SetPropsMode(const Standard_Boolean propsmode) ;
+
+ Standard_EXPORT Standard_Boolean GetPropsMode() const;
+ //! Set SHUO mode for indicate write SHUO or not. <br>
+ Standard_EXPORT void SetSHUOMode(const Standard_Boolean shuomode) ;
+
+ Standard_EXPORT Standard_Boolean GetSHUOMode() const;
+ //! Set GDT mode for indicate write GDT or not. <br>
+ Standard_EXPORT void SetGDTMode(const Standard_Boolean gdtmode) ;
+
+ Standard_EXPORT Standard_Boolean GetGDTMode() const;
+ //! Set Material mode <br>
+ Standard_EXPORT void SetMatMode(const Standard_Boolean matmode) ;
+
+ Standard_EXPORT Standard_Boolean GetMatMode() const;
+
+
+
+
+
+protected:
+
+ //! Translates STEP file already loaded into the reader <br>
+//! into the document <br>
+//! If num==0, translates all roots, else only root number num <br>
+//! Returns True if succeeded, and False in case of fail <br>
+//! If asOne is True, in case of multiple results composes <br>
+//! them into assembly. Fills sequence of produced labels <br>
+ Standard_EXPORT Standard_Boolean Transfer(STEPControl_Reader& rd,const Standard_Integer num,Handle(TDocStd_Document)& doc,TDF_LabelSequence& Lseq,const Standard_Boolean asOne = Standard_False) ;
+ //! Add a shape to a document <br>
+//! Depending on a case, this shape can be added as one, or <br>
+//! as assembly, or (in case if it is associated with external <br>
+//! reference) taken as that referred shape <br>
+ Standard_EXPORT TDF_Label AddShape(const TopoDS_Shape& S,const Handle(XCAFDoc_ShapeTool)& STool,const TopTools_MapOfShape& NewShapesMap,const STEPCAFControl_DataMapOfShapePD& ShapePDMap,const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
+ //! Reads (or if returns already read) extern file with <br>
+//! given name <br>
+ Standard_EXPORT Handle_STEPCAFControl_ExternFile ReadExternFile(const Standard_CString file,const Standard_CString fullpath,Handle(TDocStd_Document)& doc) ;
+ //! Reads style assignments from STEP model and sets <br>
+//! corresponding color assignments in the DECAF document <br>
+ Standard_EXPORT Standard_Boolean ReadColors(const Handle(XSControl_WorkSession)& WS,Handle(TDocStd_Document)& doc,const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
+ //! Reads names of parts defined in the STEP model and <br>
+//! assigns them to corresponding labels in the DECAF document <br>
+ Standard_EXPORT Standard_Boolean ReadNames(const Handle(XSControl_WorkSession)& WS,Handle(TDocStd_Document)& doc,const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
+ //! Reads validation properties assigned to shapes in the STEP <br>
+//! model and assigns them to corresponding labels in the DECAF <br>
+//! document <br>
+ Standard_EXPORT Standard_Boolean ReadValProps(const Handle(XSControl_WorkSession)& WS,Handle(TDocStd_Document)& doc,const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
+ //! Reads layers of parts defined in the STEP model and <br>
+//! set reference between shape and layers in the DECAF document <br>
+ Standard_EXPORT Standard_Boolean ReadLayers(const Handle(XSControl_WorkSession)& WS,Handle(TDocStd_Document)& doc) const;
+ //! Reads SHUO for instances defined in the STEP model and <br>
+//! set reference between shape instances from different assemblyes <br>
+ Standard_EXPORT Standard_Boolean ReadSHUOs(const Handle(XSControl_WorkSession)& WS,Handle(TDocStd_Document)& doc,const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
+ //! Reads D> for instances defined in the STEP model and <br>
+//! set reference between shape instances from different assemblyes <br>
+ Standard_EXPORT Standard_Boolean ReadGDTs(const Handle(XSControl_WorkSession)& WS,Handle(TDocStd_Document)& doc) const;
+ //! Reads materials for instances defined in the STEP model and <br>
+//! set reference between shape instances from different assemblyes <br>
+ Standard_EXPORT Standard_Boolean ReadMaterials(const Handle(XSControl_WorkSession)& WS,Handle(TDocStd_Document)& doc,const Handle(TColStd_HSequenceOfTransient)& SeqPDS) const;
+ //! Populates the sub-Label of the passed TDF Label with shape <br>
+//! data associated with the given STEP Representation Item, <br>
+//! including naming and topological information. <br>
+ Standard_EXPORT TDF_Label SettleShapeData(const Handle(StepRepr_RepresentationItem)& theItem,TDF_Label& theLab,const Handle(XCAFDoc_ShapeTool)& theShapeTool,const Handle(Transfer_TransientProcess)& theTP) const;
+ //! Given the maps of already translated shapes, this method <br>
+//! expands their correspondent Labels in XDE Document so that <br>
+//! to have a dedicated sub-Label for each sub-shape coming <br>
+//! with associated name in its STEP Representation Item. <br>
+ Standard_EXPORT void ExpandSubShapes(const Handle(XCAFDoc_ShapeTool)& theShapeTool,const XCAFDoc_DataMapOfShapeLabel& theShapeLabelMap,const STEPCAFControl_DataMapOfShapePD& theShapePDMap) const;
+ //! Expands the topological structure of Manifold Solid BRep <br>
+//! STEP entity to OCAF sub-tree. Entities having no names <br>
+//! associated via their Representation Items are skipped. <br>
+ Standard_EXPORT void ExpandManifoldSolidBrep(TDF_Label& theLab,const Handle(StepRepr_RepresentationItem)& theItem,const Handle(Transfer_TransientProcess)& theTP,const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
+ //! Expands the topological structure of Shell-Based Surface <br>
+//! Model STEP entity to OCAF sub-tree. Entities having no names <br>
+//! associated via their Representation Items are skipped. <br>
+ Standard_EXPORT void ExpandSBSM(TDF_Label& theLab,const Handle(StepRepr_RepresentationItem)& theItem,const Handle(Transfer_TransientProcess)& theTP,const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
+ //! Expands STEP Shell structure to OCAF sub-tree. Entities <br>
+//! having no names associated via their Representation Items <br>
+//! are skipped. <br>
+ Standard_EXPORT void ExpandShell(const Handle(StepShape_ConnectedFaceSet)& theShell,TDF_Label& theLab,const Handle(Transfer_TransientProcess)& theTP,const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
+
+
+
+
+private:
+
+
+
+STEPControl_Reader myReader;
+Handle_STEPCAFControl_DictionaryOfExternFile myFiles;
+Standard_Boolean myColorMode;
+Standard_Boolean myNameMode;
+Standard_Boolean myLayerMode;
+Standard_Boolean myPropsMode;
+Standard_Boolean mySHUOMode;
+Standard_Boolean myGDTMode;
+Standard_Boolean myMatMode;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
+++ /dev/null
--- Created on: 2000-08-15
--- Created by: Andrey BETENEV
--- Copyright (c) 2000-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 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.
-
-class Writer from STEPCAFControl
--- inherits Writer from STEPControl
-
- ---Purpose: Provides a tool to write DECAF document to the
- -- STEP file. Besides transfer of shapes (including
- -- assemblies) provided by STEPControl, supports also
- -- colors and part names
- --
- -- Also supports multifile writing
-
-uses
- AsciiString from TCollection,
- ReturnStatus from IFSelect,
- WorkSession from XSControl,
- Shape from TopoDS,
- Writer from STEPControl,
- StepModelType from STEPControl,
- DictionaryOfExternFile from STEPCAFControl,
- ExternFile from STEPCAFControl,
- Label from TDF,
- LabelSequence from TDF,
- DataMapOfLabelShape from STEPCAFControl,
- DataMapOfLabelExternFile from STEPCAFControl,
- Document from TDocStd,
- DataMapOfShapeTransient from MoniTool
-
-is
-
- Create returns Writer;
- ---Purpose: Creates a writer with an empty
--- STEP model and sets ColorMode, LayerMode, NameMode and
--- PropsMode to Standard_True.
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Writer;
- ---Purpose: Creates a reader tool and attaches it to an already existing Session
- -- Clears the session if it was not yet set for STEP
- -- Clears the internal data structures
-
- Init (me: in out; WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True);
- ---Purpose: Clears the internal data structures and attaches to a new session
- -- Clears the session if it was not yet set for STEP
-
- Write (me : in out; filename : CString)
- returns ReturnStatus from IFSelect;
- ---Purpose: Writes all the produced models into file
- -- In case of multimodel with extern references,
- -- filename will be a name of root file, all other files
- -- have names of corresponding parts
- -- Provided for use like single-file writer
-
- Transfer (me : in out; doc : Document from TDocStd;
- mode: StepModelType from STEPControl = STEPControl_AsIs;
- multi: CString = 0)
- returns Boolean;
- Transfer (me : in out; L: Label from TDF;
- mode: StepModelType from STEPControl = STEPControl_AsIs;
- multi: CString = 0)
- returns Boolean;
- ---Purpose: Transfers a document (or single label) to a STEP model
- -- The mode of translation of shape is AsIs
- -- If multi is not null pointer, it switches to multifile
- -- mode (with external refs), and string pointed by <multi>
- -- gives prefix for names of extern files (can be empty string)
- -- Returns True if translation is OK
-
- Perform (me : in out; doc : Document from TDocStd;
- filename: AsciiString from TCollection)
- returns Boolean;
-
- Perform (me : in out; doc : Document from TDocStd; filename: CString)
- returns Boolean;
- ---Purpose : Transfers a document and writes it to a STEP file
- -- Returns True if translation is OK
-
- ---Scope: Access to fields
-
- ExternFiles (me) returns DictionaryOfExternFile from STEPCAFControl;
- ---Purpose: Returns data on external files
- -- Returns Null handle if no external files are read
- ---C++: return const &
-
- ExternFile (me; L: Label from TDF; ef: out ExternFile from STEPCAFControl)
- returns Boolean;
- ---Purpose: Returns data on external file by its original label
- -- Returns False if no external file with given name is read
-
- ExternFile (me; name: CString; ef: out ExternFile from STEPCAFControl)
- returns Boolean;
- ---Purpose: Returns data on external file by its name
- -- Returns False if no external file with given name is read
-
- ChangeWriter (me: in out) returns Writer from STEPControl;
- ---Purpose: Returns basic reader for root file
- ---C++: return &
-
- Writer (me) returns Writer from STEPControl;
- ---Purpose: Returns basic reader as const
- ---C++: return const &
-
- ---Scope: Internal methods
-
- Transfer (me : in out; wr: in out Writer from STEPControl;
- labels: LabelSequence from TDF;
- mode: StepModelType from STEPControl = STEPControl_AsIs;
- multi: CString = 0;
- isExternFile: Boolean = Standard_False)
- returns Boolean is protected;
- ---Purpose: Transfers labels to a STEP model
- -- Returns True if translation is OK
- -- isExternFile setting from TransferExternFiles method
-
- TransferExternFiles (me : in out; L: Label from TDF;
- mode: StepModelType from STEPControl;
- Lseq: out LabelSequence from TDF;
- prefix: CString = "")
- returns Shape from TopoDS is protected;
- ---Purpose: Parses assembly structure of label L, writes all the simple
- -- shapes each to its own file named by name of its label plus
- -- prefix
- -- Returns shape representing that assembly structure
- -- in the form of nested empty compounds (and a sequence of
- -- labels which are newly written nodes of this assembly)
-
- WriteExternRefs (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Write external references to STEP
-
- WriteColors (me: in out; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Write colors assigned to specified labels, to STEP model
-
- WriteNames (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Write names assigned to specified labels, to STEP model
-
- WriteDGTs (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Write D>s assigned to specified labels, to STEP model
-
- WriteMaterials (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Write materials assigned to specified labels, to STEP model
-
- WriteValProps (me; WS: WorkSession from XSControl;
- labels: LabelSequence from TDF; multi: CString)
- returns Boolean is protected;
- ---Purpose: Write validation properties assigned to specified labels,
- -- to STEP model
-
- WriteLayers (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Write layers assigned to specified labels, to STEP model
-
- WriteSHUOs (me: in out; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
- returns Boolean is protected;
- ---Purpose: Write SHUO assigned to specified component, to STEP model
-
- --- Work with fileds for different mode of writing STEP file.
-
- SetColorMode(me: in out; colormode: Boolean from Standard);
- ---Purpose: Set ColorMode for indicate write Colors or not.
-
- GetColorMode(me) returns Boolean;
-
- SetNameMode(me: in out; namemode: Boolean from Standard);
- ---Purpose: Set NameMode for indicate write Name or not.
-
- GetNameMode(me) returns Boolean;
-
- SetLayerMode(me: in out; layermode: Boolean from Standard);
- ---Purpose: Set LayerMode for indicate write Layers or not.
-
- GetLayerMode(me) returns Boolean;
-
- SetPropsMode(me: in out; propsmode: Boolean from Standard);
- ---Purpose: PropsMode for indicate write Validation properties or not.
-
- GetPropsMode(me) returns Boolean;
-
- SetSHUOMode(me: in out; shuomode: Boolean from Standard);
- ---Purpose: Set SHUO mode for indicate write SHUO or not.
-
- GetSHUOMode(me) returns Boolean;
-
- SetDimTolMode(me: in out; dimtolmode: Boolean from Standard);
- ---Purpose: Set dimtolmode for indicate write D>s or not.
-
- GetDimTolMode(me) returns Boolean;
-
- SetMaterialMode(me: in out; matmode: Boolean from Standard);
- ---Purpose: Set dimtolmode for indicate write D>s or not.
-
- GetMaterialMode(me) returns Boolean;
-
-fields
-
- myWriter : Writer from STEPControl;
- myFiles : DictionaryOfExternFile from STEPCAFControl;
- myLabels : DataMapOfLabelShape from STEPCAFControl;
- myLabEF : DataMapOfLabelExternFile from STEPCAFControl;
- myColorMode: Boolean;
- myNameMode : Boolean;
- myLayerMode: Boolean;
- myPropsMode: Boolean;
- mySHUOMode : Boolean;
- myMapCompMDGPR : DataMapOfShapeTransient from MoniTool;
- myDGTMode : Boolean;
- myMatMode : Boolean;
-
-end Writer;
// (analysis of SDRs which the CDSR links should be done)
// Names and validation props are supported for top-level shapes only
-#include <STEPCAFControl_Writer.ixx>
+#include <STEPCAFControl_Writer.hxx>
#include <STEPControl_StepModelType.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <TDF_LabelSequence.hxx>
#include <StepRepr_MeasureRepresentationItem.hxx>
#include <StepBasic_ProductDefinition.hxx>
+#include <STEPCAFControl_DictionaryOfExternFile.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <TDocStd_Document.hxx>
+#include <TDF_Label.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <STEPCAFControl_ExternFile.hxx>
+#include <STEPControl_Writer.hxx>
+#include <TDF_LabelSequence.hxx>
+#include <TopoDS_Shape.hxx>
+#include <STEPCAFControl_Writer.hxx>
+
//=======================================================================
//function : GetLabelName
//purpose : auxilary function: take name of label and append it to str
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPCAFControl_Writer_HeaderFile
+#define _STEPCAFControl_Writer_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <STEPControl_Writer.hxx>
+#include <Handle_STEPCAFControl_DictionaryOfExternFile.hxx>
+#include <STEPCAFControl_DataMapOfLabelShape.hxx>
+#include <STEPCAFControl_DataMapOfLabelExternFile.hxx>
+#include <Standard_Boolean.hxx>
+#include <MoniTool_DataMapOfShapeTransient.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Standard_CString.hxx>
+#include <Handle_TDocStd_Document.hxx>
+#include <STEPControl_StepModelType.hxx>
+#include <Handle_STEPCAFControl_ExternFile.hxx>
+
+class STEPCAFControl_DictionaryOfExternFile;
+class XSControl_WorkSession;
+class TDocStd_Document;
+class TDF_Label;
+class TCollection_AsciiString;
+class STEPCAFControl_ExternFile;
+class STEPControl_Writer;
+class TDF_LabelSequence;
+class TopoDS_Shape;
+
+
+//! Provides a tool to write DECAF document to the <br>
+//! STEP file. Besides transfer of shapes (including <br>
+//! assemblies) provided by STEPControl, supports also <br>
+//! colors and part names <br>
+//! <br>
+//! Also supports multifile writing <br>
+class STEPCAFControl_Writer {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a writer with an empty <br>
+//! STEP model and sets ColorMode, LayerMode, NameMode and <br>
+//! PropsMode to Standard_True. <br>
+ Standard_EXPORT STEPCAFControl_Writer();
+ //! Creates a reader tool and attaches it to an already existing Session <br>
+//! Clears the session if it was not yet set for STEP <br>
+//! Clears the internal data structures <br>
+ Standard_EXPORT STEPCAFControl_Writer(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+ //! Clears the internal data structures and attaches to a new session <br>
+//! Clears the session if it was not yet set for STEP <br>
+ Standard_EXPORT void Init(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True) ;
+ //! Writes all the produced models into file <br>
+//! In case of multimodel with extern references, <br>
+//! filename will be a name of root file, all other files <br>
+//! have names of corresponding parts <br>
+//! Provided for use like single-file writer <br>
+ Standard_EXPORT IFSelect_ReturnStatus Write(const Standard_CString filename) ;
+
+ Standard_EXPORT Standard_Boolean Transfer(const Handle(TDocStd_Document)& doc,const STEPControl_StepModelType mode = STEPControl_AsIs,const Standard_CString multi = 0) ;
+ //! Transfers a document (or single label) to a STEP model <br>
+//! The mode of translation of shape is AsIs <br>
+//! If multi is not null pointer, it switches to multifile <br>
+//! mode (with external refs), and string pointed by <multi> <br>
+//! gives prefix for names of extern files (can be empty string) <br>
+//! Returns True if translation is OK <br>
+ Standard_EXPORT Standard_Boolean Transfer(const TDF_Label& L,const STEPControl_StepModelType mode = STEPControl_AsIs,const Standard_CString multi = 0) ;
+
+ Standard_EXPORT Standard_Boolean Perform(const Handle(TDocStd_Document)& doc,const TCollection_AsciiString& filename) ;
+ //! Transfers a document and writes it to a STEP file <br>
+//! Returns True if translation is OK <br>
+ Standard_EXPORT Standard_Boolean Perform(const Handle(TDocStd_Document)& doc,const Standard_CString filename) ;
+ //! Returns data on external files <br>
+//! Returns Null handle if no external files are read <br>
+ Standard_EXPORT const Handle_STEPCAFControl_DictionaryOfExternFile& ExternFiles() const;
+ //! Returns data on external file by its original label <br>
+//! Returns False if no external file with given name is read <br>
+ Standard_EXPORT Standard_Boolean ExternFile(const TDF_Label& L,Handle(STEPCAFControl_ExternFile)& ef) const;
+ //! Returns data on external file by its name <br>
+//! Returns False if no external file with given name is read <br>
+ Standard_EXPORT Standard_Boolean ExternFile(const Standard_CString name,Handle(STEPCAFControl_ExternFile)& ef) const;
+ //! Returns basic reader for root file <br>
+ Standard_EXPORT STEPControl_Writer& ChangeWriter() ;
+ //! Returns basic reader as const <br>
+ Standard_EXPORT const STEPControl_Writer& Writer() const;
+ //! Set ColorMode for indicate write Colors or not. <br>
+ Standard_EXPORT void SetColorMode(const Standard_Boolean colormode) ;
+
+ Standard_EXPORT Standard_Boolean GetColorMode() const;
+ //! Set NameMode for indicate write Name or not. <br>
+ Standard_EXPORT void SetNameMode(const Standard_Boolean namemode) ;
+
+ Standard_EXPORT Standard_Boolean GetNameMode() const;
+ //! Set LayerMode for indicate write Layers or not. <br>
+ Standard_EXPORT void SetLayerMode(const Standard_Boolean layermode) ;
+
+ Standard_EXPORT Standard_Boolean GetLayerMode() const;
+ //! PropsMode for indicate write Validation properties or not. <br>
+ Standard_EXPORT void SetPropsMode(const Standard_Boolean propsmode) ;
+
+ Standard_EXPORT Standard_Boolean GetPropsMode() const;
+ //! Set SHUO mode for indicate write SHUO or not. <br>
+ Standard_EXPORT void SetSHUOMode(const Standard_Boolean shuomode) ;
+
+ Standard_EXPORT Standard_Boolean GetSHUOMode() const;
+ //! Set dimtolmode for indicate write D>s or not. <br>
+ Standard_EXPORT void SetDimTolMode(const Standard_Boolean dimtolmode) ;
+
+ Standard_EXPORT Standard_Boolean GetDimTolMode() const;
+ //! Set dimtolmode for indicate write D>s or not. <br>
+ Standard_EXPORT void SetMaterialMode(const Standard_Boolean matmode) ;
+
+ Standard_EXPORT Standard_Boolean GetMaterialMode() const;
+
+
+
+
+
+protected:
+
+ //! Transfers labels to a STEP model <br>
+//! Returns True if translation is OK <br>
+//! isExternFile setting from TransferExternFiles method <br>
+ Standard_EXPORT Standard_Boolean Transfer(STEPControl_Writer& wr,const TDF_LabelSequence& labels,const STEPControl_StepModelType mode = STEPControl_AsIs,const Standard_CString multi = 0,const Standard_Boolean isExternFile = Standard_False) ;
+ //! Parses assembly structure of label L, writes all the simple <br>
+//! shapes each to its own file named by name of its label plus <br>
+//! prefix <br>
+//! Returns shape representing that assembly structure <br>
+//! in the form of nested empty compounds (and a sequence of <br>
+//! labels which are newly written nodes of this assembly) <br>
+ Standard_EXPORT TopoDS_Shape TransferExternFiles(const TDF_Label& L,const STEPControl_StepModelType mode,TDF_LabelSequence& Lseq,const Standard_CString prefix = "") ;
+ //! Write external references to STEP <br>
+ Standard_EXPORT Standard_Boolean WriteExternRefs(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels) const;
+ //! Write colors assigned to specified labels, to STEP model <br>
+ Standard_EXPORT Standard_Boolean WriteColors(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels) ;
+ //! Write names assigned to specified labels, to STEP model <br>
+ Standard_EXPORT Standard_Boolean WriteNames(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels) const;
+ //! Write D>s assigned to specified labels, to STEP model <br>
+ Standard_EXPORT Standard_Boolean WriteDGTs(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels) const;
+ //! Write materials assigned to specified labels, to STEP model <br>
+ Standard_EXPORT Standard_Boolean WriteMaterials(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels) const;
+ //! Write validation properties assigned to specified labels, <br>
+//! to STEP model <br>
+ Standard_EXPORT Standard_Boolean WriteValProps(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels,const Standard_CString multi) const;
+ //! Write layers assigned to specified labels, to STEP model <br>
+ Standard_EXPORT Standard_Boolean WriteLayers(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels) const;
+ //! Write SHUO assigned to specified component, to STEP model <br>
+ Standard_EXPORT Standard_Boolean WriteSHUOs(const Handle(XSControl_WorkSession)& WS,const TDF_LabelSequence& labels) ;
+
+
+
+
+private:
+
+
+
+STEPControl_Writer myWriter;
+Handle_STEPCAFControl_DictionaryOfExternFile myFiles;
+STEPCAFControl_DataMapOfLabelShape myLabels;
+STEPCAFControl_DataMapOfLabelExternFile myLabEF;
+Standard_Boolean myColorMode;
+Standard_Boolean myNameMode;
+Standard_Boolean myLayerMode;
+Standard_Boolean myPropsMode;
+Standard_Boolean mySHUOMode;
+MoniTool_DataMapOfShapeTransient myMapCompMDGPR;
+Standard_Boolean myDGTMode;
+Standard_Boolean myMatMode;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
PointHasher from STEPConstruct);
- FindEntity (FinderProcess: FinderProcess from Transfer; Shape: Shape from TopoDS)
+ FindEntity (FinderProcess: FinderProcess_Handle from Transfer; Shape: Shape from TopoDS)
returns RepresentationItem from StepRepr;
---Purpose: Returns STEP entity of the (sub)type of RepresentationItem
-- which is a result of the tranalation of the Shape, or Null if
-- no result is recorded
- FindEntity (FinderProcess: FinderProcess from Transfer; Shape: Shape from TopoDS;
+ FindEntity (FinderProcess: FinderProcess_Handle from Transfer; Shape: Shape from TopoDS;
Loc: out Location from TopLoc)
returns RepresentationItem from StepRepr;
---Purpose: The same as above, but in the case if item not found, repeats
-- location with which result is found (either location of the Shape,
-- or Null)
- FindShape (TransientProcess: TransientProcess from Transfer; item: RepresentationItem from StepRepr)
+ FindShape (TransientProcess: TransientProcess_Handle from Transfer; item: RepresentationItem from StepRepr)
returns Shape from TopoDS;
---Purpose: Returns Shape resulting from given STEP entity (Null if not mapped)
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <Transfer_Binder.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <Transfer_TransientProcess.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <StepBasic_ProductDefinition.hxx>
uses
HAsciiString from TCollection,
SequenceOfTransient from TColStd,
- WorkSession from XSControl,
+ WorkSession_Handle from XSControl,
ProductDefinition from StepBasic,
SequenceOfInteger from TColStd,
CString from Standard,
Create returns ExternRefs;
---Purpose: Creates an empty tool
- Create (WS: WorkSession from XSControl) returns ExternRefs;
+ Create (WS: WorkSession_Handle from XSControl) returns ExternRefs;
---Purpose: Creates a tool and initializes it
- Init (me: in out; WS: WorkSession from XSControl) returns Boolean;
+ Init (me: in out; WS: WorkSession_Handle from XSControl) returns Boolean;
---Purpose: Initializes tool; returns True if succeeded
Clear (me: in out);
-- with particular implementation of colors (as described in RP)
uses
- WorkSession from XSControl,
+ WorkSession_Handle from XSControl,
InterfaceModel from Interface,
HGraph from Interface,
- FinderProcess from Transfer,
- TransientProcess from Transfer,
+ FinderProcess_Handle from Transfer,
+ TransientProcess_Handle from Transfer,
Shape from TopoDS,
SequenceOfTransient from TColStd,
HSequenceOfTransient from TColStd,
Create returns Styles;
---Purpose: Creates an empty tool
- Create (WS: WorkSession from XSControl) returns Styles;
+ Create (WS: WorkSession_Handle from XSControl) returns Styles;
---Purpose: Creates a tool and initializes it
- Init (me: in out; WS: WorkSession from XSControl) returns Boolean;
+ Init (me: in out; WS: WorkSession_Handle from XSControl) returns Boolean;
---Purpose: Initializes tool; returns True if succeeded
--Basic methods: general work with styles
-- this (and derived) tool multiple times
uses
- WorkSession from XSControl,
+ WorkSession_Handle from XSControl,
InterfaceModel from Interface,
Graph from Interface,
HGraph from Interface,
- FinderProcess from Transfer,
- TransientProcess from Transfer
+ FinderProcess_Handle from Transfer,
+ TransientProcess_Handle from Transfer
is
Create returns Tool;
---Purpose: Creates an empty tool
- Create (WS: WorkSession from XSControl) returns Tool;
+ Create (WS: WorkSession_Handle from XSControl) returns Tool;
---Purpose: Creates a tool and loads it with worksession
- SetWS (me: in out; WS: WorkSession from XSControl)
+ SetWS (me: in out; WS: WorkSession_Handle from XSControl)
returns Boolean is protected;
---Purpose: Load worksession; returns True if succeeded
-- Returns False if either FinderProcess of TransientProcess
-- cannot be obtained or are Null
- WS (me) returns WorkSession from XSControl;
+ WS (me) returns WorkSession_Handle from XSControl;
---Purpose: Returns currently loaded WorkSession
---C++: return const &
---C++: inline
---C++: return const &
---C++: inline
- TransientProcess (me) returns TransientProcess from Transfer;
+ TransientProcess (me) returns TransientProcess_Handle from Transfer;
---Purpose: Returns TransientProcess (reading; Null if not loaded)
---C++: return const &
---C++: inline
- FinderProcess (me) returns FinderProcess from Transfer;
+ FinderProcess (me) returns FinderProcess_Handle from Transfer;
---Purpose: Returns FinderProcess (writing; Null if not loaded)
---C++: return const &
---C++: inline
fields
- myWS : WorkSession from XSControl;
- myFinderProcess: FinderProcess from Transfer;
- myTransientProcess: TransientProcess from Transfer;
+ myWS : WorkSession_Handle from XSControl;
+ myFinderProcess: FinderProcess_Handle from Transfer;
+ myTransientProcess: TransientProcess_Handle from Transfer;
myHGraph : HGraph from Interface; -- for optimization (no recomutings)
end Tool;
-- These are surface area, solid volume and centroid.
uses
- WorkSession from XSControl,
+ WorkSession_Handle from XSControl,
InterfaceModel from Interface,
HGraph from Interface,
- FinderProcess from Transfer,
- TransientProcess from Transfer,
+ FinderProcess_Handle from Transfer,
+ TransientProcess_Handle from Transfer,
RepresentationItem from StepRepr,
Pnt from gp,
Shape from TopoDS,
Create returns ValidationProps;
---Purpose: Creates an empty tool
- Create (WS: WorkSession from XSControl) returns ValidationProps;
+ Create (WS: WorkSession_Handle from XSControl) returns ValidationProps;
---Purpose: Creates a tool and loads it with worksession
- Init (me: in out; WS: WorkSession from XSControl) returns Boolean;
+ Init (me: in out; WS: WorkSession_Handle from XSControl) returns Boolean;
---Purpose: Load worksession; returns True if succeeded
AddProp (me: in out; Shape: Shape from TopoDS;
--- /dev/null
+STEPControl_ActorWrite.hxx
+STEPControl_ActorWrite.cxx
+STEPControl_ActorRead.hxx
+STEPControl_ActorRead.cxx
+STEPControl_Controller.hxx
+STEPControl_Controller.cxx
+STEPControl_Reader.hxx
+STEPControl_Reader.cxx
+STEPControl_Writer.hxx
+STEPControl_Writer.cxx
\ No newline at end of file
-- - STEPControl_GeometricCurveSet
-- translates an Open CASCADE shape into a STEP geometric_curve_set entity.
- class Controller;
-
- class Reader;
- class Writer;
-
- class ActorRead;
- class ActorWrite;
+ imported Controller;
+ imported Reader;
+ imported Writer;
+ imported ActorRead;
+ imported ActorWrite;
end STEPControl;
+++ /dev/null
--- Created on: 1994-12-21
--- Created by: Dieter THIEMANN
--- 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 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.
-
-class ActorRead from STEPControl
- inherits ActorOfTransientProcess from Transfer
-
- ---Purpose : This class performs the transfer of an Entity from
- -- AP214 and AP203, either Geometric or Topologic.
- --
- -- I.E. for each type of Entity, it invokes the appropriate Tool
- -- then returns the Binder which contains the Result
-
-uses
-
- TransientProcess from Transfer,
- Binder from Transfer,
- Trsf from gp,
- Axis2Placement3d from StepGeom,
- Representation from StepRepr,
- RepresentationRelationship from StepRepr,
- ProductDefinition from StepBasic,
- NextAssemblyUsageOccurrence from StepRepr,
- ShapeRepresentation from StepShape,
- ContextDependentShapeRepresentation from StepShape,
- ShapeRepresentationRelationship from StepRepr,
- GeometricRepresentationItem from StepGeom,
- MappedItem from StepRepr,
- FaceSurface from StepShape,
- ShapeBinder from TransferBRep,
- NMTool from StepToTopoDS, -- To proceed with non-manifold cases (ssv; 13.11.2010)
- Shell from TopoDS,
- ListOfShape from TopTools,
- Compound from TopoDS,
- IndexedDataMapOfShapeListOfShape from TopTools
-
-is
-
- Create returns mutable ActorRead from STEPControl;
-
- Recognize (me : mutable; start : Transient) returns Boolean is redefined;
-
- Transfer (me : mutable; start : Transient;
- TP : mutable TransientProcess from Transfer)
- returns mutable Binder from Transfer is redefined;
- -- calls TransferShape
-
- TransferShape (me : mutable;
- start : Transient;
- TP : mutable TransientProcess from Transfer;
- isManifold : Boolean = Standard_True)
- returns mutable Binder from Transfer;
-
- ---Private: unit and uncertainty context management
-
- PrepareUnits (me : mutable; rep: Representation from StepRepr;
- TP: mutable TransientProcess from Transfer);
- ---Purpose: set units and tolerances context by given ShapeRepresentation
-
- ResetUnits (me: mutable);
- ---Purpose: reset units and tolerances context to default
- --- (mm, radians, read.precision.val, etc.)
-
- ComputeTransformation (me: mutable; Origin, Target: Axis2Placement3d from StepGeom;
- OrigContext, TargContext: Representation from StepRepr;
- TP: mutable TransientProcess from Transfer;
- Trsf: out Trsf from gp)
- returns Boolean;
- ---Purpose: Computes transformation defined by two axis placements (in MAPPED_ITEM
- -- or ITEM_DEFINED_TRANSFORMATION) taking into account their
- -- representation contexts (i.e. units, which may be different)
- -- Returns True if transformation is computed and is not an identity.
-
- ComputeSRRWT (me: mutable; SRR: RepresentationRelationship from StepRepr;
- TP: mutable TransientProcess from Transfer;
- Trsf: out Trsf from gp)
- returns Boolean;
- ---Purpose: Computes transformation defined by given
- -- REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
-
- TransferEntity(me: mutable; PD : ProductDefinition from StepBasic;
- TP : mutable TransientProcess from Transfer) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers product definition entity
-
-
- TransferEntity(me: mutable; NAUO : NextAssemblyUsageOccurrence from StepRepr;
- TP : mutable TransientProcess from Transfer) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers next assembly usage occurence entity
-
- TransferEntity(me: mutable; sr : ShapeRepresentation from StepShape;
- TP : mutable TransientProcess from Transfer;
- isBound : out Boolean ) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers shape representation entity
-
-
- TransferEntity(me: mutable; CDSR : ContextDependentShapeRepresentation from StepShape;
- TP : mutable TransientProcess from Transfer) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers context dependent shape representation entity
-
- TransferEntity(me: mutable; und : ShapeRepresentationRelationship from StepRepr;
- TP : mutable TransientProcess from Transfer;
- nbrep : Integer =0) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers shape representation relationship entity
-
-
- TransferEntity(me : mutable;
- git : GeometricRepresentationItem from StepGeom;
- TP : mutable TransientProcess from Transfer;
- isManifold : Boolean) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers geometric representation item entity such as ManifoldSolidBRep ,...etc
-
- TransferEntity(me: mutable; mapit : MappedItem from StepRepr;
- TP : mutable TransientProcess from Transfer) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers mapped item
-
- TransferEntity(me: mutable; fs : FaceSurface from StepShape;
- TP : mutable TransientProcess from Transfer) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Transfers FaceSurface entity
-
- OldWay(me: mutable; start : Transient;
- TP : mutable TransientProcess from Transfer) returns mutable ShapeBinder from TransferBRep is protected;
- ---Purpose:Tranlates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off.
-
- closeIDEASShell(me : mutable;
- shell : in Shell from TopoDS;
- closingShells : in ListOfShape from TopTools)
- returns Shell from TopoDS
- is private;
-
- computeIDEASClosings(me : mutable;
- comp : in Compound from TopoDS;
- shellClosingMap : in out IndexedDataMapOfShapeListOfShape from TopTools)
- is private;
-
-fields
-
--- theUnitFactor : Real; -- Conversion unit factor.
--- theVTol : Real; -- Tolerance for Vertices
--- theETol : Real; -- Tolerance for Edges
--- theFTol : Real; -- Tolerance for Faces
- myNMTool : NMTool from StepToTopoDS; -- To proceed with non-manifold cases (ssv; 13.11.2010)
- myPrecision : Real;
- myMaxTol : Real;
- mySRContext: Representation from StepRepr; -- context for unuts
-
-end ActorRead;
//:n4 abv 11.02.99 S4132: recognition of GeometricSet (instead of GeometricCurveSet)
// gka 05.04.99 S4136: eliminate parameter lastpreci
//gka,abv 14.04.99 S4136: maintain unit context, precision and maxtolerance values
-#include <STEPControl_ActorRead.ixx>
+#include <STEPControl_ActorRead.hxx>
#include <OSD_Timer.hxx>
-
+#include <Standard_Type.hxx>
// #include <Interface_InterfaceModel.hxx> // pour mise au point
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#define TRANSLOG
+
+IMPLEMENT_STANDARD_TYPE(STEPControl_ActorRead)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_ActorOfTransientProcess),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(STEPControl_ActorRead)
+
+
+IMPLEMENT_DOWNCAST(STEPControl_ActorRead,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(STEPControl_ActorRead)
+
+
// ============================================================================
// Function: DumpWhatIs
// Purpose: Use it in DEB mode to dump your shapes
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPControl_ActorRead_HeaderFile
+#define _STEPControl_ActorRead_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <StepToTopoDS_NMTool.hxx>
+#include <Standard_Real.hxx>
+#include <Handle_StepRepr_Representation.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Handle_StepGeom_Axis2Placement3d.hxx>
+#include <Handle_StepRepr_RepresentationRelationship.hxx>
+#include <TransferBRep_ShapeBinder.hxx>
+#include <Handle_StepBasic_ProductDefinition.hxx>
+#include <Handle_StepRepr_NextAssemblyUsageOccurrence.hxx>
+#include <Handle_StepShape_ShapeRepresentation.hxx>
+#include <Handle_StepShape_ContextDependentShapeRepresentation.hxx>
+#include <Handle_StepRepr_ShapeRepresentationRelationship.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_StepGeom_GeometricRepresentationItem.hxx>
+#include <Handle_StepRepr_MappedItem.hxx>
+#include <Handle_StepShape_FaceSurface.hxx>
+
+class StepRepr_Representation;
+class Standard_Transient;
+class Transfer_Binder;
+class Transfer_TransientProcess;
+class StepGeom_Axis2Placement3d;
+class gp_Trsf;
+class StepRepr_RepresentationRelationship;
+class TransferBRep_ShapeBinder;
+class StepBasic_ProductDefinition;
+class StepRepr_NextAssemblyUsageOccurrence;
+class StepShape_ShapeRepresentation;
+class StepShape_ContextDependentShapeRepresentation;
+class StepRepr_ShapeRepresentationRelationship;
+class StepGeom_GeometricRepresentationItem;
+class StepRepr_MappedItem;
+class StepShape_FaceSurface;
+class TopoDS_Shell;
+class TopTools_ListOfShape;
+class TopoDS_Compound;
+class TopTools_IndexedDataMapOfShapeListOfShape;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Transfer_ActorOfTransientProcess);
+class STEPControl_ActorRead;
+
+DEFINE_STANDARD_HANDLE(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
+
+
+//! This class performs the transfer of an Entity from <br>
+//! AP214 and AP203, either Geometric or Topologic. <br>
+//! <br>
+//! I.E. for each type of Entity, it invokes the appropriate Tool <br>
+//! then returns the Binder which contains the Result <br>
+class STEPControl_ActorRead : public Transfer_ActorOfTransientProcess {
+
+public:
+
+
+ Standard_EXPORT STEPControl_ActorRead();
+
+ Standard_EXPORT virtual Standard_Boolean Recognize(const Handle(Standard_Transient)& start) ;
+
+ Standard_EXPORT virtual Handle_Transfer_Binder Transfer(const Handle(Standard_Transient)& start,const Handle(Transfer_TransientProcess)& TP) ;
+
+ Standard_EXPORT Handle_Transfer_Binder TransferShape(const Handle(Standard_Transient)& start,const Handle(Transfer_TransientProcess)& TP,const Standard_Boolean isManifold = Standard_True) ;
+ //! set units and tolerances context by given ShapeRepresentation <br>
+ Standard_EXPORT void PrepareUnits(const Handle(StepRepr_Representation)& rep,const Handle(Transfer_TransientProcess)& TP) ;
+ //! reset units and tolerances context to default <br>
+//! (mm, radians, read.precision.val, etc.) <br>
+ Standard_EXPORT void ResetUnits() ;
+ //! Computes transformation defined by two axis placements (in MAPPED_ITEM <br>
+//! or ITEM_DEFINED_TRANSFORMATION) taking into account their <br>
+//! representation contexts (i.e. units, which may be different) <br>
+//! Returns True if transformation is computed and is not an identity. <br>
+ Standard_EXPORT Standard_Boolean ComputeTransformation(const Handle(StepGeom_Axis2Placement3d)& Origin,const Handle(StepGeom_Axis2Placement3d)& Target,const Handle(StepRepr_Representation)& OrigContext,const Handle(StepRepr_Representation)& TargContext,const Handle(Transfer_TransientProcess)& TP,gp_Trsf& Trsf) ;
+ //! Computes transformation defined by given <br>
+//! REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION <br>
+ Standard_EXPORT Standard_Boolean ComputeSRRWT(const Handle(StepRepr_RepresentationRelationship)& SRR,const Handle(Transfer_TransientProcess)& TP,gp_Trsf& Trsf) ;
+
+
+
+
+ DEFINE_STANDARD_RTTI(STEPControl_ActorRead)
+
+protected:
+
+ //!Transfers product definition entity <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepBasic_ProductDefinition)& PD,const Handle(Transfer_TransientProcess)& TP) ;
+ //!Transfers next assembly usage occurence entity <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,const Handle(Transfer_TransientProcess)& TP) ;
+ //!Transfers shape representation entity <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepShape_ShapeRepresentation)& sr,const Handle(Transfer_TransientProcess)& TP,Standard_Boolean& isBound) ;
+ //!Transfers context dependent shape representation entity <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR,const Handle(Transfer_TransientProcess)& TP) ;
+ //!Transfers shape representation relationship entity <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepRepr_ShapeRepresentationRelationship)& und,const Handle(Transfer_TransientProcess)& TP,const Standard_Integer nbrep = 0) ;
+ //!Transfers geometric representation item entity such as ManifoldSolidBRep ,...etc <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepGeom_GeometricRepresentationItem)& git,const Handle(Transfer_TransientProcess)& TP,const Standard_Boolean isManifold) ;
+ //!Transfers mapped item <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepRepr_MappedItem)& mapit,const Handle(Transfer_TransientProcess)& TP) ;
+ //!Transfers FaceSurface entity <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder TransferEntity(const Handle(StepShape_FaceSurface)& fs,const Handle(Transfer_TransientProcess)& TP) ;
+ //!Tranlates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off. <br>
+ Standard_EXPORT Handle_TransferBRep_ShapeBinder OldWay(const Handle(Standard_Transient)& start,const Handle(Transfer_TransientProcess)& TP) ;
+
+
+
+private:
+
+
+ Standard_EXPORT TopoDS_Shell closeIDEASShell(const TopoDS_Shell& shell,const TopTools_ListOfShape& closingShells) ;
+
+ Standard_EXPORT void computeIDEASClosings(const TopoDS_Compound& comp,TopTools_IndexedDataMapOfShapeListOfShape& shellClosingMap) ;
+
+StepToTopoDS_NMTool myNMTool;
+Standard_Real myPrecision;
+Standard_Real myMaxTol;
+Handle_StepRepr_Representation mySRContext;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
+++ /dev/null
--- Created on: 1995-01-31
--- Created by: Dieter THIEMANN
--- 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 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.
-
-class ActorWrite from STEPControl
- inherits ActorOfFinderProcess from Transfer
-
- ---Purpose : This class performs the transfer of a Shape from TopoDS
- -- to AP203 or AP214 (CD2 or DIS)
-
-
-uses FinderProcess, TransientProcess, Binder, Finder, StepModel from StepData,
- Shape from TopoDS,
- StepModelType from STEPControl,
- Axis2Placement3d from StepGeom,
- ShapeRepresentation from StepShape,
- ShapeDefinitionRepresentation from StepShape,
- HAsciiString from TCollection,
- ContextTool from STEPConstruct,
- Part from STEPConstruct,
- HSequenceOfShape from TopTools, -- For non-manifold topology processing (ssv; 13.11.2010)
- NonManifoldSurfaceShapeRepresentation from StepShape -- For non-manifold topology processing (ssv; 13.11.2010)
-
-is
-
- Create returns mutable ActorWrite from STEPControl;
-
- Recognize (me : mutable; start : Finder) returns Boolean is redefined;
-
- Transfer (me : mutable; start : Finder; FP : mutable FinderProcess)
- returns mutable Binder is redefined;
- -- enchains : TransferShape , MakeProductData , and manages mode
- -- "simple" or in Assembly
-
- TransferSubShape (me : mutable; start : Finder;
- SDR : ShapeDefinitionRepresentation from StepShape;
- AX1 : out Axis2Placement3d from StepGeom;
- FP : mutable FinderProcess;
- shapeGroup : HSequenceOfShape from TopTools = NULL;
- isManifold : Boolean = Standard_True)
- returns mutable Binder;
-
- TransferShape (me : mutable; start : Finder;
- SDR : ShapeDefinitionRepresentation from StepShape;
- FP : mutable FinderProcess;
- shapeGroup : HSequenceOfShape from TopTools = NULL;
- isManifold : Boolean = Standard_True)
- returns mutable Binder;
-
- TransferCompound (me : mutable; start : Finder;
- SDR : ShapeDefinitionRepresentation from StepShape;
- FP : mutable FinderProcess)
- returns mutable Binder;
-
--- InitProductData (me: mutable) returns Part from STEPConstruct;
-
--- MakeProductData (me : mutable;
--- SR : ShapeRepresentation from StepShape;
--- SDRTool : Part from STEPConstruct;
--- model : StepModel from StepData;
--- addPRPC : Boolean)
--- returns mutable Binder;
-
-
- SetMode (me : mutable; M : StepModelType from STEPControl);
-
- Mode (me) returns StepModelType from STEPControl;
-
- SetGroupMode (me : mutable; mode : Integer);
- -- Default is 0 (no group item)
- -- 1 for REPRESENTATION_RELATIONSHIP with ITEM_DEFINED_TRANSFORMATION
- -- other positive values if needed (not implemented)
-
- GroupMode (me) returns Integer;
-
- SetTolerance (me : mutable; Tol : Real);
- -- Tol <= 0 means Unset
-
- IsAssembly (me; S: in out Shape from TopoDS) returns Boolean is virtual;
- ---Purpose: Customizable method to check whether shape S should
- -- be written as assembly or not
- -- Default implementation uses flag GroupMode and analyses
- -- the shape itself
- -- NOTE: this method can modify shape
-
- getNMSSRForGroup (me;
- shapeGroup : HSequenceOfShape from TopTools;
- FP : mutable FinderProcess;
- isNMSSRCreated : in out Boolean)
- returns NonManifoldSurfaceShapeRepresentation from StepShape
- is private;
- ---Purpose: Non-manifold shapes are stored in NMSSR group
- -- (NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION).
- -- Use this method to get the corresponding NMSSR (or
- -- to create a new one if doesn't exist yet)
- -- (ssv; 13.11.2010)
-
-fields
-
- mygroup : Integer;
- mytoler : Real;
- myContext: ContextTool from STEPConstruct;
-
-end ActorWrite;
//abv,gka 05.04.99: S4136: change parameters and update units
// PTV 22.08.2002 OCC609 transfer solo vertices into step file.
// PTV 16.09.2002 OCC725 transfer compound of vertices into one geometrical curve set.
-#include <STEPControl_ActorWrite.ixx>
+#include <STEPControl_ActorWrite.hxx>
#include <STEPControl_StepModelType.hxx>
// Transfer
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+IMPLEMENT_STANDARD_TYPE(STEPControl_ActorWrite)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_ActorOfFinderProcess),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(STEPControl_ActorWrite)
+
+
+IMPLEMENT_DOWNCAST(STEPControl_ActorWrite,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(STEPControl_ActorWrite)
+
// ============================================================================
// Function: DumpWhatIs
// Purpose: Use it in DEB mode to dump your shapes
STEPControl_StepModelType STEPControl_ActorWrite::Mode () const
{
- switch (themodetrans) {
+ switch (myModeTrans) {
case 0 : return STEPControl_AsIs;
case 1 : return STEPControl_FacetedBrep;
case 2 : return STEPControl_ShellBasedSurfaceModel;
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPControl_ActorWrite_HeaderFile
+#define _STEPControl_ActorWrite_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Real.hxx>
+#include <STEPConstruct_ContextTool.hxx>
+#include <Transfer_ActorOfFinderProcess.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Transfer_Finder.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <Handle_StepShape_ShapeDefinitionRepresentation.hxx>
+#include <Handle_StepGeom_Axis2Placement3d.hxx>
+#include <Handle_TopTools_HSequenceOfShape.hxx>
+#include <STEPControl_StepModelType.hxx>
+#include <Handle_StepShape_NonManifoldSurfaceShapeRepresentation.hxx>
+
+class Transfer_Finder;
+class Transfer_Binder;
+class Transfer_FinderProcess;
+class StepShape_ShapeDefinitionRepresentation;
+class StepGeom_Axis2Placement3d;
+class TopTools_HSequenceOfShape;
+class TopoDS_Shape;
+class StepShape_NonManifoldSurfaceShapeRepresentation;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Transfer_ActorOfFinderProcess);
+class STEPControl_ActorWrite;
+
+DEFINE_STANDARD_HANDLE(STEPControl_ActorWrite,Transfer_ActorOfFinderProcess)
+
+//! This class performs the transfer of a Shape from TopoDS <br>
+//! to AP203 or AP214 (CD2 or DIS) <br>
+class STEPControl_ActorWrite : public Transfer_ActorOfFinderProcess
+{
+
+public:
+
+
+ Standard_EXPORT STEPControl_ActorWrite();
+
+ Standard_EXPORT virtual Standard_Boolean Recognize(const Handle(Transfer_Finder)& start) ;
+
+ Standard_EXPORT virtual Handle_Transfer_Binder Transfer(const Handle(Transfer_Finder)& start,
+ const Handle(Transfer_FinderProcess)& FP) ;
+
+ Standard_EXPORT Handle_Transfer_Binder TransferSubShape(const Handle(Transfer_Finder)& start,
+ const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
+ Handle(StepGeom_Axis2Placement3d)& AX1,
+ const Handle(Transfer_FinderProcess)& FP,
+ const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL,
+ const Standard_Boolean isManifold = Standard_True) ;
+
+ Standard_EXPORT Handle_Transfer_Binder TransferShape(const Handle(Transfer_Finder)& start,
+ const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
+ const Handle(Transfer_FinderProcess)& FP,
+ const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL,
+ const Standard_Boolean isManifold = Standard_True) ;
+
+ Standard_EXPORT Handle_Transfer_Binder TransferCompound(const Handle(Transfer_Finder)& start,
+ const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
+ const Handle(Transfer_FinderProcess)& FP) ;
+
+ Standard_EXPORT void SetMode(const STEPControl_StepModelType M) ;
+
+ Standard_EXPORT STEPControl_StepModelType Mode() const;
+
+ Standard_EXPORT void SetGroupMode(const Standard_Integer mode) ;
+
+ Standard_EXPORT Standard_Integer GroupMode() const;
+
+ Standard_EXPORT void SetTolerance(const Standard_Real Tol) ;
+
+ //! Customizable method to check whether shape S should <br>
+ //! be written as assembly or not <br>
+ //! Default implementation uses flag GroupMode and analyses <br>
+ //! the shape itself <br>
+ //! NOTE: this method can modify shape <br>
+ Standard_EXPORT virtual Standard_Boolean IsAssembly(TopoDS_Shape& S) const;
+
+ DEFINE_STANDARD_RTTI(STEPControl_ActorWrite)
+
+private:
+
+ //! Non-manifold shapes are stored in NMSSR group <br>
+ //! (NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION). <br>
+ //! Use this method to get the corresponding NMSSR (or <br>
+ //! to create a new one if doesn't exist yet) <br>
+ //! (ssv; 13.11.2010) <br>
+ Standard_EXPORT Handle(StepShape_NonManifoldSurfaceShapeRepresentation) getNMSSRForGroup(const Handle(TopTools_HSequenceOfShape)& shapeGroup,
+ const Handle(Transfer_FinderProcess)& FP,
+ Standard_Boolean& isNMSSRCreated) const;
+
+ Standard_Integer mygroup;
+ Standard_Real mytoler;
+ STEPConstruct_ContextTool myContext;
+};
+#endif
+++ /dev/null
--- Created on: 1995-02-20
--- 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 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.
-
-class Controller from STEPControl inherits Controller from XSControl
-
- ---Purpose : defines basic controller for STEP processor
-
-uses
-
- CString,
- Protocol from Interface,
- InterfaceModel from Interface,
- WorkLibrary from IFSelect,
- ReturnStatus from IFSelect,
- ActorOfTransientProcess from Transfer,
- FinderProcess from Transfer,
- ActorOfFinderProcess from Transfer,
- Shape from TopoDS,
- WorkSession from XSControl
-
-is
-
- Create returns mutable Controller from STEPControl;
- ---Purpose : Initializes the use of STEP Norm (the first time) and
- -- returns a Controller
-
- NewModel (me) returns mutable InterfaceModel from Interface;
- ---Purpose : Creates a new empty Model ready to receive data of the Norm.
- -- It is taken from STEP Template Model
-
- ActorRead (me; model : InterfaceModel)
- returns mutable ActorOfTransientProcess from Transfer;
- ---Purpose : Returns a new Actor for Read attached to the pair (norm,appli)
- -- It is a PmsToTopoDSAct_Actor
-
- -- Redefined Transfer for Write (using Actor) --
- Customise (me: mutable; WS : in out WorkSession from XSControl) is redefined;
-
- TransferWriteShape (me; shape : Shape from TopoDS;
- FP : mutable FinderProcess from Transfer;
- model : mutable InterfaceModel from Interface;
- modetrans : Integer = 0) returns ReturnStatus
- is redefined;
- ---Purpose : Takes one Shape and transfers it to the InterfaceModel
- -- (already created by NewModel for instance)
- -- <modeshape> is to be interpreted by each kind of XstepAdaptor
- -- Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape
- -- -2 bad model (requires a StepModel)
- -- modeshape : 1 Facetted BRep, 2 Shell, 3 Manifold Solid
-
- -- for global initialisation
-
- Init (myclass) returns Boolean;
- ---Purpose : Standard Initialisation. It creates a Controller for STEP
- -- and records it to various names, available to select it later
- -- Returns True when done, False if could not be done
-
-end Controller;
//:j4 gka 16.03.99 S4134
// gka 05.04.99 S4136: parameters definitions changed
-#include <STEPControl_Controller.ixx>
+#include <STEPControl_Controller.hxx>
#include <StepSelect_WorkLibrary.hxx>
#include <IFSelect_Option.hxx>
#include <IFSelect_Profile.hxx>
//#include <StepAP214.hxx>
#include <RWStepAP214.hxx>
-
+#include <Standard_Type.hxx>
#include <Standard_Version.hxx>
#include <StepData_StepModel.hxx>
#include <APIHeaderSection_MakeHeader.hxx>
#include <XSAlgo.hxx>
#include <STEPSelections_SelectForTransfer.hxx>
#include <IFSelect_SelectModelRoots.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Transfer_FinderProcess.hxx>
+
+IMPLEMENT_STANDARD_TYPE(STEPControl_Controller)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(XSControl_Controller),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(STEPControl_Controller)
+
+IMPLEMENT_DOWNCAST(STEPControl_Controller,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(STEPControl_Controller)
STEPControl_Controller::STEPControl_Controller ()
: XSControl_Controller ("STEP", "step")
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPControl_Controller_HeaderFile
+#define _STEPControl_Controller_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_Controller.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Boolean.hxx>
+
+class Interface_InterfaceModel;
+class Transfer_ActorOfTransientProcess;
+class XSControl_WorkSession;
+class TopoDS_Shape;
+class Transfer_FinderProcess;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(XSControl_Controller);
+class STEPControl_Controller;
+
+DEFINE_STANDARD_HANDLE(STEPControl_Controller,XSControl_Controller)
+
+//! defines basic controller for STEP processor <br>
+class STEPControl_Controller : public XSControl_Controller {
+
+public:
+
+ //! Initializes the use of STEP Norm (the first time) and <br>
+//! returns a Controller <br>
+ Standard_EXPORT STEPControl_Controller();
+ //! Creates a new empty Model ready to receive data of the Norm. <br>
+//! It is taken from STEP Template Model <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel NewModel() const;
+ //! Returns a new Actor for Read attached to the pair (norm,appli) <br>
+//! It is a PmsToTopoDSAct_Actor <br>
+ Standard_EXPORT Handle_Transfer_ActorOfTransientProcess ActorRead(const Handle(Interface_InterfaceModel)& model) const;
+
+ Standard_EXPORT virtual void Customise(Handle(XSControl_WorkSession)& WS) ;
+ //! Takes one Shape and transfers it to the InterfaceModel <br>
+//! (already created by NewModel for instance) <br>
+//! <modeshape> is to be interpreted by each kind of XstepAdaptor <br>
+//! Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape <br>
+//! -2 bad model (requires a StepModel) <br>
+//! modeshape : 1 Facetted BRep, 2 Shell, 3 Manifold Solid <br>
+ Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape,const Handle(Transfer_FinderProcess)& FP,const Handle(Interface_InterfaceModel)& model,const Standard_Integer modetrans = 0) const;
+ //! Standard Initialisation. It creates a Controller for STEP <br>
+//! and records it to various names, available to select it later <br>
+//! Returns True when done, False if could not be done <br>
+ Standard_EXPORT static Standard_Boolean Init() ;
+
+
+
+
+ DEFINE_STANDARD_RTTI(STEPControl_Controller)
+
+protected:
+
+
+
+
+private:
+
+
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
+++ /dev/null
--- Created on: 1996-07-08
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class Reader from STEPControl inherits Reader from XSControl
-
- ---Purpose : Reads STEP files, checks them and translates their contents
- -- into Open CASCADE models. The STEP data can be that of
- -- a whole model or that of a specific list of entities in the model.
- -- As in XSControl_Reader, you specify the list using a selection.
- -- For the translation of iges files it is possible to use next sequence:
- -- To change translation parameters
- -- class Interface_Static should be used before beginning of
- -- translation (see STEP Parameters and General Parameters)
- -- Creation of reader - STEPControl_Reader reader;
- -- To load s file in a model use method reader.ReadFile("filename.stp")
- -- To print load results reader.PrintCheckLoad(failsonly,mode)
- -- where mode is equal to the value of enumeration IFSelect_PrintCount
- -- For definition number of candidates :
- -- Standard_Integer nbroots = reader. NbRootsForTransfer();
- -- To transfer entities from a model the following methods can be used:
- -- for the whole model - reader.TransferRoots();
- -- to transfer a list of entities: reader.TransferList(list);
- -- to transfer one entity Handle(Standard_Transient)
- -- ent = reader.RootForTransfer(num);
- -- reader.TransferEntity(ent), or
- -- reader.TransferOneRoot(num), or
- -- reader.TransferOne(num), or
- -- reader.TransferRoot(num)
- -- To obtain the result the following method can be used:
- -- reader.NbShapes() and reader.Shape(num); or reader.OneShape();
- -- To print the results of transfer use method:
- -- reader.PrintCheckTransfer(failwarn,mode);
- -- where printfail is equal to the value of enumeration
- -- IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer();
- -- Gets correspondence between a STEP entity and a result
- -- shape obtained from it.
- -- Handle(XSControl_WorkSession)
- -- WS = reader.WS();
- -- if ( WS->TransferReader()->HasResult(ent) )
- -- TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent);
-
-uses
-
- CString, OStream, Transient, SequenceOfTransient from TColStd,
- StepModel from StepData, WorkSession from XSControl,
- ReturnStatus from IFSelect, PrintCount from IFSelect,
- Shape from TopoDS, SequenceOfShape from TopTools,
- SequenceOfAsciiString from TColStd,
- Array1OfAsciiString from TColStd,
- Array1OfReal from TColStd,
- SequenceOfAsciiString from TColStd,
- RepresentationContext from StepRepr
-is
-
- Create returns Reader;
- ---Purpose : Creates a reader object with an empty STEP model.
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Reader;
- ---Purpose : Creates a Reader for STEP from an already existing Session
- -- Clears the session if it was not yet set for STEP
-
- StepModel (me) returns StepModel;
- ---Purpose : Returns the model as a StepModel.
- -- It can then be consulted (header, product)
-
- TransferRoot (me : in out; num : Integer = 1) returns Boolean;
- ---Purpose : Transfers a root given its rank in the list of candidate roots
- -- Default is the first one
- -- Returns True if a shape has resulted, false else
- -- Same as inherited TransferOneRoot, kept for compatibility
-
- NbRootsForTransfer (me : in out) returns Integer is redefined;
- ---Purpose : Determines the list of root entities from Model which are candidate for
- -- a transfer to a Shape (type of entities is PRODUCT)
-
- FileUnits(me : in out; theUnitLengthNames : in out SequenceOfAsciiString from TColStd;
- theUnitAngleNames : in out SequenceOfAsciiString from TColStd;
- theUnitSolidAngleNames : in out SequenceOfAsciiString from TColStd );
- ---Purpose : Returns sequence of all unit names for shape representations
- -- found in file
-
- findUnits(me : in out ; theReprContext : RepresentationContext from StepRepr;
- theNameUnits : in out Array1OfAsciiString from TColStd;
- theFactorUnits : in out Array1OfReal from TColStd) returns Boolean is private;
- ---Purpose : Returns units for length , angle and solidangle for shape representations
-
-
-end Reader;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <STEPControl_Reader.ixx>
+#include <STEPControl_Reader.hxx>
#include <STEPControl_Controller.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferReader.hxx>
#include <Interface_ShareFlags.hxx>
#include <STEPControl_ActorRead.hxx>
-
#include <StepBasic_ProductDefinition.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_Graph.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <TColStd_Array1OfAsciiString.hxx>
#include <TColStd_Array1OfReal.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <StepData_StepModel.hxx>
+#include <TColStd_SequenceOfAsciiString.hxx>
+#include <StepRepr_RepresentationContext.hxx>
+#include <TColStd_Array1OfAsciiString.hxx>
+#include <TColStd_Array1OfReal.hxx>
//=======================================================================
//function : STEPControl_Reader
return (nbFind);
}
-
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPControl_Reader_HeaderFile
+#define _STEPControl_Reader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <XSControl_Reader.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_StepData_StepModel.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_StepRepr_RepresentationContext.hxx>
+
+class XSControl_WorkSession;
+class StepData_StepModel;
+class TColStd_SequenceOfAsciiString;
+class StepRepr_RepresentationContext;
+class TColStd_Array1OfAsciiString;
+class TColStd_Array1OfReal;
+
+
+//! Reads STEP files, checks them and translates their contents <br>
+//! into Open CASCADE models. The STEP data can be that of <br>
+//! a whole model or that of a specific list of entities in the model. <br>
+//! As in XSControl_Reader, you specify the list using a selection. <br>
+//! For the translation of iges files it is possible to use next sequence: <br>
+//! To change translation parameters <br>
+//! class Interface_Static should be used before beginning of <br>
+//! translation (see STEP Parameters and General Parameters) <br>
+//! Creation of reader - STEPControl_Reader reader; <br>
+//! To load s file in a model use method reader.ReadFile("filename.stp") <br>
+//! To print load results reader.PrintCheckLoad(failsonly,mode) <br>
+//! where mode is equal to the value of enumeration IFSelect_PrintCount <br>
+//! For definition number of candidates : <br>
+//! Standard_Integer nbroots = reader. NbRootsForTransfer(); <br>
+//! To transfer entities from a model the following methods can be used: <br>
+//! for the whole model - reader.TransferRoots(); <br>
+//! to transfer a list of entities: reader.TransferList(list); <br>
+//! to transfer one entity Handle(Standard_Transient) <br>
+//! ent = reader.RootForTransfer(num); <br>
+//! reader.TransferEntity(ent), or <br>
+//! reader.TransferOneRoot(num), or <br>
+//! reader.TransferOne(num), or <br>
+//! reader.TransferRoot(num) <br>
+//! To obtain the result the following method can be used: <br>
+//! reader.NbShapes() and reader.Shape(num); or reader.OneShape(); <br>
+//! To print the results of transfer use method: <br>
+//! reader.PrintCheckTransfer(failwarn,mode); <br>
+//! where printfail is equal to the value of enumeration <br>
+//! IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer(); <br>
+//! Gets correspondence between a STEP entity and a result <br>
+//! shape obtained from it. <br>
+//! Handle(XSControl_WorkSession) <br>
+//! WS = reader.WS(); <br>
+//! if ( WS->TransferReader()->HasResult(ent) ) <br>
+//! TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent); <br>
+class STEPControl_Reader : public XSControl_Reader {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a reader object with an empty STEP model. <br>
+ Standard_EXPORT STEPControl_Reader();
+ //! Creates a Reader for STEP from an already existing Session <br>
+//! Clears the session if it was not yet set for STEP <br>
+ Standard_EXPORT STEPControl_Reader(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+ //! Returns the model as a StepModel. <br>
+//! It can then be consulted (header, product) <br>
+ Standard_EXPORT Handle_StepData_StepModel StepModel() const;
+ //! Transfers a root given its rank in the list of candidate roots <br>
+//! Default is the first one <br>
+//! Returns True if a shape has resulted, false else <br>
+//! Same as inherited TransferOneRoot, kept for compatibility <br>
+ Standard_EXPORT Standard_Boolean TransferRoot(const Standard_Integer num = 1) ;
+ //! Determines the list of root entities from Model which are candidate for <br>
+//! a transfer to a Shape (type of entities is PRODUCT) <br>
+ Standard_EXPORT virtual Standard_Integer NbRootsForTransfer() ;
+ //! Returns sequence of all unit names for shape representations <br>
+//! found in file <br>
+ Standard_EXPORT void FileUnits(TColStd_SequenceOfAsciiString& theUnitLengthNames,TColStd_SequenceOfAsciiString& theUnitAngleNames,TColStd_SequenceOfAsciiString& theUnitSolidAngleNames) ;
+
+
+
+
+
+protected:
+
+
+
+
+
+private:
+
+ //! Returns units for length , angle and solidangle for shape representations <br>
+ Standard_EXPORT Standard_Boolean findUnits(const Handle(StepRepr_RepresentationContext)& theReprContext,TColStd_Array1OfAsciiString& theNameUnits,TColStd_Array1OfReal& theFactorUnits) ;
+
+
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
+++ /dev/null
--- Created on: 1996-07-08
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class Writer from STEPControl
-
- ---Purpose : This class creates and writes
- -- STEP files from Open CASCADE models. A STEP file can be
- -- written to an existing STEP file or to a new one.
- -- Translation can be performed in one or several operations. Each
- -- translation operation outputs a distinct root entity in the STEP file.
-
-uses
-
- CString,
- StepModel from StepData, WorkSession from XSControl,
- ReturnStatus from IFSelect,
- Shape from TopoDS,
- StepModelType from STEPControl
-
-is
-
- Create returns Writer;
- ---Purpose : Creates a Writer from scratch
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Writer;
- ---Purpose : Creates a Writer from an already existing Session
- -- If <scratch> is True (D), clears already recorded data
-
- SetTolerance (me : in out; Tol : Real);
- ---Purpose : Sets a length-measure value that
- -- will be written to uncertainty-measure-with-unit
- -- when the next shape is translated.
-
- UnsetTolerance (me : in out);
- ---Purpose : Unsets the tolerance formerly forced by SetTolerance
-
- SetWS (me : in out; WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True);
- ---Purpose : Sets a specific session to <me>
-
- WS (me) returns WorkSession from XSControl;
- ---Purpose : Returns the session used in <me>
-
- Model (me : in out; newone : Boolean = Standard_False) returns StepModel;
- ---Purpose : Returns the produced model. Produces a new one if not yet done
- -- or if <newone> is True
- -- This method allows for instance to edit product or header
- -- data before writing.
-
- Transfer (me : in out; sh : Shape from TopoDS;
- mode : StepModelType from STEPControl;
- compgraph : Boolean = Standard_True)
- returns ReturnStatus;
- ---Purpose : Translates shape sh to a STEP
- -- entity. mode defines the STEP entity type to be output:
- -- - STEPControlStd_AsIs translates a shape to its highest possible
- -- STEP representation.
- -- - STEPControlStd_ManifoldSolidBrep translates a shape to a STEP
- -- manifold_solid_brep or brep_with_voids entity.
- -- - STEPControlStd_FacetedBrep translates a shape into a STEP
- -- faceted_brep entity.
- -- - STEPControlStd_ShellBasedSurfaceModel translates a shape into a STEP
- -- shell_based_surface_model entity.
- -- - STEPControlStd_GeometricCurveSet translates a shape into a STEP
- -- geometric_curve_set entity.
-
-
- Write (me : in out; filename : CString) returns ReturnStatus;
- ---Purpose : Writes a STEP model in the file identified by filename.
-
- PrintStatsTransfer (me; what : Integer; mode : Integer = 0);
- ---Purpose : Displays the statistics for the
- -- last translation. what defines the kind of statistics that are displayed:
- -- - 0 gives general statistics (number of translated roots,
- -- number of warnings, number of fail messages),
- -- - 1 gives root results,
- -- - 2 gives statistics for all checked entities,
- -- - 3 gives the list of translated entities,
- -- - 4 gives warning and fail messages,
- -- - 5 gives fail messages only.
- -- mode is used according to the use of what. If what is 0, mode is
- -- ignored. If what is 1, 2 or 3, mode defines the following:
- -- - 0 lists the numbers of STEP entities in a STEP model,
- -- - 1 gives the number, identifier, type and result type for each
- -- STEP entity and/or its status (fail, warning, etc.),
- -- - 2 gives maximum information for each STEP entity (i.e. checks),
- -- - 3 gives the number of entities by the type of a STEP entity,
- -- - 4 gives the number of of STEP entities per result type and/or status,
- -- - 5 gives the number of pairs (STEP or result type and status),
- -- - 6 gives the number of pairs (STEP or result type and status)
- -- AND the list of entity numbers in the STEP model.
-
-fields
-
- thesession : WorkSession from XSControl;
-
-end Writer;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <STEPControl_Writer.ixx>
+#include <STEPControl_Writer.hxx>
#include <STEPControl_Controller.hxx>
#include <STEPControl_ActorWrite.hxx>
#include <XSControl_TransferWriter.hxx>
#include <Message_ProgressIndicator.hxx>
#include <TopExp_Explorer.hxx>
#include <Transfer_FinderProcess.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <StepData_StepModel.hxx>
+#include <TopoDS_Shape.hxx>
+#include <STEPControl_Writer.hxx>
//=======================================================================
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPControl_Writer_HeaderFile
+#define _STEPControl_Writer_HeaderFile
+
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Real.hxx>
+#include <Handle_StepData_StepModel.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <STEPControl_StepModelType.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Integer.hxx>
+
+class XSControl_WorkSession;
+class StepData_StepModel;
+class TopoDS_Shape;
+
+
+//! This class creates and writes <br>
+//! STEP files from Open CASCADE models. A STEP file can be <br>
+//! written to an existing STEP file or to a new one. <br>
+//! Translation can be performed in one or several operations. Each <br>
+//! translation operation outputs a distinct root entity in the STEP file. <br>
+class STEPControl_Writer {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a Writer from scratch <br>
+ Standard_EXPORT STEPControl_Writer();
+ //! Creates a Writer from an already existing Session <br>
+//! If <scratch> is True (D), clears already recorded data <br>
+ Standard_EXPORT STEPControl_Writer(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+ //! Sets a length-measure value that <br>
+//! will be written to uncertainty-measure-with-unit <br>
+//! when the next shape is translated. <br>
+ Standard_EXPORT void SetTolerance(const Standard_Real Tol) ;
+ //! Unsets the tolerance formerly forced by SetTolerance <br>
+ Standard_EXPORT void UnsetTolerance() ;
+ //! Sets a specific session to <me> <br>
+ Standard_EXPORT void SetWS(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True) ;
+ //! Returns the session used in <me> <br>
+ Standard_EXPORT Handle_XSControl_WorkSession WS() const;
+ //! Returns the produced model. Produces a new one if not yet done <br>
+//! or if <newone> is True <br>
+//! This method allows for instance to edit product or header <br>
+//! data before writing. <br>
+ Standard_EXPORT Handle_StepData_StepModel Model(const Standard_Boolean newone = Standard_False) ;
+ //! Translates shape sh to a STEP <br>
+//! entity. mode defines the STEP entity type to be output: <br>
+//! - STEPControlStd_AsIs translates a shape to its highest possible <br>
+//! STEP representation. <br>
+//! - STEPControlStd_ManifoldSolidBrep translates a shape to a STEP <br>
+//! manifold_solid_brep or brep_with_voids entity. <br>
+//! - STEPControlStd_FacetedBrep translates a shape into a STEP <br>
+//! faceted_brep entity. <br>
+//! - STEPControlStd_ShellBasedSurfaceModel translates a shape into a STEP <br>
+//! shell_based_surface_model entity. <br>
+//! - STEPControlStd_GeometricCurveSet translates a shape into a STEP <br>
+//! geometric_curve_set entity. <br>
+ Standard_EXPORT IFSelect_ReturnStatus Transfer(const TopoDS_Shape& sh,const STEPControl_StepModelType mode,const Standard_Boolean compgraph = Standard_True) ;
+ //! Writes a STEP model in the file identified by filename. <br>
+ Standard_EXPORT IFSelect_ReturnStatus Write(const Standard_CString filename) ;
+ //! Displays the statistics for the <br>
+//! last translation. what defines the kind of statistics that are displayed: <br>
+//! - 0 gives general statistics (number of translated roots, <br>
+//! number of warnings, number of fail messages), <br>
+//! - 1 gives root results, <br>
+//! - 2 gives statistics for all checked entities, <br>
+//! - 3 gives the list of translated entities, <br>
+//! - 4 gives warning and fail messages, <br>
+//! - 5 gives fail messages only. <br>
+//! mode is used according to the use of what. If what is 0, mode is <br>
+//! ignored. If what is 1, 2 or 3, mode defines the following: <br>
+//! - 0 lists the numbers of STEP entities in a STEP model, <br>
+//! - 1 gives the number, identifier, type and result type for each <br>
+//! STEP entity and/or its status (fail, warning, etc.), <br>
+//! - 2 gives maximum information for each STEP entity (i.e. checks), <br>
+//! - 3 gives the number of entities by the type of a STEP entity, <br>
+//! - 4 gives the number of of STEP entities per result type and/or status, <br>
+//! - 5 gives the number of pairs (STEP or result type and status), <br>
+//! - 6 gives the number of pairs (STEP or result type and status) <br>
+//! AND the list of entity numbers in the STEP model. <br>
+ Standard_EXPORT void PrintStatsTransfer(const Standard_Integer what,const Standard_Integer mode = 0) const;
+
+
+
+
+
+protected:
+
+
+
+
+
+private:
+
+
+
+Handle_XSControl_WorkSession thesession;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
--- /dev/null
+STEPSelections_SelectForTransfer.hxx
+STEPSelections_SelectForTransfer.cxx
class SelectInstances;
- class SelectForTransfer;
+ imported SelectForTransfer;
-- Classes that are intended for assembly exploration
class SequenceOfAssemblyLink instantiates
+++ /dev/null
--- Created on: 2003-06-02
--- Created by: Galina KULIKOVA
--- Copyright (c) 2003-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 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.
-
-class SelectForTransfer from STEPSelections inherits SelectForTransfer from XSControl
-
- ---Purpose:
-
-uses
- EntityIterator,
- Graph,
- TransferReader from XSControl
-
-is
- Create returns mutable SelectForTransfer;
- Create (TR : TransferReader from XSControl) returns mutable SelectForTransfer;
- RootResult(me; G : Graph) returns EntityIterator is redefined;
-
-
-end SelectForTransfer;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <STEPSelections_SelectForTransfer.ixx>
+#include <STEPSelections_SelectForTransfer.hxx>
#include <Interface_EntityIterator.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <Transfer_TransientProcess.hxx>
+#include <Standard_Type.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <Interface_Graph.hxx>
+
+IMPLEMENT_STANDARD_TYPE(STEPSelections_SelectForTransfer)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(XSControl_SelectForTransfer),
+ STANDARD_TYPE(IFSelect_SelectExtract),
+ STANDARD_TYPE(IFSelect_SelectDeduct),
+ STANDARD_TYPE(IFSelect_Selection),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(STEPSelections_SelectForTransfer)
+
+
+IMPLEMENT_DOWNCAST(STEPSelections_SelectForTransfer,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(STEPSelections_SelectForTransfer)
+
+
//=======================================================================
//function : STEPSelections_SelectForTransfer
//purpose :
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _STEPSelections_SelectForTransfer_HeaderFile
+#define _STEPSelections_SelectForTransfer_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_SelectForTransfer.hxx>
+#include <XSControl_TransferReader.hxx>
+class XSControl_TransferReader;
+class Interface_EntityIterator;
+class Interface_Graph;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(XSControl_SelectForTransfer);
+class STEPSelections_SelectForTransfer;
+
+DEFINE_STANDARD_HANDLE(STEPSelections_SelectForTransfer,XSControl_SelectForTransfer)
+
+class STEPSelections_SelectForTransfer : public XSControl_SelectForTransfer {
+
+public:
+
+
+ Standard_EXPORT STEPSelections_SelectForTransfer();
+
+ Standard_EXPORT STEPSelections_SelectForTransfer(const Handle(XSControl_TransferReader)& TR);
+
+ Standard_EXPORT virtual Interface_EntityIterator RootResult(const Interface_Graph& G) const;
+
+
+
+
+ DEFINE_STANDARD_RTTI(STEPSelections_SelectForTransfer)
+};
+#endif
---Purpose: Basic tool for working with AP209 model
uses
- WorkSession from XSControl,
+ WorkSession_Handle from XSControl,
Product from StepBasic,
ProductDefinition from StepBasic,
ProductDefinitionFormation from StepBasic,
Create returns Construct;
---Purpose: Creates an empty tool
- Create (WS: WorkSession from XSControl) returns Construct;
+ Create (WS: WorkSession_Handle from XSControl) returns Construct;
---Purpose: Creates a tool and initializes it
- Init (me: in out; WS: WorkSession from XSControl) returns Boolean;
+ Init (me: in out; WS: WorkSession_Handle from XSControl) returns Boolean;
---Purpose: Initializes tool; returns True if succeeded
IsDesing(me; PD: ProductDefinitionFormation from StepBasic) returns Boolean;
--- /dev/null
+StepData_FileRecognizer.hxx
+StepData_FileRecognizer.cxx
+StepData_StepReaderTool.hxx
+StepData_StepReaderTool.cxx
+StepData_WriterLib.hxx
+StepData_WriterLib.cxx
class Protocol; -- basic protocol for Step
deferred class GeneralModule; -- general services
- deferred class FileRecognizer instantiates
- Recognizer from Interface (AsciiString from TCollection, Transient);
+ imported FileRecognizer;
class FileProtocol;
class HeaderTool;
class DescrReadWrite;
class StepReaderData; -- litteral description of Step File
- class StepReaderTool;
+ imported StepReaderTool;
deferred class ReadWriteModule;
class StepWriter; -- idem but in the other sense
class StepDumper;
- class WriterLib instantiates Library from LibCtl
- (Transient, ReadWriteModule, Protocol from StepData);
+ imported WriterLib;
class DefaultGeneral; -- Default Module which processes UnknownEntity
--- /dev/null
+// 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 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>
+
+ IMPLEMENT_STANDARD_HANDLE(StepData_FileRecognizer, Standard_Transient)
+ IMPLEMENT_STANDARD_RTTIEXT(StepData_FileRecognizer, Standard_Transient)
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _StepData_FileRecognizer_H__
+#define _StepData_FileRecognizer_H__
+
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_Recognizer.hxx>
+
+class TCollection_AsciiString;
+class Standard_Transient;
+class Standard_NoSuchObject;
+
+DEFINE_STANDARD_HANDLE(StepData_FileRecognizer, Standard_Transient)
+
+class StepData_FileRecognizer : public Interface_Recognizer <TCollection_AsciiString, Handle(Standard_Transient), Handle(StepData_FileRecognizer)>
+{
+public:
+ Standard_EXPORT StepData_FileRecognizer()
+ :Interface_Recognizer <TCollection_AsciiString, Handle(Standard_Transient),Handle(StepData_FileRecognizer)>()
+ {}
+
+ Standard_EXPORT void Add (const Handle(StepData_FileRecognizer)& theRecognizer);
+
+ DEFINE_STANDARD_RTTI(StepData_FileRecognizer);
+};
+
+
+
+#endif
+
+++ /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 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.
-
-class StepReaderTool from StepData inherits FileReaderTool
-
- ---Purpose : Specific FileReaderTool for Step; works with FileReaderData
- -- provides references evaluation, plus access to litteral data
- -- and specific methods defined by FileReaderTool
- -- Remarks : works with a ReaderLib to load Entities
-
-uses Integer, Boolean, Transient,
- InterfaceModel, Check, GeneralLib, ReaderLib,
- StepReaderData, FileRecognizer, Protocol from StepData
-
-is
-
- -- -- File data storing and access (specific) -- --
-
- Create (reader : mutable StepReaderData; protocol : Protocol from StepData)
- returns StepReaderTool;
- ---Purpose : creates StepReaderTool to work with a StepReaderData according
- -- to a Step Protocol. Defines the ReaderLib at this time
-
- -- -- setting empty entities before loading model -- --
-
- Prepare (me : in out; optimize : Boolean = Standard_True);
- ---Purpose : Bounds empty entities to records, uses default Recognition
- -- provided by ReaderLib and ReaderModule. Also calls computation
- -- of references (SetEntityNumbers from StepReaderData)
- -- Works only on data entities (skips header)
- -- <optimize> given False allows to test some internal algorithms
- -- which are normally avoided (see also StepReaderData)
-
- Prepare (me : in out; reco : mutable FileRecognizer;
- optimize : Boolean = Standard_True);
- ---Purpose : 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
-
- Recognize (me : in out; num : Integer;
- ach : in out Check; ent : out mutable Transient)
- returns Boolean;
- ---Purpose : recognizes records, by asking either ReaderLib (default) or
- -- FileRecognizer (if defined) to do so. <ach> is to call
- -- RecognizeByLib
-
- -- -- managing Header -- --
- -- Header is defined as a list of StepEntities (without ident)
-
- PrepareHeader (me : in out; reco : mutable FileRecognizer);
- ---Purpose : 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)
-
- -- -- loading entities into the model -- --
-
- BeginRead (me : in out; amodel : mutable InterfaceModel);
- ---Purpose : 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
-
- AnalyseRecord (me : in out;
- num : Integer; anent : mutable Transient; acheck : in out Check)
- returns Boolean;
- ---Purpose : fills an entity, given record no; works by using a ReaderLib
- -- to load each entity, which must be a Transient
- -- Actually, returned value is True if no fail, False else
-
- EndRead (me : in out; amodel : mutable InterfaceModel) is redefined;
- ---Purpose : Ends file reading after reading all the entities
- -- Here, it binds in the model, Idents to Entities (for checks)
-
-fields
-
- thereco : FileRecognizer;
- theglib : GeneralLib;
- therlib : ReaderLib;
-
-end StepReaderTool;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <StepData_StepReaderTool.ixx>
+#include <StepData_FileRecognizer.hxx>
+#include <StepData_StepReaderData.hxx>
+#include <StepData_Protocol.hxx>
+#include <Interface_Check.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <StepData_StepReaderTool.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <StepData_StepModel.hxx>
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _StepData_StepReaderTool_HeaderFile
+#define _StepData_StepReaderTool_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <StepData_FileRecognizer.hxx>
+#include <Interface_GeneralLib.hxx>
+#include <Interface_ReaderLib.hxx>
+#include <Interface_FileReaderTool.hxx>
+#include <Handle_StepData_StepReaderData.hxx>
+#include <Handle_StepData_Protocol.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_Interface_Check.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+
+class StepData_FileRecognizer;
+class StepData_StepReaderData;
+class StepData_Protocol;
+class Interface_Check;
+class Standard_Transient;
+class Interface_InterfaceModel;
+
+
+//! Specific FileReaderTool for Step; works with FileReaderData <br>
+//! provides references evaluation, plus access to litteral data <br>
+//! and specific methods defined by FileReaderTool <br>
+//! Remarks : works with a ReaderLib to load Entities <br>
+class StepData_StepReaderTool : public Interface_FileReaderTool
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! creates StepReaderTool to work with a StepReaderData according <br>
+//! to a Step Protocol. Defines the ReaderLib at this time <br>
+ Standard_EXPORT StepData_StepReaderTool(const Handle(StepData_StepReaderData)& reader,const Handle(StepData_Protocol)& protocol);
+ //! Bounds empty entities to records, uses default Recognition <br>
+//! provided by ReaderLib and ReaderModule. Also calls computation <br>
+//! of references (SetEntityNumbers from StepReaderData) <br>
+//! Works only on data entities (skips header) <br>
+//! <optimize> given False allows to test some internal algorithms <br>
+//! which are normally avoided (see also StepReaderData) <br>
+ Standard_EXPORT void Prepare(const Standard_Boolean optimize = Standard_True) ;
+ //! Bounds empty entities to records, works with a specific <br>
+//! FileRecognizer, stored and later used in Recognize <br>
+//! Works only on data entities (skips header) <br>
+//! <optimize : same as above <br>
+ Standard_EXPORT void Prepare(const Handle(StepData_FileRecognizer)& reco,const Standard_Boolean optimize = Standard_True) ;
+ //! recognizes records, by asking either ReaderLib (default) or <br>
+//! FileRecognizer (if defined) to do so. <ach> is to call <br>
+//! RecognizeByLib <br>
+ Standard_EXPORT Standard_Boolean Recognize(const Standard_Integer num,Handle(Interface_Check)& ach,Handle(Standard_Transient)& ent) ;
+ //! bounds empty entities and sub-lists to header records <br>
+//! works like Prepare + SetEntityNumbers, but for header <br>
+//! (N.B.: in Header, no Ident and no reference) <br>
+//! FileRecognizer is to specify Entities which are allowed to be <br>
+//! defined in the Header (not every type can be) <br>
+ Standard_EXPORT void PrepareHeader(const Handle(StepData_FileRecognizer)& reco) ;
+ //! fills model's header; that is, gives to it Header entities <br>
+//! and commands their loading. Also fills StepModel's Global <br>
+//! Check from StepReaderData's GlobalCheck <br>
+ Standard_EXPORT void BeginRead(const Handle(Interface_InterfaceModel)& amodel) ;
+ //! fills an entity, given record no; works by using a ReaderLib <br>
+//! to load each entity, which must be a Transient <br>
+//! Actually, returned value is True if no fail, False else <br>
+ Standard_EXPORT Standard_Boolean AnalyseRecord(const Standard_Integer num,const Handle(Standard_Transient)& anent,Handle(Interface_Check)& acheck) ;
+ //! Ends file reading after reading all the entities <br>
+//! Here, it binds in the model, Idents to Entities (for checks) <br>
+ Standard_EXPORT virtual void EndRead(const Handle(Interface_InterfaceModel)& amodel) ;
+
+private:
+
+Handle_StepData_FileRecognizer thereco;
+Interface_GeneralLib theglib;
+Interface_ReaderLib therlib;
+
+
+};
+
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <StepData_WriterLib.hxx>
+#include <NCollection_Handle.hxx>
+
+typedef LibCtl_GlobalNode <Handle(StepData_ReadWriteModule),
+ Handle(StepData_Protocol)>
+ StepData_GlobalNode;
+
+template <>
+Standard_EXPORT NCollection_Handle< StepData_GlobalNode > &
+StepData_WriterLib::GetGlobal()
+{
+ static NCollection_Handle < StepData_GlobalNode > aGlobal;
+ return aGlobal;
+}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _StepData_WriterLib_HeaderFile
+#define _StepData_WriterLib_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Transient.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <LibCtl_Library.hxx>
+#include <Handle_StepData_ReadWriteModule.hxx>
+#include <Handle_StepData_Protocol.hxx>
+#include <MMgt_TShared.hxx>
+#include <StepData_Protocol.hxx>
+
+
+class StepData_NodeOfWriterLib;
+class Standard_NoSuchObject;
+class Standard_Transient;
+class StepData_ReadWriteModule;
+class StepData_Protocol;
+
+typedef LibCtl_Library <Handle(Standard_Transient),
+ Handle(StepData_ReadWriteModule),
+ Handle(StepData_Protocol)>
+ StepData_WriterLib;
+
+#endif
\ No newline at end of file
--- /dev/null
+StepSelect_FileModifier.hxx
+StepSelect_FileModifier.cxx
+StepSelect_FloatFormat.hxx
+StepSelect_FloatFormat.cxx
class StepType;
- deferred class ModelModifier instantiates ModelModifier from IFSelect
- (StepModel from StepData, Protocol from StepData);
- deferred class FileModifier instantiates FileModifier from IFSelect
- (StepWriter from StepData);
+ imported FileModifier;
- class FloatFormat;
+ imported FloatFormat;
class WorkLibrary;
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <StepSelect_FileModifier.hxx>
+#include <StepData_StepWriter.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(StepSelect_FileModifier)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IFSelect_GeneralModifier),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(StepSelect_FileModifier)
+
+
+IMPLEMENT_DOWNCAST(StepSelect_FileModifier,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(StepSelect_FileModifier)
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _StepSelect_FileModifier_HeaderFile
+#define _StepSelect_FileModifier_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <IFSelect_GeneralModifier.hxx>
+#include <Handle_IFSelect_GeneralModifier.hxx>
+
+class StepData_StepWriter;
+class IFSelect_ContextWrite;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(IFSelect_GeneralModifier);
+class StepSelect_FileModifier;
+
+DEFINE_STANDARD_HANDLE(StepSelect_FileModifier,IFSelect_GeneralModifier)
+
+class StepSelect_FileModifier : public IFSelect_GeneralModifier
+{
+
+public:
+
+
+ Standard_EXPORT virtual void Perform (IFSelect_ContextWrite& ctx,
+ StepData_StepWriter& writer) const = 0;
+
+ DEFINE_STANDARD_RTTI(StepSelect_FileModifier)
+
+protected:
+ Standard_EXPORT StepSelect_FileModifier ()
+ : IFSelect_GeneralModifier (Standard_False)
+ { }
+};
+
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1994-06-01
--- Created by: Christian CAILLET
--- 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 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.
-
-class FloatFormat from StepSelect inherits FileModifier from StepSelect
-
- ---Purpose : This class gives control out format for floatting values :
- -- ZeroSuppress or no, Main Format, Format in Range (for values
- -- around 1.), as StepWriter allows to manage it.
- -- Formats are given under C-printf form
-
-uses CString, AsciiString from TCollection, HSequenceOfInteger from TColStd,
- CheckIterator, StepWriter , ContextWrite
-
-is
-
- Create returns mutable FloatFormat;
- ---Purpose : Creates a new FloatFormat, with standard options :
- -- ZeroSuppress, Main Format = %E,
- -- Format between 0.001 and 1000. = %f
-
- SetDefault (me : mutable; digits : Integer = 0);
- ---Purpose : Sets FloatFormat to default value (see Create) but if <digits>
- -- is given positive, it commands Formats (main and range) to
- -- ensure <digits> significant digits to be displayed
-
- SetZeroSuppress (me : mutable; mode : Boolean);
- ---Purpose : Sets ZeroSuppress mode to a new value
-
- SetFormat (me : mutable; format : CString = "%E");
- ---Purpose : Sets Main Format to a new value
- -- Remark : SetFormat, SetZeroSuppress and SetFormatForRange are
- -- independant
-
- SetFormatForRange (me : mutable; format : CString = "%f";
- Rmin : Real = 0.1; Rmax : Real = 1000.0);
- ---Purpose : Sets Format for Range to a new value with its range of
- -- application.
- -- To cancel it, give format as "" (empty string)
- -- Remark that if the condition (0. < Rmin < Rmax) is not
- -- verified, this secondary format will be ignored.
- -- Moreover, this secondary format is intended to be used in a
- -- range around 1.
-
-
- Format (me; zerosup : out Boolean;
- mainform : out AsciiString from TCollection;
- hasrange : out Boolean;
- forminrange : out AsciiString from TCollection;
- rangemin, rangemax : out Real);
- ---Purpose : Returns all recorded parameters :
- -- zerosup : ZeroSuppress status
- -- mainform : Main Format (which applies out of the range, or
- -- for every real if no range is set)
- -- hasrange : True if a FormatInRange is set, False else
- -- (following parameters do not apply if it is False)
- -- forminrange : Secondary Format (it applies inside the range)
- -- rangemin, rangemax : the range in which the secondary format
- -- applies
-
-
- Perform (me; ctx : in out ContextWrite;
- writer : in out StepWriter);
- ---Purpose : Sets the Floatting Formats of StepWriter to the recorded
- -- parameters
-
- Label (me) returns AsciiString from TCollection;
- ---Purpose : Returns specific Label : for instance,
- -- "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]"
-
-fields
-
- thezerosup : Boolean;
- themainform : AsciiString from TCollection;
- theformrange : AsciiString from TCollection;
- therangemin : Real;
- therangemax : Real;
-
-end FloatFormat;
-
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <StepSelect_FloatFormat.ixx>
+#include <StepSelect_FloatFormat.hxx>
#include <Interface_FloatWriter.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <IFSelect_ContextWrite.hxx>
+#include <StepData_StepWriter.hxx>
+#include <Standard_Type.hxx>
#include <stdio.h>
+IMPLEMENT_STANDARD_TYPE(StepSelect_FloatFormat)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(StepSelect_FileModifier),
+ STANDARD_TYPE(IFSelect_GeneralModifier),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(StepSelect_FloatFormat)
+
+
+IMPLEMENT_DOWNCAST(StepSelect_FloatFormat,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(StepSelect_FloatFormat)
StepSelect_FloatFormat::StepSelect_FloatFormat ()
: thezerosup (Standard_True) , themainform ("%E") ,
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _StepSelect_FloatFormat_HeaderFile
+#define _StepSelect_FloatFormat_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Boolean.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <Standard_Real.hxx>
+#include <StepSelect_FileModifier.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_CString.hxx>
+
+class TCollection_AsciiString;
+class IFSelect_ContextWrite;
+class StepData_StepWriter;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(StepSelect_FileModifier);
+class StepSelect_FloatFormat;
+
+DEFINE_STANDARD_HANDLE(StepSelect_FloatFormat,StepSelect_FileModifier)
+
+//! This class gives control out format for floatting values : <br>
+//! ZeroSuppress or no, Main Format, Format in Range (for values <br>
+//! around 1.), as StepWriter allows to manage it. <br>
+//! Formats are given under C-printf form <br>
+class StepSelect_FloatFormat : public StepSelect_FileModifier {
+
+public:
+
+ //! Creates a new FloatFormat, with standard options : <br>
+//! ZeroSuppress, Main Format = %E, <br>
+//! Format between 0.001 and 1000. = %f <br>
+ Standard_EXPORT StepSelect_FloatFormat();
+ //! Sets FloatFormat to default value (see Create) but if <digits> <br>
+//! is given positive, it commands Formats (main and range) to <br>
+//! ensure <digits> significant digits to be displayed <br>
+ Standard_EXPORT void SetDefault(const Standard_Integer digits = 0) ;
+ //! Sets ZeroSuppress mode to a new value <br>
+ Standard_EXPORT void SetZeroSuppress(const Standard_Boolean mode) ;
+ //! Sets Main Format to a new value <br>
+//! Remark : SetFormat, SetZeroSuppress and SetFormatForRange are <br>
+//! independant <br>
+ Standard_EXPORT void SetFormat(const Standard_CString format = "%E") ;
+ //! Sets Format for Range to a new value with its range of <br>
+//! application. <br>
+//! To cancel it, give format as "" (empty string) <br>
+//! Remark that if the condition (0. < Rmin < Rmax) is not <br>
+//! verified, this secondary format will be ignored. <br>
+//! Moreover, this secondary format is intended to be used in a <br>
+//! range around 1. <br>
+ Standard_EXPORT void SetFormatForRange(const Standard_CString format = "%f",const Standard_Real Rmin = 0.1,const Standard_Real Rmax = 1000.0) ;
+ //! Returns all recorded parameters : <br>
+//! zerosup : ZeroSuppress status <br>
+//! mainform : Main Format (which applies out of the range, or <br>
+//! for every real if no range is set) <br>
+//! hasrange : True if a FormatInRange is set, False else <br>
+//! (following parameters do not apply if it is False) <br>
+//! forminrange : Secondary Format (it applies inside the range) <br>
+//! rangemin, rangemax : the range in which the secondary format <br>
+//! applies <br>
+ Standard_EXPORT void Format(Standard_Boolean& zerosup,TCollection_AsciiString& mainform,Standard_Boolean& hasrange,TCollection_AsciiString& forminrange,Standard_Real& rangemin,Standard_Real& rangemax) const;
+ //! Sets the Floatting Formats of StepWriter to the recorded <br>
+//! parameters <br>
+ Standard_EXPORT void Perform(IFSelect_ContextWrite& ctx,StepData_StepWriter& writer) const;
+ //! Returns specific Label : for instance, <br>
+//! "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]" <br>
+ Standard_EXPORT TCollection_AsciiString Label() const;
+
+
+
+
+ DEFINE_STANDARD_RTTI(StepSelect_FloatFormat)
+
+protected:
+
+
+
+
+private:
+
+
+Standard_Boolean thezerosup;
+TCollection_AsciiString themainform;
+TCollection_AsciiString theformrange;
+Standard_Real therangemin;
+Standard_Real therangemax;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
GeometricSet from StepShape,
Shape from TopoDS,
BuilderError from StepToTopoDS,
- TransientProcess from Transfer,
+ TransientProcess_Handle from Transfer,
NMTool from StepToTopoDS
raises NotDone from StdFail
Create returns Builder from StepToTopoDS;
Create (S : ManifoldSolidBrep from StepShape;
- TP : TransientProcess from Transfer )
+ TP : TransientProcess_Handle from Transfer )
returns Builder from StepToTopoDS;
Create (S : BrepWithVoids from StepShape;
- TP : TransientProcess from Transfer )
+ TP : TransientProcess_Handle from Transfer )
returns Builder from StepToTopoDS;
Create ( S : FacetedBrep from StepShape;
- TP : TransientProcess from Transfer )
+ TP : TransientProcess_Handle from Transfer )
returns Builder from StepToTopoDS;
Create (S : FacetedBrepAndBrepWithVoids from StepShape;
- TP : TransientProcess from Transfer )
+ TP : TransientProcess_Handle from Transfer )
returns Builder from StepToTopoDS;
Create (S : ShellBasedSurfaceModel from StepShape;
- TP : TransientProcess from Transfer;
+ TP : TransientProcess_Handle from Transfer;
NMTool : in out NMTool from StepToTopoDS )
returns Builder from StepToTopoDS;
Create ( S : GeometricSet from StepShape;
- TP : TransientProcess from Transfer )
+ TP : TransientProcess_Handle from Transfer )
returns Builder from StepToTopoDS;
Init (me : in out;
S : ManifoldSolidBrep from StepShape;
- TP : TransientProcess from Transfer );
+ TP : TransientProcess_Handle from Transfer );
Init (me : in out;
S : BrepWithVoids from StepShape;
- TP : TransientProcess from Transfer );
+ TP : TransientProcess_Handle from Transfer );
Init (me : in out;
S : FacetedBrep from StepShape;
- TP : TransientProcess from Transfer );
+ TP : TransientProcess_Handle from Transfer );
Init (me : in out;
S : FacetedBrepAndBrepWithVoids from StepShape;
- TP : TransientProcess from Transfer );
+ TP : TransientProcess_Handle from Transfer );
Init (me : in out;
S : ShellBasedSurfaceModel from StepShape;
- TP : TransientProcess from Transfer;
+ TP : TransientProcess_Handle from Transfer;
NMTool : in out NMTool from StepToTopoDS );
Init (me : in out;
S : EdgeBasedWireframeModel from StepShape;
- TP : TransientProcess from Transfer );
+ TP : TransientProcess_Handle from Transfer );
Init (me : in out;
S : FaceBasedSurfaceModel from StepShape;
- TP : TransientProcess from Transfer );
+ TP : TransientProcess_Handle from Transfer );
Init (me : in out;
S : GeometricSet from StepShape;
- TP : TransientProcess from Transfer );
+ TP : TransientProcess_Handle from Transfer );
Value (me) returns Shape from TopoDS
raises NotDone
#include <TopoDS_Compound.hxx>
#include <TopExp_Explorer.hxx>
+#include <Transfer_TransientProcess.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
---Purpose : Produces instances by Transformation of a basic item
uses Trsf from gp, Shape from TopoDS,
- TransientProcess from Transfer,
+ TransientProcess_Handle from Transfer,
Axis2Placement3d from StepGeom,
CartesianTransformationOperator3d from StepGeom,
MappedItem from StepRepr
TranslateMappedItem (me : in out; mapit : MappedItem from StepRepr;
- TP : mutable TransientProcess from Transfer)
+ TP : TransientProcess_Handle from Transfer)
returns Shape;
---Purpose : Translates a MappedItem. More precisely
-- A MappedItem has a MappingSource and a MappingTarget
#include <StepToTopoDS_MakeTransformed.ixx>
#include <Transfer_Binder.hxx>
+#include <Transfer_TransientProcess.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <StepToGeom_MakeAxis2Placement.hxx>
Curve from Geom2d,
Curve from Geom,
Surface from Geom,
- TransientProcess from Transfer
+ TransientProcess_Handle from Transfer
is
Create returns Tool from StepToTopoDS;
Create(Map : DataMapOfTRI from StepToTopoDS;
- TP : TransientProcess from Transfer)
+ TP : TransientProcess_Handle from Transfer)
returns Tool from StepToTopoDS;
Init(me : in out;
Map : DataMapOfTRI from StepToTopoDS;
- TP : TransientProcess from Transfer);
+ TP : TransientProcess_Handle from Transfer);
IsBound(me : in out;
TRI : TopologicalRepresentationItem from StepShape)
ComputePCurve(me) returns Boolean from Standard;
- TransientProcess(me) returns TransientProcess from Transfer;
+ TransientProcess(me) returns TransientProcess_Handle from Transfer;
-- Statistics
myComputePC : Boolean from Standard;
- myTransProc : TransientProcess from Transfer;
+ myTransProc : TransientProcess_Handle from Transfer;
-- Statistics :
-- Surface continuity
-- cyclic references is implemented.
uses
- TransientProcess from Transfer,
+ TransientProcess_Handle from Transfer,
CompositeCurve from StepGeom,
Surface from StepGeom,
Surface from Geom,
---Purpose: Empty constructor
Create (CC: CompositeCurve from StepGeom;
- TP: TransientProcess from Transfer)
+ TP: TransientProcess_Handle from Transfer)
returns TranslateCompositeCurve;
---Purpose: Translates standalone composite_curve
Create (CC: CompositeCurve from StepGeom;
- TP: TransientProcess from Transfer;
+ TP: TransientProcess_Handle from Transfer;
S : Surface from StepGeom;
Surf: Surface from Geom)
returns TranslateCompositeCurve;
Init (me: in out;
CC: CompositeCurve from StepGeom;
- TP: TransientProcess from Transfer)
+ TP: TransientProcess_Handle from Transfer)
returns Boolean;
---Purpose: Translates standalone composite_curve
Init (me: in out;
CC: CompositeCurve from StepGeom;
- TP: TransientProcess from Transfer;
+ TP: TransientProcess_Handle from Transfer;
S : Surface from StepGeom;
Surf: Surface from Geom)
returns Boolean;
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Iterator.hxx>
-
+#include <Transfer_TransientProcess.hxx>
#include <ShapeExtend_WireData.hxx>
#include <ShapeFix_Wire.hxx>
---Purpose: Translate curve_bounded_surface into TopoDS_Face
uses
- TransientProcess from Transfer,
+ TransientProcess_Handle from Transfer,
CurveBoundedSurface from StepGeom,
Face from TopoDS
---Purpose: Create empty tool
Create (CBS: CurveBoundedSurface from StepGeom;
- TP: TransientProcess from Transfer)
+ TP: TransientProcess_Handle from Transfer)
returns TranslateCurveBoundedSurface;
---Purpose: Translate surface
Init (me: in out;
CBS: CurveBoundedSurface from StepGeom;
- TP: TransientProcess from Transfer)
+ TP: TransientProcess_Handle from Transfer)
returns Boolean;
---Purpose: Translate surface
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Iterator.hxx>
+#include <Transfer_TransientProcess.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
-- returns Shape from TopoDS;
---Purpose: Returns a new shape without undirect surfaces.
- AddResult (FP: FinderProcess from Transfer;
+ AddResult (FP: FinderProcess_Handle from Transfer;
Shape: Shape from TopoDS;
entity: Transient from Standard);
---Purpose: Adds an entity into the list of results (binders) for
-- shape stored in FinderProcess
- AddResult (FP: FinderProcess from Transfer;
+ AddResult (FP: FinderProcess_Handle from Transfer;
Tool: Tool from TopoDSToStep);
---Purpose: Adds all entities recorded in Tool into the map of results
-- (binders) stored in FinderProcess
#include <TransferBRep_ShapeMapper.hxx>
#include <TransferBRep.hxx>
#include <Transfer_Binder.hxx>
+#include <Transfer_FinderProcess.hxx>
#include <MoniTool_DataMapOfShapeTransient.hxx>
#include <TopoDSToStep_Tool.hxx>
#include <MoniTool_DataMapIteratorOfDataMapOfShapeTransient.hxx>
uses
- FinderProcess from Transfer,
+ FinderProcess_Handle from Transfer,
Shape from TopoDS,
Tool from TopoDSToStep,
BuilderError from TopoDSToStep,
Create(S : Shape from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns Builder from TopoDSToStep;
Init(me : in out;
S : Shape from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer);
+ FP : FinderProcess_Handle from Transfer);
-- -----------------------------------------------------------
-- Get the Result
// commercial license or contractual agreement.
#include <TopoDSToStep_Builder.ixx>
-
#include <TopoDSToStep_Tool.hxx>
-
#include <TopoDSToStep_MakeStepFace.hxx>
+#include <Message_ProgressIndicator.hxx>
#include <StepShape_ConnectedFaceSet.hxx>
#include <StepShape_HArray1OfFace.hxx>
#include <StepShape_ClosedShell.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Face.hxx>
-
#include <TopExp_Explorer.hxx>
-
+#include <TCollection_HAsciiString.hxx>
#include <TColStd_SequenceOfTransient.hxx>
#include <TransferBRep_ShapeMapper.hxx>
-#include <TCollection_HAsciiString.hxx>
-
-#include <Message_ProgressIndicator.hxx>
+#include <Transfer_FinderProcess.hxx>
// ============================================================================
// Method : TopoDSToStep_Builder::TopoDSToStep_Builder
uses Solid from TopoDS,
BrepWithVoids from StepShape,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
is
Create ( S : Solid from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeBrepWithVoids;
Value (me) returns BrepWithVoids from StepShape
uses Shell from TopoDS,
Solid from TopoDS,
FacetedBrep from StepShape,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
is
Create ( S : Shell from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeFacetedBrep;
Create ( S : Solid from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeFacetedBrep;
Value (me) returns FacetedBrep from StepShape
uses Solid from TopoDS,
FacetedBrepAndBrepWithVoids from StepShape,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
is
Create ( S : Solid from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeFacetedBrepAndBrepWithVoids;
Value (me) returns FacetedBrepAndBrepWithVoids from StepShape
uses Shape from TopoDS,
GeometricCurveSet from StepShape,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
is
Create ( SH : Shape from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeGeometricCurveSet;
Value (me) returns GeometricCurveSet from StepShape
uses Shell from TopoDS,
Solid from TopoDS,
ManifoldSolidBrep from StepShape,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
is
Create ( S : Shell from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeManifoldSolidBrep;
Create ( S : Solid from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeManifoldSolidBrep;
Value (me) returns ManifoldSolidBrep from StepShape
Shell from TopoDS,
Solid from TopoDS,
ShellBasedSurfaceModel from StepShape,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
is
Create ( F : Face from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeShellBasedSurfaceModel;
Create ( S : Shell from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeShellBasedSurfaceModel;
Create ( S : Solid from TopoDS;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeShellBasedSurfaceModel;
Value (me) returns ShellBasedSurfaceModel from StepShape
TopologicalRepresentationItem from StepShape,
Tool from TopoDSToStep,
MakeEdgeError from TopoDSToStep,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
Create(E : Edge from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeStepEdge;
Init(me : in out;
E : Edge from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer);
+ FP : FinderProcess_Handle from Transfer);
Value (me) returns TopologicalRepresentationItem from StepShape
#include <TopExp_Explorer.hxx>
#include <TopExp.hxx>
#include <TransferBRep_ShapeMapper.hxx>
+#include <Transfer_FinderProcess.hxx>
#include <TCollection_HAsciiString.hxx>
// Processing of non-manifold topology (ssv; 11.11.2010)
TopologicalRepresentationItem from StepShape,
Tool from TopoDSToStep,
MakeFaceError from TopoDSToStep,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
Create (F : Face from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeStepFace;
Init(me : in out;
F : Face from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer);
+ FP : FinderProcess_Handle from Transfer);
Value (me) returns TopologicalRepresentationItem from StepShape
raises NotDone
#include <TColStd_SequenceOfTransient.hxx>
#include <TransferBRep_ShapeMapper.hxx>
+#include <Transfer_FinderProcess.hxx>
#include <TCollection_HAsciiString.hxx>
#include <ShapeAlgo.hxx>
TopologicalRepresentationItem from StepShape,
Tool from TopoDSToStep,
MakeVertexError from TopoDSToStep,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
Create (V : Vertex from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeStepVertex;
Init(me : in out;
V : Vertex from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer);
+ FP : FinderProcess_Handle from Transfer);
Value (me) returns TopologicalRepresentationItem from StepShape
#include <gp_Pnt.hxx>
#include <TransferBRep_ShapeMapper.hxx>
-
+#include <Transfer_FinderProcess.hxx>
#include <TCollection_HAsciiString.hxx>
// Processing of non-manifold topology (ssv; 11.11.2010)
TopologicalRepresentationItem from StepShape,
Tool from TopoDSToStep,
MakeWireError from TopoDSToStep,
- FinderProcess from Transfer
+ FinderProcess_Handle from Transfer
raises NotDone from StdFail
Create (W : Wire from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns MakeStepWire;
Init(me : in out;
W : Wire from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer);
+ FP : FinderProcess_Handle from Transfer);
Value (me) returns TopologicalRepresentationItem from StepShape
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_HArray1OfCartesianPoint.hxx>
#include <TransferBRep_ShapeMapper.hxx>
+#include <Transfer_FinderProcess.hxx>
#include <TCollection_HAsciiString.hxx>
#include <ShapeExtend_WireData.hxx>
#include <ShapeFix_Wire.hxx>
uses
- FinderProcess from Transfer,
+ FinderProcess_Handle from Transfer,
Edge from TopoDS,
Face from TopoDS,
Shape from TopoDS,
Create(S : Shape from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer)
+ FP : FinderProcess_Handle from Transfer)
returns WireframeBuilder from TopoDSToStep;
Init(me : in out;
S : Shape from TopoDS;
T : in out Tool from TopoDSToStep;
- FP : mutable FinderProcess from Transfer);
+ FP : FinderProcess_Handle from Transfer);
-- -----------------------------------------------------------
-- Get the Result
--- /dev/null
+Transfer_Actor.hxx
+Transfer_ActorOfFinderProcess.hxx
+Transfer_ActorOfFinderProcess.cxx
+Transfer_ActorOfTransientProcess.hxx
+Transfer_ActorOfTransientProcess.cxx
+Transfer_TransferOutput.hxx
+Transfer_TransferOutput.cxx
+Transfer_FinderProcess.hxx
+Transfer_FinderProcess.cxx
+Transfer_TransientProcess.hxx
+Transfer_TransientProcess.cxx
+Transfer_Iterator.hxx
+Transfer_IteratorOfProcessForFinder.hxx
+Transfer_IteratorOfProcessForTransient.hxx
+Transfer_DispatchControl.hxx
+Transfer_DispatchControl.cxx
+Transfer_TransferDispatch.hxx
+Transfer_TransferDispatch.cxx
+Transfer_ResultFromTransient.hxx
+Transfer_ResultFromTransient.cxx
+Transfer_ResultFromModel.hxx
+Transfer_ResultFromModel.cxx
+Transfer_TransferProcess.hxx
+Transfer_TransientProcess_Handle.hxx
+Transfer_FinderProcess_Handle.hxx
+Transfer_Mapper.hxx
+Transfer_TransientMapper.hxx
+Transfer_TransientMapper.cxx
\ No newline at end of file
is
class DataInfo; -- used in Mapper
-
deferred class Finder;
- generic class Mapper;
- class TransientMapper instantiates Mapper
- (Transient, MapTransientHasher from TColStd, DataInfo);
+ imported Mapper;
+ imported TransientMapper;
class FindHasher;
deferred class Binder;
- class VoidBinder;
- generic class SimpleBinder;
- class SimpleBinderOfTransient;
- class BinderOfTransientInteger;
- class TransientListBinder;
- class MultipleBinder;
+ class VoidBinder;
+ class SimpleBinderOfTransient;
+ class BinderOfTransientInteger;
+ class TransientListBinder;
+ class MultipleBinder;
- class ResultFromTransient;
- class ResultFromModel;
+ imported ResultFromTransient;
+ imported ResultFromModel;
class TransferIterator;
- generic class TransferProcess;
- generic class TransferMap;
- generic class Iterator;
- generic class Actor;
-
- class ProcessForTransient instantiates TransferProcess
- (Transient, MapTransientHasher from TColStd,
- HSequenceOfTransient from TColStd);
- ---Purpose : Manages Transfer of Transient Objects. Produces also
- -- ActorOfTransientProcess (deferred class),
- -- IteratorOfTransientProcess (for Results),
- -- TransferMapOfTransientProcess (internally used)
- -- Normally uses as TransientProcess, which adds some specifics
-
- class TransientProcess; -- inherits TransferForTransient
- class ActorOfTransientProcess;
+ imported TransferProcess;
+ imported Iterator;
+ imported Actor;
+ imported TransientProcess_Handle; -- Workaround for WOK creating handles of non-cdl classes
+ imported TransientProcess;
+ ---Purpose : Manages Transfer of Transient Objects.
+ imported ActorOfTransientProcess;
class SequenceOfFinder instantiates
Sequence from TCollection (Finder);
class HSequenceOfFinder instantiates
HSequence from TCollection (Finder,SequenceOfFinder);
- class ProcessForFinder instantiates TransferProcess
- (Finder, FindHasher, HSequenceOfFinder);
-
- class FinderProcess;
- class ActorOfFinderProcess;
-
- class TransferOutput;
+ imported IteratorOfProcessForFinder;
+ imported IteratorOfProcessForTransient;
+ imported FinderProcess;
+ imported FinderProcess_Handle;-- Workaround for WOK creating handles of non-cdl classes
+ imported ActorOfFinderProcess;
+ imported TransferOutput;
class TransferInput;
- class DispatchControl;
- class TransferDispatch;
- class ActorDispatch;
+ imported DispatchControl;
+ imported TransferDispatch;
+ imported ActorDispatch;
class MapContainer;
+++ /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 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 <Transfer_Actor.ixx>
-
-// TheStart : Handle(Standard_Transient) ou (Transfer_Finder)
-
-
-
-Transfer_Actor::Transfer_Actor () { }
-
-
- Standard_Boolean Transfer_Actor::Recognize (const TheStart& /*start*/)
- { return Standard_True; }
-
- Handle(Transfer_Binder) Transfer_Actor::Transferring
- (const TheStart& /*start*/,
- const Handle(Transfer_TransferProcess)& /*TP*/)
- { return NullResult(); }
-
-
- Handle(Transfer_SimpleBinderOfTransient)
- Transfer_Actor::TransientResult
- (const Handle(Standard_Transient)& res) const
-{
- Handle(Transfer_SimpleBinderOfTransient) binder;
- if (res.IsNull()) return binder;
- binder = new Transfer_SimpleBinderOfTransient;
- binder->SetResult (res);
- return binder;
-}
-
-
- Handle(Transfer_Binder) Transfer_Actor::NullResult () const
-{
- Handle(Transfer_Binder) binder;
- return binder;
-}
-
-
- void Transfer_Actor::SetNext
- (const Handle(Transfer_Actor)& next)
-{
- if (thenext == next) return;
- if (thenext.IsNull()) thenext = next;
- else if (thenext->IsLast()) { next->SetNext(thenext); thenext = next; }
- else thenext->SetNext(next);
-}
-
- Handle(Transfer_Actor) Transfer_Actor::Next () const
- { return thenext; }
-
- void Transfer_Actor::SetLast (const Standard_Boolean mode)
- { thelast = mode; }
-
-
- Standard_Boolean Transfer_Actor::IsLast () const
- { return thelast; }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_Actor_HeaderFile
+#define _Transfer_Actor_HeaderFile
+
+#include <Standard_Boolean.hxx>
+#include <MMgt_TShared.hxx>
+#include <Transfer_Binder.hxx>
+#include <Transfer_SimpleBinderOfTransient.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Transfer_HSequenceOfFinder.hxx>
+
+//! An Actor performs the effective Transfer of a Starting
+//! Object, piloted by a TransferProcess. That is :
+//! - It recognizes, for a Starting Object, the case to be run
+//! - Then, it performs the Transfer : the recommanded way to
+//! work is to define for each Type of Object to Transfer, a
+//! specific Transfer Tool, then to call it by the Actor
+//! - It assumes that the Result of Transfer is stored in a
+//! Binder, it creates it if the Tool does not do
+//! It can use the TransferProcess for intermediate Results
+//! - It returns the Binder which stores the Result
+//! It no Result can be produced, it returns a Null Handle
+//! It may bind this Binder to <start> but is not obliged :
+//! TransferProcess controls this point.
+//!
+//! Remark about the kind of returned Binder :
+//! - for a Transient Result, use the method TransientResult
+//! - else, cast and query the Binder itself
+//!
+//! An Actor can be built by combination : this allows to
+//! gather several Actors, each one processing a set of cases.
+
+template < class ActorHandle, class TheStart, class TransferProcessHandle >
+class Transfer_Actor : public MMgt_TShared
+{
+private:
+ ActorHandle myNext;
+ Standard_Boolean myLast;
+public:
+ Standard_EXPORT Transfer_Actor () { }
+
+ //! Prerequesite for Transfer : the method Transfer is
+ //! called on a starting object only if Recognize has
+ //! returned True on it. This allows to define a list
+ //! of Actors, each one processing a definite kind of data.
+ //! TransferProcess calls Recognize on each one before
+ //! calling Transfer. But even if Recognize has returned
+ //! true, Transfer can reject by returning a Null Binder
+ //! (afterwards rejection), the theNext actor is then invoked.
+ //! The provided default returns True, can be redefined.
+ Standard_EXPORT Standard_Boolean Recognize (const TheStart& /*start*/)
+ {
+ return Standard_True;
+ }
+
+ //! Specific action of Transfer. The Result is stored in
+ //! the returned Binder, or a Null Handle for "No result"
+ //! (Default defined as doing nothing; should be deffered)
+ //! "mutable" allows the Actor to record intermediate
+ //! information, in addition to those of TransferProcess.
+ //! In case of Error during a Transfer, any kind of
+ //! exception can be raised.
+ Standard_EXPORT Handle(Transfer_Binder) Transferring (const TheStart& /*start*/,
+ const TransferProcessHandle& /*TP*/)
+ {
+ return NullResult();
+ }
+
+ //! Prepares and returns a binder for a Transient result.
+ //! Returns a Null Handle if <theRes> is itself null.
+ Standard_EXPORT Handle(Transfer_SimpleBinderOfTransient) TransientResult
+ (const Handle(Standard_Transient)& theRes) const
+ {
+ Handle(Transfer_SimpleBinderOfTransient) binder;
+ if (theRes.IsNull())
+ return binder;
+ binder = new Transfer_SimpleBinderOfTransient;
+ binder->SetResult (theRes);
+ return binder;
+ }
+
+ //! Returns a binder for no result, i.e. a null handle.
+ Standard_EXPORT Handle(Transfer_Binder) NullResult () const
+ {
+ Handle(Transfer_Binder) binder;
+ return binder;
+ }
+
+ //! If <theMode> is true, commands an Actor to be set at the
+ //! end of the list of Actors (see SetNext).
+ //! If it is False (creation default), each add Actor is
+ //! set at the beginning of the list.
+ //! This allows to define default Actors (which are Last).
+ Standard_EXPORT void SetLast (const Standard_Boolean theMode = Standard_True)
+ {
+ myLast = theMode;
+ }
+
+ //! Defines a Next Actor : it can then be asked to work if
+ //! <me> produces no result for a given type of Object.
+ //! If Next is already set and is not "Last", calls
+ //! SetNext on it. If Next defined and "Last", the new
+ //! actor is added before it in the list.
+ Standard_EXPORT void SetNext (const ActorHandle& theNext)
+ {
+ if (myNext == theNext)
+ return;
+ if (myNext.IsNull())
+ myNext = theNext;
+ else if (myNext->IsLast())
+ {
+ theNext->SetNext(myNext);
+ myNext = theNext;
+ }
+ else
+ myNext->SetNext(theNext);
+ }
+
+ //! Returns the actor defined as Next, or a null handle.
+ Standard_EXPORT ActorHandle Next () const
+ {
+ return myNext;
+ }
+
+ //! Returns the Last status (see SetLast).
+ Standard_EXPORT Standard_Boolean IsLast () const
+ {
+ return myLast;
+ }
+};
+#endif
+++ /dev/null
--- Created on: 1994-05-24
--- Created by: Christian CAILLET
--- 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 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.
-
-class ActorDispatch from Transfer inherits ActorOfTransientProcess
-
- ---Purpose : This class allows to work with a TransferDispatch, i.e. to
- -- transfer entities from a data set to another one defined by
- -- the same interface norm, with the following features :
- -- - ActorDispatch itself acts as a default actor, i.e. it copies
- -- entities with the general service Copy, as CopyTool does
- -- - it allows to add other actors for specific ways of transfer,
- -- which may include data modifications, conversions ...
- -- - and other features from TransferDispatch (such as mapping
- -- other than one-one)
-
-uses Transient, InterfaceModel, GeneralLib, Protocol from Interface,
- TransferDispatch, TransientProcess, Binder
-
-raises InterfaceError
-
-is
-
- Create (amodel : InterfaceModel; lib : GeneralLib)
- returns mutable ActorDispatch;
- ---Purpose : Creates an ActorDispatch from a Model. Works with a General
- -- Service Library, given as an Argument
- -- This causes TransferDispatch and its TransientProcess to be
- -- created, with default actor <me>
-
- Create (amodel : InterfaceModel; protocol : Protocol from Interface)
- returns mutable ActorDispatch;
- ---Purpose : Same as above, but Library is defined through a Protocol
-
- Create (amodel : InterfaceModel) returns mutable ActorDispatch
- ---Purpose : Same as above, but works with the Active Protocol
- raises InterfaceError;
- -- Error if no Active Protocol is defined
-
- AddActor (me : mutable; actor : mutable ActorOfTransientProcess from Transfer);
- ---Purpose : Utility which adds an actor to the default <me> (it calls
- -- SetActor from the TransientProcess)
-
- TransferDispatch (me : mutable) returns TransferDispatch;
- ---Purpose : Returns the TransferDispatch, which does the work, records
- -- the intermediate data, etc...
- -- See TransferDispatch & CopyTool, to see the available methods
- ---C++ : return &
-
-
- Transfer (me : mutable; start : Transient; TP : mutable TransientProcess)
- returns mutable Binder is redefined;
- ---Purpose : Specific action : it calls the method Transfer from CopyTool
- -- i.e. the general service Copy, then returns the Binder
- -- produced by the TransientProcess
-
-fields
-
- thetool : TransferDispatch;
-
-end ActorDispatch;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_ActorDispatch.ixx>
+#include <Standard_Type.hxx>
+#include <Interface_InterfaceError.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Interface_Protocol.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Transfer_TransferDispatch.hxx>
+#include <Transfer_Binder.hxx>
+#include <Standard_Transient.hxx>
#include <Transfer_TransientProcess.hxx>
+#include <Transfer_ActorDispatch.hxx>
+#include <Transfer_TransientProcess.hxx>
+
+IMPLEMENT_STANDARD_TYPE(Transfer_ActorDispatch)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_ActorOfTransientProcess),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(Transfer_ActorDispatch)
+
+IMPLEMENT_DOWNCAST(Transfer_ActorDispatch,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(Transfer_ActorDispatch)
Transfer_ActorDispatch::Transfer_ActorDispatch
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_ActorDispatch_HeaderFile
+#define _Transfer_ActorDispatch_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Handle_Transfer_ActorDispatch.hxx>
+#include <Transfer_TransferDispatch.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Interface_GeneralLib.hxx>
+#include <Handle_Interface_Protocol.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Transfer_TransientProcess.hxx>
+
+class Interface_InterfaceError;
+class Interface_InterfaceModel;
+class Interface_Protocol;
+class Transfer_ActorOfTransientProcess;
+class Transfer_TransferDispatch;
+class Transfer_Binder;
+class Standard_Transient;
+class Transfer_TransientProcess;
+class Handle(Standard_Type);
+class Handle(Transfer_ActorOfTransientProcess);
+
+DEFINE_STANDARD_HANDLE(Transfer_ActorDispatch,Transfer_ActorOfTransientProcess)
+
+//! This class allows to work with a TransferDispatch, i.e. to <br>
+//! transfer entities from a data set to another one defined by <br>
+//! the same interface norm, with the following features : <br>
+//! - ActorDispatch itself acts as a default actor, i.e. it copies <br>
+//! entities with the general service Copy, as CopyTool does <br>
+//! - it allows to add other actors for specific ways of transfer, <br>
+//! which may include data modifications, conversions ... <br>
+//! - and other features from TransferDispatch (such as mapping <br>
+//! other than one-one) <br>
+class Transfer_ActorDispatch : public Transfer_ActorOfTransientProcess {
+
+public:
+
+ //! Creates an ActorDispatch from a Model. Works with a General <br>
+ //! Service Library, given as an Argument <br>
+ //! This causes TransferDispatch and its TransientProcess to be <br>
+ //! created, with default actor <me> <br>
+ Standard_EXPORT Transfer_ActorDispatch(const Handle(Interface_InterfaceModel)& amodel,const Interface_GeneralLib& lib);
+
+ //! Same as above, but Library is defined through a Protocol <br>
+ Standard_EXPORT Transfer_ActorDispatch(const Handle(Interface_InterfaceModel)& amodel,
+ const Handle(Interface_Protocol)& protocol);
+
+ //! Same as above, but works with the Active Protocol <br>
+ Standard_EXPORT Transfer_ActorDispatch(const Handle(Interface_InterfaceModel)& amodel);
+
+ //! Utility which adds an actor to the default <me> (it calls <br>
+ //! SetActor from the TransientProcess) <br>
+ Standard_EXPORT void AddActor(const Handle(Transfer_ActorOfTransientProcess)& actor);
+
+ //! Returns the TransferDispatch, which does the work, records <br>
+ //! the intermediate data, etc... <br>
+ //! See TransferDispatch & CopyTool, to see the available methods <br>
+ Standard_EXPORT Transfer_TransferDispatch& TransferDispatch();
+
+ //! Specific action : it calls the method Transfer from CopyTool <br>
+ //! i.e. the general service Copy, then returns the Binder <br>
+ //! produced by the TransientProcess <br>
+ Standard_EXPORT virtual Handle_Transfer_Binder Transfer(const Handle(Standard_Transient)& start,
+ const Handle(Transfer_TransientProcess)& TP) ;
+
+
+ DEFINE_STANDARD_RTTI(Transfer_ActorDispatch)
+
+private:
+ Transfer_TransferDispatch thetool;
+};
+#endif
+++ /dev/null
--- Created on: 1996-09-04
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class ActorOfFinderProcess from Transfer inherits ActorOfProcessForFinder
-
- ---Purpose : The original class was renamed. Compatibility only
- --
- -- ModeTrans : a simple way of transmitting a transfer mode from
- -- a user. To be interpreted for each norm
-
-uses Finder, FinderProcess, ProcessForFinder, Binder
-
-is
-
- Create returns mutable ActorOfFinderProcess;
-
- ModeTrans (me : mutable) returns Integer;
- ---Purpose : Returns the Transfer Mode, modifiable
- ---C++ : return &
-
- Transferring (me : mutable; start : Finder; TP : mutable ProcessForFinder)
- returns mutable Binder is redefined;
- -- calls the one below
-
- Transfer (me : mutable; start : Finder; TP : mutable FinderProcess)
- returns mutable Binder is virtual;
- -- default calls TransferTransient if <start> is a TransientMapper,
- -- i.e. does nothing, to be redefined
-
- TransferTransient (me : mutable; start : Transient;
- TP : mutable FinderProcess)
- returns mutable Transient is virtual;
- -- default does nothing, can be redefined
- -- usefull when a result is Transient, simpler to define than Transfer with
- -- a Finder
-
-fields
-
- themodetrans : Integer is protected;
-
-end ActorOfFinderProcess;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_ActorOfFinderProcess.ixx>
+#include <Transfer_ActorOfFinderProcess.hxx>
+#include <Transfer_Binder.hxx>
+#include <Transfer_Finder.hxx>
#include <Transfer_TransientMapper.hxx>
-Transfer_ActorOfFinderProcess::Transfer_ActorOfFinderProcess () { themodetrans = 0; }
+IMPLEMENT_STANDARD_HANDLE(Transfer_ActorOfFinderProcess, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(Transfer_ActorOfFinderProcess, MMgt_TShared)
+
+Transfer_ActorOfFinderProcess::Transfer_ActorOfFinderProcess () { myModeTrans = 0; }
Standard_Integer& Transfer_ActorOfFinderProcess::ModeTrans ()
-{ return themodetrans; }
+{ return myModeTrans; }
Handle(Transfer_Binder) Transfer_ActorOfFinderProcess::Transfer
- (const Handle(Transfer_Finder)& fnd,
- const Handle(Transfer_FinderProcess)& FP)
+ (const Handle(Transfer_Finder)& theFinder,
+ const Handle(Transfer_FinderProcess)& theFP)
{
- Handle(Transfer_TransientMapper) tm = Handle(Transfer_TransientMapper)::DownCast (fnd);
+ Handle(Transfer_TransientMapper) tm = Handle(Transfer_TransientMapper)::DownCast (theFinder);
if (tm.IsNull()) return NullResult();
- Handle(Standard_Transient) res = TransferTransient (tm->Value(),FP);
+ Handle(Standard_Transient) res = TransferTransient (tm->Value(),theFP);
if (res.IsNull()) return NullResult();
return TransientResult (res);
}
Handle(Transfer_Binder) Transfer_ActorOfFinderProcess::Transferring
- (const Handle(Transfer_Finder)& ent,
- const Handle(Transfer_ProcessForFinder)& TP)
+ (const Handle(Transfer_Finder)& theFinder,
+ const Handle(Transfer_FinderProcess)& theTP)
{
- return Transfer(ent,Handle(Transfer_FinderProcess)::DownCast(TP));
+ return Transfer(theFinder,Handle(Transfer_FinderProcess)::DownCast(theTP));
}
Handle(Standard_Transient) Transfer_ActorOfFinderProcess::TransferTransient
- (const Handle(Standard_Transient)& /*ent*/,
+ (const Handle(Standard_Transient)& /*theEnt*/,
const Handle(Transfer_FinderProcess)& )
{
- Handle(Standard_Transient) nulres;
- return nulres;
+ Handle(Standard_Transient) aNullRes;
+ return aNullRes;
}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_ActorOfFinderProcess_HeaderFile
+#define _Transfer_ActorOfFinderProcess_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Integer.hxx>
+#include <Transfer_Binder.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Handle_Transfer_Finder.hxx>
+#include <Transfer_FinderProcess_Handle.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Transfer_Actor.hxx>
+
+DEFINE_STANDARD_HANDLE(Transfer_ActorOfFinderProcess, MMgt_TShared)
+
+class Transfer_ActorOfFinderProcess : public Transfer_Actor < Handle(Transfer_ActorOfFinderProcess),
+ Handle(Transfer_Finder),
+ Handle(Transfer_FinderProcess) >
+{
+public:
+ Standard_EXPORT Transfer_ActorOfFinderProcess();
+ //! Returns the Transfer Mode, modifiable <br>
+ Standard_EXPORT Standard_Integer& ModeTrans() ;
+
+ Standard_EXPORT virtual Handle(Transfer_Binder) Transferring(const Handle(Transfer_Finder)& theFinder,
+ const Handle(Transfer_FinderProcess)& theFP);
+
+ Standard_EXPORT virtual Handle(Transfer_Binder) Transfer(const Handle(Transfer_Finder)& theFinder,
+ const Handle(Transfer_FinderProcess)& theFP);
+
+ Standard_EXPORT virtual Handle(Standard_Transient) TransferTransient(const Handle(Standard_Transient)& theEnt,
+ const Handle(Transfer_FinderProcess)& theFP);
+
+ DEFINE_STANDARD_RTTI(Transfer_ActorOfFinderProcess)
+
+protected:
+ Standard_Integer myModeTrans;
+};
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1996-09-04
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class ActorOfTransientProcess from Transfer inherits ActorOfProcessForTransient from Transfer
-
- ---Purpose : The original class was renamed. Compatibility only
-
-uses Transient, TransientProcess, ProcessForTransient, Binder
-
-is
-
- Create returns mutable ActorOfTransientProcess;
-
- Transferring (me : mutable; start : Transient; TP : mutable ProcessForTransient)
- returns mutable Binder is redefined;
- -- calls the one below
-
- Transfer (me : mutable; start : Transient; TP : mutable TransientProcess)
- returns mutable Binder is virtual;
- -- default calls TransferTransient i.e. does nothing, to be redefined
-
- TransferTransient (me : mutable; start : Transient;
- TP : mutable TransientProcess)
- returns mutable Transient is virtual;
- -- default does nothing, can be redefined
- -- usefull when a result is Transient, simpler to define than Transfer with
- -- a Binder
-
-end ActorOfTransientProcess;
+// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_ActorOfTransientProcess.ixx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Transfer_Binder.hxx>
+#include <Transfer_Finder.hxx>
+#include <Standard_Transient.hxx>
-Transfer_ActorOfTransientProcess::Transfer_ActorOfTransientProcess () { }
+ IMPLEMENT_STANDARD_HANDLE(Transfer_ActorOfTransientProcess, MMgt_TShared)
+ IMPLEMENT_STANDARD_RTTIEXT(Transfer_ActorOfTransientProcess, MMgt_TShared)
+
+Transfer_ActorOfTransientProcess::Transfer_ActorOfTransientProcess () { }
Handle(Transfer_Binder) Transfer_ActorOfTransientProcess::Transfer
- (const Handle(Standard_Transient)& start,
- const Handle(Transfer_TransientProcess)& TP)
+ (const Handle(Standard_Transient)& theEnt,
+ const Handle(Transfer_TransientProcess)& theTP)
{
- Handle(Standard_Transient) res = TransferTransient (start,TP);
+ Handle(Standard_Transient) res = TransferTransient (theEnt,theTP);
if (res.IsNull()) return NullResult();
return TransientResult (res);
}
Handle(Transfer_Binder) Transfer_ActorOfTransientProcess::Transferring
- (const Handle(Standard_Transient)& ent,
- const Handle(Transfer_ProcessForTransient)& TP)
+ (const Handle(Standard_Transient)& theEnt,
+ const Handle(Transfer_TransientProcess)& theTP)
{
- return Transfer(ent,Handle(Transfer_TransientProcess)::DownCast(TP));
+ return Transfer (theEnt, Handle(Transfer_TransientProcess)::DownCast(theTP));
}
Handle(Standard_Transient) Transfer_ActorOfTransientProcess::TransferTransient
- (const Handle(Standard_Transient)& /*ent*/,
- const Handle(Transfer_TransientProcess)& /*TP*/)
+ (const Handle(Standard_Transient)& /*theEnt*/,
+ const Handle(Transfer_TransientProcess)& /*theTP*/)
{
- Handle(Standard_Transient) nulres;
- return nulres;
+ Handle(Standard_Transient) aNullRes;
+ return aNullRes;
}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_ActorOfTransientProcess_HeaderFile
+#define _Transfer_ActorOfTransientProcess_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Standard_Transient.hxx>
+#include <Transfer_TransientProcess_Handle.hxx>
+#include <Transfer_Actor.hxx>
+
+DEFINE_STANDARD_HANDLE(Transfer_ActorOfTransientProcess, MMgt_TShared)
+
+class Transfer_ActorOfTransientProcess : public Transfer_Actor < Handle(Transfer_ActorOfTransientProcess),
+ Handle(Standard_Transient),
+ Handle(Transfer_TransientProcess) >
+{
+public:
+
+ Standard_EXPORT Transfer_ActorOfTransientProcess();
+
+ Standard_EXPORT virtual Handle_Transfer_Binder Transferring (const Handle(Standard_Transient)& theEnt,
+ const Handle(Transfer_TransientProcess)& theTP) ;
+
+ Standard_EXPORT virtual Handle_Transfer_Binder Transfer (const Handle(Standard_Transient)& theEnt,
+ const Handle(Transfer_TransientProcess)& theTP) ;
+
+ Standard_EXPORT virtual Handle_Standard_Transient TransferTransient (const Handle(Standard_Transient)& theStart,
+ const Handle(Transfer_TransientProcess)& theTP) ;
+
+
+ DEFINE_STANDARD_RTTI(Transfer_ActorOfTransientProcess)
+
+};
+
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1993-06-17
--- 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 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.
-
-class DispatchControl from Transfer inherits CopyControl from Interface
-
- ---Purpose : This is an auxiliary class for TransferDispatch, which allows
- -- to record simple copies, as CopyControl from Interface, but
- -- based on a TransientProcess. Hence, it allows in addition
- -- more actions (such as recording results of adaptations)
-
-uses Transient, TransientProcess, InterfaceModel
-
-raises InterfaceError
-
-is
-
- Create (model : InterfaceModel; TP : mutable TransientProcess)
- returns mutable DispatchControl;
- ---Purpose : Creates the DispatchControl, ready for use
-
- TransientProcess (me) returns mutable TransientProcess;
- ---Purpose : Returns the content of the DispatchControl : it can be used
- -- for a direct call, if the basic methods do not suffice
- ---C++ : return const &
-
- StartingModel (me) returns any InterfaceModel;
- ---Purpose : Returns the Model from which the transfer is to be done
- ---C++ : return const &
-
- -- Now, inherited methods used for Copy (the minimum set)
-
- Clear (me : mutable);
- ---Purpose : Clears the List of Copied Results
-
- Bind (me : mutable; ent : Transient; res : mutable Transient)
- ---Purpose : Binds a (Transient) Result to a (Transient) Starting Entity
- raises InterfaceError;
- -- Error if <ent> is already bound
-
- Search (me; ent : Transient; res : out mutable Transient)
- returns Boolean;
- ---Purpose : Searches for the Result bound to a Starting Entity
- -- If Found, returns True and fills <res>
- -- Else, returns False and nullifies <res>
-
-fields
-
- theTP : TransientProcess;
- themodel : InterfaceModel;
-
-end DispatchControl;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_DispatchControl.ixx>
-
+#include <Transfer_DispatchControl.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Interface_InterfaceError.hxx>
+#include <Standard_Transient.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(Transfer_DispatchControl)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Interface_CopyControl),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(Transfer_DispatchControl)
+
+
+IMPLEMENT_DOWNCAST(Transfer_DispatchControl,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(Transfer_DispatchControl)
Transfer_DispatchControl::Transfer_DispatchControl
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_DispatchControl_HeaderFile
+#define _Transfer_DispatchControl_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Transfer_TransientProcess_Handle.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Interface_CopyControl.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Standard_Boolean.hxx>
+class Transfer_TransientProcess;
+class Interface_InterfaceModel;
+class Interface_InterfaceError;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Interface_CopyControl);
+class Transfer_DispatchControl;
+
+DEFINE_STANDARD_HANDLE(Transfer_DispatchControl,Interface_CopyControl)
+
+
+//! This is an auxiliary class for TransferDispatch, which allows <br>
+//! to record simple copies, as CopyControl from Interface, but <br>
+//! based on a TransientProcess. Hence, it allows in addition <br>
+//! more actions (such as recording results of adaptations) <br>
+class Transfer_DispatchControl : public Interface_CopyControl
+{
+
+public:
+
+ //! Creates the DispatchControl, ready for use <br>
+ Standard_EXPORT Transfer_DispatchControl(const Handle(Interface_InterfaceModel)& model,const Handle(Transfer_TransientProcess)& TP);
+ //! Returns the content of the DispatchControl : it can be used <br>
+ //! for a direct call, if the basic methods do not suffice <br>
+ Standard_EXPORT const Handle_Transfer_TransientProcess& TransientProcess() const;
+ //! Returns the Model from which the transfer is to be done <br>
+ Standard_EXPORT const Handle_Interface_InterfaceModel& StartingModel() const;
+ //! Clears the List of Copied Results <br>
+ Standard_EXPORT void Clear() ;
+ //! Binds a (Transient) Result to a (Transient) Starting Entity <br>
+ Standard_EXPORT void Bind(const Handle(Standard_Transient)& ent,const Handle(Standard_Transient)& res) ;
+ //! Searches for the Result bound to a Starting Entity <br>
+ //! If Found, returns True and fills <res> <br>
+ //! Else, returns False and nullifies <res> <br>
+ Standard_EXPORT Standard_Boolean Search(const Handle(Standard_Transient)& ent,Handle(Standard_Transient)& res) const;
+
+ DEFINE_STANDARD_RTTI(Transfer_DispatchControl)
+
+private:
+
+Handle_Transfer_TransientProcess theTP;
+Handle_Interface_InterfaceModel themodel;
+};
+#endif
+++ /dev/null
--- Created on: 1996-09-04
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class FinderProcess from Transfer inherits ProcessForFinder
-
- ---Purpose : Adds specific features to the generic definition :
- -- PrintTrace is adapted
-
-uses InterfaceModel from Interface,
- Messenger from Message,
- Finder, TransientMapper
-
-is
-
- Create (nb : Integer = 10000) returns mutable FinderProcess;
- ---Purpose : Sets FinderProcess at initial state, with an initial size
-
- SetModel (me : mutable; model : InterfaceModel);
- ---Purpose : Sets an InterfaceModel, which can be used during transfer
- -- for instance if a context must be managed, it is in the Model
-
- Model (me) returns InterfaceModel;
- ---Purpose : Returns the Model which can be used for context
-
- NextMappedWithAttribute (me; name : CString; num0 : Integer) returns Integer;
- ---Purpose : In the list of mapped items (between 1 and NbMapped),
- -- searches for the first mapped item which follows <num0>
- -- (not included) and which has an attribute named <name>
- -- The considered Attributes are those brought by Finders,i.e.
- -- by Input data.
- -- While NextItemWithAttribute works on Result data (Binders)
- --
- -- Hence, allows such an iteration
- --
- -- for (num = FP->NextMappedWithAttribute(name,0);
- -- num > 0;
- -- num = FP->NextMappedWithAttribute(name,num) {
- -- .. process mapped item <num>
- -- }
-
- TransientMapper (me; obj : Transient) returns TransientMapper;
- ---Purpose : Returns a TransientMapper for a given Transient Object
- -- Either <obj> is already mapped, then its Mapper is returned
- -- Or it is not, then a new one is created then returned, BUT
- -- it is not mapped here (use Bind or FindElseBind to do this)
-
-
- PrintTrace (me; start : Finder; S : Messenger from Message) is redefined;
- ---Purpose : Specific printing to trace a Finder (by its method ValueType)
-
- PrintStats (me; mode : Integer; S : Messenger from Message);
- ---Purpose : Prints statistics on a given output, according mode
-
-fields
-
- themodel : InterfaceModel;
-
-end FinderProcess;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_FinderProcess.ixx>
+#include <Transfer_FinderProcess.hxx>
#include <Interface_MSG.hxx>
#include <Transfer_Binder.hxx>
#include <Interface_Check.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Transfer_TransientMapper.hxx>
+#include <Standard_Transient.hxx>
+#include <Transfer_Finder.hxx>
+#include <Message_Messenger.hxx>
+#include <Standard_Type.hxx>
+IMPLEMENT_STANDARD_TYPE(Transfer_FinderProcess)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
-Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer nb)
- : Transfer_ProcessForFinder (nb) { }
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(Transfer_FinderProcess)
+
+
+IMPLEMENT_DOWNCAST(Transfer_FinderProcess,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(Transfer_FinderProcess)
+
+ Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer theNb)
+ : Transfer_TransferProcess < Handle(Transfer_ActorOfFinderProcess),
+ Transfer_TransferMapOfProcessForFinder,
+ Handle(Transfer_Finder),
+ Transfer_FindHasher,
+ Handle(Transfer_HSequenceOfFinder),
+ Transfer_IteratorOfProcessForFinder > (theNb) { }
- void Transfer_FinderProcess::SetModel
- (const Handle(Interface_InterfaceModel)& model)
- { themodel = model; }
+ void Transfer_FinderProcess::SetModel (const Handle(Interface_InterfaceModel)& theModel)
+ {
+ myModel = theModel;
+ }
- Handle(Interface_InterfaceModel) Transfer_FinderProcess::Model () const
- { return themodel; }
+ Handle(Interface_InterfaceModel) Transfer_FinderProcess::Model () const
+ {
+ return myModel;
+ }
+ Standard_Integer Transfer_FinderProcess::NextMappedWithAttribute
+ (const Standard_CString theName,
+ const Standard_Integer theNum0) const
+ {
+ Standard_Integer aNum, aNb = NbMapped();
+ for (aNum = theNum0 + 1; aNum <= aNb; aNum ++)
+ {
+ Handle(Transfer_Finder) aFnd = Mapped (aNum);
+ if (aFnd.IsNull()) continue;
+ if (!aFnd->Attribute(theName).IsNull())
+ return aNum;
+ }
+ return 0;
+ }
- Standard_Integer Transfer_FinderProcess::NextMappedWithAttribute
- (const Standard_CString name, const Standard_Integer num0) const
-{
- Standard_Integer num, nb = NbMapped();
- for (num = num0+1; num <= nb; num ++) {
- Handle(Transfer_Finder) fnd = Mapped (num);
- if (fnd.IsNull()) continue;
- if (!fnd->Attribute(name).IsNull()) return num;
+ Handle(Transfer_TransientMapper) Transfer_FinderProcess::TransientMapper
+ (const Handle(Standard_Transient)& theObj) const
+ {
+ Handle(Transfer_TransientMapper) aMapper = new Transfer_TransientMapper(theObj);
+ Standard_Integer anIndex = MapIndex (aMapper);
+ if (anIndex == 0)
+ return aMapper;
+ return Handle(Transfer_TransientMapper)::DownCast(Mapped(anIndex));
}
- return 0;
-}
-
- Handle(Transfer_TransientMapper) Transfer_FinderProcess::TransientMapper
- (const Handle(Standard_Transient)& obj) const
-{
- Handle(Transfer_TransientMapper) mapper = new Transfer_TransientMapper(obj);
- Standard_Integer index = MapIndex (mapper);
- if (index == 0) return mapper;
- return Handle(Transfer_TransientMapper)::DownCast(Mapped(index));
-}
-
-
- void Transfer_FinderProcess::PrintTrace
- (const Handle(Transfer_Finder)& start, const Handle(Message_Messenger)& S) const
- { if (!start.IsNull()) S<<" Type:"<<start->ValueTypeName(); }
-
- void Transfer_FinderProcess::PrintStats
- (const Standard_Integer mode, const Handle(Message_Messenger)& S) const
-{
- S<<"\n*******************************************************************\n";
- if (mode == 1) { // Statistiques de base
- S << "******** Basic Statistics ********"<<endl;
-
- Standard_Integer nbr = 0, nbe = 0, nbw = 0;
- Standard_Integer i, max = NbMapped(), nbroots = NbRoots();
- S << "**** Nb Final Results : "<<nbroots<<endl;
-
- for (i = 1; i <= max; i ++) {
- const Handle(Transfer_Binder)& binder = MapItem(i);
- if (binder.IsNull()) continue;
- const Handle(Interface_Check) ach = binder->Check();
- Transfer_StatusExec stat = binder->StatusExec();
- if (stat != Transfer_StatusInitial && stat != Transfer_StatusDone)
- nbe ++;
- else {
- if (ach->NbWarnings() > 0) nbw ++;
- if (binder->HasResult()) nbr ++;
+
+
+ void Transfer_FinderProcess::PrintTrace (const Handle(Transfer_Finder)& theStart,
+ const Handle(Message_Messenger)& theMessenger) const
+ {
+ if (!theStart.IsNull())
+ theMessenger<<" Type:"<<theStart->ValueTypeName();
+ }
+
+ void Transfer_FinderProcess::PrintStats (const Standard_Integer theMode,
+ const Handle(Message_Messenger)& theMessenger) const
+ {
+ theMessenger<<"\n*******************************************************************\n";
+ if (theMode == 1) { // Statistiques de base
+ theMessenger << "******** Basic Statistics ********"<<endl;
+
+ Standard_Integer aNbr = 0, aNbe = 0, aNbw = 0;
+ Standard_Integer anI, aMax = NbMapped(), aNbRoots = NbRoots();
+ theMessenger << "**** Nb Final Results : "<<aNbRoots<<endl;
+
+ for (anI = 1; anI <= aMax; anI ++) {
+ const Handle(Transfer_Binder)& aBinder = MapItem(anI);
+ if (aBinder.IsNull()) continue;
+ const Handle(Interface_Check) aCheck = aBinder->Check();
+ Transfer_StatusExec aStatus = aBinder->StatusExec();
+ if (aStatus != Transfer_StatusInitial && aStatus != Transfer_StatusDone)
+ aNbe ++;
+ else {
+ if (aCheck->NbWarnings() > 0) aNbw ++;
+ if (aBinder->HasResult()) aNbr ++;
+ }
}
+ if (aNbr > aNbRoots)
+ theMessenger<<"**** ( Itermediate Results : "<<aNbr-aNbRoots<<" )\n";
+ if (aNbe > 0)
+ theMessenger<<"**** Errors on :"<<Interface_MSG::Blanks(aNbe,4)<<aNbe<<" Entities\n";
+ if (aNbw > 0)
+ theMessenger<<"**** Warnings on : "<<Interface_MSG::Blanks(aNbw,4)<<aNbw<<" Entities\n";
+ theMessenger<<"*******************************************************************";
+ }
+ theMessenger<<endl;
+ }
+
+//=======================================================================
+//function : TransferProduct
+//purpose :
+//=======================================================================
+
+ Handle(Transfer_Binder) Transfer_FinderProcess::TransferProduct (const Handle(Transfer_Finder)& theStart)
+ {
+ myLevel ++; // decrement and if == 0, root transfer
+ Handle(Transfer_Binder) aBinder;
+ Handle(Transfer_ActorOfFinderProcess) anActor = myActor;
+ while (!anActor.IsNull())
+ {
+ if (anActor->Recognize (theStart)) aBinder = anActor->Transferring(theStart,this);
+ else aBinder.Nullify();
+ if (!aBinder.IsNull()) break;
+ anActor = anActor->Next();
}
- if (nbr > nbroots)
- S<<"**** ( Itermediate Results : "<<nbr-nbroots<<" )\n";
- if (nbe > 0)
- S<<"**** Errors on :"<<Interface_MSG::Blanks(nbe,4)<<nbe<<" Entities\n";
- if (nbw > 0)
- S<<"**** Warnings on : "<<Interface_MSG::Blanks(nbw,4)<<nbw<<" Entities\n";
- S<<"*******************************************************************";
+ if (aBinder.IsNull()) {
+ if (myLevel > 0) myLevel --;
+ return aBinder;
+ }
+ // Managing the root level (.. a close look ..)
+ if (myRootLevel == 0 && aBinder->StatusExec() == Transfer_StatusDone)
+ myRootLevel = myLevel - 1;
+
+ if (myLevel > 0) myLevel --;
+ return aBinder;
+ }
+
+ //=======================================================================
+ //function : Transferring
+ //purpose :
+ //=======================================================================
+
+ Handle(Transfer_Binder) Transfer_FinderProcess::Transferring (const Handle(Transfer_Finder)& theStart)
+ {
+ Handle(Transfer_Binder) aFormer = FindAndMask(theStart);
+
+ // Use more: note "AlreadyUsed" so result can not be changed
+ if (!aFormer.IsNull()) {
+ if (aFormer->HasResult()) {
+ aFormer->SetAlreadyUsed();
+ return aFormer;
+ }
+
+ // Initial state: perhaps already done ... or infeasible
+ Transfer_StatusExec statex = aFormer->StatusExec();
+ switch (statex) {
+ case Transfer_StatusInitial : // Transfer is prepared to do
+ break;
+ case Transfer_StatusDone : // Transfer was already done
+ myMessenger << " .. and Transfer done" << endl;
+ return aFormer;
+ case Transfer_StatusRun :
+ aFormer->SetStatusExec(Transfer_StatusLoop);
+ return aFormer;
+ case Transfer_StatusError :
+ if (myTrace) {
+ myMessenger << " *** Transfer in Error Status :" << endl;
+ StartTrace (aFormer, theStart, myLevel,0);
+ }
+ else StartTrace (aFormer, theStart,myLevel,4);
+ Transfer_TransferFailure::Raise
+ ("TransferProcess : Transfer in Error Status");
+ case Transfer_StatusLoop : // The loop is closed ...
+ if (myTrace) {
+ myMessenger << " *** Transfer Head of Dead Loop :" << endl;
+ StartTrace (aFormer, theStart, myLevel,0);
+ }
+ else StartTrace (aFormer, theStart,myLevel,4);
+ Transfer_TransferDeadLoop::Raise
+ ("TransferProcess : Transfer at Head of a Dead Loop");
+ }
+#ifdef TRANSLOG
+ cout << "Transfer,level "<<myLevel<<Message_Flush;
+#endif
+ aFormer->SetStatusExec(Transfer_StatusRun);
+ }
+#ifdef TRANSLOG
+ cout << " GO .." << endl;
+#endif
+
+ Handle(Transfer_Binder) aBinder;
+ Standard_Boolean newbind = Standard_False;
+ if (myToHandleErr) {
+ // Transfer under protection exceptions (for notification actually)
+ Standard_Integer anOldLevel = myLevel;
+ try {
+ OCC_CATCH_SIGNALS
+ aBinder = TransferProduct(theStart);
+ }
+ catch (Transfer_TransferDeadLoop) {
+ if (aBinder.IsNull()) {
+ myMessenger << " *** Dead Loop with no Result" << endl;
+ if (myTrace) StartTrace (aBinder, theStart, myLevel-1,0);
+ aBinder = new Transfer_VoidBinder;
+ Bind (theStart,aBinder); newbind = Standard_True;
+ } else if (aBinder->StatusExec() == Transfer_StatusLoop) {
+ if (myTrace) {
+ myMessenger << " *** Dead Loop : Finding head of Loop :" << endl;
+ StartTrace (aBinder, theStart, myLevel-1,0);
+ }
+ else StartTrace (aBinder, theStart,myLevel-1,4);
+ Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop");
+ } else {
+ if (myTrace) {
+ myMessenger << " *** Dead Loop : Actor in Loop :" << endl;
+ StartTrace (aBinder, theStart, myLevel-1,0);
+ }
+ }
+ aBinder->AddFail("Transfer in dead Loop");
+ myLevel = anOldLevel;
+ }
+ catch (Standard_Failure) {
+ if (aBinder.IsNull()) {
+ myMessenger << " *** Exception Raised with no Result" << endl;
+ aBinder = new Transfer_VoidBinder;
+ Bind (theStart,aBinder); newbind = Standard_True;
+ }
+ aBinder->AddFail("Transfer stopped by exception raising");
+ if (myTrace) {
+ myMessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl;
+ StartTrace (aBinder, theStart, myLevel-1,4);
+ }
+ myLevel = anOldLevel;
+ }
+ }
+
+ else aBinder = TransferProduct(theStart);
+
+ // Conclusion : Noter dans la Map
+
+ if (!newbind && !aBinder.IsNull()) {
+ if (aFormer.IsNull()) {
+ if (!IsBound(theStart)) Bind(theStart,aBinder); // result = 0 category
+ else { // gka TRJ9 for writing SDR for solid
+ Rebind(theStart,aBinder); // test_pattern.sat
+ }
+ }
+ else Rebind(theStart,aBinder);
+#ifdef TRANSLOG
+ cout << " ... OK" << endl;
+#endif
+ }
+ else
+ {
+ //= by ABV: 5 Oct 97: nothing generated, but aFormer can be in run state - drop it
+ //= ASK: may be set it to StatusInitial ?
+ if ( ! aFormer.IsNull() ) aFormer->SetStatusExec ( Transfer_StatusDone );
+ Handle(Transfer_Binder) nulbinder;
+ return nulbinder;
+ }
+
+ // Manage Roots (if planned)
+ if (myRootLevel >= myLevel) {
+ myRootLevel = 0;
+ if (myToManageRoot && aBinder->Status() != Transfer_StatusVoid) {
+ SetRoot (theStart);
+ }
+ }
+ return myLastBinder;
+ }
+
+ Standard_Boolean Transfer_FinderProcess::Transfer(const Handle(Transfer_Finder)& theStart)
+ {
+ Handle(Transfer_Binder) aBinder = Transferring(theStart);
+ return (!aBinder.IsNull());
}
- S<<endl;
-}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_FinderProcess_HeaderFile
+#define _Transfer_FinderProcess_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_CString.hxx>
+#include <Transfer_TransferProcess.hxx>
+#include <Transfer_TransientMapper.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Transfer_Finder.hxx>
+#include <Handle_Message_Messenger.hxx>
+#include <Transfer_FindHasher.hxx>
+#include <Transfer_ActorOfFinderProcess.hxx>
+#include <Transfer_HSequenceOfFinder.hxx>
+#include <Transfer_Binder.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+#include <Transfer_IteratorOfProcessForFinder.hxx>
+#include <MMgt_TShared.hxx>
+#include <Transfer_FinderProcess_Handle.hxx>
+
+class Interface_InterfaceModel;
+class Transfer_TransientMapper;
+class Standard_Transient;
+class Transfer_Finder;
+class Message_Messenger;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+class Transfer_FinderProcess;
+
+class Transfer_FinderProcess
+: public Transfer_TransferProcess < Handle(Transfer_ActorOfFinderProcess),
+ Transfer_TransferMapOfProcessForFinder,
+ Handle(Transfer_Finder),
+ Transfer_FindHasher,
+ Handle(Transfer_HSequenceOfFinder),
+ Transfer_IteratorOfProcessForFinder >
+{
+
+public:
+
+ //! Sets FinderProcess at initial state, with an initial size <br>
+ Standard_EXPORT Transfer_FinderProcess(const Standard_Integer theNb = 10000);
+ //! Sets an InterfaceModel, which can be used during transfer <br>
+ //! for instance if a context must be managed, it is in the Model <br>
+ Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& theModel) ;
+ //! Returns the Model which can be used for context <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model() const;
+ //! In the list of mapped items (between 1 and NbMapped), <br>
+ //! searches for the first mapped item which follows <num0> <br>
+ //! (not included) and which has an attribute named <name> <br>
+ //! The considered Attributes are those brought by Finders,i.e. <br>
+ //! by Input data. <br>
+ //! While NextItemWithAttribute works on Result data (Binders) <br>
+ //! <br>
+ //! Hence, allows such an iteration <br>
+ //! <br>
+ //! for (num = FP->NextMappedWithAttribute(name,0); <br>
+ //! num > 0; <br>
+ //! num = FP->NextMappedWithAttribute(name,num) { <br>
+ //! .. process mapped item <num> <br>
+ //! } <br>
+ Standard_EXPORT Standard_Integer NextMappedWithAttribute (const Standard_CString theName,
+ const Standard_Integer theNum0) const;
+ //! Returns a TransientMapper for a given Transient Object <br>
+ //! Either <obj> is already mapped, then its Mapper is returned <br>
+ //! Or it is not, then a new one is created then returned, BUT <br>
+ //! it is not mapped here (use Bind or FindElseBind to do this) <br>
+ Standard_EXPORT Handle_Transfer_TransientMapper TransientMapper (const Handle(Standard_Transient)& theObj) const;
+ //! Specific printing to trace a Finder (by its method ValueType) <br>
+ Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& theStart,
+ const Handle(Message_Messenger)& theMessenger) const;
+ //! Prints statistics on a given output, according mode <br>
+ Standard_EXPORT void PrintStats(const Standard_Integer mode,const Handle(Message_Messenger)& theMessenger) const;
+
+ Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Transfer_Finder)& theStart);
+
+ Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& theStart);
+
+ Standard_EXPORT Standard_Boolean Transfer(const Handle(Transfer_Finder)& theStart);
+
+ DEFINE_STANDARD_RTTI(Transfer_FinderProcess)
+
+private:
+
+ Handle_Interface_InterfaceModel myModel;
+
+};
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+// Workaround: Handles for none-cdl classes.
+// Delete this file after transformation all classes to none-cdl.
+
+#ifndef _Transfer_FinderProcess_Handle_HeaderFile
+#define _Transfer_FinderProcess_Handle_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <MMgt_TShared.hxx>
+
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+class Transfer_FinderProcess;
+
+DEFINE_STANDARD_HANDLE(Transfer_FinderProcess,MMgt_TShared)
+
+typedef Handle(Transfer_FinderProcess) Transfer_FinderProcess_Handle;
+
+#endif
\ No newline at end of file
+++ /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 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.
-
-// Transfer_Iterator.gxx
-#include <Standard_NoSuchObject.hxx>
-
-
-// TheStart est suppose Handle(Standard_Transient) ou (Transfer_Finder)
-// Il a servi a instancier TheList qui est une HSequence
-
-
-Transfer_Iterator::Transfer_Iterator (const Standard_Boolean withstarts)
- : Transfer_TransferIterator ()
-{ if (withstarts) thestarts = new TheList(); }
-
-
- void Transfer_Iterator::Add
- (const Handle(Transfer_Binder)& binder)
-{
- if (!thestarts.IsNull()) Standard_NoSuchObject::Raise
- ("Transfer_Iterator : Add, Starting Object required not provided");
- AddItem(binder);
-}
-
- void Transfer_Iterator::Add
- (const Handle(Transfer_Binder)& binder, const TheStart& start)
-{
- AddItem(binder);
- if (!thestarts.IsNull()) thestarts->Append(start);
-}
-
- void Transfer_Iterator::Filter
- (const Handle(TheList)& list, const Standard_Boolean keep)
-{
- if (list.IsNull() || thestarts.IsNull()) return;
- Standard_Integer i, j, nb = thestarts->Length();
- if (nb == 0) return;
- Handle(Transfer_Binder) factice;
- Transfer_TransferMap amap (nb);
- for (i = 1; i <= nb; i ++) {
- j = amap.Add (thestarts->Value(i),factice);
- SelectItem (j,!keep);
- }
-
-// Comparaison
- nb = list->Length();
- for (i = 1; i <= nb; i ++) {
- j = amap.FindIndex (list->Value(i));
- if (j > 0) SelectItem (j,keep);
- }
-}
-
- Standard_Boolean Transfer_Iterator::HasStarting () const
- { return (!thestarts.IsNull()); }
-
- const TheStart& Transfer_Iterator::Starting () const
-{
-// if (thecurr == 0 || thecurr > themaxi) Standard_NoSuchObject::Raise
-// ("TransferIterator : Starting");
-// if (theselect->Value(thecurr) == 0) Standard_NoSuchObject::Raise
-// ("TransferIterator : Starting");
- if (thestarts.IsNull()) Standard_NoSuchObject::Raise
- ("TransferIterator : No Starting defined at all");
- return thestarts->Value(thecurr);
-}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_Iterator_HeaderFile
+#define _Transfer_Iterator_HeaderFile
+
+#include <Standard_NoSuchObject.hxx>
+#include <Transfer_TransferIterator.hxx>
+#include <Transfer_Binder.hxx>
+#include <Standard_Boolean.hxx>
+
+//! This is a TransferIterator PLUS the capability to access
+//! the Starting Objects. It is given as a Result from
+//! TransferProcess. It can be used when a TransferIterator
+//! is required.
+//! See also : TransferIterator, for more information
+template <class TheStart, class List, class ListHandle, class TransferMap>
+class Transfer_Iterator : public Transfer_TransferIterator
+{
+private:
+ ListHandle myStarts;
+
+public:
+ DEFINE_STANDARD_ALLOC
+
+ Standard_EXPORT Transfer_Iterator (const Standard_Boolean theWithStarts)
+ : Transfer_TransferIterator ()
+ { if (theWithStarts)
+ myStarts = new List(); }
+
+
+ Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder)
+ {
+ if (!myStarts.IsNull()) Standard_NoSuchObject::Raise
+ ("Transfer_Iterator : Add, Starting Object required not provided");
+ AddItem(theBinder);
+ }
+
+ Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder,
+ const TheStart& theStart)
+ {
+ AddItem (theBinder);
+ if (!myStarts.IsNull())
+ myStarts->Append(theStart);
+ }
+
+ Standard_EXPORT void Filter (const ListHandle& theList,
+ const Standard_Boolean toKeep = Standard_True)
+ {
+ if (theList.IsNull() || myStarts.IsNull())
+ return;
+ Standard_Integer anI, aJ, aNb = myStarts->Length();
+ if (aNb == 0) return;
+ Handle(Transfer_Binder) factice;
+ TransferMap amap (aNb);
+ for (anI = 1; anI <= aNb; anI ++) {
+ aJ = amap.Add (myStarts->Value(anI),factice);
+ SelectItem (aJ,!toKeep);
+ }
+
+ // Comparaison
+ aNb = theList->Length();
+ for (anI = 1; anI <= aNb; anI ++) {
+ aJ = amap.FindIndex (theList->Value(anI));
+ if (aJ > 0) SelectItem (aJ,toKeep);
+ }
+ }
+
+ Standard_EXPORT Standard_Boolean HasStarting () const
+ {
+ return (!myStarts.IsNull());
+ }
+
+ Standard_EXPORT const TheStart& Starting () const
+ {
+ if (myStarts.IsNull()) Standard_NoSuchObject::Raise
+ ("TransferIterator : No Starting defined at all");
+ return myStarts->Value(thecurr);
+ }
+};
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_IteratorOfProcessForFinder_HeaderFile
+#define _Transfer_IteratorOfProcessForFinder_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Handle_Transfer_HSequenceOfFinder.hxx>
+#include <Handle_Transfer_Finder.hxx>
+#include <Transfer_FinderProcess_Handle.hxx>
+#include <Transfer_ActorOfFinderProcess.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Transfer_Iterator.hxx>
+#include <Transfer_HSequenceOfFinder.hxx>
+#include <Standard_NoSuchObject.hxx>
+#include <Transfer_Finder.hxx>
+#include <Transfer_FindHasher.hxx>
+#include <Transfer_Binder.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+
+class Transfer_HSequenceOfFinder;
+class Standard_NoSuchObject;
+class Transfer_Finder;
+class Transfer_FindHasher;
+class Transfer_FinderProcess;
+class Transfer_ActorOfFinderProcess;
+class Transfer_Binder;
+
+typedef NCollection_IndexedDataMap < Handle(Transfer_Finder),
+ Handle(Transfer_Binder),
+ Transfer_FindHasher >
+ Transfer_TransferMapOfProcessForFinder;
+
+class Transfer_IteratorOfProcessForFinder : public Transfer_Iterator <Handle(Transfer_Finder),
+ Transfer_HSequenceOfFinder,
+ Handle(Transfer_HSequenceOfFinder),
+ Transfer_TransferMapOfProcessForFinder>
+{
+public:
+ Standard_EXPORT Transfer_IteratorOfProcessForFinder(const Standard_Boolean theWithStarts)
+ : Transfer_Iterator <Handle(Transfer_Finder),
+ Transfer_HSequenceOfFinder,
+ Handle(Transfer_HSequenceOfFinder),
+ Transfer_TransferMapOfProcessForFinder> (theWithStarts)
+ { }
+
+};
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_IteratorOfProcessForTransient_HeaderFile
+#define _Transfer_IteratorOfProcessForTransient_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Transfer_Iterator.hxx>
+#include <Transfer_TransferIterator.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Standard_NoSuchObject.hxx>
+#include <Standard_Transient.hxx>
+#include <TColStd_MapTransientHasher.hxx>
+#include <Transfer_Binder.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+
+class TColStd_HSequenceOfTransient;
+class Standard_NoSuchObject;
+class Standard_Transient;
+class TColStd_MapTransientHasher;
+class Transfer_TransientProcess;
+class Transfer_ActorOfTransientProcess;
+class Transfer_Binder;
+
+typedef NCollection_IndexedDataMap <Handle(Standard_Transient),
+ Handle(Transfer_Binder),
+ TColStd_MapTransientHasher>
+ Transfer_TransferMapOfProcessForTransient;
+
+
+class Transfer_IteratorOfProcessForTransient : public Transfer_Iterator <Handle(Standard_Transient),
+ TColStd_HSequenceOfTransient,
+ Handle(TColStd_HSequenceOfTransient),
+ Transfer_TransferMapOfProcessForTransient>
+{
+public:
+ Standard_EXPORT Transfer_IteratorOfProcessForTransient(const Standard_Boolean theWithStarts)
+ : Transfer_Iterator <Handle(Standard_Transient),
+ TColStd_HSequenceOfTransient,
+ Handle(TColStd_HSequenceOfTransient),
+ Transfer_TransferMapOfProcessForTransient> (theWithStarts)
+ { }
+
+};
+#endif
+++ /dev/null
--- Created on: 1994-11-04
--- Created by: Christian CAILLET
--- 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 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.
-
-generic class Mapper from Transfer
- (TheKey as any;
- TheHasher as any;
- TheInfo as any)
- inherits Finder
-
- ---Purpose : a Mapper defines a Finder for a specific input class
- -- its definition includes the value of the Key to be mapped,
- -- and the HashCoder associated to the class of the Key
- --
- -- TheKey defines the class to be keyed
- -- TheHasher is the associated Hasher
- -- TheInfo is an additionnal class which helps to provide
- -- informations on the value (template : see DataInfo)
-
-uses CString
-
-is
-
- Create (akey : any TheKey) returns mutable Mapper;
- ---Purpose : Creates a Mapper with a Value. This Value can then not be
- -- changed. It is used by the Hasher to compute the HashCode,
- -- which will then be stored for an immediate reading.
-
- Value (me) returns any TheKey is static;
- ---Purpose : Returns the contained value
- ---C++ : return const &
-
- Equates (me; other : Finder) returns Boolean;
- ---Purpose : Specific testof equallity : defined as False if <other> has
- -- not the same true Type, else contents are compared (by
- -- C++ operator ==)
-
- ValueType (me) returns Type is redefined;
- ---Purpose : Returns the Type of the Value. By default, returns the
- -- DynamicType of <me>, but can be redefined
-
- ValueTypeName (me) returns CString is redefined;
- ---Purpose : Returns the name of the Type of the Value. Default is name
- -- of ValueType, unless it is for a non-handled object
-
-fields
-
- theval : TheKey;
-
-end Mapper;
+++ /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 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 <Transfer_Mapper.ixx>
-#include <Standard_Integer.hxx>
-
-
-Transfer_Mapper::Transfer_Mapper (const TheKey& akey)
- : theval (akey)
-{ SetHashCode ( TheHasher::HashCode (akey, IntegerLast() ) ); }
-
-
- const TheKey& Transfer_Mapper::Value () const
- { return theval; }
-
- Standard_Boolean Transfer_Mapper::Equates
- (const Handle(Transfer_Finder)& other) const
-{
- if (other.IsNull()) return Standard_False;
- if (GetHashCode() != other->GetHashCode()) return Standard_False;
- if (other->DynamicType() != DynamicType()) return Standard_False;
- Handle(Transfer_Mapper) another = Handle(Transfer_Mapper)::DownCast(other);
-// return (theval == another->Value());
- return TheHasher::IsEqual (theval,another->Value());
-}
-
- Handle(Standard_Type) Transfer_Mapper::ValueType () const
- { return TheInfo::Type(theval); }
-
- Standard_CString Transfer_Mapper::ValueTypeName () const
- { return TheInfo::TypeName(theval); }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_Mapper_HeaderFile
+#define _Transfer_Mapper_HeaderFile
+
+#include <Transfer_Finder.hxx>
+#include <Standard_CString.hxx>
+
+ //! Mapper defines a Finder for a specific input class
+ //! its definition includes the value of the Key to be mapped,
+ //! and the HashCoder associated to the class of the Key
+ //! TheKey defines the class to be keyed
+ //! TheHasher is the associated Hasher
+ //! TheInfo is an additionnal class which helps to provide
+ //! informations on the value (template : see DataInfo)
+template <class TheKey, class TheHasher, class TheInfo, class MapperHandle>
+class Transfer_Mapper : public Transfer_Finder
+{
+private:
+ TheKey myVal;
+public:
+ Standard_EXPORT Transfer_Mapper (const TheKey& theKey)
+ : myVal (theKey)
+ {
+ SetHashCode (TheHasher::HashCode (theKey, IntegerLast()));
+ }
+
+ Standard_EXPORT const TheKey& Value () const
+ {
+ return myVal;
+ }
+
+ Standard_EXPORT Standard_Boolean Equates (const Handle(Transfer_Finder)& theOther) const
+ {
+ if (theOther.IsNull()) return Standard_False;
+ if (GetHashCode() != theOther->GetHashCode()) return Standard_False;
+ if (theOther->DynamicType() != DynamicType()) return Standard_False;
+ MapperHandle another = MapperHandle::DownCast(theOther);
+ return TheHasher::IsEqual (myVal,another->Value());
+ }
+
+ Standard_EXPORT Handle(Standard_Type) ValueType () const
+ {
+ return TheInfo::Type(myVal);
+ }
+
+ Standard_EXPORT Standard_CString ValueTypeName () const
+ {
+ return TheInfo::TypeName(myVal);
+ }
+};
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1995-11-16
--- 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 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.
-
-class ResultFromModel from Transfer inherits TShared
-
- ---Purpose : ResultFromModel is used to store a final result stored in a
- -- TransientProcess, respectfully to its structuration in scopes
- -- by using a set of ResultFromTransient
- -- Hence, it can be regarded as a passive equivalent of the
- -- stored data in the TransientProcess, while an Iterator gives
- -- a flat view of it.
- --
- -- A ResultFromModel is intended to be attached to the transfer
- -- of one entity (typically root entity but it is not mandatory)
- --
- -- It is then possible to :
- -- - Create and fill a ResultFromModel from a TransientProcess,
- -- by designating a starting entity
- -- - Fill back the TransientProcess from a ResultFromModel, as it
- -- were filled by the operation which filled it the first time
-
-uses CString, AsciiString, HSequenceOfTransient from TColStd,
- InterfaceModel, CheckIterator, CheckStatus,
- ResultFromTransient, TransientProcess
-
-is
-
- Create returns mutable ResultFromModel;
- ---Purpose : Creates a ResultFromModel, empty
-
- SetModel (me : mutable; model : InterfaceModel);
- ---Purpose : Sets starting Model
-
- SetFileName (me : mutable; filename : CString);
- ---Purpose : Sets starting File Name
-
- Model (me) returns InterfaceModel;
- ---Purpose : Returns starting Model (null if not set)
-
- FileName (me) returns CString;
- ---Purpose : Returns starting File Name (empty if not set)
-
- Fill (me : mutable; TP : TransientProcess; ent : Transient) returns Boolean;
- ---Purpose : Fills from a TransientProcess, with the result attached to
- -- a starting entity. Considers its Model if it is set.
- -- This action produces a structured set of ResultFromTransient,
- -- considering scopes, starting by that of <ent>.
- -- If <ent> has no recorded result, it remains empty
- -- Returns True if a result is recorded, False else
-
- Strip (me : mutable; mode : Integer);
- ---Purpose : Clears some data attached to binders used by TransientProcess,
- -- which become useless once the transfer has been done,
- -- by calling Strip on its ResultFromTransient
- --
- -- mode = 0 : minimum, clears data remaining from TransferProcess
- -- mode = 10 : just keeps file name, label, check status ...,
- -- and MainResult but only the result (Binder)
- -- mode = 11 : also clears MainResult (status and names remain)
-
- FillBack (me; TP : mutable TransientProcess);
- ---Purpose : Fills back a TransientProcess from the structured set of
- -- binders. Also sets the Model.
-
-
- HasResult (me) returns Boolean;
- ---Purpose : Returns True if a Result is recorded
-
- MainResult (me) returns ResultFromTransient;
- ---Purpose : Returns the main recorded ResultFromTransient, or a null
-
- SetMainResult (me : mutable; amain : ResultFromTransient);
- ---Purpose : Sets a new value for the main recorded ResultFromTransient
-
- MainLabel (me) returns CString;
- ---Purpose : Returns the label in starting model attached to main entity
- -- (updated by Fill or SetMainResult, if Model is known)
-
- MainNumber (me) returns Integer;
- ---Purpose : Returns the label in starting model attached to main entity
-
- -- Global Queries --
-
- ResultFromKey (me; start : Transient) returns ResultFromTransient;
- ---Purpose : Searches for a key (starting entity) and returns its result
- -- Returns a null handle if not found
-
- Results (me; level : Integer) returns HSequenceOfTransient;
- ---Purpose : Internal method which returns the list of ResultFromTransient,
- -- according level (2:complete; 1:sub-level 1; 0:main only)
-
- TransferredList (me; level : Integer = 2) returns HSequenceOfTransient;
- ---Purpose : Returns the list of recorded starting entities, ending by the
- -- root. Entities with check but no transfer result are ignored
- -- <level> = 2 (D), considers the complete list
- -- <level> = 1 considers the main result plus immediate subs
- -- <level> = 0 just the main result
-
- CheckedList (me; check : CheckStatus; result : Boolean)
- returns HSequenceOfTransient;
- ---Purpose : Returns the list of starting entities to which a check status
- -- is attached.
- -- <check> = -2 , all entities whatever the check (see result)
- -- <check> = -1 , entities with no fail (warning allowed)
- -- <check> = 0 , entities with no check at all
- -- <check> = 1 , entities with warning but no fail
- -- <check> = 2 , entities with fail
- -- <result> : if True, only entities with an attached result
- -- Remark : result True and check=0 will give an empty list
-
- CheckList (me; erronly : Boolean; level : Integer = 2)
- returns CheckIterator;
- ---Purpose : Returns the check-list of this set of results
- -- <erronly> true : only fails are considered
- -- <level> = 0 : considers only main binder
- -- <level> = 1 : considers main binder plus immediate subs
- -- <level> = 2 (D) : considers all checks
-
- CheckStatus (me) returns CheckStatus;
- ---Purpose : Returns the check status with corresponds to the content
- -- of this ResultFromModel; considers all levels of transfer
- -- (worst status). Returns CheckAny if not yet computed
- -- Reads it from recorded status if already computed, else
- -- recomputes one
-
- ComputeCheckStatus (me : mutable; enforce : Boolean) returns CheckStatus;
- ---Purpose : Computes and records check status (see CheckStatus)
- -- Does not computes it if already done and <enforce> False
-
-fields
-
- themodel : InterfaceModel;
- thename : AsciiString;
- themain : ResultFromTransient;
- themlab : AsciiString;
- themnum : Integer;
- themchk : CheckStatus;
-
-end ResultFromModel;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_ResultFromModel.ixx>
+#include <Transfer_ResultFromModel.hxx>
#include <TColStd_IndexedMapOfTransient.hxx>
#include <Interface_Check.hxx>
#include <Interface_Macros.hxx>
#include <Transfer_Binder.hxx>
#include <TCollection_HAsciiString.hxx>
+#include <Standard_Type.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Standard_Transient.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Interface_CheckIterator.hxx>
+#include <Transfer_ResultFromModel.hxx>
+IMPLEMENT_STANDARD_TYPE(Transfer_ResultFromModel)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(Transfer_ResultFromModel)
+
+
+IMPLEMENT_DOWNCAST(Transfer_ResultFromModel,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(Transfer_ResultFromModel)
Transfer_ResultFromModel::Transfer_ResultFromModel ()
{ themnum = 0; themchk = Interface_CheckAny; }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_ResultFromModel_HeaderFile
+#define _Transfer_ResultFromModel_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <Standard_Integer.hxx>
+#include <Interface_CheckStatus.hxx>
+#include <MMgt_TShared.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Boolean.hxx>
+#include <Transfer_ResultFromTransient.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Handle_MMgt_TShared.hxx>
+class Interface_InterfaceModel;
+class Transfer_ResultFromTransient;
+class Transfer_TransientProcess;
+class Standard_Transient;
+class TColStd_HSequenceOfTransient;
+class Interface_CheckIterator;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+class Transfer_ResultFromModel;
+
+DEFINE_STANDARD_HANDLE(Transfer_ResultFromModel,MMgt_TShared)
+
+//! ResultFromModel is used to store a final result stored in a <br>
+//! TransientProcess, respectfully to its structuration in scopes <br>
+//! by using a set of ResultFromTransient <br>
+//! Hence, it can be regarded as a passive equivalent of the <br>
+//! stored data in the TransientProcess, while an Iterator gives <br>
+//! a flat view of it. <br>
+//! <br>
+//! A ResultFromModel is intended to be attached to the transfer <br>
+//! of one entity (typically root entity but it is not mandatory) <br>
+//! <br>
+//! It is then possible to : <br>
+//! - Create and fill a ResultFromModel from a TransientProcess, <br>
+//! by designating a starting entity <br>
+//! - Fill back the TransientProcess from a ResultFromModel, as it <br>
+//! were filled by the operation which filled it the first time <br>
+class Transfer_ResultFromModel : public MMgt_TShared {
+
+public:
+
+ //! Creates a ResultFromModel, empty <br>
+ Standard_EXPORT Transfer_ResultFromModel();
+ //! Sets starting Model <br>
+ Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& model) ;
+ //! Sets starting File Name <br>
+ Standard_EXPORT void SetFileName(const Standard_CString filename) ;
+ //! Returns starting Model (null if not set) <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model() const;
+ //! Returns starting File Name (empty if not set) <br>
+ Standard_EXPORT Standard_CString FileName() const;
+ //! Fills from a TransientProcess, with the result attached to <br>
+//! a starting entity. Considers its Model if it is set. <br>
+//! This action produces a structured set of ResultFromTransient, <br>
+//! considering scopes, starting by that of <ent>. <br>
+//! If <ent> has no recorded result, it remains empty <br>
+//! Returns True if a result is recorded, False else <br>
+ Standard_EXPORT Standard_Boolean Fill(const Handle(Transfer_TransientProcess)& TP,const Handle(Standard_Transient)& ent) ;
+ //! Clears some data attached to binders used by TransientProcess, <br>
+//! which become useless once the transfer has been done, <br>
+//! by calling Strip on its ResultFromTransient <br>
+//! <br>
+//! mode = 0 : minimum, clears data remaining from TransferProcess <br>
+//! mode = 10 : just keeps file name, label, check status ..., <br>
+//! and MainResult but only the result (Binder) <br>
+//! mode = 11 : also clears MainResult (status and names remain) <br>
+ Standard_EXPORT void Strip(const Standard_Integer mode) ;
+ //! Fills back a TransientProcess from the structured set of <br>
+//! binders. Also sets the Model. <br>
+ Standard_EXPORT void FillBack(const Handle(Transfer_TransientProcess)& TP) const;
+ //! Returns True if a Result is recorded <br>
+ Standard_EXPORT Standard_Boolean HasResult() const;
+ //! Returns the main recorded ResultFromTransient, or a null <br>
+ Standard_EXPORT Handle_Transfer_ResultFromTransient MainResult() const;
+ //! Sets a new value for the main recorded ResultFromTransient <br>
+ Standard_EXPORT void SetMainResult(const Handle(Transfer_ResultFromTransient)& amain) ;
+ //! Returns the label in starting model attached to main entity <br>
+//! (updated by Fill or SetMainResult, if Model is known) <br>
+ Standard_EXPORT Standard_CString MainLabel() const;
+ //! Returns the label in starting model attached to main entity <br>
+ Standard_EXPORT Standard_Integer MainNumber() const;
+ //! Searches for a key (starting entity) and returns its result <br>
+//! Returns a null handle if not found <br>
+ Standard_EXPORT Handle_Transfer_ResultFromTransient ResultFromKey(const Handle(Standard_Transient)& start) const;
+ //! Internal method which returns the list of ResultFromTransient, <br>
+//! according level (2:complete; 1:sub-level 1; 0:main only) <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient Results(const Standard_Integer level) const;
+ //! Returns the list of recorded starting entities, ending by the <br>
+//! root. Entities with check but no transfer result are ignored <br>
+//! <level> = 2 (D), considers the complete list <br>
+//! <level> = 1 considers the main result plus immediate subs <br>
+//! <level> = 0 just the main result <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient TransferredList(const Standard_Integer level = 2) const;
+ //! Returns the list of starting entities to which a check status <br>
+//! is attached. <br>
+//! <check> = -2 , all entities whatever the check (see result) <br>
+//! <check> = -1 , entities with no fail (warning allowed) <br>
+//! <check> = 0 , entities with no check at all <br>
+//! <check> = 1 , entities with warning but no fail <br>
+//! <check> = 2 , entities with fail <br>
+//! <result> : if True, only entities with an attached result <br>
+//! Remark : result True and check=0 will give an empty list <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient CheckedList(const Interface_CheckStatus check,const Standard_Boolean result) const;
+ //! Returns the check-list of this set of results <br>
+//! <erronly> true : only fails are considered <br>
+//! <level> = 0 : considers only main binder <br>
+//! <level> = 1 : considers main binder plus immediate subs <br>
+//! <level> = 2 (D) : considers all checks <br>
+ Standard_EXPORT Interface_CheckIterator CheckList(const Standard_Boolean erronly,const Standard_Integer level = 2) const;
+ //! Returns the check status with corresponds to the content <br>
+//! of this ResultFromModel; considers all levels of transfer <br>
+//! (worst status). Returns CheckAny if not yet computed <br>
+//! Reads it from recorded status if already computed, else <br>
+//! recomputes one <br>
+ Standard_EXPORT Interface_CheckStatus CheckStatus() const;
+ //! Computes and records check status (see CheckStatus) <br>
+//! Does not computes it if already done and <enforce> False <br>
+ Standard_EXPORT Interface_CheckStatus ComputeCheckStatus(const Standard_Boolean enforce) ;
+
+ DEFINE_STANDARD_RTTI(Transfer_ResultFromModel)
+
+private:
+
+
+Handle_Interface_InterfaceModel themodel;
+TCollection_AsciiString thename;
+Handle_Transfer_ResultFromTransient themain;
+TCollection_AsciiString themlab;
+Standard_Integer themnum;
+Interface_CheckStatus themchk;
+
+
+};
+#endif
+++ /dev/null
--- Created on: 1995-11-16
--- 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 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.
-
-class ResultFromTransient from Transfer inherits TShared
-
- ---Purpose : This class, in conjunction with ResultFromModel, allows to
- -- record the result of a transfer initially stored in a
- -- TransientProcess.
- --
- -- A ResultFromTransient records a couple (Transient,Binder for
- -- the result and checks) plus a list of "sub-results", which
- -- have been recorded in the TrabsientProcess, under scope
- -- attached to the starting transient.
-
-uses Transient, HSequenceOfTransient, IndexedMapOfTransient,
- Check, CheckStatus, Binder, TransientProcess
-
-is
-
- Create returns mutable ResultFromTransient;
- ---Purpose : Creates a ResultFromTransient, empty
-
- SetStart (me : mutable; start : any Transient);
- ---Purpose : Sets starting entity
-
- SetBinder (me : mutable; binder : any Binder);
- ---Purpose : Sets Binder (for result plus individual check)
-
- Start (me) returns any Transient;
- ---Purpose : Returns the starting entity
-
- Binder (me) returns any Binder;
- ---Purpose : Returns the binder
-
- HasResult (me) returns Boolean;
- ---Purpose : Returns True if a result is recorded
-
- Check (me) returns Check;
- ---Purpose : Returns the check (or an empty one if no binder)
- ---C++ : return const
-
- CheckStatus (me) returns CheckStatus;
- ---Purpose : Returns the check status
-
-
- ClearSubs (me : mutable);
- ---Purpose : Clears the list of (immediate) sub-results
-
- AddSubResult (me : mutable; sub : mutable ResultFromTransient);
- ---Purpose : Adds a sub-result
-
- NbSubResults (me) returns Integer;
- ---Purpose : Returns the count of recorded sub-results
-
- SubResult (me; num : Integer) returns mutable ResultFromTransient;
- ---Purpose : Returns a sub-result, given its rank
-
- ResultFromKey (me; key : Transient) returns ResultFromTransient;
- ---Purpose : Returns the ResultFromTransient attached to a given starting
- -- entity (the key). Returns a null handle if not found
-
- FillMap (me; map : in out IndexedMapOfTransient);
- ---Purpose : This method is used by ResultFromModel to collate the list of
- -- ResultFromTransient, avoiding duplications with a map
- -- Remark : <me> is already in the map and has not to be bound
-
-
- Fill (me : mutable; TP : TransientProcess);
- ---Purpose : Fills from a TransientProcess, with the starting entity which
- -- must have been set before. It works with scopes, calls Fill
- -- on each of its sub-results
-
- Strip (me : mutable);
- ---Purpose : Clears some data attached to binders used by TransientProcess,
- -- which become useless once the transfer has been done :
- -- the list of sub-scoped binders, which is now recorded as
- -- sub-results
-
- FillBack (me; TP : mutable TransientProcess);
- ---Purpose : Fills back a TransientProcess with definition of a
- -- ResultFromTransient, respectfully to its structuration in
- -- scopes
-
-fields
-
- thestart : Transient;
- thebinder : Binder;
- thesubs : HSequenceOfTransient;
-
-end ResultFromTransient;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_ResultFromTransient.ixx>
+#include <Transfer_ResultFromTransient.hxx>
#include <TColStd_HArray1OfInteger.hxx>
+#include <Standard_Transient.hxx>
+#include <Standard_Type.hxx>
+#include <Transfer_Binder.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Interface_Check.hxx>
+#include <TColStd_IndexedMapOfTransient.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Transfer_ResultFromTransient.hxx>
+
+IMPLEMENT_STANDARD_TYPE(Transfer_ResultFromTransient)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(Transfer_ResultFromTransient)
+
+
+IMPLEMENT_DOWNCAST(Transfer_ResultFromTransient,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(Transfer_ResultFromTransient)
static Handle(Interface_Check) voidcheck = new Interface_Check;
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_ResultFromTransient_HeaderFile
+#define _Transfer_ResultFromTransient_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Transfer_Binder.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <MMgt_TShared.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Interface_Check.hxx>
+#include <Interface_CheckStatus.hxx>
+#include <Standard_Integer.hxx>
+#include <Transfer_TransientProcess.hxx>
+
+class Standard_Transient;
+class Transfer_Binder;
+class TColStd_HSequenceOfTransient;
+class Interface_Check;
+class TColStd_IndexedMapOfTransient;
+class Transfer_TransientProcess;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+class Transfer_ResultFromTransient;
+
+DEFINE_STANDARD_HANDLE(Transfer_ResultFromTransient,MMgt_TShared)
+
+//! This class, in conjunction with ResultFromModel, allows to <br>
+//! record the result of a transfer initially stored in a <br>
+//! TransientProcess. <br>
+//! <br>
+//! A ResultFromTransient records a couple (Transient,Binder for <br>
+//! the result and checks) plus a list of "sub-results", which <br>
+//! have been recorded in the TrabsientProcess, under scope <br>
+//! attached to the starting transient. <br>
+
+class Transfer_ResultFromTransient : public MMgt_TShared
+{
+
+public:
+
+ //! Creates a ResultFromTransient, empty <br>
+ Standard_EXPORT Transfer_ResultFromTransient();
+ //! Sets starting entity <br>
+ Standard_EXPORT void SetStart(const Handle(Standard_Transient)& start) ;
+ //! Sets Binder (for result plus individual check) <br>
+ Standard_EXPORT void SetBinder(const Handle(Transfer_Binder)& binder) ;
+ //! Returns the starting entity <br>
+ Standard_EXPORT Handle_Standard_Transient Start() const;
+ //! Returns the binder <br>
+ Standard_EXPORT Handle_Transfer_Binder Binder() const;
+ //! Returns True if a result is recorded <br>
+ Standard_EXPORT Standard_Boolean HasResult() const;
+ //! Returns the check (or an empty one if no binder) <br>
+ Standard_EXPORT const Handle_Interface_Check Check() const;
+ //! Returns the check status <br>
+ Standard_EXPORT Interface_CheckStatus CheckStatus() const;
+ //! Clears the list of (immediate) sub-results <br>
+ Standard_EXPORT void ClearSubs() ;
+ //! Adds a sub-result <br>
+ Standard_EXPORT void AddSubResult(const Handle(Transfer_ResultFromTransient)& sub) ;
+ //! Returns the count of recorded sub-results <br>
+ Standard_EXPORT Standard_Integer NbSubResults() const;
+ //! Returns a sub-result, given its rank <br>
+ Standard_EXPORT Handle_Transfer_ResultFromTransient SubResult(const Standard_Integer num) const;
+ //! Returns the ResultFromTransient attached to a given starting <br>
+ //! entity (the key). Returns a null handle if not found <br>
+ Standard_EXPORT Handle_Transfer_ResultFromTransient ResultFromKey(const Handle(Standard_Transient)& key) const;
+ //! This method is used by ResultFromModel to collate the list of <br>
+ //! ResultFromTransient, avoiding duplications with a map <br>
+ //! Remark : <me> is already in the map and has not to be bound <br>
+ Standard_EXPORT void FillMap(TColStd_IndexedMapOfTransient& map) const;
+ //! Fills from a TransientProcess, with the starting entity which <br>
+ //! must have been set before. It works with scopes, calls Fill <br>
+ //! on each of its sub-results <br>
+ Standard_EXPORT void Fill(const Handle(Transfer_TransientProcess)& TP) ;
+ //! Clears some data attached to binders used by TransientProcess, <br>
+ //! which become useless once the transfer has been done : <br>
+ //! the list of sub-scoped binders, which is now recorded as <br>
+ //! sub-results <br>
+ Standard_EXPORT void Strip() ;
+ //! Fills back a TransientProcess with definition of a <br>
+ //! ResultFromTransient, respectfully to its structuration in <br>
+ //! scopes <br>
+ Standard_EXPORT void FillBack(const Handle(Transfer_TransientProcess)& TP) const;
+
+ DEFINE_STANDARD_RTTI(Transfer_ResultFromTransient)
+
+private:
+
+ Handle_Standard_Transient thestart;
+ Handle_Transfer_Binder thebinder;
+ Handle_TColStd_HSequenceOfTransient thesubs;
+
+};
+#endif
+++ /dev/null
--- Created on: 1992-02-17
--- 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 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.
-
-generic class SimpleBinder from Transfer
-
- (TheResult as any; -- any : avoid Transient classes
- TheInfo as any) -- template : DataInfo
-
- inherits Binder
-
- ---Purpose : Allows direct binding between a starting Object and the Result
- -- of its transfer when it is Unique.
- -- The Result itself is defined as a formal parameter <TheResult>
- -- Warning : While it is possible to instantiate SimpleBinder with any Type
- -- for the Result, it is not advisable to instantiate it with
- -- Transient Classes, because such Results are directly known and
- -- managed by TransferProcess & Co, through
- -- SimpleBinderOfTransient : this class looks like instantiation
- -- of SimpleBinder, but its method ResultType
- -- is adapted (reads DynamicType of the Result)
-
-uses CString, Type
-
-raises TransferFailure
-
-is
-
- Create returns mutable SimpleBinder;
- ---Purpose : normal standard constructor, creates an empty SimpleBinder
-
- Create (res : any TheResult) returns mutable SimpleBinder;
- ---Purpose : constructor which in the same time defines the result
-
--- IsMultiple (me) returns Boolean;
- ---Purpose : Returns True if a starting object is bound with SEVERAL
- -- results : Here, returns allways False
- -- But it can have next results
-
- ResultType (me) returns Type;
- ---Purpose : Returns the Type permitted for the Result, i.e. the Type
- -- of the Parameter Class <TheResult> (statically defined)
-
- ResultTypeName (me) returns CString;
- ---Purpose : Returns the Type Name computed for the Result (dynamic)
-
- SetResult (me : mutable; res : any TheResult)
- ---Purpose : Defines the Result
- raises TransferFailure;
- -- Error if the Result is already used (see class Binder)
-
- Result (me) returns any TheResult
- ---Purpose : Returns the defined Result, if there is one
- raises TransferFailure;
- -- Error if the Result is not defined (see class Binder)
- ---C++ : return const &
-
- CResult (me : mutable) returns any TheResult;
- ---Purpose : Returns the defined Result, if there is one, and allows to
- -- change it (avoids Result + SetResult).
- -- Admits that Result can be not yet defined
- -- Warning : a call to CResult causes Result to be known as defined
- ---C++ : return &
-
-fields
-
- theres : TheResult;
-
-end SimpleBinder;
+++ /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 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 <Transfer_SimpleBinder.ixx> classe generique
-
-
-// "TheResult" identifie la classe donnee en parametre du Resultat
-
-
-Transfer_SimpleBinder::Transfer_SimpleBinder () { }
-
- Transfer_SimpleBinder::Transfer_SimpleBinder (const TheResult& res)
- : theres (res)
- { SetResultPresent(); }
-
-
-// Standard_Boolean Transfer_SimpleBinder::IsMultiple() const
-// { return Standard_False; }
-
-
- Handle(Standard_Type) Transfer_SimpleBinder::ResultType () const
- { return TheInfo::Type (theres); } // correspond a "STANDARD_TYPE(TheResult)"
-
- Standard_CString Transfer_SimpleBinder::ResultTypeName () const
- { return TheInfo::TypeName (theres); } // correspond a "STANDARD_TYPE(TheResult)"
-
-
- void Transfer_SimpleBinder::SetResult (const TheResult& res)
-{
- SetResultPresent();
- theres = res;
-}
-
- const TheResult& Transfer_SimpleBinder::Result () const
- { return theres; }
-
- TheResult& Transfer_SimpleBinder::CResult ()
- { SetResultPresent(); return theres; }
+++ /dev/null
--- Created on: 1992-02-07
--- 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 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.
-
-class TransferDispatch from Transfer inherits CopyTool
-
- ---Purpose : A TransferDispatch is aimed to dispatch Entities between two
- -- Interface Models, by default by copying them, as CopyTool, but
- -- with more capabilities of adapting : Copy is redefined to
- -- firstly pass the hand to a TransferProcess. If this gives no
- -- result, standard Copy is called.
- --
- -- This allow, for instance, to modify the copied Entity (such as
- -- changing a Name for a VDA Entity), or to do a deeper work
- -- (such as Substituting a kind of Entity to another one).
- --
- -- For these reasons, TransferDispatch is basically a CopyTool,
- -- but uses a more sophiscated control, which is TransferProcess,
- -- and its method Copy is redefined
-
-uses Transient, InterfaceModel, GeneralLib, Protocol from Interface,
- TransientProcess
-
-raises InterfaceError
-
-is
-
- Create (amodel : InterfaceModel; lib : GeneralLib) returns TransferDispatch;
- ---Purpose : Creates a TransferDispatch from a Model. Works with a General
- -- Service Library, given as an Argument
- -- A TransferDispatch is created as a CopyTool in which the
- -- Control is set to TransientProcess
-
- Create (amodel : InterfaceModel; protocol : Protocol from Interface)
- returns TransferDispatch;
- ---Purpose : Same as above, but Library is defined through a Protocol
-
- Create (amodel : InterfaceModel) returns TransferDispatch
- ---Purpose : Same as above, but works with the Active Protocol
- raises InterfaceError;
- -- Error if no Active Protocol is defined
-
- TransientProcess (me) returns mutable TransientProcess;
- ---Purpose : Returns the content of Control Object, as a TransientProcess
-
-
- Copy (me : in out; entfrom : Transient; entto : out mutable Transient;
- mapped : Boolean; errstat : Boolean)
- returns Boolean is redefined;
- ---Purpose : Copies an Entity by calling the method Transferring from the
- -- TransferProcess. If this called produces a Null Binder, then
- -- the standard, inherited Copy is called
-
-end TransferDispatch;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_TransferDispatch.ixx>
+#include <Transfer_TransferDispatch.hxx>
#include <Transfer_DispatchControl.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Interface_Macros.hxx>
-
-
+#include <Interface_InterfaceError.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Interface_Protocol.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Standard_Transient.hxx>
Transfer_TransferDispatch::Transfer_TransferDispatch
- (const Handle(Interface_InterfaceModel)& amodel,
- const Interface_GeneralLib& lib)
- : Interface_CopyTool (amodel,lib)
-{ SetControl (new Transfer_DispatchControl
- (amodel, new Transfer_TransientProcess(amodel->NbEntities()))); }
-
-
- Transfer_TransferDispatch::Transfer_TransferDispatch
- (const Handle(Interface_InterfaceModel)& amodel,
- const Handle(Interface_Protocol)& protocol)
- : Interface_CopyTool (amodel,protocol)
-{ SetControl (new Transfer_DispatchControl
- (amodel,new Transfer_TransientProcess(amodel->NbEntities()))); }
-
-
- Transfer_TransferDispatch::Transfer_TransferDispatch
- (const Handle(Interface_InterfaceModel)& amodel)
- : Interface_CopyTool (amodel)
-{ SetControl (new Transfer_DispatchControl
- (amodel,new Transfer_TransientProcess(amodel->NbEntities()))); }
+ (const Handle(Interface_InterfaceModel)& amodel,
+ const Interface_GeneralLib& lib)
+ : Interface_CopyTool (amodel,lib)
+{
+ SetControl (new Transfer_DispatchControl
+ (amodel, new Transfer_TransientProcess(amodel->NbEntities())));
+}
+Transfer_TransferDispatch::Transfer_TransferDispatch
+ (const Handle(Interface_InterfaceModel)& amodel,
+ const Handle(Interface_Protocol)& protocol)
+ : Interface_CopyTool (amodel,protocol)
+{
+ SetControl (new Transfer_DispatchControl
+ (amodel,new Transfer_TransientProcess(amodel->NbEntities())));
+}
+Transfer_TransferDispatch::Transfer_TransferDispatch
+ (const Handle(Interface_InterfaceModel)& amodel)
+ : Interface_CopyTool (amodel)
+{
+ SetControl (new Transfer_DispatchControl
+ (amodel,new Transfer_TransientProcess(amodel->NbEntities())));
+}
- Handle(Transfer_TransientProcess) Transfer_TransferDispatch::TransientProcess
+Handle(Transfer_TransientProcess) Transfer_TransferDispatch::TransientProcess
() const
{ return Handle(Transfer_DispatchControl)::DownCast(Control())->TransientProcess(); }
- Standard_Boolean Transfer_TransferDispatch::Copy
- (const Handle(Standard_Transient)& entfrom,
- Handle(Standard_Transient)& entto,
- const Standard_Boolean mapped, const Standard_Boolean errstat)
+Standard_Boolean Transfer_TransferDispatch::Copy
+ (const Handle(Standard_Transient)& entfrom,
+ Handle(Standard_Transient)& entto,
+ const Standard_Boolean mapped,
+ const Standard_Boolean errstat)
{
Handle(Transfer_Binder) result = TransientProcess()->Transferring(entfrom);
if (result.IsNull())
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_TransferDispatch_HeaderFile
+#define _Transfer_TransferDispatch_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Interface_CopyTool.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Interface_GeneralLib.hxx>
+#include <Handle_Interface_Protocol.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Standard_Transient.hxx>
+
+class Interface_InterfaceError;
+class Interface_InterfaceModel;
+class Interface_Protocol;
+class Transfer_TransientProcess;
+class Standard_Transient;
+
+
+//! A TransferDispatch is aimed to dispatch Entities between two <br>
+//! Interface Models, by default by copying them, as CopyTool, but <br>
+//! with more capabilities of adapting : Copy is redefined to <br>
+//! firstly pass the hand to a TransferProcess. If this gives no <br>
+//! result, standard Copy is called. <br>
+//! <br>
+//! This allow, for instance, to modify the copied Entity (such as <br>
+//! changing a Name for a VDA Entity), or to do a deeper work <br>
+//! (such as Substituting a kind of Entity to another one). <br>
+//! <br>
+//! For these reasons, TransferDispatch is basically a CopyTool, <br>
+//! but uses a more sophiscated control, which is TransferProcess, <br>
+//! and its method Copy is redefined <br>
+class Transfer_TransferDispatch : public Interface_CopyTool
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a TransferDispatch from a Model. Works with a General <br>
+ //! Service Library, given as an Argument <br>
+ //! A TransferDispatch is created as a CopyTool in which the <br>
+ //! Control is set to TransientProcess <br>
+ Standard_EXPORT Transfer_TransferDispatch(const Handle(Interface_InterfaceModel)& amodel,const Interface_GeneralLib& lib);
+ //! Same as above, but Library is defined through a Protocol <br>
+ Standard_EXPORT Transfer_TransferDispatch(const Handle(Interface_InterfaceModel)& amodel,const Handle(Interface_Protocol)& protocol);
+ //! Same as above, but works with the Active Protocol <br>
+ Standard_EXPORT Transfer_TransferDispatch(const Handle(Interface_InterfaceModel)& amodel);
+ //! Returns the content of Control Object, as a TransientProcess <br>
+ Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const;
+ //! Copies an Entity by calling the method Transferring from the <br>
+ //! TransferProcess. If this called produces a Null Binder, then <br>
+ //! the standard, inherited Copy is called <br>
+ Standard_EXPORT virtual Standard_Boolean Copy (const Handle(Standard_Transient)& entfrom,
+ Handle(Standard_Transient)& entto,
+ const Standard_Boolean mapped,
+ const Standard_Boolean errstat) ;
+};
+#endif
-- only Transient Objects)
uses InterfaceModel, EntityIterator, Protocol from Interface,
- TransferIterator, TransientProcess, FinderProcess
+ TransferIterator, TransientProcess_Handle, FinderProcess_Handle
raises TransferFailure
-- Error if one of the Resulting Objects is defined not Transient
- FillModel (me; proc : TransientProcess;
+ FillModel (me; proc : TransientProcess_Handle;
amodel : mutable InterfaceModel)
---Purpose : Fills an InterfaceModel with the Complete Result of a Transfer
-- stored in a TransientProcess (Starting Objects are Transient)
raises TransferFailure;
-- Error if one of the Resulting Objects is defined not Transient
- FillModel (me; proc : TransientProcess;
+ FillModel (me; proc : TransientProcess_Handle;
amodel : mutable InterfaceModel;
proto : Protocol from Interface;
roots : Boolean = Standard_True)
-- Error if one of the Resulting Objects is defined not Transient
- FillModel (me; proc : FinderProcess;
+ FillModel (me; proc : FinderProcess_Handle;
amodel : mutable InterfaceModel)
---Purpose : Fills an InterfaceModel with the Complete Result of a Transfer
-- stored in a TransientProcess (Starting Objects are Transient)
raises TransferFailure;
-- Error if one of the Resulting Objects is defined not Transient
- FillModel (me; proc : FinderProcess;
+ FillModel (me; proc : FinderProcess_Handle;
amodel : mutable InterfaceModel;
proto : Protocol from Interface;
roots : Boolean = Standard_True)
#include <Transfer_TransferInput.ixx>
#include <Transfer_Binder.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Transfer_FinderProcess.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <Transfer_IteratorOfProcessForFinder.hxx>
#include <Transfer_VoidBinder.hxx>
+++ /dev/null
--- Created on: 1992-02-04
--- 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 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.
-
-class TransferOutput from Transfer
-
- ---Purpose : A TransferOutput is a Tool which manages the transfer of
- -- entities created by an Interface, stored in an InterfaceModel,
- -- into a set of Objects suitable for an Application
- -- Objects to be transferred are given, by method Transfer
- -- (which calls Transfer from TransientProcess)
- -- A default action is available to get all roots of the Model
- -- Result is given as a TransferIterator (see TransferProcess)
- -- Also, it is possible to pilot directly the TransientProcess
-
-uses Transient, HSequenceOfTransient,
- InterfaceModel, Protocol from Interface, Graph, EntityIterator,
- TransientProcess, ActorOfTransientProcess
-
-raises NoSuchObject, TransferFailure
-
-is
-
- Create (actor : mutable ActorOfTransientProcess; amodel : InterfaceModel)
- returns TransferOutput;
- ---Purpose : Creates a TransferOutput ready to use, with a TransientProcess
-
- Create (proc : mutable TransientProcess; amodel : InterfaceModel)
- returns TransferOutput;
- ---Purpose : Creates a TransferOutput from an already existing
- -- TransientProcess, and a Model
-
--- ScopeMode (me : in out) returns Boolean;
- ---Purpose : Returns (by Reference, hence can be changed) the Mode for
- -- Scope Management. False (D) means Scope is ignored.
- -- True means that each individual Transfer (direct or through
- -- TransferRoots) is regarded as one Scope
- ---C++ : return &
-
- Model (me) returns InterfaceModel;
- ---Purpose : Returns the Starting Model
-
- TransientProcess (me) returns mutable TransientProcess;
- ---Purpose : Returns the TransientProcess used to work
-
- Transfer (me : in out; obj : Transient)
- ---Purpose : Transfer checks that all taken Entities come from the same
- -- Model, then calls Transfer from TransientProcess
- raises TransferFailure;
- -- Error if <obj> does not come from starting Model
-
-
- TransferRoots (me : in out; protocol : Protocol from Interface);
- ---Purpose : Runs transfer on the roots of the Interface Model
- -- The Roots are computed with a ShareFlags created from a
- -- Protocol given as Argument
-
- TransferRoots (me : in out; G : Graph from Interface);
- ---Purpose : Runs transfer on the roots defined by a Graph of dependences
- -- (which detains also a Model and its Entities)
- -- Roots are computed with a ShareFlags created from the Graph
-
- TransferRoots (me : in out);
- ---Purpose : Runs transfer on the roots of the Interface Model
- -- Remark : the Roots are computed with a ShareFlags created
- -- from the Active Protocol
-
- -- Helping Extractions --
-
- ListForStatus (me; normal : Boolean; roots : Boolean = Standard_True)
- returns EntityIterator;
- ---Purpose : Returns the list of Starting Entities with these criteria :
- -- - <normal> False, gives the entities bound with ABNORMAL STATUS
- -- (e.g. : Fail recorded, Exception raised during Transfer)
- -- - <normal> True, gives Entities with or without a Result, but
- -- with no Fail, no Exception (Warnings are not counted)
- -- - <roots> False, considers all entities recorded (either for
- -- Result, or for at least one Fail or Warning message)
- -- - <roots> True (Default), considers only roots of Transfer
- -- (the Entities recorded at highest level)
- -- This method is based on AbnormalResult from TransferProcess
-
- ModelForStatus (me; protocol : Protocol;
- normal : Boolean; roots : Boolean = Standard_True)
- returns mutable InterfaceModel;
- ---Purpose : Fills a Model with the list determined by ListForStatus
- -- This model starts from scratch (made by NewEmptyModel from the
- -- current Model), then is filled by AddWithRefs
- --
- -- Useful to get separately from a transfer, the entities which
- -- have caused problem, in order to furtherly analyse them (with
- -- normal = False), or the "good" entities, to obtain a data set
- -- "which works well" (with normal = True)
-
-fields
-
- theproc : TransientProcess;
- themodel : InterfaceModel;
--- thescope : Boolean;
-
-end TransferOutput;
// commercial license or contractual agreement.
//szv#4 S4163
-#include <Transfer_TransferOutput.ixx>
+
+#include <Transfer_TransientProcess.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Standard_NoSuchObject.hxx>
+#include <Transfer_TransferFailure.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_Protocol.hxx>
+#include <Interface_Graph.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <Transfer_TransferOutput.hxx>
#include <Transfer_Binder.hxx>
#include <Interface_ShareFlags.hxx>
#include <Interface_EntityIterator.hxx>
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_TransferOutput_HeaderFile
+#define _Transfer_TransferOutput_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Interface_Protocol.hxx>
+#include <Standard_Boolean.hxx>
+
+class Transfer_TransientProcess;
+class Interface_InterfaceModel;
+class Standard_NoSuchObject;
+class Transfer_TransferFailure;
+class Transfer_ActorOfTransientProcess;
+class Standard_Transient;
+class Interface_Protocol;
+class Interface_Graph;
+class Interface_EntityIterator;
+
+//! A TransferOutput is a Tool which manages the transfer of <br>
+//! entities created by an Interface, stored in an InterfaceModel, <br>
+//! into a set of Objects suitable for an Application <br>
+//! Objects to be transferred are given, by method Transfer <br>
+//! (which calls Transfer from TransientProcess) <br>
+//! A default action is available to get all roots of the Model <br>
+//! Result is given as a TransferIterator (see TransferProcess) <br>
+//! Also, it is possible to pilot directly the TransientProcess <br>
+class Transfer_TransferOutput
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a TransferOutput ready to use, with a TransientProcess <br>
+ Standard_EXPORT Transfer_TransferOutput(const Handle(Transfer_ActorOfTransientProcess)& actor,
+ const Handle(Interface_InterfaceModel)& amodel);
+
+ //! Creates a TransferOutput from an already existing <br>
+ //! TransientProcess, and a Model <br>//! Returns (by Reference, hence can be changed) the Mode for <br>
+ //! Scope Management. False (D) means Scope is ignored. <br>
+ //! True means that each individual Transfer (direct or through <br>
+ //! TransferRoots) is regarded as one Scope <br>
+ Standard_EXPORT Transfer_TransferOutput(const Handle(Transfer_TransientProcess)& proc,
+ const Handle(Interface_InterfaceModel)& amodel);
+
+ //! Returns the Starting Model <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model() const;
+
+ //! Returns the TransientProcess used to work <br>
+ Standard_EXPORT Handle_Transfer_TransientProcess TransientProcess() const;
+
+ //! Transfer checks that all taken Entities come from the same <br>
+ //! Model, then calls Transfer from TransientProcess <br>
+ Standard_EXPORT void Transfer(const Handle(Standard_Transient)& obj);
+
+ //! Runs transfer on the roots of the Interface Model <br>
+ //! The Roots are computed with a ShareFlags created from a <br>
+ //! Protocol given as Argument <br>
+ Standard_EXPORT void TransferRoots(const Handle(Interface_Protocol)& protocol);
+
+ //! Runs transfer on the roots defined by a Graph of dependences <br>
+ //! (which detains also a Model and its Entities) <br>
+ //! Roots are computed with a ShareFlags created from the Graph <br>
+ Standard_EXPORT void TransferRoots(const Interface_Graph& G);
+
+ //! Runs transfer on the roots of the Interface Model <br>
+ //! Remark : the Roots are computed with a ShareFlags created <br>
+ //! from the Active Protocol <br>
+ Standard_EXPORT void TransferRoots();
+
+ //! Returns the list of Starting Entities with these criteria : <br>
+ //! - <normal> False, gives the entities bound with ABNORMAL STATUS <br>
+ //! (e.g. : Fail recorded, Exception raised during Transfer) <br>
+ //! - <normal> True, gives Entities with or without a Result, but <br>
+ //! with no Fail, no Exception (Warnings are not counted) <br>
+ //! - <roots> False, considers all entities recorded (either for <br>
+ //! Result, or for at least one Fail or Warning message) <br>
+ //! - <roots> True (Default), considers only roots of Transfer <br>
+ //! (the Entities recorded at highest level) <br>
+ //! This method is based on AbnormalResult from TransferProcess <br>
+ Standard_EXPORT Interface_EntityIterator ListForStatus (const Standard_Boolean normal,
+ const Standard_Boolean roots = Standard_True) const;
+ //! Fills a Model with the list determined by ListForStatus <br>
+ //! This model starts from scratch (made by NewEmptyModel from the <br>
+ //! current Model), then is filled by AddWithRefs <br>
+ //! <br>
+ //! Useful to get separately from a transfer, the entities which <br>
+ //! have caused problem, in order to furtherly analyse them (with <br>
+ //! normal = False), or the "good" entities, to obtain a data set <br>
+ //! "which works well" (with normal = True) <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel ModelForStatus (const Handle(Interface_Protocol)& protocol,
+ const Standard_Boolean normal,
+ const Standard_Boolean roots = Standard_True) const;
+
+private:
+
+Handle_Transfer_TransientProcess theproc;
+Handle_Interface_InterfaceModel themodel;
+
+
+};
+#endif
+++ /dev/null
--- Created on: 1992-02-03
--- 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 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.
-
-generic class TransferProcess from Transfer
- (TheStart as any; -- either Transient or Finder
- TheMapHasher as any;
- TheList as Transient) -- HSequence from TCollection(TheStart)
- -- TheStart as Handle (i.e. Finder-Transient only)
- -- TheMapMasher : only for the Map
- -- TheList : for Starting Objects in Iterator (a HSequence from TColStd)
- inherits TShared
-
- ---Purpose : This class gives the frame for doing a direct transfer : it
- -- provides required basic tools, such as a Map, and automatisms
- -- which simplify work, while their use is not mandatory.
- --
- -- Starting Objects managed by Mapping can be Transient or any
- -- (by two instantiations provided by the package,
- -- TransientProcess and FinderProcess, see class Finder).
- --
- -- A direct Transfer must maintain data sharing whenever possible
- -- (that is, when described by both sides) : this is managed by a
- -- Map. It works with intermediate Objects, the Binders. Hence it
- -- allows a binding, one/several-one/several, and it controls
- -- that a Resulting Data can be used by another one only
- -- if its creation has been ended. Also it keeps error status.
- --
- -- Several results can be bound to a starting object, identified
- -- by a category number. The default one (the only one considered
- -- for final analysis) is zero. But mapping accesses allow to
- -- precise a category number different from zero
- --
- -- In order to work more easily in most cases, automatisms are
- -- offered. Classically, to transfer an object, its result is
- -- computed then bound. This applies recursively for referenced
- -- objects. Each Transfer of a kind of object can be performed
- -- by a specific Tool, which can use TransferProcess to work.
- --
- --
- -- Many often, a specific Transfer can work as : "Search the good
- -- Tool to Perform the Transfer (if not provided), run the Tool,
- -- then Bind the Result", where "Perform" is seen as a black box.
- --
- -- This way of working is assumed through automatisms which use
- -- two types of auxiliary objects :
- -- - An Actor acts as a Library of Transfer Actions :
- -- it recognizes the operation to perform on a starting object,
- -- then runs it (see class Actor)
- -- - it produces a Binder, which is then recorded in the Map
- -- - of course, if the Transfer has been already done, it is not
- -- run once more : the first Result is available
- -- - it is possible to re-evaluate the Result if required (i.e.
- -- if the definitive Result is known only once other Transfers
- -- have been engaged)
- -- - in the case of a second (or more) ask for Transfer, the
- -- Result is considered as "AlreadyUsed", hence it may not be
- -- changed (in the Binder itself or by Rebinding another one)
- --
- -- This gives a top-down process, in which first object to be
- -- transferred asks for another one it references to be, etc...
- -- This allows automatic management of Roots : only first
- -- transfers (asked by the user) can be Root Transfers.
- --
- --
- -- Other features are : Management of Root Entities (the Entities
- -- by which the Transfer has started, and their Results, can be
- -- identified as Roots, by the user or by automatisms); Error
- -- Handling (if automatisms are used);
- -- Returning Results, which can be specialized for
- -- Roots, or Erroneous Data, or complete/partial (for one entity)
- --
- -- Finally, TransferProcess inherits TShared : this allows to
- -- run successive steps on the same set of data attached to a
- -- given Transfer, by easily transmitting this set.
-
-uses Integer, Boolean, Transient, Type,
- IndexedMapOfInteger,SequenceOfInteger,HArray1OfInteger, SequenceOfTransient,
- HSequenceOfTransient, DictionaryOfInteger from Dico,
- Msg from Message, Messenger from Message,
- ParamType from Interface,
- Check from Interface, CheckIterator from Interface, Binder from Transfer,
- ProgressIndicator from Message
- -- also : parameter TheStart; nested Actor, Iterator, TransferMap
-
-raises InterfaceError, TransferFailure
-
-
- -- -- Nested Classes -- --
-
- class TransferMap instantiates IndexedDataMap from TCollection
- (TheStart,Binder,TheMapHasher);
- ---Purpose : This is the Map used by TransferProcess
-
-
- class Iterator inherits TransferIterator
- ---Purpose : This is a TransferIterator PLUS the capability to access
- -- the Starting Objects. It is given as a Result from
- -- TransferProcess. It can be used when a TransferIterator
- -- is required
- ---See also : TransferIterator, for more information
-
- uses Boolean, Binder -- , TheStart, TheList
-
- raises NoSuchObject
-
- is
-
- Create (withstarts : Boolean) returns Iterator;
- ---Purpose : Creates an empty Iterator
- -- if withstarts is True, each Binder to be iterated will
- -- be associated to its corresponding Starting Object
-
- Add (me : in out; binder : Binder)
- ---Purpose : Adds a Binder to the iteration list (construction)
- -- with no corresponding Starting Object
- -- (note that Result is brought by Binder)
- raises NoSuchObject is static;
- -- Error if Starting Objects were required at Creation
- -- time
-
- Add (me : in out; binder : Binder; start : TheStart) is static;
- ---Purpose : Adds a Binder to the iteration list, associated with
- -- its corresponding Starting Object "start"
- -- Starting Object is ignored if not required at
- -- Creation time
-
- Filter (me : in out; list : TheList; keep : Boolean = Standard_True);
- ---Purpose : After having added all items, keeps or rejects items
- -- which are attached to starting data given by <only>
- -- <keep> = True (D) : keeps. <keep> = False : rejects
- -- Does nothing if <withstarts> was False
-
- HasStarting (me) returns Boolean is static;
- ---Purpose : Returns True if Starting Object is available
- -- (defined at Creation Time)
-
- Starting (me) returns TheStart
- ---Purpose : Returns corresponding Starting Object
- raises NoSuchObject is static;
- -- Error if the Iterator was not created with Starting
- -- Objects (Create called with <withstarts> = True)
- ---C++ : return const &
-
- fields
-
- thestarts : TheList;
-
- end Iterator;
-
-
- -- (should be deferred, not allowed for a nested class)
- class Actor inherits TShared
- ---Purpose : An Actor performs the effective Transfer of a Starting
- -- Object, piloted by a TransferProcess. That is :
- -- - It recognizes, for a Starting Object, the case to be run
- -- - Then, it performs the Transfer : the recommanded way to
- -- work is to define for each Type of Object to Transfer, a
- -- specific Transfer Tool, then to call it by the Actor
- -- - It assumes that the Result of Transfer is stored in a
- -- Binder, it creates it if the Tool does not do
- -- It can use the TransferProcess for intermediate Results
- -- - It returns the Binder which stores the Result
- -- It no Result can be produced, it returns a Null Handle
- -- It may bind this Binder to <start> but is not obliged :
- -- TransferProcess controls this point.
- --
- -- Remark about the kind of returned Binder :
- -- - for a Transient Result, use the method TransientResult
- -- - else, cast and query the Binder itself
- --
- -- An Actor can be built by combination : this allows to
- -- gather several Actors, each one processing a set of cases.
-
- uses Transient, Binder,
- SimpleBinderOfTransient
- -- TransferProcess, TheStart
-
- raises DomainError
-
- is
-
- Create returns mutable Actor;
-
- Recognize (me : mutable; start : TheStart)
- returns Boolean is virtual;
- ---Purpose : Prerequesite for Transfer : the method Transfer is
- -- called on a starting object only if Recognize has
- -- returned True on it
- -- This allows to define a list of Actors, each one
- -- processing a definite kind of data
- -- TransferProcess calls Recognize on each one before
- -- calling Transfer. But even if Recognize has returned
- -- True, Transfer can reject by returning a Null Binder
- -- (afterwards rejection), the next actor is then invoked
- --
- -- The provided default returns True, can be redefined
-
- Transferring (me : mutable;
- start : TheStart; TP : mutable TransferProcess)
- returns mutable Binder
- ---Purpose : Specific action of Transfer. The Result is stored in
- -- the returned Binder, or a Null Handle for "No result"
- -- (Default defined as doing nothing; should be deffered)
- -- "mutable" allows the Actor to record intermediate
- -- information, in addition to those of TransferProcess
- raises DomainError is virtual; -- should be deferred;
- -- In case of Error during a Transfer, any kind of
- -- exception can be raised
-
- TransientResult (me; res : any Transient)
- returns mutable SimpleBinderOfTransient;
- ---Purpose : Prepares and Returns a Binder for a Transient Result
- -- Returns a Null Handle if <res> is itself Null
-
- NullResult (me) returns mutable Binder;
- ---Purpose : Returns a Binder for No Result, i.e. a Null Handle
-
-
- SetLast (me : mutable; mode : Boolean = Standard_True);
- ---Purpose : If <mode> is True, commands an Actor to be set at the
- -- end of the list of Actors (see SetNext)
- -- If it is False (creation default), each add Actor is
- -- set at the beginning of the list
- -- This allows to define default Actors (which are Last)
-
- IsLast (me) returns Boolean;
- ---Purpose : Returns the Last status (see SetLast).
-
- SetNext (me : mutable; next : mutable Actor);
- ---Purpose : Defines a Next Actor : it can then be asked to work if
- -- <me> produces no result for a given type of Object.
- -- If Next is already set and is not "Last", calls
- -- SetNext on it. If Next defined and "Last", the new
- -- actor is added before it in the list
-
- Next (me) returns mutable Actor;
- ---Purpose : Returns the Actor defined as Next, or a Null Handle
-
- fields
-
- thenext : Actor;
- thelast : Boolean;
-
- end Actor;
-
- -- -- The class TransferProcess itself -- --
-
-is
-
- Create (nb : Integer = 10000) returns mutable TransferProcess from Transfer;
- ---Purpose : Sets TransferProcess at initial state. Gives an Initial size
- -- (indicative) for the Map when known (default is 10000).
- -- Sets default trace file as a printer and default trace level
- -- (see Message_TraceFile).
-
- Create (printer: Messenger from Message; nb: Integer = 10000)
- returns mutable TransferProcess from Transfer;
- ---Purpose : Sets TransferProcess at initial state. Gives an Initial size
- -- (indicative) for the Map when known (default is 10000).
- -- Sets a specified printer.
-
- Clear (me : mutable);
- ---Purpose : Resets a TransferProcess as ready for a completely new work.
- -- Clears general data (roots) and the Map
-
- Clean (me : mutable);
- ---Purpose : Rebuilds the Map and the roots to really remove Unbound items
- -- Because Unbind keeps the entity in place, even if not bound
- -- Hence, working by checking new items is meaningless if a
- -- formerly unbound item is rebound
-
- Resize (me : mutable; nb : Integer);
- ---Purpose : Resizes the Map as required (if a new reliable value has been
- -- determined). Acts only if <nb> is greater than actual NbMapped
-
- SetActor (me : mutable; actor : mutable Actor);
- ---Purpose : Defines an Actor, which is used for automatic Transfer
- -- If already defined, the new Actor is cumulated
- -- (see SetNext from Actor)
-
- Actor (me) returns mutable Actor;
- ---Purpose : Returns the defined Actor. Returns a Null Handle if
- -- not set.
-
- -- -- Fine Access to Map -- --
- -- This access works on : Binder (default), or Handle Result
- -- (Transient,Finder) as privileged kinds of Result
-
- Find (me; start : TheStart) returns mutable Binder;
- ---Purpose : Returns the Binder which is linked with a starting Object
- -- It can either bring a Result (Transfer done) or none (for a
- -- pre-binding).
- -- If no Binder is linked with <start>, returns a Null Handle
- -- Considers a category number, by default 0
- ---Warning : it is not equivalent to IsBound, which demands a Result
- -- C++ : return const &
-
- IsBound (me; start : TheStart) returns Boolean;
- ---Purpose : Returns True if a Result (whatever its form) is Bound with
- -- a starting Object. I.e., if a Binder with a Result set,
- -- is linked with it
- -- Considers a category number, by default 0
-
- IsAlreadyUsed (me; start : TheStart) returns Boolean;
- ---Purpose : Returns True if the result of the transfer of an object is
- -- already used in other ones. If it is, Rebind cannot change it.
- -- Considers a category number, by default 0
-
- FindAndMask (me : mutable; start : TheStart)
- returns mutable Binder is private;
- ---Purpose : Same as Find but stores the last access to the map, for a
- -- faster access on next calls (as Bind does too)
- -- Considers a category number, by default 0
- -- C++ : return const &
-
- Bind (me : mutable; start : TheStart; binder : mutable Binder)
- ---Purpose : Creates a Link a starting Object with a Binder. This Binder
- -- can either bring a Result (effective Binding) or none (it can
- -- be set later : pre-binding).
- -- Considers a category number, by default 0
- raises TransferFailure;
- -- Error if a Binder with a Result set is already linked with
- -- this Object (Binder with StatusResult not Initial)
-
- Rebind (me : mutable; start : TheStart; binder : mutable Binder)
- ---Purpose : Changes the Binder linked with a starting Object for its
- -- unitary transfer. This it can be useful when the exact form
- -- of the result is known once the transfer is widely engaged.
- -- This can be done only on first transfer.
- -- Considers a category number, by default 0
- raises TransferFailure;
- -- Error if : - the Result is known as Already Used
- -- or if - No Result is bound to <start>
- -- or if - <binder> brings No result
-
- Unbind (me : mutable; start : TheStart) returns Boolean
- ---Purpose : Removes the Binder linked with a starting object
- -- If this Binder brings a non-empty Check, it is replaced by
- -- a VoidBinder. Also removes from the list of Roots as required.
- -- Returns True if done, False if <start> was not bound
- -- Considers a category number, by default 0
- raises TransferFailure;
- -- Error if : - the Result is known as Already Used
-
- FindElseBind (me : mutable; start : TheStart)
- returns mutable Binder;
- ---Purpose : Returns a Binder for a starting entity, as follows :
- -- Tries to Find the already bound one
- -- If none found, creates a VoidBinder and Binds it
-
- -- Check management (uses Binder's Check)
-
- SetMessenger (me: mutable; messenger: Messenger from Message);
- ---Purpose : Sets Messenger used for outputting messages.
-
- Messenger (me) returns Messenger from Message;
- ---Purpose : Returns Messenger used for outputting messages.
- -- The returned object is guaranteed to be non-null;
- -- default is Message::Messenger().
-
- SetTraceLevel (me: mutable; tracelev: Integer);
- ---Purpose : Sets trace level used for outputting messages:
- -- <trace> = 0 : no trace at all
- -- <trace> = 1 : handled exceptions and calls to AddError
- -- <trace> = 2 : also calls to AddWarning
- -- <trace> = 3 : also traces new Roots
- -- (uses method ErrorTrace).
- -- Default is 1 : Errors traced
-
- TraceLevel (me) returns Integer;
- ---Purpose : Returns trace level used for outputting messages.
-
- SendFail (me : mutable; start : TheStart; amsg : Msg from Message);
- ---Purpose : New name for AddFail (Msg)
-
- SendWarning (me : mutable; start : TheStart; amsg : Msg from Message);
- ---Purpose : New name for AddWarning (Msg)
-
- SendMsg (me : mutable; start : TheStart; amsg : Msg from Message);
- ---Purpose : Adds an information message
- -- Trace is filled if trace level is at least 3
-
- AddFail (me : mutable; start : TheStart; mess : CString; orig : CString = "");
- ---Purpose : Adds an Error message to a starting entity (to the check of
- -- its Binder of category 0, as a Fail)
-
- AddError (me : mutable; start : TheStart; mess : CString; orig : CString = "");
- ---Purpose : (other name of AddFail, maintained for compatibility)
-
- AddFail (me : mutable; start : TheStart; amsg : Msg from Message);
- ---Purpose : Adds an Error Message to a starting entity from the definition
- -- of a Msg (Original+Value)
-
- AddWarning (me : mutable; start : TheStart; mess : CString; orig : CString = "");
- ---Purpose : Adds a Warning message to a starting entity (to the check of
- -- its Binder of category 0)
-
- AddWarning (me : mutable; start : TheStart; amsg : Msg from Message);
- ---Purpose : Adds a Warning Message to a starting entity from the definition
- -- of a Msg (Original+Value)
-
-
- Mend (me : mutable; start : TheStart; pref : CString = "");
- ---Pirpose : Mends messages bound to a starting entity, if there are some
- -- <pref> as for Check from Interface :
- -- Default converts all fails to warnings and that's all
-
- Check (me; start : TheStart) returns Check;
- ---Purpose : Returns the Check attached to a starting entity. If <start>
- -- is unknown, returns an empty Check
-
--- AddCaseName (me : mutable; start : TheStart; casename : CString);
- ---Purpose : Adds a case name to a starting entity
-
--- AddCaseValue (me : mutable; start : TheStart; caseval : Transient);
- ---Purpose : Adds a case value to a starting entity
-
--- CaseList (me; start : TheStart) returns HSequenceOfTransient;
- ---Purpose : Returns the complete case list for an entity. Null Handle if empty
-
--- NextItemWithAttribute (me; name : CString; num0 : Integer) returns Integer;
- ---Purpose : In the list of mapped items (between 1 and NbMapped),
- -- searches for the first item which follows <num0>(not included)
- -- and which has an attribute named <name>
- -- Attributes are brought by Binders
- -- Hence, allows such an iteration
- --
- -- for (num = TP->NextItemWithAttribute(name,0);
- -- num > 0;
- -- num = TP->NextItemWithAttribute(name,num) {
- -- .. process mapped item <num>
- -- }
-
--- AttributeType (me; name : CString) returns ParamType;
- ---Purpose : Returns the type of an Attribute attached to binders
- -- If this name gives no Attribute, returns ParamVoid
- -- If this name gives several different types, returns ParamMisc
- -- Else, returns the effective type (ParamInteger, ParamReal,
- -- ParamIdent, or ParamText)
-
--- Attributes (me; rootname : CString = "") returns DictionaryOfInteger;
- ---Purpose : Returns the list of recorded Attribute Names, as a Dictionary
- -- of Integer : each value gives the count of items which bring
- -- this attribute name
- -- By default, considers all the attribute names
- -- If <rootname> is given, considers only the attribute names
- -- which begin by <rootname>
-
- -- Most Useful Specific Bindings --
-
- BindTransient (me : mutable; start : TheStart; res : any Transient)
- ---Purpose : Binds a starting object with a Transient Result.
- -- Uses a SimpleBinderOfTransient to work. If there is already
- -- one but with no Result set, sets its Result.
- -- Considers a category number, by default 0
- raises TransferFailure;
- -- Error if a result is already bound (Binder not Initial)
-
- FindTransient (me; start : TheStart)
- returns any Transient;
- ---Purpose : Returns the Result of the Transfer of an object <start> as a
- -- Transient Result.
- -- Returns a Null Handle if there is no Transient Result
- -- Considers a category number, by default 0
- -- Warning : Supposes that Binding is done with a SimpleBinderOfTransient
- ---C++ : return const &
-
-
- BindMultiple (me : mutable; start : TheStart)
- ---Purpose : Prepares an object <start> to be bound with several results.
- -- If no Binder is yet attached to <obj>, a MultipleBinder
- -- is created, empty. If a Binder is already set, it must
- -- accept Multiple Binding.
- -- Considers a category number, by default 0
- raises TransferFailure;
- -- Error if a UNIQUE result is already bound (if a Multiple
- -- Result is, nothing is done)
-
- AddMultiple (me : mutable; start : TheStart; res : mutable Transient)
- ---Purpose : Adds an item to a list of results bound to a starting object.
- -- Considers a category number, by default 0, for all results
- raises TransferFailure;
- -- Error if no Binder accepting Multiple Binding is attached
- -- to <start> (none at all, or for a unique result)
-
- FindTypedTransient (me; start : TheStart; atype : Type from Standard;
- val : out mutable Transient) returns Boolean;
- ---Purpose : Searches for a transient result attached to a starting object,
- -- according to its type, by criterium IsKind(atype)
- --
- -- In case of multiple result, explores the list and gives in
- -- <val> the first transient result IsKind(atype)
- -- Returns True and fills <val> if found
- -- Else, returns False (<val> is not touched, not even nullified)
- --
- -- This syntactic form avoids to do DownCast : if a result is
- -- found with the good type, it is loaded in <val> and can be
- -- immediately used, well initialised
-
- GetTypedTransient (me; binder : Binder; atype : Type from Standard;
- val : out mutable Transient) returns Boolean;
- ---Purpose : Searches for a transient result recorded in a Binder, whatever
- -- this Binder is recorded or not in <me>
- --
- -- This is strictly equivalent to the class method GetTypedResult
- -- from class SimpleBinderOfTransient, but is just lighter to call
- --
- -- Apart from this, works as FindTypedTransient
-
-
- -- -- Atomic access to Map -- --
-
- NbMapped (me) returns Integer;
- ---Purpose : Returns the maximum possible value for Map Index
- -- (no result can be bound with a value greater than it)
-
- Mapped (me; num : Integer) returns any TheStart;
- ---Purpose : Returns the Starting Object bound to an Index,
- ---C++ : return const &
-
- MapIndex (me; start : TheStart) returns Integer;
- ---Purpose : Returns the Index value bound to a Starting Object, 0 if none
-
- MapItem (me; num : Integer) returns mutable Binder;
- ---Purpose : Returns the Binder bound to an Index
- -- Considers a category number, by default 0
-
- -- -- Root Management -- --
-
- SetRoot (me : mutable; start : TheStart)
- ---Purpose : Declares <obj> (and its Result) as Root. This status will be
- -- later exploited by RootResult, see below (Result can be
- -- produced at any time)
- raises TransferFailure;
- -- Error if <obj> is not bound before calling to SetRoot
-
- SetRootManagement (me : mutable; stat : Boolean);
- ---Purpose : Enable (if <stat> True) or Disables (if <stat> False) Root
- -- Management. If it is set, Transfers are considered as stacked
- -- (a first Transfer commands other Transfers, and so on) and
- -- the Transfers commanded by an external caller are "Root".
- -- Remark : SetRoot can be called whatever this status, on every
- -- object.
- -- Default is set to True.
-
- NbRoots (me) returns Integer;
- ---Purpose : Returns the count of recorded Roots
-
- Root (me; num : Integer) returns any TheStart;
- ---Purpose : Returns a Root Entity given its number in the list (1-NbRoots)
- ---C++ : return const &
-
- RootItem (me; num : Integer) returns mutable Binder;
- ---Purpose : Returns the Binder bound with a Root Entity given its number
- -- Considers a category number, by default 0
-
- RootIndex (me; start : TheStart) returns Integer;
- ---Purpose : Returns the index in the list of roots for a starting item,
- -- or 0 if it is not recorded as a root
-
- NestingLevel (me) returns Integer;
- ---Purpose : Returns Nesting Level of Transfers (managed by methods
- -- TranscriptWith & Co). Starts to zero. If no automatic Transfer
- -- is used, it remains to zero. Zero means Root Level.
-
- ResetNestingLevel (me : mutable);
- ---Purpose : Resets Nesting Level of Transfers to Zero (Root Level),
- -- whatever its current value.
-
- -- -- The Transfer Operations themselves -- --
-
- Recognize (me; start : TheStart) returns Boolean;
- ---Purpose : Tells if <start> has been recognized as good candidate for
- -- Transfer. i.e. queries the Actor and its Nexts
-
- Transferring (me : mutable; start : TheStart) returns mutable Binder
- ---Purpose : Performs the Transfer of a Starting Object, by calling
- -- the method TransferProduct (see below).
- -- Mapping and Roots are managed : nothing is done if a Result is
- -- already Bound, an exception is raised in case of error.
- raises TransferFailure;
- -- Error : if the Transfer falls in a loop, or asks to Rebind an
- -- Object already Bound AND Used or reads a non computed Result
- --
- -- Remark : if ErrorHandle is set, no exception is raised : see
- -- the method SetErrorHandle for more details
- -- C++ : return const &
-
- TransferProduct (me : mutable; start : TheStart) returns mutable Binder
- ---Purpose : Internal action of Transfer, called by Transferring, with or
- -- without ErrorHandle. It invokes the Actor to work (set by
- -- SetActor), and tries its Nexts if no result is produced,
- -- until a Non Null Binder is produced.
- -- But keep in mind that a Null Binder can allways be returned
- -- if a Starting Entity has not been recognized at all.
- raises TransferFailure
- is private;
- -- Error if the Transfer Action does any bad use of the Bindings
-
- Transfer (me : mutable; start : TheStart) returns Boolean
- --- Purpose : Same as Transferring but does not return the Binder.
- -- Simply returns True in case of success (for user call)
- raises TransferFailure;
- -- Error : from Transferring.
-
- -- -- Error Control on run-time -- --
-
- SetErrorHandle (me : mutable; err : Boolean);
- ---Purpose : Allows controls if exceptions will be handled
- -- Transfer Operations
- -- <err> False : they are not handled with try {} catch {}
- -- <err> True : they are
- -- Default is False: no handling performed
-
- ErrorHandle (me) returns Boolean;
- ---Purpose : Returns error handling flag
-
- StartTrace (me; binder : Binder; start : TheStart; level,mode : Integer);
- ---Purpose : Method called when trace is asked
- -- Calls PrintTrace to display information relevant for starting
- -- objects (which can be redefined)
- -- <level> is Nesting Level of Transfer (0 = root)
- -- <mode> controls the way the trace is done :
- -- 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root
-
- PrintTrace (me; start : TheStart; S : Messenger from Message) is virtual;
- ---Purpose : Prints a short information on a starting object. By default
- -- prints its Dynamic Type. Can be redefined
-
- IsLooping (me; alevel : Integer) returns Boolean;
- ---Purpose : Returns True if we are surely in a DeadLoop. Evaluation is not
- -- exact, it is a "majorant" which must be computed fast.
- -- This "majorant" is : <alevel> greater than NbMapped.
-
- -- -- Results and Error Log -- --
- -- The Map can be consulted term by term (as being indexed),
- -- or through an Iterator
-
-
- RootResult (me; withstart : Boolean = Standard_False) returns Iterator;
- ---Purpose : Returns, as an iterator, the log of root transfer, i.e. the
- -- created objects and Binders bound to starting roots
- -- If withstart is given True, Starting Objets are also returned
-
- CompleteResult (me; withstart : Boolean = Standard_False) returns Iterator;
- ---Purpose : Returns, as an Iterator, the entire log of transfer (list of
- -- created objects and Binders which can bring errors)
- -- If withstart is given True, Starting Objets are also returned
-
- AbnormalResult (me) returns Iterator;
- ---Purpose : Returns Binders which are neither "Done" nor "Initial",
- -- that is Error,Loop or Run (abnormal states at end of Transfer)
- -- Starting Objects are given in correspondance in the iterator
-
- CheckList (me; erronly : Boolean) returns CheckIterator;
- ---Purpose : Returns a CheckList as a list of Check : each one is for a
- -- starting entity which have either check (warning or fail)
- -- messages are attached, or are in abnormal state : that case
- -- gives a specific message
- -- If <erronly> is True, checks with Warnings only are ignored
-
- ResultOne (me; start : TheStart; level : Integer;
- withstart : Boolean = Standard_False) returns Iterator;
- ---Purpose : Returns, as an Iterator, the log of transfer for one object
- -- <level> = 0 : this object only
- -- and if <start> is a scope owner (else, <level> is ignored) :
- -- <level> = 1 : object plus its immediate scoped ones
- -- <level> = 2 : object plus all its scoped ones
-
- CheckListOne (me; start : TheStart; level : Integer;
- erronly : Boolean) returns CheckIterator;
- ---Purpose : Returns a CheckList for one starting object
- -- <level> interpreted as by ResultOne
- -- If <erronly> is True, checks with Warnings only are ignored
-
- IsCheckListEmpty (me; start : TheStart; level : Integer;
- erronly : Boolean) returns Boolean;
- ---Purpose : Returns True if no check message is attached to a starting
- -- object. <level> interpreted as by ResultOne
- -- If <erronly> is True, checks with Warnings only are ignored
-
- RemoveResult (me : mutable; start : TheStart; level : Integer;
- compute : Boolean = Standard_True);
- ---Purpose : Removes Results attached to (== Unbinds) a given object and,
- -- according <level> :
- -- <level> = 0 : only it
- -- <level> = 1 : it plus its immediately owned sub-results(scope)
- -- <level> = 2 : it plus all its owned sub-results(scope)
-
- CheckNum (me; start : TheStart) returns Integer is virtual;
- ---Purpose : Computes a number to be associated to a starting object in
- -- a check or a check-list
- -- By default, returns 0; can be redefined
-
- SetProgress(me : mutable; theProgress : ProgressIndicator from Message);
- ---Purpose: Sets Progress indicator
-
- GetProgress(me) returns ProgressIndicator from Message;
- ---Purpose: Gets Progress indicator
-
-fields
-
- theerrh : Boolean; -- to handle or not exception raisings
- thetrace : Integer; -- trace level (exceptions,errors, etc...)
- themessenger : Messenger from Message; -- messenger for sending messages
-
- thelevel : Integer;
- therootl : Integer; -- level of root at each time (not allways 1)
- therootm : Boolean; -- Flag for Root Management set or not
- theroots : IndexedMapOfInteger; -- indices of roots in the map
-
- thelastobj : TheStart; -- Last Starting Object Bound
- thelastbnd : Binder; -- Its attached Binder (noted to optimize)
- theindex : Integer; -- And Index
- theactor : Actor;
- themap : TransferMap;
-
- myProgress : ProgressIndicator from Message; -- Progress indicator
-
-end TransferProcess;
+++ /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 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.
-
-// DCE 21.01.99 S3767 Display original messages only
-// if the level is greater than 2
-
-//#include <Transfer_TransferProcess.ixx>
-// Class generique
-
-// TheStart est suppose Handle(Standard_Transient) ou (Transfer_Finder)
-// Il doit offrir : "==" , .IsNull() , ->DynamicType()
-
-#include <Standard_ErrorHandler.hxx>
-#include <Standard_Failure.hxx>
-
-#include <Message_Messenger.hxx>
-#include <Message_Msg.hxx>
-#include <Message.hxx>
-
-#include <Transfer_VoidBinder.hxx>
-#include <Transfer_SimpleBinderOfTransient.hxx>
-#include <Transfer_MultipleBinder.hxx>
-#include <Transfer_StatusResult.hxx>
-#include <Transfer_TransferFailure.hxx>
-#include <Transfer_TransferDeadLoop.hxx>
-
-#include <TCollection_HAsciiString.hxx>
-#include <Dico_DictionaryOfTransient.hxx>
-#include <Dico_IteratorOfDictionaryOfTransient.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
-
-
-//#define TRANSLOG // debug
-
-static Handle(Standard_Transient) nultrans; // pour retour const&(Null) ...
-static Handle(Transfer_Binder) nulbinder;
-
-
-//=======================================================================
-//function : Transfer_TransferProcess
-//purpose :
-//=======================================================================
-
-Transfer_TransferProcess::Transfer_TransferProcess (const Standard_Integer nb)
- : themap (nb)
-{
- theerrh = Standard_True;
- therootm = Standard_False;
- thelevel = 0; therootl = 0;
- themessenger = Message::DefaultMessenger();
- thetrace = 0;
-// theroots = new TColStd_HSequenceOfInteger ();
- theindex = 0;
-}
-
-
-//=======================================================================
-//function : Transfer_TransferProcess
-//purpose :
-//=======================================================================
-
-Transfer_TransferProcess::Transfer_TransferProcess(const Handle(Message_Messenger)& messenger,
- const Standard_Integer nb)
- : themap (nb)
-{
- theerrh = Standard_True;
- therootm = Standard_False;
- thelevel = 0; therootl = 0;
- SetMessenger (messenger);
- thetrace = 1;
-// theroots = new TColStd_HSequenceOfInteger ();
- theindex = 0;
-}
-
- void Transfer_TransferProcess::Clear ()
-{
- thelevel = 0; therootl = 0;
- theroots.Clear();
- themap.Clear();
- theindex = 0; thelastobj.Nullify(); thelastbnd.Nullify();
-}
-
- void Transfer_TransferProcess::Clean ()
-{
- Standard_Integer i, nb = NbMapped();
- Standard_Integer j,unb = 0;
- for (i = 1; i <= nb; i ++) {
- if (themap(i).IsNull()) unb ++;
- }
- if (unb == 0) return;
-
-// Refaire la map -> decalages
- TColStd_Array1OfInteger unbs (1,nb); unbs.Init(0);
- Transfer_TransferMap newmap (nb*2);
- for (i = 1; i <= nb; i ++) {
- TheStart ent = Mapped(i);
- Handle(Transfer_Binder) bnd = MapItem(i);
- if (bnd.IsNull()) continue;
- j = newmap.Add (ent,bnd);
- unbs.SetValue (i,j);
- }
- themap.Assign (newmap);
-
- // Update La liste des racines
- TColStd_IndexedMapOfInteger aNewRoots;
- for( i=1; i<= theroots.Extent(); i++ ) {
- j = theroots.FindKey(i);
- Standard_Integer k = unbs.Value(j);
- if ( k ) aNewRoots.Add ( k );
- }
- theroots.Clear();
- theroots = aNewRoots;
-
-// Le reste : nettoyage
- thelastobj.Nullify();
- thelastbnd.Nullify();
- theindex = 0;
-}
-
-
-//=======================================================================
-//function : Resize
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::Resize (const Standard_Integer nb)
-{
- if (nb > themap.NbBuckets()) themap.ReSize(nb);
-}
-
-
-//=======================================================================
-//function : SetActor
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SetActor(const Handle(Transfer_Actor)& actor)
-{
- if (theactor == actor) return;
- if (theactor.IsNull()) theactor = actor;
- else if (actor.IsNull()) theactor = actor; // declenche RAZ
- else if (theactor->IsLast()) { actor->SetNext(theactor); theactor = actor; }
- else theactor->SetNext(actor);
-}
-
-
-//=======================================================================
-//function : Actor
-//purpose :
-//=======================================================================
-
-Handle(Transfer_Actor) Transfer_TransferProcess::Actor () const
-{
- return theactor;
-}
-
-
-// ########################################################################
-// .... MAPPING ....
-
-// ## ## ## Actions Generales sur Binders ## ## ##
-// ## ## ## Consultations ## ## ##
-
-
-// ## ## Find ## ##
-
-//=======================================================================
-//function : Find
-//purpose :
-//=======================================================================
-
-Handle(Transfer_Binder) Transfer_TransferProcess::Find (const TheStart& start) const
-// const Standard_Integer categ) const
-{
- if (thelastobj == start) {
- //if (theindex > 0) return thelastbnd->Search(categ); //skl
- if (theindex > 0) return thelastbnd; //skl
- }
- Standard_Integer index = themap.FindIndex (start);
- if (index > 0) {
- const Handle(Transfer_Binder)& binder = themap.FindFromIndex(index);
- //if (binder.IsNull()) //skl
- return binder;
- //return binder->Search(categ); //skl
- }
- return nulbinder;
-}
-
-// ## ## IsBound ## ##
-
-//=======================================================================
-//function : IsBound
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::IsBound(const TheStart& start) const
-// const Standard_Integer categ) const
-{
- Handle(Transfer_Binder) binder = Find(start); //,categ); skl
- if (binder.IsNull()) return Standard_False;
- return binder->HasResult();
-}
-
-// ## ## IsAlreadyUsed ## ##
-
-//=======================================================================
-//function : IsAlreadyUsed
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::IsAlreadyUsed(const TheStart& start) const
-// const Standard_Integer categ) const
-{
- Handle(Transfer_Binder) binder = Find(start); //,categ); skl
- if (binder.IsNull()) {
- StartTrace (binder,start,thelevel,4);
- Transfer_TransferFailure::Raise
- ("TransferProcess : IsAlreadyUsed, transfer not done cannot be used...");
- }
- return (binder->Status() == Transfer_StatusUsed);
-}
-
-
-// ## ## FindAndMask (private) ## ##
-
-//=======================================================================
-//function : FindAndMask
-//purpose :
-//=======================================================================
-
-Handle(Transfer_Binder) Transfer_TransferProcess::FindAndMask(const TheStart& start)
-// const Standard_Integer categ)
-{
- if (thelastobj == start) {
- if (theindex > 0) return thelastbnd; //skl ->Search(categ);
- }
- thelastobj = start;
- theindex = themap.FindIndex (start);
- if (theindex > 0) thelastbnd = themap.FindFromIndex(theindex);
- else thelastbnd.Nullify();
- //if (thelastbnd.IsNull()) skl
- return thelastbnd;
- //return thelastbnd->Search(categ); //skl
-}
-
-
-// ## ## ## Modifications ## ## ##
-
-
-//=======================================================================
-//function : Bind
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::Bind (const TheStart& start,
- const Handle(Transfer_Binder)& binder)
-// const Standard_Integer categ)
-{
- if (binder.IsNull()) return;
- Handle(Transfer_Binder) former = FindAndMask(start);//,categ);skl
- if (!former.IsNull()) {
-// On admet VoidBinder : alors on reprend son Check
- if (former->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) {
- binder->Merge(former);
- //binder->SetCategory(categ); //skl
- themap(theindex) = binder; // Substitution
- }
- else if (former->Status() == Transfer_StatusUsed) {
- StartTrace (former,start,thelevel,4);
- Transfer_TransferFailure::Raise
- ("TransferProcess : Bind, already Bound");
- }
- else {
- if (thetrace > 2) StartTrace (former,start,thelevel,5);
- binder->CCheck()->GetMessages (former->Check());
- }
- }
- //binder->SetCategory(categ); //skl
- if (theindex == 0 || thelastbnd.IsNull()) {
- if (theindex == 0) theindex = themap.Add(start,binder); // Nouveau
- else themap(theindex) = binder; // idem en fait
- thelastbnd = binder;
- }
- else { //skl
- //binder->AddResult(thelastbnd);
- thelastbnd = binder;
- themap(theindex) = binder;
- }
-/*skl else if (thelastbnd->Category() == categ) { // Substitue cette categorie
- binder->Next(Standard_False)->SetNext(thelastbnd->Next(Standard_True),Standard_True);
- thelastbnd = binder;
- themap(theindex) = binder;
- } else {
- thelastbnd->AddNext (binder,categ,Standard_True);
- } */
-}
-
-
-//=======================================================================
-//function : Rebind
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::Rebind (const TheStart& start,
- const Handle(Transfer_Binder)& binder)
-// const Standard_Integer categ)
-{
- Bind(start,binder); //,categ);skl
- // entre les deux, les differences allaient s amenuisant
- // au debut, on criait si pas encore Bound (idiot)
- // ne restait plus comme difference que le test StatusUsed sur Rebind,
- // tandis que Bind refusait des lors qu il y avait un resultat
- // -> a present, Bind s aligne sur Rebind
-}
-
-
-//=======================================================================
-//function : Unbind
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::Unbind(const TheStart& start)
-// const Standard_Integer categ)
-{
- Handle(Transfer_Binder) former = FindAndMask(start);//,categ);skl
- if (theindex == 0) return Standard_False;
- if (former.IsNull()) return Standard_False;
- if (former->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) return Standard_True;
- //const Interface_Check& ach = thelastbnd->Check();
- //Handle(Transfer_Binder) newbinder = thelastbnd->RemoveNext(categ);skl
- //if (newbinder != thelastbnd)skl
- themap(theindex) = thelastbnd;// = newbinder;skl
- if(theroots.Contains(theindex)) {
- TColStd_IndexedMapOfInteger aNewRoots;
- for(Standard_Integer i = 1; i <= theroots.Extent(); i++)
- if(theindex!= theroots.FindKey(i))
- aNewRoots.Add(theroots.FindKey(i));
-
- theroots.Clear();
- theroots = aNewRoots;
- }
-
- thelastobj.Nullify();
- thelastbnd.Nullify();
- theindex = 0;
- return Standard_True;
-}
-
-
-//=======================================================================
-//function : FindElseBind
-//purpose :
-//=======================================================================
-
-Handle(Transfer_Binder) Transfer_TransferProcess::FindElseBind(const TheStart& start)
-// const Standard_Integer categ)
-{
- Handle(Transfer_Binder) binder = FindAndMask (start);//,categ);skl
- if (!binder.IsNull()) return binder;
- binder = new Transfer_VoidBinder;
- Bind(start,binder);//,categ);skl
- return binder;
-}
-
-
-// ## ## ## Messages associes ## ## ##
-
-//=======================================================================
-//function : SetMessenger
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SetMessenger (const Handle(Message_Messenger)& messenger)
-{
- if ( messenger.IsNull() )
- themessenger = Message::DefaultMessenger();
- else
- themessenger = messenger;
-}
-
-//=======================================================================
-//function : Messenger
-//purpose :
-//=======================================================================
-
-Handle(Message_Messenger) Transfer_TransferProcess::Messenger () const
-{
- return themessenger;
-}
-
-//=======================================================================
-//function : SetTraceLevel
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SetTraceLevel (const Standard_Integer tracelev)
-{
- thetrace = tracelev;
-}
-
-//=======================================================================
-//function : TraceLevel
-//purpose :
-//=======================================================================
-
-Standard_Integer Transfer_TransferProcess::TraceLevel () const
-{
- return thetrace;
-}
-
-//=======================================================================
-//function : SendFail
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SendFail(const TheStart& start,
- const Message_Msg& amsg)
-{
- AddFail(start,amsg);
-}
-
-
-//=======================================================================
-//function : SendWarning
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SendWarning(const TheStart& start,
- const Message_Msg& amsg)
-{
- AddWarning(start,amsg);
-}
-
-
-//=======================================================================
-//function : SendMsg
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SendMsg(const TheStart& start,
- const Message_Msg& amsg)
-{
- Handle(Transfer_Binder) binder = FindAndMask(start);
- if (binder.IsNull()) {
- binder = new Transfer_VoidBinder;
- Bind (start,binder);
- }
- // Alimente la trace : Regle causant (user messages)
- if (thetrace > 0) {
- StartTrace (binder,start,thelevel,6);
- themessenger << amsg.Value();
- if (amsg.IsEdited()&&thetrace>2)
- themessenger << " [from: " << amsg.Original() << "]";
- themessenger << endl;
- }
-}
-
-
-//=======================================================================
-//function : AddFail
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::AddFail(const TheStart& start,
- const Standard_CString mess,
- const Standard_CString orig)
-{
- Handle(Transfer_Binder) binder = FindAndMask(start);
- if (binder.IsNull()) {
- binder = new Transfer_VoidBinder;
- Bind (start,binder);
- }
- binder->AddFail (mess,orig);
- if (thetrace > 0) {
- StartTrace (binder,start,thelevel,1);
- themessenger << " --> Fail : " << mess;
- if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]";
- themessenger << endl;
- }
-}
-
-
-//=======================================================================
-//function : AddError
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::AddError(const TheStart& start,
- const Standard_CString mess,
- const Standard_CString orig)
-{
- AddFail (start,mess,orig);
-}
-
-
-//=======================================================================
-//function : AddFail
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::AddFail(const TheStart& start,
- const Message_Msg& amsg)
-{
- if (amsg.IsEdited()) AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString(),
- TCollection_AsciiString(amsg.Original()).ToCString());
- else AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString());
-}
-
-
-//=======================================================================
-//function : AddWarning
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::AddWarning(const TheStart& start,
- const Standard_CString mess,
- const Standard_CString orig)
-{
- Handle(Transfer_Binder) binder = FindAndMask(start);
- if (binder.IsNull()) {
- binder = new Transfer_VoidBinder;
- Bind (start,binder);
- }
- binder->AddWarning(mess,orig);
- if (thetrace > 1) {
- StartTrace (binder,start,thelevel,2);
- themessenger << " --> Warning : " << mess;
- if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]";
- themessenger << endl;
- }
-}
-
-
-//=======================================================================
-//function : AddWarning
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::AddWarning(const TheStart& start,
- const Message_Msg& amsg)
-{
- if (amsg.IsEdited()) AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString(),
- TCollection_AsciiString(amsg.Original()).ToCString());
- else AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString());
-}
-
-
-//=======================================================================
-//function : Mend
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::Mend(const TheStart& start,
- const Standard_CString pref)
-{
- Handle(Transfer_Binder) binder = FindAndMask(start);
- if (binder.IsNull()) return; // rien a faire ...
- Handle(Interface_Check) ach = binder->CCheck();
- ach->Mend (pref);
-}
-
-
-//=======================================================================
-//function : Check
-//purpose :
-//=======================================================================
-
-Handle(Interface_Check) Transfer_TransferProcess::Check(const TheStart& start) const
-{
- const Handle(Transfer_Binder)& binder = Find(start);
- if (binder.IsNull()) {
- Handle(Interface_Check) check;
- return check;
- }
- return binder->Check();
-}
-
-/*skl
-void Transfer_TransferProcess::AddCaseName(const TheStart& start,
- const Standard_CString casename)
-{
- AddCaseValue (start, new TCollection_HAsciiString (casename));
-}
-
-
-void Transfer_TransferProcess::AddCaseValue(const TheStart& start,
- const Handle(Standard_Transient)& caseval)
-{
- Handle(Transfer_Binder) binder = FindAndMask(start);
- if (binder.IsNull()) {
- binder = new Transfer_VoidBinder;
- Bind (start,binder);
- }
- binder->AddCaseValue (caseval);
-}
-
-
-Handle(TColStd_HSequenceOfTransient) Transfer_TransferProcess::CaseList
- (const TheStart& start) const
-{
- Handle(TColStd_HSequenceOfTransient) list;
- const Handle(Transfer_Binder)& binder = Find(start);
- if (binder.IsNull()) return list;
- return binder->CaseList();
-}
-
-Standard_Integer Transfer_TransferProcess::NextItemWithAttribute
- (const Standard_CString name, const Standard_Integer num0) const
-{
- Standard_Integer num, nb = NbMapped();
- for (num = num0+1; num <= nb; num ++) {
- Handle(Transfer_Binder) bnd = MapItem (num);
- if (bnd.IsNull()) continue;
- if (!bnd->Attribute(name).IsNull()) return num;
- }
- return 0;
-}
-
-
-Interface_ParamType Transfer_TransferProcess::AttributeType
- (const Standard_CString name) const
-{
- Interface_ParamType aty, res = Interface_ParamVoid;
- Standard_Integer num, nb = NbMapped();
- for (num = 1; num <= nb; num ++) {
- Handle(Transfer_Binder) bnd = MapItem (num);
- if (bnd.IsNull()) continue;
- aty = bnd->AttributeType(name);
- if (aty == Interface_ParamVoid) continue;
- if (res == Interface_ParamVoid) res = aty;
- else if (res != aty) return Interface_ParamMisc;
- }
- return res;
-}
-
-Handle(Dico_DictionaryOfInteger) Transfer_TransferProcess::Attributes
- (const Standard_CString rootname) const
-{
- Handle(Dico_DictionaryOfInteger) list = new Dico_DictionaryOfInteger;
- Standard_Integer num, nb = NbMapped();
- for (num = 1; num <= nb; num ++) {
- Handle(Transfer_Binder) bnd = MapItem (num);
- if (bnd.IsNull()) continue;
- Handle(Dico_DictionaryOfTransient) atr = bnd->AttrList();
- if (atr.IsNull()) continue;
- Dico_IteratorOfDictionaryOfTransient iatr(atr,rootname);
- for (; iatr.More(); iatr.Next()) {
- TCollection_AsciiString name = iatr.Name();
- Standard_Boolean deja;
- Standard_Integer& nbval = list->NewItem (name.ToCString(),deja);
- if (!deja) nbval = 0;
- nbval ++;
- }
-
- }
- return list;
-}
-skl*/
-
-
-// ## ## ## Actions sur Types Privilegies ## ## ##
-// ## ## ## (Transient) ## ## ##
-
-// Bind associe un objet a un objet resultat; or la Map associe un Objet a un
-// Binder (qui designe son resultat)
-// *Transient travaillent avec un SimpleBinderOfTransient
-// si deja la, on considere son resultat
-// sinon, on cree un Binder du bon type
-
-
-//=======================================================================
-//function : BindTransient
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::BindTransient(const TheStart& start,
- const Handle(Standard_Transient)& res)
-// const Standard_Integer categ)
-{
- if (res.IsNull()) return;
- Handle(Transfer_Binder) former = Find(start);//,categ);skl
- Handle(Transfer_SimpleBinderOfTransient) binder =
- Handle(Transfer_SimpleBinderOfTransient)::DownCast(former);
-// Binding sur place ?
- if (!binder.IsNull()) {
- if (binder->Status() == Transfer_StatusVoid) { binder->SetResult(res); return; }
- }
-// Sinon, refaire
- binder = new Transfer_SimpleBinderOfTransient;
- binder->SetResult (res);
- if (former.IsNull()) Bind(start,binder);//,categ);skl
- else Rebind(start,binder);//,categ);skl
-}
-
-
-//=======================================================================
-//function : FindTransient
-//purpose :
-//=======================================================================
-
-const Handle(Standard_Transient)& Transfer_TransferProcess::FindTransient
- (const TheStart& start) const
-{
- Handle(Transfer_SimpleBinderOfTransient) binder =
- Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(start));
- if (binder.IsNull()) return nultrans;
- if (!binder->HasResult()) return nultrans;
- return binder->Result();
-}
-
-
-// Binding Multiple : D abord le declarer par BindMultiple (si pas deja fait)
-// Puis ajouter les termes par AddMultiple
-
-//=======================================================================
-//function : BindMultiple
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::BindMultiple(const TheStart& start)
-// const Standard_Integer categ)
-{
- Handle(Transfer_Binder) binder = FindAndMask (start);//,categ);skl
- if (!binder.IsNull()) {
- if (!binder->IsKind(STANDARD_TYPE(Transfer_MultipleBinder))) {
- StartTrace (thelastbnd,start,thelevel,4);
- Transfer_TransferFailure::Raise ("TransferProcess : BindMultiple");
- }
- }
- else Bind(start,new Transfer_MultipleBinder);//,categ);skl
-}
-
-
-//=======================================================================
-//function : AddMultiple
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::AddMultiple(const TheStart& start,
- const Handle(Standard_Transient)& res)
-// const Standard_Integer categ)
-{
- Handle(Transfer_Binder) binder = FindAndMask(start);//,categ);skl
- Handle(Transfer_MultipleBinder) multr =
- Handle(Transfer_MultipleBinder)::DownCast(binder);
- if (multr.IsNull()) {
- StartTrace (binder,start,thelevel,4);
- if (binder.IsNull()) Transfer_TransferFailure::Raise
- ("TransferProcess : AddMultiple, nothing bound");
- else Transfer_TransferFailure::Raise
- ("TransferProcess : AddMultiple, Binder not a MultipleBinder");
- }
- multr->AddResult(res);
-}
-
-
-//=======================================================================
-//function : FindTypedTransient
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::FindTypedTransient
- (const TheStart& start, const Handle(Standard_Type)& atype,
- Handle(Standard_Transient)& val) const
-{
- return GetTypedTransient (Find(start),atype,val);
-}
-
-
-//=======================================================================
-//function : GetTypedTransient
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::GetTypedTransient
- (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype,
- Handle(Standard_Transient)& val) const
-{
- return Transfer_SimpleBinderOfTransient::GetTypedResult(binder,atype,val);
-}
-
-
-// ## ## ## ## ## Acces Atomique ## ## ## ## ##
-// (ne gere pas le scope mais donne acces aux categories)
-
-//=======================================================================
-//function : NbMapped
-//purpose :
-//=======================================================================
-
-Standard_Integer Transfer_TransferProcess::NbMapped () const
-{
- return themap.Extent();
-}
-
-
-//=======================================================================
-//function : Mapped
-//purpose :
-//=======================================================================
-
-const TheStart& Transfer_TransferProcess::Mapped(const Standard_Integer num) const
-{
- return themap.FindKey(num);
-}
-
-
-//=======================================================================
-//function : MapIndex
-//purpose :
-//=======================================================================
-
-Standard_Integer Transfer_TransferProcess::MapIndex(const TheStart& start) const
-{
- return themap.FindIndex(start);
-}
-
-
-//=======================================================================
-//function : MapItem
-//purpose :
-//=======================================================================
-
-Handle(Transfer_Binder) Transfer_TransferProcess::MapItem(const Standard_Integer num) const
-// const Standard_Integer categ) const
-{
- Handle(Transfer_Binder) binder = themap.FindFromIndex(num);
- //sklif (binder.IsNull())
- return binder;
- //sklreturn binder->Search (categ);
-}
-
-
-// ########################################################################
-// .... ROOT MANAGEMENT ....
-
-//=======================================================================
-//function : SetRoot
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SetRoot (const TheStart& start)
-{
- Standard_Integer index = MapIndex(start);
- if (index == 0) {
- //StartTrace (thelastbnd,start,thelevel,4);
- //Transfer_TransferFailure::Raise("TransferProcess : SetRoot");
- return;
- }
-
- theroots.Add(index);
- if (thetrace > 2) StartTrace (MapItem(index),start,thelevel,3);
-}
-
-
-//=======================================================================
-//function : SetRootManagement
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SetRootManagement(const Standard_Boolean stat)
-{
- therootm = stat;
-}
-
-
-//=======================================================================
-//function : NbRoots
-//purpose :
-//=======================================================================
-
-Standard_Integer Transfer_TransferProcess::NbRoots () const
-{
- return theroots.Extent();
-}
-
-
-//=======================================================================
-//function : Root
-//purpose :
-//=======================================================================
-
-const TheStart& Transfer_TransferProcess::Root(const Standard_Integer num) const
-{
- Standard_Integer ind = 0;
- if (num > 0 && num <= theroots.Extent()) ind = theroots.FindKey(num);
- return themap.FindKey (ind);
-}
-
-
-//=======================================================================
-//function : RootItem
-//purpose :
-//=======================================================================
-
-Handle(Transfer_Binder) Transfer_TransferProcess::RootItem(const Standard_Integer num) const
-// const Standard_Integer categ) const
-{
- Standard_Integer ind = 0;
- if (num > 0 && num <= theroots.Extent()) ind = theroots.FindKey(num);
- return themap.FindFromIndex(ind);//->Search(categ);skl
-}
-
-
-//=======================================================================
-//function : RootIndex
-//purpose :
-//=======================================================================
-
-Standard_Integer Transfer_TransferProcess::RootIndex(const TheStart& start) const
-{
- Standard_Integer index = MapIndex(start);
- if (index == 0) return 0;
- return theroots.FindIndex(index);
-}
-
-
-//=======================================================================
-//function : NestingLevel
-//purpose :
-//=======================================================================
-
-Standard_Integer Transfer_TransferProcess::NestingLevel () const
-{
- return thelevel;
-}
-
-
-//=======================================================================
-//function : ResetNestingLevel
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::ResetNestingLevel ()
-{
- thelevel = 0;
-}
-
-
-// ########################################################################
-// .... SCOPE MANAGEMENT ....
-
-
-//======================================================================
-//Purpose : gka TRJ9 for writing SDR for solid
-// Check if binder has already been bound to the result binder.
-//======================================================================
-
-// static Standard_Boolean Contains(const Handle(Transfer_Binder)& resbinder,
-// const Handle(Transfer_Binder)& addbinder)
-// {
-// Handle(Transfer_Binder) tmpbind = resbinder;
-// for ( ; ! tmpbind.IsNull(); tmpbind = tmpbind->NextResult() )
-// if ( tmpbind == addbinder ) return Standard_True;
-// return Standard_False;
-// }
-
-// ########################################################################
-// .... AUTOMATISMES DE TRANSFERT ....
-
-// ## ## ## ## ## Fonctions de Base ## ## ## ## ##
-
-
-//=======================================================================
-//function : Recognize
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::Recognize(const TheStart& start) const
-{
- Handle(Transfer_Actor) actor = theactor;
- // On balaie les Next jusqu a avoir un Resultat
- while (!actor.IsNull()) {
- if (actor->Recognize (start)) return Standard_True;
- actor = actor->Next();
- }
- return Standard_False;
-}
-
-
-//=======================================================================
-//function : Transferring
-//purpose :
-//=======================================================================
-
-Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& start)
-{
- // Map deja alimentee ?
- Handle(Transfer_Binder) former = FindAndMask(start);
-
- // .... Transfert deja effectue avec Resultat ? ....
-
- // On considere que cette nouvelle demande de Transfert correspond donc a une
- // utilisation en plus : noter "AlreadyUsed", donc resultat non modifiable
- if (!former.IsNull()) {
- if (former->HasResult()) {
- former->SetAlreadyUsed();
- return former;
- }
- //}
-
- // .... Etat Initial : peut-etre deja fait ... ou infaisable !
-
- //if (!former.IsNull()) {
- Transfer_StatusExec statex = former->StatusExec();
- switch (statex) {
- case Transfer_StatusInitial : // Transfert prepare a faire
- break;
- case Transfer_StatusDone : // Transfert deja fait
-//#ifdef TRANSLOG
- themessenger << " .. and Transfer done" << endl;
-//#endif
-// if (former->HasResult()) former->SetAlreadyUsed();
- return former;
- case Transfer_StatusRun : // ca y est, on boucle
- former->SetStatusExec(Transfer_StatusLoop);
- return former;
- case Transfer_StatusError : // pas propre, ca ...
- if (thetrace) {
- themessenger << " *** Transfer in Error Status :" << endl;
- StartTrace (former, start, thelevel,0);
-// (*themessenger->Out()) << flush;
- }
- else StartTrace (former, start,thelevel,4);
- Transfer_TransferFailure::Raise
- ("TransferProcess : Transfer in Error Status");
- case Transfer_StatusLoop : // la boucle est bouclee ...
- if (thetrace) {
- themessenger << " *** Transfer Head of Dead Loop :" << endl;
- StartTrace (former, start, thelevel,0);
-// (*themessenger->Out()) << flush;
- }
- else StartTrace (former, start,thelevel,4);
- Transfer_TransferDeadLoop::Raise
- ("TransferProcess : Transfer at Head of a Dead Loop");
- }
-#ifdef TRANSLOG
- cout << "Transfer,level "<<thelevel<<Message_Flush;
-#endif
- //}
-
- // .... OK, on peut lancer l Execution
- //if (!former.IsNull())
- former->SetStatusExec(Transfer_StatusRun);
- }
-#ifdef TRANSLOG
- cout << " GO .." << endl;
-#endif
-
- Handle(Transfer_Binder) binder;
- Standard_Boolean newbind = Standard_False;
- if (theerrh) {
- // Transfert sous protection pour les exceptions (pour notification en fait)
- Standard_Integer oldlev = thelevel;
- try {
- OCC_CATCH_SIGNALS
- binder = TransferProduct(start);
- }
-
- // ... Exceptions a Rattraper : elles ne se ressemblent pas toutes ... !
- catch (Transfer_TransferDeadLoop) {
- if (binder.IsNull()) {
- themessenger << " *** Dead Loop with no Result" << endl;
- if (thetrace) StartTrace (binder, start, thelevel-1,0);
- binder = new Transfer_VoidBinder;
- Bind (start,binder); newbind = Standard_True;
- } else if (binder->StatusExec() == Transfer_StatusLoop) {
- if (thetrace) {
- themessenger << " *** Dead Loop : Finding head of Loop :" << endl;
- StartTrace (binder, start, thelevel-1,0);
- }
- else StartTrace (binder, start,thelevel-1,4);
- Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop");
-// Autrement dit, on change d exception (on est sorti de la boucle)
- } else {
- if (thetrace) {
- themessenger << " *** Dead Loop : Actor in Loop :" << endl;
- StartTrace (binder, start, thelevel-1,0);
- }
- }
- binder->AddFail("Transfer in dead Loop");
- thelevel = oldlev;
- }
- catch (Standard_Failure) {
- if (binder.IsNull()) {
- themessenger << " *** Exception Raised with no Result" << endl;
- binder = new Transfer_VoidBinder;
- Bind (start,binder); newbind = Standard_True;
- }
- binder->AddFail("Transfer stopped by exception raising");
- if (thetrace) {
- themessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl;
- StartTrace (binder, start, thelevel-1,4);
- }
- thelevel = oldlev;
- }
- }
-
-// Transfert non protege (ainsi, dbx a la main en cas de plantage par Raise)
- else binder = TransferProduct(start);
-
-// .... Conclusion : Noter dans la Map ....
-
- if (!newbind && !binder.IsNull()) {
- if (former.IsNull()) {
-// Peut-etre <theactor> a fait lui meme Bind ... verifier sinon le faire
- if (!IsBound(start)) Bind(start,binder); // resultat = categorie 0
- else { // gka TRJ9 for writing SDR for solid
-// Handle(Transfer_Binder) tmpbind = Find(start);
-// if(!Contains(binder,tmpbind))
-// binder->AddResult(tmpbind);
- Rebind(start,binder); // test_pattern.sat
- }
- }
- else Rebind(start,binder);
-// (du coup, <thelastbnd> vaut <binder>)
-#ifdef TRANSLOG
- cout << " ... OK" << endl;
-#endif
- }
- else {
- //= by ABV: 5 Oct 97: nothing generated, but former can be in run state - drop it
- //= ASK: may be set it to StatusInitial ?
- if ( ! former.IsNull() ) former->SetStatusExec ( Transfer_StatusDone ); //+
- return nulbinder; // Binder Null ... que faire d autre ?
- }
-
-// .... Gerer les Racines (si prevu) ....
-
- if (therootl >= thelevel) {
- therootl = 0;
- if (therootm && binder->Status() != Transfer_StatusVoid) {
- SetRoot (start);
- }
- }
- return thelastbnd;
-}
-
-// ## ## TransferProduct : Action proprement dite ## ##
-
- Handle(Transfer_Binder) Transfer_TransferProcess::TransferProduct
- (const TheStart& start)
-{
- thelevel ++; // si decremente et == 0, transfert racine
- Handle(Transfer_Binder) binder;
- Handle(Transfer_Actor) actor = theactor;
-
-// On balaie les Next jusqu a avoir un Resultat
- while (!actor.IsNull()) {
- if (actor->Recognize (start)) binder = actor->Transferring(start,this);
- else binder.Nullify();
- if (!binder.IsNull()) break;
- actor = actor->Next();
- }
- if (binder.IsNull()) {
-// if (thetrace) {
-// themessenger << "Transfer has produced no Result" <<endl;
-// StartTrace (binder, start, thelevel-1,0); sout << flush;
-// }
- if (thelevel > 0) thelevel --;
- return binder;
- }
-// Gestion du niveau racine (.. a regarder de pres ..)
- if (therootl == 0 && binder->StatusExec() == Transfer_StatusDone)
- therootl = thelevel - 1;
-
- if (thelevel > 0) thelevel --;
- return binder;
-}
-
-
-//=======================================================================
-//function : Transfer
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::Transfer(const TheStart& start)
-{
- Handle(Transfer_Binder) binder = Transferring(start);
- return (!binder.IsNull());
-}
-
-
-// #########################################################################
-// .... Error Handling + Trace ....
-
-// trace : 1 pour Fail et Exception , 2 pour Root et Warning
-
-
-//=======================================================================
-//function : SetErrorHandle
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::SetErrorHandle(const Standard_Boolean err)
-{
- theerrh = err;
-} // traite par Transferring
-
-
-//=======================================================================
-//function : ErrorHandle
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::ErrorHandle() const
-{
- return theerrh;
-}
-
-//=======================================================================
-//function : StartTrace
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::StartTrace(const Handle(Transfer_Binder)& binder,
- const TheStart& start,
- const Standard_Integer level,
- const Standard_Integer mode) const
-{
- // ### Fail (Roots:50) -- Start start->DynamicType()
- // ### Fail (Roots:50) -- Start id:#label.. Type:start->DynamicType()
- if (thetrace > 3) { // Internal to be switch when searching bug (trace >= 4)
- if (mode == 1) themessenger << " ### Fail";
- if (mode == 2) themessenger << " ### Warning";
- if (mode == 3) themessenger << " ### New Root n0 " << theroots.Extent();
- if (mode == 4) themessenger << " ### Exception";
- if (mode == 5) themessenger << " ### Substitution";
- if (mode == 6) themessenger << " ### Information";
- if (level > 1)
- themessenger << " (nested)"; // " at nesting Level:"<<level;
- if (mode >= 0 && mode != 3)
- themessenger << " at " << theroots.Extent() << " Roots";
- }
- if (!start.IsNull()) PrintTrace (start,themessenger);
-//// sout << endl;
-
- if (!binder.IsNull()) { // old: if IsNull sout <<endl<< " --- Not Bound";
- Handle(Transfer_Binder) bnd = binder;
- Standard_Boolean hasres = Standard_False;
- while (!bnd.IsNull()) {
- if (bnd->Status() != Transfer_StatusVoid) {
-// --- Result Type: binder->ResultType() --- Binder : binder->DynamicType();
- if (!hasres)
- themessenger << "\n --- Result Type : ";
- else
- themessenger << " , ";
- themessenger << bnd->ResultTypeName();
-// CKY 9-JAN-1999: waiting for XSTEP Kernel message (not IGES_2075)
-/* Message_Msg Msg2075("IGES_2075");
- Msg2075.AddString(bnd->ResultTypeName());
- Msg2075.TraceEver(); */
- hasres = Standard_True;
- }
- bnd = bnd->NextResult();
- }
- if (!hasres && mode > 2) {
- themessenger << "\n --- No Result recorded";
-// CKY 9-JAN-1999 : waiting for XSTEP Kernel message
-// (not IGES_2075, no reference to specifically TopoDS_Shape)
-/* Message_Msg Msg2075("IGES_2075");
- Msg2075.AddString("No TopoDS_Shape");
- Msg2075.TraceEver(); */
- }
-//old if (isused) sout << " -- (Already Used in another Transfer)";
- }
- themessenger << endl;
-}
-
-
-//=======================================================================
-//function : PrintTrace
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::PrintTrace(const TheStart& start,
- const Handle(Message_Messenger)& S) const
-{
- if (!start.IsNull()) S <<" Type:" << start->DynamicType()->Name();
-}
-
-
-//=======================================================================
-//function : IsLooping
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::IsLooping
- (const Standard_Integer alevel) const
- { return alevel > NbMapped(); }
-
-
-
-// #########################################################################
-// .... RESULTATS ....
-
-
-// ## ## RootResult : Les Racines ## ##
-
-
-//=======================================================================
-//function : RootResult
-//purpose :
-//=======================================================================
-
-Transfer_Iterator Transfer_TransferProcess::RootResult(const Standard_Boolean withstart) const
-{
- Transfer_Iterator iter(withstart);
- Standard_Integer max = theroots.Extent();
- for (Standard_Integer j = 1; j <= max; j ++) {
- Standard_Integer i = theroots.FindKey(j);
- Handle(Transfer_Binder) binder = MapItem(i);
- if (binder.IsNull()) continue;
- if (withstart) iter.Add (binder,Mapped(i));
- else iter.Add (binder);
- }
- return iter;
-}
-
-
-// ## ## CompleteResult : Tous les Resultats ## ##
-
-//=======================================================================
-//function : CompleteResult
-//purpose :
-//=======================================================================
-
-Transfer_Iterator Transfer_TransferProcess::CompleteResult
- (const Standard_Boolean withstart) const
-{
- Transfer_Iterator iter(withstart);
- Standard_Integer max = NbMapped();
- for (Standard_Integer i = 1; i <= max; i ++) {
- Handle(Transfer_Binder) binder = MapItem(i);
- if (binder.IsNull()) continue;
- if (withstart) iter.Add (binder,Mapped(i));
- else iter.Add (binder);
- }
- return iter;
-}
-
-
-// ## ## AbnormalResult : Transferts a probleme ## ##
-//=======================================================================
-//function : AbnormalResult
-//purpose :
-//=======================================================================
-
-Transfer_Iterator Transfer_TransferProcess::AbnormalResult() const
-{
- Transfer_Iterator iter(Standard_True);
- Standard_Integer max = NbMapped();
- for (Standard_Integer i = 1; i <= max; i ++) {
- Handle(Transfer_Binder) binder = MapItem(i);
- if (binder.IsNull()) continue;
- Transfer_StatusExec statex = binder->StatusExec();
- if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone)
- iter.Add (binder,Mapped(i)); // on note les cas "pas normaux"
- }
- return iter;
-}
-
-
-// ## ## ## CheckList : les messages ## ## ##
-//=======================================================================
-//function : CheckList
-//purpose :
-//=======================================================================
-
-Interface_CheckIterator Transfer_TransferProcess::CheckList
- (const Standard_Boolean erronly) const
-{
- Interface_CheckIterator list;
- Standard_Integer num, max = NbMapped();
- for (Standard_Integer i = 1; i <= max; i ++) {
- Handle(Transfer_Binder) binder = MapItem(i);
- if (binder.IsNull()) continue;
- Transfer_StatusExec statex = binder->StatusExec();
- Handle(Interface_Check) check = binder->Check();
- if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone &&
- !check->HasFailed())
- check->AddFail("Transfer in Abnormal Status (!= Initial or Done)");
- if (!check->HasFailed() && (erronly || check->NbWarnings() == 0)) continue;
- const TheStart& ent = Mapped(i);
- num = CheckNum(ent);
- if (num == 0) num = i;
- check->SetEntity(ent);
- list.Add(check,num);
- }
- return list;
-}
-
-
-// #########################################################################
-// .... RESULTATS PAR ENTITE ....
-
-//=======================================================================
-//function : ResultOne
-//purpose :
-//=======================================================================
-
-Transfer_Iterator Transfer_TransferProcess::ResultOne(const TheStart& start,
- const Standard_Integer level,
- const Standard_Boolean withstart) const
-{
- Transfer_Iterator iter(withstart);
- Standard_Integer max = NbMapped();
- Standard_Integer ind = MapIndex (start);
- if (ind == 0) return iter;
- Standard_Integer i1 = (level == 0 ? ind : 1);
- Standard_Integer i2 = (level == 0 ? ind : max);
- Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
- //MarkScoped (ind,level,map);
-
- for (Standard_Integer i = i1; i <= i2; i ++) {
- ind = map->Value(i);
- if (ind == 0) continue;
- Handle(Transfer_Binder) binder = MapItem(i);
- if (binder.IsNull()) continue;
- if (withstart) iter.Add (binder,Mapped(ind));
- else iter.Add (binder);
- }
- return iter;
-}
-
-
-//=======================================================================
-//function : CheckListOne
-//purpose :
-//=======================================================================
-
-Interface_CheckIterator Transfer_TransferProcess::CheckListOne
- (const TheStart& start,const Standard_Integer level,
- const Standard_Boolean erronly) const
-{
- Interface_CheckIterator list;
- Standard_Integer max = NbMapped();
- Standard_Integer num, ind = MapIndex (start);
- if (ind == 0) return list;
- Standard_Integer i1 = (level == 0 ? ind : 1);
- Standard_Integer i2 = (level == 0 ? ind : max);
- Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
- //MarkScoped (ind,level,map);
-
- for (Standard_Integer i = i1; i <= i2; i ++) {
- ind = map->Value(i);
- if (ind == 0) continue;
- Handle(Transfer_Binder) binder = MapItem(ind);
- if (binder.IsNull()) continue;
- Transfer_StatusExec statex = binder->StatusExec();
- Handle(Interface_Check) check = binder->Check();
- if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone &&
- !check->HasFailed())
- check->AddFail("Transfer in Abnormal Status (!= Initial or Done)");
- if (!check->HasFailed() && (erronly || check->NbWarnings() == 0)) continue;
- const TheStart& ent = Mapped(ind);
- num = CheckNum(ent); if (num == 0) num = ind;
- check->SetEntity(ent);
- list.Add(check,num);
- }
- return list;
-}
-
-
-//=======================================================================
-//function : IsCheckListEmpty
-//purpose :
-//=======================================================================
-
-Standard_Boolean Transfer_TransferProcess::IsCheckListEmpty
- (const TheStart& start, const Standard_Integer level,
- const Standard_Boolean erronly) const
-{
- Standard_Integer max = NbMapped();
- Standard_Integer ind = MapIndex (start);
- if (ind == 0) return Standard_False;
- Standard_Integer i1 = (level == 0 ? ind : 1);
- Standard_Integer i2 = (level == 0 ? ind : max);
- Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
-// MarkScoped (ind,level,map);
-
- for (Standard_Integer i = i1; i <= i2; i ++) {
- ind = map->Value(i);
- if (ind == 0) continue;
- Handle(Transfer_Binder) binder = MapItem(ind);
- if (binder.IsNull()) continue;
-
- Transfer_StatusExec statex = binder->StatusExec();
- Handle(Interface_Check) check = binder->Check();
- if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone)
- return Standard_False;
- if (check->HasFailed() || (!erronly && check->NbWarnings() > 0)) return Standard_False;
- }
- return Standard_True;
-}
-
-
-//=======================================================================
-//function : RemoveResult
-//purpose :
-//=======================================================================
-
-void Transfer_TransferProcess::RemoveResult(const TheStart& start,
- const Standard_Integer level,
- const Standard_Boolean /*compute*/)
-{
- //if (compute) ComputeScopes();
- Standard_Integer max = NbMapped();
- Standard_Integer ind = MapIndex (start);
- if (ind == 0) return;
- Standard_Integer i1 = (level == 0 ? ind : 1);
- Standard_Integer i2 = (level == 0 ? ind : max);
- Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
-// MarkScoped (ind,level,map);
-
- Standard_Integer i; // svv Jan11 2000 : porting on DEC
- for (i = i1; i <= i2; i ++) {
- ind = map->Value(i);
- if (ind == 0) continue;
- Handle(Transfer_Binder) binder = MapItem(ind);
- if (binder.IsNull()) continue;
-// Standard_Boolean cayest = binder->SetNbUserScopes (-1);
-// if (cayest) themap(ind) = nulbinder; // RAZ !
- }
-
-//pdn commented for (i = NbRoots(); i > 0; i --)
-// if (theroots.Value(i) == ind) theroots.Remove(i);
-}
-
-
-Standard_Integer Transfer_TransferProcess::CheckNum(const TheStart& ) const
-{
- return 0;
-}
-
-
-//=======================================================================
-//function : SetProgress
-//purpose : Sets Progress indicator
-//=======================================================================
-
-void Transfer_TransferProcess::SetProgress(const Handle(Message_ProgressIndicator)& theProgress)
-{
- myProgress = theProgress;
-}
-
-//=======================================================================
-//function : GetProgress
-//purpose : Returns Progress indicator
-//=======================================================================
-
-Handle(Message_ProgressIndicator) Transfer_TransferProcess::GetProgress() const
-{
- return myProgress;
-}
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_TransferProcess_HeaderFile
+#define _Transfer_TransferProcess_HeaderFile
+
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+#include <Interface_Check.hxx>
+#include <Interface_CheckIterator.hxx>
+
+#include <Message.hxx>
+#include <Message_Messenger.hxx>
+#include <Message_Msg.hxx>
+#include <Message_ProgressIndicator.hxx>
+#include <Transfer_VoidBinder.hxx>
+#include <Transfer_SimpleBinderOfTransient.hxx>
+#include <Transfer_MultipleBinder.hxx>
+#include <Transfer_StatusResult.hxx>
+#include <Transfer_TransferFailure.hxx>
+#include <Transfer_TransferDeadLoop.hxx>
+#include <Transfer_Binder.hxx>
+
+#include <TCollection_HAsciiString.hxx>
+#include <Dico_DictionaryOfTransient.hxx>
+#include <Dico_IteratorOfDictionaryOfTransient.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+
+ //! This class gives the frame for doing a direct transfer : it
+ //! provides required basic tools, such as a Map, and automatisms
+ //! which simplify work, while their use is not mandatory.
+ //!
+ //! Starting Objects managed by Mapping can be Transient or any
+ //! (by two instantiations provided by the package,
+ //! TransientProcess and FinderProcess, see class Finder).
+ //!
+ //! A direct Transfer must maintain data sharing whenever possible
+ //! (that is, when described by both sides) : this is managed by a
+ //! Map. It works with intermediate Objects, the Binders. Hence it
+ //! allows a binding, one/several-one/several, and it controls
+ //! that a Resulting Data can be used by another one only
+ //! if its creation has been ended. Also it keeps error status.
+ //!
+ //! Several results can be bound to a starting object, identified
+ //! by a category number. The default one (the only one considered
+ //! for final analysis) is zero. But mapping accesses allow to
+ //! precise a category number different from zero
+ //!
+ //! In order to work more easily in most cases, automatisms are
+ //! offered. Classically, to transfer an object, its result is
+ //! computed then bound. This applies recursively for referenced
+ //! objects. Each Transfer of a kind of object can be performed
+ //! by a specific Tool, which can use TransferProcess to work.
+ //!
+ //!
+ //! Many often, a specific Transfer can work as : "Search the good
+ //! Tool to Perform the Transfer (if not provided), run the Tool,
+ //! then Bind the Result", where "Perform" is seen as a black box.
+ //!
+ //! This way of working is assumed through automatisms which use
+ //! two types of auxiliary objects :
+ //! - An Actor acts as a Library of Transfer Actions :
+ //! it recognizes the operation to perform on a starting object,
+ //! then runs it (see class Actor)
+ //! - it produces a Binder, which is then recorded in the Map
+ //! - of course, if the Transfer has been already done, it is not
+ //! run once more : the first Result is available
+ //! - it is possible to re-evaluate the Result if required (anI.e.
+ //! if the definitive Result is known only once other Transfers
+ //! have been engaged)
+ //! - in the case of a second (or more) ask for Transfer, the
+ //! Result is considered as "AlreadyUsed", hence it may not be
+ //! changed (in the Binder itself or by Rebinding another one)
+ //!
+ //! This gives a top-down process, in which first object to be
+ //! transferred asks for another one it references to be, etc...
+ //! This allows automatic management of Roots : only first
+ //! transfers (asked by the user) can be Root Transfers.
+ //!
+ //!
+ //! Other features are : Management of Root Entities (the Entities
+ //! by which the Transfer has started, and their Results, can be
+ //! identified as Roots, by the user or by automatisms); Error
+ //! Handling (if automatisms are used);
+ //! Returning Results, which can be specialized for
+ //! Roots, or Erroneous Data, or complete/partial (for one entity)
+ //!
+ //! Finally, TransferProcess inherits TShared : this allows to
+ //! run successive steps on the same set of data attached to a
+ //! given Transfer, by easily transmitting this set.
+
+template <class ActorHandle,
+ class TransferMap,
+ class StartObject,
+ class MapHasher,
+ class ListHandle,
+ class Iterator>
+class Transfer_TransferProcess : public MMgt_TShared
+{
+private:
+ Handle(Standard_Transient) myNullTrans;
+protected:
+ //! To handle or not exception raisings
+ Standard_Boolean myToHandleErr;
+ //! Trace theLevel (exceptions,errors, etc...)
+ Standard_Integer myTrace;
+ //! Messenger for sending messages
+ Handle(Message_Messenger) myMessenger;
+
+ Standard_Integer myLevel;
+ //! Level of root at each time (not allways 1)
+ Standard_Integer myRootLevel;
+ //! Flag for Root Management set or not
+ Standard_Boolean myToManageRoot;
+ //! Indices of roots in the map
+ TColStd_IndexedMapOfInteger myRoots;
+
+ //! Last Starting Object Bound
+ StartObject myLastObj;
+ //! Its attached Binder (noted to optimize)
+ Handle(Transfer_Binder) myLastBinder;
+ Standard_Integer myIndex;
+ ActorHandle myActor;
+ TransferMap myMap;
+ //! Progress indicator
+ Handle(Message_ProgressIndicator) myProgress;
+
+private:
+
+
+ Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const StartObject& start) ;
+public:
+ //! Sets TransferProcess at initial state. Gives an Initial size
+ //! (indicative) for the Map when known (default is 10000).
+ //! Sets default trace file as a printer and default trace level
+ //! (see Message_TraceFile).
+ Standard_EXPORT Transfer_TransferProcess (const Standard_Integer theNb = 10000);
+
+ //! Sets TransferProcess at initial state. Gives an Initial size
+ //! (indicative) for the Map when known (default is 10000).
+ //! Sets a specified printer.
+ Standard_EXPORT Transfer_TransferProcess (const Handle(Message_Messenger)& myMessenger,
+ const Standard_Integer theNb = 10000);
+
+ //! Same as Find but stores the last access to the map, for a
+ //! faster access on next calls (as Bind does too).
+ //! Considers a category number, by default 0.
+ Standard_EXPORT Handle(Transfer_Binder) FindAndMask (const StartObject& theStart);
+
+ //! Resets a TransferProcess as ready for a completely new work.
+ //! Clears general data (roots) and the Map.
+ Standard_EXPORT void Clear ();
+
+ //! Rebuilds the Map and the roots to really remove Unbound items
+ //! Because Unbind keeps the entity in place, even if not bound
+ //! Hence, working by checking new items is meaningless if a
+ //! formerly unbound item is rebound.
+ Standard_EXPORT void Clean ();
+
+ //! Resizes the Map as required (if a new reliable value has been
+ //! determined). Acts only if <nb> is greater than actual NbMapped.
+ Standard_EXPORT void Resize (const Standard_Integer theNb);
+
+ //! Defines an Actor, which is used for automatic Transfer
+ //! If already defined, the new Actor is cumulated
+ //! (see SetNext from Actor).
+ Standard_EXPORT void SetActor(const ActorHandle& theActor);
+
+ //! Returns the defined Actor. Returns a Null Handle if not set.
+ Standard_EXPORT ActorHandle Actor () const;
+
+ //! Fine Access to Map
+ //! This access works on : Binder (default), or Handle Result
+ //! (Transient,Finder) as privileged kinds of Result
+
+ //! Returns the Binder which is linked with a starting Object
+ //! It can either bring a Result (Transfer done) or none (for a
+ //! pre-binding).
+ //! If no Binder is linked with <start>, returns a Null Handle
+ //! Considers a category number, by default 0.
+ //! Warning : it is not equivalent to IsBound, which demands a Result
+ Standard_EXPORT Handle(Transfer_Binder) Find (const StartObject& theStart) const;
+
+ //! Returns True if a Result (whatever its form) is Bound with
+ //! a starting Object. I.e., if a Binder with a Result set, is linked with it.
+ //! Considers a category number, by default 0.
+ Standard_EXPORT Standard_Boolean IsBound (const StartObject& theStart) const;
+
+ //! Returns True if the result of the transfer of an object is
+ //! already used in other ones. If it is, Rebind cannot change it.
+ //! Considers a category number, by default 0.
+ Standard_EXPORT Standard_Boolean IsAlreadyUsed (const StartObject& theStart) const;
+
+ //! Creates a Link a starting Object with a Binder. This Binder
+ //! can either bring a Result (effective Binding) or none (it can
+ //! be set later : pre-binding).
+ //! Considers a category number, by default 0.
+ //! Error if a Binder with a Result set is already linked with
+ //! this Object (Binder with StatusResult not Initial).
+ Standard_EXPORT void Bind (const StartObject& theStart,
+ const Handle(Transfer_Binder)& theBinder);
+
+ //! Changes the Binder linked with a starting Object for its
+ //! unitary transfer. This it can be useful when the exact form
+ //! of the result is known once the transfer is widely engaged.
+ //! This can be done only on first transfer.
+ //! Considers a category number, by default 0.
+ //! Error if : - the Result is known as Already Used
+ //! or if - No Result is bound to <start>
+ //! or if - <binder> brings No result.
+ Standard_EXPORT void Rebind (const StartObject& theStart,
+ const Handle(Transfer_Binder)& theBinder);
+
+ //! Removes the Binder linked with a starting object
+ //! If this Binder brings a non-empty Check, it is replaced by
+ //! a VoidBinder. Also removes from the list of Roots as required.
+ //! Returns True if done, False if <start> was not bound.
+ //! Considers a category number, by default 0.
+ //! Error if : - the Result is known as Already Used.
+ Standard_EXPORT Standard_Boolean Unbind (const StartObject& theStart);
+
+ //! Returns a Binder for a starting entity, as follows:
+ //! Tries to Find the already bound one.
+ //! If none found, creates a VoidBinder and Binds it.
+ Standard_EXPORT Handle(Transfer_Binder) FindElseBind (const StartObject& theStart);
+
+ //! Sets Messenger used for outputting messages.
+ Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& myMessenger);
+
+ //! 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;
+
+ //! Sets trace level used for outputting messages:
+ //! <trace> = 0 : no trace at all
+ //! <trace> = 1 : handled exceptions and calls to AddError
+ //! <trace> = 2 : also calls to AddWarning
+ //! <trace> = 3 : also traces new Roots
+ //! (uses method ErrorTrace).
+ //! Default is 1 : Errors traced.
+ Standard_EXPORT void SetTraceLevel (const Standard_Integer myTraceLevel);
+
+ //! Returns trace level used for outputting messages.
+ Standard_EXPORT Standard_Integer TraceLevel () const;
+
+ //! New name for AddFail(theMsg).
+ Standard_EXPORT void SendFail (const StartObject& theStart,
+ const Message_Msg& theMsg);
+
+ //! New name for AddWarning (Msg).
+ Standard_EXPORT void SendWarning (const StartObject& theStart,
+ const Message_Msg& theMsg);
+ //! Adds an information message.
+ //! Trace is filled if trace level is at least 3.
+ Standard_EXPORT void SendMsg (const StartObject& theStart,
+ const Message_Msg& theMsg);
+
+ //! Adds an Error message to a starting entity (to the check of
+ //! its Binder of category 0, as a Fail).
+ Standard_EXPORT void AddFail (const StartObject& theStart,
+ const Standard_CString theMessage,
+ const Standard_CString theOrig = "");
+
+ //! The other name of AddFail, maintained for compatibility.
+ Standard_EXPORT void AddError (const StartObject& theStart,
+ const Standard_CString theMessage,
+ const Standard_CString theOrig = "");
+
+ //! Adds an Error Message to a starting entity from the definition
+ //! of a Msg (Original+Value).
+ Standard_EXPORT void AddFail (const StartObject& theStart,
+ const Message_Msg& theMsg);
+
+ //! Adds a Warning message to a starting entity (to the check of
+ //! its Binder of category 0).
+ Standard_EXPORT void AddWarning (const StartObject& theStart,
+ const Standard_CString theMessage,
+ const Standard_CString theOrig = "");
+
+ //! Adds a Warning Message to a starting entity from the definition
+ //! of a Msg (Original+Value).
+ Standard_EXPORT void AddWarning (const StartObject& theStart,
+ const Message_Msg& theMsg);
+
+ //! Mends messages bound to a starting entity, if there are some
+ //! <thePref> as for Check from Interface :
+ //! Default converts all fails to warnings and that's all.
+ Standard_EXPORT void Mend (const StartObject& theStart,
+ const Standard_CString thePref = "");
+
+ //! Returns the Check attached to a starting entity.
+ //! If <start> is unknown, returns an empty Check.
+ Standard_EXPORT Handle(Interface_Check) Check (const StartObject& theStart) const;
+
+ //! Binds a starting object with a Transient Result.
+ //! Uses a SimpleBinderOfTransient to work. If there is already
+ //! one but with no Result set, sets its Result.
+ //! Considers a category number, by default 0.
+ //! Error if a result is already bound (Binder not Initial).
+ Standard_EXPORT void BindTransient (const StartObject& theStart,
+ const Handle(Standard_Transient)& theResult);
+
+ //! Returns the Result of the Transfer of an object <start> as a
+ //! Transient Result.
+ //! Returns a Null Handle if there is no Transient Result
+ //! Considers a category number, by default 0.
+ //! Warning : Supposes that Binding is done with a SimpleBinderOfTransient.
+ Standard_EXPORT const Handle(Standard_Transient)& FindTransient
+ (const StartObject& theStart) const;
+
+ //! Prepares an object <start> to be bound with several results.
+ //! If no Binder is yet attached to <obj>, a MultipleBinder
+ //! is created, empty. If a Binder is already set, it must
+ //! accept Multiple Binding.
+ //! Considers a category number, by default 0.
+ //! Error if a UNIQUE result is already bound (if a Multiple
+ //! Result is, nothing is done).
+ Standard_EXPORT void BindMultiple (const StartObject& theStart);
+
+ //! Searches for a transient result attached to a starting object,
+ //! according to its type, by criterium IsKind(theType)
+ //! In case of multiple result, explores the list and gives in
+ //! <theVal> the first transient result IsKind(atype)
+ //! Returns True and fills <theVal> if found
+ //! Else, returns False (<theVal> is not touched, not even nullified)
+ //! This syntactic form avoids to do DownCast : if a result is
+ //! found with the good type, it is loaded in <theVal> and can be
+ //! immediately used, well initialised.
+ Standard_EXPORT Standard_Boolean
+ FindTypedTransient (const StartObject& theStart,
+ const Handle(Standard_Type)& theType,
+ Handle(Standard_Transient)& theVal) const;
+
+ //! Searches for a transient result recorded in a Binder, whatever
+ //! this Binder is recorded or not in <me>.
+ //! This is strictly equivalent to the class method GetTypedResult
+ //! from class SimpleBinderOfTransient, but is just lighter to call
+ //! Apart from this, works as FindTypedTransient.
+ Standard_EXPORT Standard_Boolean
+ GetTypedTransient (const Handle(Transfer_Binder)& theBinder,
+ const Handle(Standard_Type)& theType,
+ Handle(Standard_Transient)& theVal) const;
+
+ //! Returns the maximum possible value for Map Index
+ //! (no result can be bound with a value greater than it).
+ Standard_EXPORT Standard_Integer NbMapped () const;
+
+ //! Returns the Starting Object bound to an Index.
+ Standard_EXPORT const StartObject& Mapped (const Standard_Integer theNum) const;
+
+ //! Returns the Index value bound to a Starting Object, 0 if none.
+ Standard_EXPORT Standard_Integer MapIndex (const StartObject& theStart) const;
+
+ //! Returns the Binder bound to an Index
+ //! Considers a category number, by default 0.
+ Standard_EXPORT Handle(Transfer_Binder) MapItem(const Standard_Integer theNum) const;
+
+ //! Declares <obj> (and its Result) as Root. This status will be
+ //! later exploited by RootResult, see below (Result can be
+ //! produced at any time).
+ //! Error if <obj> is not bound before calling to SetRoot.
+ Standard_EXPORT void SetRoot (const StartObject& theStart);
+
+ //! Enable (if <stat> True) or Disables (if <stat> False) Root
+ //! Management. If it is set, Transfers are considered as stacked
+ //! (a first Transfer commands other Transfers, and so on) and
+ //! the Transfers commanded by an external caller are "Root".
+ //! Remark : SetRoot can be called whatever this status, on every
+ //! object.
+ //! Default is set to True.
+ Standard_EXPORT void SetRootManagement (const Standard_Boolean theStatus);
+
+ //! Returns the count of recorded roots.
+ Standard_EXPORT Standard_Integer NbRoots () const;
+
+ //! Returns a Root Entity given its number in the list (1-NbRoots).
+ Standard_EXPORT const StartObject& Root (const Standard_Integer theNum) const;
+
+ //! Returns the Binder bound with a Root Entity given its number.
+ //! Considers a category number, by default 0.
+ Standard_EXPORT Handle(Transfer_Binder) RootItem (const Standard_Integer theNum) const;
+
+ //! Returns the index in the list of roots for a starting item,
+ //! or 0 if it is not recorded as a root.
+ Standard_EXPORT Standard_Integer RootIndex (const StartObject& theStart) const;
+
+ //! Returns Nesting Level of Transfers (managed by methods
+ //! TranscriptWith & Co). Starts to zero. If no automatic Transfer
+ //! is used, it remains to zero. Zero means Root Level.
+ Standard_EXPORT Standard_Integer NestingLevel () const;
+
+ //! Resets Nesting Level of Transfers to Zero (Root Level),
+ //! whatever its current value.
+ Standard_EXPORT void ResetNestingLevel ();
+
+ //! Tells if <start> has been recognized as good candidate for
+ //! Transfer. i.e. queries the Actor and its Nexts.
+ Standard_EXPORT Standard_Boolean Recognize (const StartObject& theStart) const;
+
+ //! Performs the Transfer of a Starting Object, by calling
+ //! the method TransferProduct (see below).
+ //! Mapping and Roots are managed : nothing is done if a Result is
+ //! already Bound, an exception is raised in case of error.
+ //! Error : if the Transfer falls in a loop, or asks to Rebind an
+ //! Object already Bound AND Used or reads a non computed Result
+ //!
+ //! Remark : if ErrorHandle is set, no exception is raised : see
+ //! the method SetErrorHandle for more details
+ Standard_EXPORT Handle(Transfer_Binder) Transferring (const StartObject& theStart);
+
+ //! Same as Transferring but does not return the Binder.
+ //! Simply returns True in case of success (for user call).
+ Standard_EXPORT Standard_Boolean Transfer (const StartObject& theStart) ;
+
+ //! Allows controls if exceptions will be handled
+ //! Transfer Operations
+ //! <err> False : they are not handled with try {} catch {}
+ //! <err> True : they are
+ //! Default is False: no handling performed.
+ Standard_EXPORT void SetErrorHandle (const Standard_Boolean isError);
+
+ //! Returns error handling flag.
+ Standard_EXPORT Standard_Boolean ErrorHandle() const;
+
+ //! Method called when trace is asked
+ //! Calls PrintTrace to display information relevant for starting
+ //! objects (which can be redefined)
+ //! <level> is Nesting Level of Transfer (0 = root)
+ //! <mode> controls the way the trace is done :
+ //! 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root.
+ Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& theBinder,
+ const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Integer theMode) const;
+
+ //! Prints a short information on a starting object.
+ //! By default prints its Dynamic Type. Can be redefined.
+ Standard_EXPORT void PrintTrace (const StartObject& theStart,
+ const Handle(Message_Messenger)& myMessenger) const;
+
+ //! Returns True if we are surely in a DeadLoop. Evaluation is not
+ //! exact, it is a "majorant" which must be computed fast.
+ //! This "majorant" is : <theLevel> greater than NbMapped.
+ Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer theLevel) const;
+
+ //! Returns, as an iterator, the log of root transfer, i.e. the
+ //! created objects and Binders bound to starting roots.
+ //! If withstart is given True, Starting Objets are also returned.
+ Standard_EXPORT Iterator RootResult (const Standard_Boolean isWithStart = Standard_False) const;
+
+ //! Returns, as an Iterator, the entire log of transfer (list of
+ //! created objects and Binders which can bring errors).
+ //! If withstart is given True, Starting Objets are also returned.
+ Standard_EXPORT Iterator CompleteResult (const Standard_Boolean isWithStart = Standard_False) const;
+
+ //! Returns Binders which are neither "Done" nor "Initial",
+ //! that is Error,Loop or Run (abnormal states at end of Transfer)
+ //! Starting Objects are given in correspondance in the iterator.
+ Standard_EXPORT Iterator AbnormalResult() const;
+
+ //! Returns a CheckList as a list of Check : each one is for a
+ //! starting entity which have either check (warning or fail)
+ //! messages are attached, or are in abnormal state : that case
+ //! gives a specific message.
+ //! If <erronly> is True, checks with Warnings only are ignored
+ Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean isErrOnly) const;
+
+ //! Returns, as an Iterator, the log of transfer for one object
+ //! <theLevel> = 0 : this object only
+ //! and if <start> is a scope owner (else, <theLevel> is ignored) :
+ //! <theLevel> = 1 : object plus its immediate scoped ones
+ //! <theLevel> = 2 : object plus all its scoped ones.
+ Standard_EXPORT Iterator ResultOne (const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Boolean isWithStart = Standard_False) const;
+
+ //! Returns a CheckList for one starting object
+ //! <theLevel> interpreted as by ResultOne
+ //! If <isErrOnly> is True, checks with Warnings only are ignored
+ Standard_EXPORT Interface_CheckIterator
+ CheckListOne (const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Boolean isErrOnly) const;
+
+ //! Returns True if no check message is attached to a starting
+ //! object. <level> interpreted as by ResultOne
+ //! If <erronly> is True, checks with Warnings only are ignored .
+ Standard_EXPORT Standard_Boolean
+ IsCheckListEmpty (const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Boolean isErrOnly) const;
+
+ //! Removes Results attached to (== Unbinds) a given object and,
+ //! according <level> :
+ //! <level> = 0 : only it
+ //! <level> = 1 : it plus its immediately owned sub-results(scope)
+ //! <level> = 2 : it plus all its owned sub-results(scope).
+ Standard_EXPORT void RemoveResult (const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Boolean toCompute = Standard_True);
+
+ //! Computes a number to be associated to a starting object in
+ //! a check or a check-list.
+ //! By default, returns 0; can be redefined.
+ Standard_EXPORT virtual Standard_Integer CheckNum(const StartObject& ) const;
+
+ //! Sets Progress indicator.
+ Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& theProgress);
+
+ //! Gets Progress indicator.
+ Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress () const;
+
+ //! Adds an item to a list of results bound to a starting object.
+ //! Considers a category number, by default 0, for all results
+ //! Error if no Binder accepting Multiple Binding is attached
+ //! to <start> (none at all, or for a unique result)
+ Standard_EXPORT void AddMultiple (const StartObject& theStart,
+ const Handle(Standard_Transient)& theResult);
+
+};
+
+ //=======================================================================
+ //function : Transfer_TransferProcess
+ //purpose :
+ //=======================================================================
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Transfer_TransferProcess (const Standard_Integer theNb)
+ : myMap (theNb)
+ {
+ myToHandleErr = Standard_True;
+ myToManageRoot = Standard_False;
+ myLevel = 0; myRootLevel = 0;
+ myMessenger = Message::DefaultMessenger();
+ myTrace = 0;
+ // myRoots = new TColStd_HSequenceOfInteger ();
+ myIndex = 0;
+ }
+
+
+ //=======================================================================
+ //function : Transfer_TransferProcess
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Transfer_TransferProcess (const Handle(Message_Messenger)& myMessenger,
+ const Standard_Integer theNb)
+ : myMap (theNb)
+ {
+ myToHandleErr = Standard_True;
+ myToManageRoot = Standard_False;
+ myLevel = 0; myRootLevel = 0;
+ SetMessenger (myMessenger);
+ myTrace = 1;
+ myIndex = 0;
+ }
+
+ //=======================================================================
+ //function : Clear
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Clear ()
+ {
+ myLevel = 0; myRootLevel = 0;
+ myRoots.Clear();
+ myMap.Clear();
+ myIndex = 0; myLastObj.Nullify(); myLastBinder.Nullify();
+ }
+
+ //=======================================================================
+ //function : Clean
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Clean ()
+ {
+ Standard_Integer anI, aNb = NbMapped();
+ Standard_Integer aJ,unb = 0;
+ for (anI = 1; anI <= aNb; anI ++)
+ {
+ if (myMap(anI).IsNull()) unb ++;
+ }
+ if (unb == 0) return;
+
+ TColStd_Array1OfInteger unbs (1,aNb); unbs.Init(0);
+ TransferMap newmap (aNb*2);
+ for (anI = 1; anI <= aNb; anI ++)
+ {
+ StartObject ent = Mapped(anI);
+ Handle(Transfer_Binder) bnd = MapItem(anI);
+ if (bnd.IsNull()) continue;
+ aJ = newmap.Add (ent,bnd);
+ unbs.SetValue (anI,aJ);
+ }
+ myMap.Assign (newmap);
+
+ // Update the list of root
+ TColStd_IndexedMapOfInteger aNewRoots;
+ for (anI=1; anI<= myRoots.Extent(); anI++)
+ {
+ aJ = myRoots.FindKey(anI);
+ Standard_Integer k = unbs.Value(aJ);
+ if (k) aNewRoots.Add (k);
+ }
+ myRoots.Clear();
+ myRoots = aNewRoots;
+
+ myLastObj.Nullify();
+ myLastBinder.Nullify();
+ myIndex = 0;
+ }
+
+ //=======================================================================
+ //function : Resize
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Resize (const Standard_Integer theNb)
+ {
+ if (theNb > myMap.NbBuckets())
+ myMap.ReSize(theNb);
+ }
+
+ //=======================================================================
+ //function : SetActor
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SetActor(const ActorHandle& theActor)
+ {
+ if (myActor == theActor) return;
+ if (myActor.IsNull()) myActor = theActor;
+ else if (theActor.IsNull()) myActor = theActor; // declenche RAZ
+ else if (myActor->IsLast()) { theActor->SetNext(myActor); myActor = theActor; }
+ else myActor->SetNext(theActor);
+ }
+
+
+ //=======================================================================
+ //function : Actor
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ ActorHandle
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Actor () const
+ {
+ return myActor;
+ }
+
+
+ // ########################################################################
+ // .... MAPPING ....
+
+ // ## ## ## Actions Generales sur Binders ## ## ##
+ // ## ## ## Consultations ## ## ##
+
+ //=======================================================================
+ //function : Find
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Transfer_Binder)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Find (const StartObject& theStart) const
+ {
+ if (myLastObj == theStart)
+ {
+ //if (myIndex > 0) return myLastBinder->Search(categ); //skl
+ if (myIndex > 0) return myLastBinder; //skl
+ }
+ Standard_Integer index = myMap.FindIndex (theStart);
+ if (index > 0)
+ {
+ const Handle(Transfer_Binder)& theBinder = myMap.FindFromIndex(index);
+ //if (theBinder.IsNull()) //skl
+ return theBinder;
+ //return theBinder->Search(categ); //skl
+ }
+ Handle(Transfer_Binder) aNullBinder;
+ return aNullBinder;
+ }
+
+ //=======================================================================
+ //function : IsBound
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::IsBound (const StartObject& theStart) const
+ {
+ Handle(Transfer_Binder) theBinder = Find(theStart); //,categ); skl
+ if (theBinder.IsNull()) return Standard_False;
+ return theBinder->HasResult();
+ }
+
+ //=======================================================================
+ //function : IsAlreadyUsed
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::IsAlreadyUsed (const StartObject& theStart) const
+ {
+ Handle(Transfer_Binder) theBinder = Find(theStart);
+ if (theBinder.IsNull()) {
+ StartTrace (theBinder,theStart,myLevel,4);
+ Transfer_TransferFailure::Raise
+ ("TransferProcess : IsAlreadyUsed, transfer not done cannot be used...");
+ }
+ return (theBinder->Status() == Transfer_StatusUsed);
+ }
+
+ //=======================================================================
+ //function : FindAndMask
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Transfer_Binder)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::FindAndMask (const StartObject& theStart)
+ {
+ if (myLastObj == theStart)
+ {
+ if (myIndex > 0) return myLastBinder;
+ }
+ myLastObj = theStart;
+ myIndex = myMap.FindIndex (theStart);
+ if (myIndex > 0) myLastBinder = myMap.FindFromIndex(myIndex);
+ else myLastBinder.Nullify();
+ return myLastBinder;
+ }
+
+ //=======================================================================
+ //function : Bind
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Bind (const StartObject& theStart,
+ const Handle(Transfer_Binder)& theBinder)
+ {
+ if (theBinder.IsNull()) return;
+ Handle(Transfer_Binder) aFormer = FindAndMask(theStart);
+ if (!aFormer.IsNull())
+ {
+ if (aFormer->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder))
+ {
+ theBinder->Merge(aFormer);
+ myMap(myIndex) = theBinder; // Substitution
+ }
+ else if (aFormer->Status() == Transfer_StatusUsed)
+ {
+ StartTrace (aFormer,theStart,myLevel,4);
+ Transfer_TransferFailure::Raise
+ ("TransferProcess : Bind, already Bound");
+ }
+ else
+ {
+ if (myTrace > 2) StartTrace (aFormer,theStart,myLevel,5);
+ theBinder->CCheck()->GetMessages (aFormer->Check());
+ }
+ }
+ if (myIndex == 0 || myLastBinder.IsNull())
+ {
+ if (myIndex == 0) myIndex = myMap.Add(theStart,theBinder);
+ else myMap(myIndex) = theBinder;
+ myLastBinder = theBinder;
+ }
+ else
+ {
+ myLastBinder = theBinder;
+ myMap(myIndex) = theBinder;
+ }
+ }
+
+ //=======================================================================
+ //function : Rebind
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Rebind (const StartObject& theStart,
+ const Handle(Transfer_Binder)& theBinder)
+ {
+ Bind(theStart,theBinder);
+ }
+
+ //=======================================================================
+ //function : Unbind
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Unbind (const StartObject& theStart)
+ {
+ Handle(Transfer_Binder) aFormer = FindAndMask(theStart);
+ if (myIndex == 0) return Standard_False;
+ if (aFormer.IsNull()) return Standard_False;
+ if (aFormer->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder))
+ return Standard_True;
+ myMap(myIndex) = myLastBinder;
+ if (myRoots.Contains(myIndex))
+ {
+ TColStd_IndexedMapOfInteger aNewRoots;
+ for (Standard_Integer anI = 1; anI <= myRoots.Extent(); anI++)
+ if (myIndex!= myRoots.FindKey(anI))
+ aNewRoots.Add(myRoots.FindKey(anI));
+
+ myRoots.Clear();
+ myRoots = aNewRoots;
+ }
+
+ myLastObj.Nullify();
+ myLastBinder.Nullify();
+ myIndex = 0;
+ return Standard_True;
+ }
+
+ //=======================================================================
+ //function : FindElseBind
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Transfer_Binder)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::FindElseBind (const StartObject& theStart)
+ {
+ Handle(Transfer_Binder) aBinder = FindAndMask (theStart);
+ if (!aBinder.IsNull()) return aBinder;
+ aBinder = new Transfer_VoidBinder;
+ Bind(theStart,aBinder);
+ return aBinder;
+ }
+
+ //=======================================================================
+ //function : SetMessenger
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SetMessenger (const Handle(Message_Messenger)& myMessenger)
+ {
+ if ( myMessenger.IsNull() )
+ myMessenger = Message::DefaultMessenger();
+ else
+ myMessenger = myMessenger;
+ }
+
+ //=======================================================================
+ //function : Messenger
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Message_Messenger)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Messenger () const
+ {
+ return myMessenger;
+ }
+
+ //=======================================================================
+ //function : SetTraceLevel
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SetTraceLevel (const Standard_Integer myTraceLevel)
+ {
+ myTrace = myTraceLevel;
+ }
+
+ //=======================================================================
+ //function : TraceLevel
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Integer
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::TraceLevel () const
+ {
+ return myTrace;
+ }
+
+ //=======================================================================
+ //function : SendFail
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SendFail (const StartObject& theStart,
+ const Message_Msg& theMsg)
+ {
+ AddFail(theStart,theMsg);
+ }
+
+ //=======================================================================
+ //function : SendWarning
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SendWarning (const StartObject& theStart,
+ const Message_Msg& theMsg)
+ {
+ AddWarning(theStart,theMsg);
+ }
+
+ //=======================================================================
+ //function : SendMsg
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SendMsg (const StartObject& theStart,
+ const Message_Msg& theMsg)
+ {
+ Handle(Transfer_Binder) theBinder = FindAndMask(theStart);
+ if (theBinder.IsNull()) {
+ theBinder = new Transfer_VoidBinder;
+ Bind (theStart,theBinder);
+ }
+ // Feeds the trace: Rule causing (user messages)
+ if (myTrace > 0) {
+ StartTrace (theBinder,theStart,myLevel,6);
+ myMessenger << theMsg.Value();
+ if (theMsg.IsEdited()&&myTrace>2)
+ myMessenger << " [from: " << theMsg.Original() << "]";
+ myMessenger << endl;
+ }
+ }
+
+ //=======================================================================
+ //function : AddFail
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::AddFail (const StartObject& theStart,
+ const Standard_CString theMessage,
+ const Standard_CString theOrig)
+ {
+ Handle(Transfer_Binder) theBinder = FindAndMask (theStart);
+ if (theBinder.IsNull())
+ {
+ theBinder = new Transfer_VoidBinder;
+ Bind (theStart,theBinder);
+ }
+ theBinder->AddFail (theMessage,theOrig);
+ if (myTrace > 0)
+ {
+ StartTrace (theBinder,theStart,myLevel,1);
+ myMessenger << " --> Fail : " << theMessage;
+ if (theOrig[0] != '\0'&&myTrace>2) myMessenger << " [from: " << theOrig << "]";
+ myMessenger << endl;
+ }
+ }
+
+
+ //=======================================================================
+ //function : AddError
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::AddError(const StartObject& theStart,
+ const Standard_CString theMessage,
+ const Standard_CString theOrig)
+ {
+ AddFail (theStart,theMessage,theOrig);
+ }
+
+ //=======================================================================
+ //function : AddFail
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::AddFail (const StartObject& theStart,
+ const Message_Msg& theMsg)
+ {
+ if (theMsg.IsEdited()) AddFail (theStart,TCollection_AsciiString(theMsg.Value()).ToCString(),
+ TCollection_AsciiString(theMsg.Original()).ToCString());
+ else AddFail (theStart,TCollection_AsciiString(theMsg.Value()).ToCString());
+ }
+
+ //=======================================================================
+ //function : AddWarning
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::AddWarning (const StartObject& theStart,
+ const Standard_CString theMessage,
+ const Standard_CString theOrig)
+ {
+ Handle(Transfer_Binder) aBinder = FindAndMask(theStart);
+ if (aBinder.IsNull()) {
+ aBinder = new Transfer_VoidBinder;
+ Bind (theStart,aBinder);
+ }
+ aBinder->AddWarning(theMessage,theOrig);
+ if (myTrace > 1) {
+ StartTrace (aBinder,theStart,myLevel,2);
+ myMessenger << " --> Warning : " << theMessage;
+ if (theOrig[0] != '\0'&&myTrace>2) myMessenger << " [from: " << theOrig << "]";
+ myMessenger << endl;
+ }
+ }
+
+ //=======================================================================
+ //function : AddWarning
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::AddWarning (const StartObject& theStart,
+ const Message_Msg& theMsg)
+ {
+ if (theMsg.IsEdited())
+ AddWarning (theStart,TCollection_AsciiString(theMsg.Value()).ToCString(),
+ TCollection_AsciiString(theMsg.Original()).ToCString());
+ else
+ AddWarning (theStart,TCollection_AsciiString(theMsg.Value()).ToCString());
+ }
+
+ //=======================================================================
+ //function : Mend
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Mend (const StartObject& theStart,
+ const Standard_CString thePref)
+ {
+ Handle(Transfer_Binder) aBinder = FindAndMask (theStart);
+ if (aBinder.IsNull())
+ return;
+ Handle(Interface_Check) ach = aBinder->CCheck();
+ ach->Mend (thePref);
+ }
+
+ //=======================================================================
+ //function : Check
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Interface_Check)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Check(const StartObject& theStart) const
+ {
+ const Handle(Transfer_Binder)& aBinder = Find(theStart);
+ if (aBinder.IsNull()) {
+ Handle(Interface_Check) aCheck;
+ return aCheck;
+ }
+ return aBinder->Check();
+ }
+
+ // ## ## ## Actions sur Types Privilegies ## ## ##
+ // ## ## ## (Transient) ## ## ##
+
+ // Bind associe un objet a un objet resultat; or la Map associe un Objet a un
+ // Binder (qui designe son resultat)
+ // *Transient travaillent avec un SimpleBinderOfTransient
+ // si deja la, on considere son resultat
+ // sinon, on cree un Binder du bon type
+
+
+ //=======================================================================
+ //function : BindTransient
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::BindTransient (const StartObject& theStart,
+ const Handle(Standard_Transient)& theResult)
+ {
+ if (theResult.IsNull()) return;
+ Handle(Transfer_Binder) aFormer = Find(theStart);
+ Handle(Transfer_SimpleBinderOfTransient) aBinder =
+ Handle(Transfer_SimpleBinderOfTransient)::DownCast(aFormer);
+ if (!aBinder.IsNull())
+ {
+ if (aBinder->Status() == Transfer_StatusVoid)
+ {
+ aBinder->SetResult(theResult); return;
+ }
+ }
+ aBinder = new Transfer_SimpleBinderOfTransient;
+ aBinder->SetResult (theResult);
+ if (aFormer.IsNull())
+ Bind(theStart,aBinder);
+ else
+ Rebind(theStart,aBinder);
+ }
+
+ //=======================================================================
+ //function : FindTransient
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ const Handle(Standard_Transient)&
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::FindTransient (const StartObject& theStart) const
+ {
+ Handle(Transfer_SimpleBinderOfTransient) aBinder =
+ Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(theStart));
+ if (aBinder.IsNull()) return myNullTrans;
+ if (!aBinder->HasResult()) return myNullTrans;
+ return aBinder->Result();
+ }
+
+ // Binding Multiple: D by BindMultiple declare the first (if not already done)
+ // Then add the words by AddMultiple
+
+ //=======================================================================
+ //function : BindMultiple
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::BindMultiple (const StartObject& theStart)
+ {
+ Handle(Transfer_Binder) aBinder = FindAndMask (theStart);
+ if (!aBinder.IsNull())
+ {
+ if (!aBinder->IsKind(STANDARD_TYPE(Transfer_MultipleBinder)))
+ {
+ StartTrace (myLastBinder,theStart,myLevel,4);
+ Transfer_TransferFailure::Raise ("TransferProcess : BindMultiple");
+ }
+ }
+ else Bind(theStart,new Transfer_MultipleBinder);
+ }
+
+ //=======================================================================
+ //function : AddMultiple
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::AddMultiple (const StartObject& theStart,
+ const Handle(Standard_Transient)& theResult)
+ {
+ Handle(Transfer_Binder) aBinder = FindAndMask(theStart);
+ Handle(Transfer_MultipleBinder) aMultBinder =
+ Handle(Transfer_MultipleBinder)::DownCast(aBinder);
+ if (aMultBinder.IsNull())
+ {
+ StartTrace (aBinder,theStart,myLevel,4);
+ if (aBinder.IsNull()) Transfer_TransferFailure::Raise
+ ("TransferProcess : AddMultiple, nothing bound");
+ else Transfer_TransferFailure::Raise
+ ("TransferProcess : AddMultiple, Binder not a MultipleBinder");
+ }
+ aMultBinder->AddResult(theResult);
+ }
+
+ //=======================================================================
+ //function : FindTypedTransient
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::FindTypedTransient (const StartObject& theStart,
+ const Handle(Standard_Type)& theType,
+ Handle(Standard_Transient)& theVal) const
+ {
+ return GetTypedTransient (Find(theStart), theType, theVal);
+ }
+
+ //=======================================================================
+ //function : GetTypedTransient
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::GetTypedTransient (const Handle(Transfer_Binder)& theBinder,
+ const Handle(Standard_Type)& theType,
+ Handle(Standard_Transient)& theVal) const
+ {
+ return Transfer_SimpleBinderOfTransient::GetTypedResult(theBinder, theType, theVal);
+ }
+
+
+ // ## ## ## ## ## Atomic access ## ## ## ## ##
+ // (doesn't manage the scope but gives access to categories)
+
+ //=======================================================================
+ //function : NbMapped
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Integer
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::NbMapped () const
+ {
+ return myMap.Extent();
+ }
+
+ //=======================================================================
+ //function : Mapped
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ const StartObject&
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Mapped(const Standard_Integer theNum) const
+ {
+ return myMap.FindKey(theNum);
+ }
+
+ //=======================================================================
+ //function : MapIndex
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Integer
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::MapIndex(const StartObject& theStart) const
+ {
+ return myMap.FindIndex(theStart);
+ }
+
+ //=======================================================================
+ //function : MapItem
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Transfer_Binder)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::MapItem(const Standard_Integer theNum) const
+ {
+ Handle(Transfer_Binder) aBinder = myMap.FindFromIndex(theNum);
+ return aBinder;
+ }
+
+
+ // ########################################################################
+ // .... ROOT MANAGEMENT ....
+
+ //=======================================================================
+ //function : SetRoot
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SetRoot (const StartObject& theStart)
+ {
+ Standard_Integer anIndex = MapIndex(theStart);
+ if (anIndex == 0)
+ {
+ return;
+ }
+
+ myRoots.Add(anIndex);
+ if (myTrace > 2)
+ StartTrace (MapItem(anIndex),theStart,myLevel,3);
+ }
+
+ //=======================================================================
+ //function : SetRootManagement
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SetRootManagement (const Standard_Boolean theStatus)
+ {
+ myToManageRoot = theStatus;
+ }
+
+ //=======================================================================
+ //function : NbRoots
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Integer
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::NbRoots () const
+ {
+ return myRoots.Extent();
+ }
+
+ //=======================================================================
+ //function : Root
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ const StartObject&
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Root (const Standard_Integer theNum) const
+ {
+ Standard_Integer anInd = 0;
+ if (theNum > 0 && theNum <= myRoots.Extent()) anInd = myRoots.FindKey(theNum);
+ return myMap.FindKey (anInd);
+ }
+
+ //=======================================================================
+ //function : RootItem
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Transfer_Binder)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::RootItem (const Standard_Integer theNum) const
+ {
+ Standard_Integer anInd = 0;
+ if (theNum > 0 && theNum <= myRoots.Extent()) anInd = myRoots.FindKey(theNum);
+ return myMap.FindFromIndex(anInd);//->Search(categ);skl
+ }
+
+ //=======================================================================
+ //function : RootIndex
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Integer
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::RootIndex (const StartObject& theStart) const
+ {
+ Standard_Integer anIndex = MapIndex (theStart);
+ if (anIndex == 0) return 0;
+ return myRoots.FindIndex (anIndex);
+ }
+
+ //=======================================================================
+ //function : NestingLevel
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Integer
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::NestingLevel () const
+ {
+ return myLevel;
+ }
+
+ //=======================================================================
+ //function : ResetNestingLevel
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::ResetNestingLevel ()
+ {
+ myLevel = 0;
+ }
+
+ // ########################################################################
+ // .... SCOPE MANAGEMENT ....
+
+
+ //======================================================================
+ //Purpose : gka TRJ9 for writing SDR for solid
+ // Check if aBinder has already been bound to the result aBinder.
+ //======================================================================
+
+ // static Standard_Boolean Contains(const Handle(Transfer_Binder)& resbinder,
+ // const Handle(Transfer_Binder)& addbinder)
+ // {
+ // Handle(Transfer_Binder) tmpbind = resbinder;
+ // for ( ; ! tmpbind.IsNull(); tmpbind = tmpbind->NextResult() )
+ // if ( tmpbind == addbinder ) return Standard_True;
+ // return Standard_False;
+ // }
+
+ // ########################################################################
+ // .... AUTOMATION OF TRANSFER ....
+
+ // ## ## ## ## ## Basic Functions ## ## ## ## ##
+
+
+ //=======================================================================
+ //function : Recognize
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Recognize(const StartObject& theStart) const
+ {
+ ActorHandle anActor = myActor;
+ // It scans up to have a next result
+ while (!anActor.IsNull())
+ {
+ if (anActor->Recognize (theStart))
+ return Standard_True;
+ anActor = anActor->Next();
+ }
+ return Standard_False;
+ }
+
+//=======================================================================
+//function : Transferring
+//purpose :
+//=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Transfer_Binder)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Transferring (const StartObject& theStart)
+ {
+ Handle(Transfer_Binder) aFormer = FindAndMask(theStart);
+
+ // Was the Transfer already done with Result?
+ if (!aFormer.IsNull())
+ {
+ if (aFormer->HasResult())
+ {
+ aFormer->SetAlreadyUsed();
+ return aFormer;
+ }
+
+ // Initial state: perhaps already done ... or infeasible!
+ Transfer_StatusExec statex = aFormer->StatusExec();
+ switch (statex)
+ {
+ case Transfer_StatusInitial :
+ break;
+ case Transfer_StatusDone :
+
+ myMessenger << " .. and Transfer done" << endl;
+
+ return aFormer;
+ case Transfer_StatusRun :
+ aFormer->SetStatusExec(Transfer_StatusLoop);
+ return aFormer;
+ case Transfer_StatusError :
+ if (myTrace)
+ {
+ myMessenger << " *** Transfer in Error Status :" << endl;
+ StartTrace (aFormer, theStart, myLevel,0);
+ }
+ else StartTrace (aFormer, theStart,myLevel,4);
+ Transfer_TransferFailure::Raise
+ ("TransferProcess : Transfer in Error Status");
+ case Transfer_StatusLoop :
+ if (myTrace)
+ {
+ myMessenger << " *** Transfer Head of Dead Loop :" << endl;
+ StartTrace (aFormer, theStart, myLevel,0);
+ }
+ else StartTrace (aFormer, theStart,myLevel,4);
+ Transfer_TransferDeadLoop::Raise
+ ("TransferProcess : Transfer at Head of a Dead Loop");
+ }
+#ifdef TRANSLOG
+ cout << "Transfer,level "<<myLevel<<Message_Flush;
+#endif
+ aFormer->SetStatusExec(Transfer_StatusRun);
+ }
+#ifdef TRANSLOG
+ cout << " GO .." << endl;
+#endif
+
+ Handle(Transfer_Binder) aBinder;
+ Standard_Boolean isNewBind = Standard_False;
+ if (myToHandleErr)
+ {
+ // Transfer under protection exceptions (for notification actually)
+ Standard_Integer anOldLevel = myLevel;
+ try
+ {
+ OCC_CATCH_SIGNALS
+ aBinder = TransferProduct(theStart);
+ }
+ catch (Transfer_TransferDeadLoop)
+ {
+ if (aBinder.IsNull())
+ {
+ myMessenger << " *** Dead Loop with no Result" << endl;
+ if (myTrace) StartTrace (aBinder, theStart, myLevel-1,0);
+ aBinder = new Transfer_VoidBinder;
+ Bind (theStart,aBinder); isNewBind = Standard_True;
+ } else if (aBinder->StatusExec() == Transfer_StatusLoop) {
+ if (myTrace) {
+ myMessenger << " *** Dead Loop : Finding head of Loop :" << endl;
+ StartTrace (aBinder, theStart, myLevel-1,0);
+ }
+ else StartTrace (aBinder, theStart,myLevel-1,4);
+ Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop");
+ // In other words, exchange of exception (it is out of the loop)
+ } else {
+ if (myTrace) {
+ myMessenger << " *** Dead Loop : Actor in Loop :" << endl;
+ StartTrace (aBinder, theStart, myLevel-1,0);
+ }
+ }
+ aBinder->AddFail("Transfer in dead Loop");
+ myLevel = anOldLevel;
+ }
+ catch (Standard_Failure) {
+ if (aBinder.IsNull()) {
+ myMessenger << " *** Exception Raised with no Result" << endl;
+ aBinder = new Transfer_VoidBinder;
+ Bind (theStart,aBinder); isNewBind = Standard_True;
+ }
+ aBinder->AddFail("Transfer stopped by exception raising");
+ if (myTrace) {
+ myMessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl;
+ StartTrace (aBinder, theStart, myLevel-1,4);
+ }
+ myLevel = anOldLevel;
+ }
+ }
+
+ // Transfer is non protected (for example, dbx hand in case of a crash by Raise)
+ else aBinder = TransferProduct(theStart);
+
+ // Conclusion : Save the Map
+
+ if (!isNewBind && !aBinder.IsNull())
+ {
+ if (aFormer.IsNull())
+ {
+ // Maybe <myActor> made ​​him even Bind
+ if (!IsBound(theStart))
+ Bind(theStart,aBinder); //result = 0 category
+ else
+ {
+ // gka TRJ9 for writing SDR for solid
+ Rebind(theStart,aBinder); // test_pattern.sat
+ }
+ }
+ else Rebind(theStart,aBinder);
+ // (Therefore, <myLastBinder> is <aBinder>)
+#ifdef TRANSLOG
+ cout << " ... OK" << endl;
+#endif
+ }
+ else
+ {
+ //= by ABV: 5 Oct 97: nothing generated, but aFormer can be in run state - drop it
+ //= ASK: may be set it to StatusInitial ?
+ if ( ! aFormer.IsNull() ) aFormer->SetStatusExec ( Transfer_StatusDone ); //+
+ Handle(Transfer_Binder) aNullBinder;
+ return aNullBinder; // Binder Null ... que faire d autre ?
+ }
+
+ // Manage Roots (if planned)
+ if (myRootLevel >= myLevel) {
+ myRootLevel = 0;
+ if (myToManageRoot && aBinder->Status() != Transfer_StatusVoid)
+ {
+ SetRoot (theStart);
+ }
+ }
+ return myLastBinder;
+ }
+
+//=======================================================================
+//function : TransferProduct
+//purpose :
+//=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Transfer_Binder)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::TransferProduct (const StartObject& theStart)
+{
+ myLevel ++;
+ Handle(Transfer_Binder) aBinder;
+ ActorHandle anActor = myActor;
+
+ while (!anActor.IsNull()) {
+ if (anActor->Recognize (theStart)) aBinder = anActor->Transferring(theStart,this);
+ else aBinder.Nullify();
+ if (!aBinder.IsNull()) break;
+ anActor = anActor->Next();
+ }
+ if (aBinder.IsNull())
+ {
+
+ if (myLevel > 0) myLevel --;
+ return aBinder;
+ }
+
+ if (myRootLevel == 0 && aBinder->StatusExec() == Transfer_StatusDone)
+ myRootLevel = myLevel - 1;
+
+ if (myLevel > 0) myLevel --;
+ return aBinder;
+}
+
+
+//=======================================================================
+//function : Transfer
+//purpose :
+//=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::Transfer(const StartObject& theStart)
+{
+ Handle(Transfer_Binder) aBinder = Transferring (theStart);
+ return (!aBinder.IsNull());
+}
+
+ // #########################################################################
+ // .... Error Handling + Trace ....
+
+ //=======================================================================
+ //function : SetErrorHandle
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SetErrorHandle (const Standard_Boolean isError)
+ {
+ myToHandleErr = isError;
+ }
+
+ //=======================================================================
+ //function : ErrorHandle
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::ErrorHandle() const
+ {
+ return myToHandleErr;
+ }
+
+ //=======================================================================
+ //function : StartTrace
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::StartTrace (const Handle(Transfer_Binder)& theBinder,
+ const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Integer theMode) const
+ {
+ // ### Fail (Roots:50) //! Start theStart->DynamicType()
+ // ### Fail (Roots:50) //! Start id:#label.. Type:theStart->DynamicType()
+ if (myTrace > 3) { // Internal to be switch when searching bug (trace >= 4)
+ if (theMode == 1) myMessenger << " ### Fail";
+ if (theMode == 2) myMessenger << " ### Warning";
+ if (theMode == 3) myMessenger << " ### New Root n0 " << myRoots.Extent();
+ if (theMode == 4) myMessenger << " ### Exception";
+ if (theMode == 5) myMessenger << " ### Substitution";
+ if (theMode == 6) myMessenger << " ### Information";
+ if (theLevel > 1)
+ myMessenger << " (nested)"; // " at nesting Level:"<<theLevel;
+ if (theMode >= 0 && theMode != 3)
+ myMessenger << " at " << myRoots.Extent() << " Roots";
+ }
+ if (!theStart.IsNull()) PrintTrace (theStart,myMessenger);
+
+ if (!theBinder.IsNull()) { // old: if IsNull sout <<endl<< " --- Not Bound";
+ Handle(Transfer_Binder) bnd = theBinder;
+ Standard_Boolean hasres = Standard_False, isused = Standard_False;
+ while (!bnd.IsNull()) {
+ if (bnd->Status() != Transfer_StatusVoid) {
+ // --- Result Type: theBinder->ResultType() --- Binder : theBinder->DynamicType();
+ if (!hasres)
+ myMessenger << "\n --- Result Type : ";
+ else
+ myMessenger << " , ";
+ myMessenger << bnd->ResultTypeName();
+ // CKY 9-JAN-1999: waiting for XSTEP Kernel message (not IGES_2075)
+ /* Message_Msg Msg2075("IGES_2075");
+ Msg2075.AddString(bnd->ResultTypeName());
+ Msg2075.TraceEver(); */
+ hasres = Standard_True;
+ if (bnd->Status() == Transfer_StatusUsed) isused = Standard_True;
+ }
+ bnd = bnd->NextResult();
+ }
+ if (!hasres && theMode > 2) {
+ myMessenger << "\n --- No Result recorded";
+ // CKY 9-JAN-1999 : waiting for XSTEP Kernel message
+ // (not IGES_2075, no reference to specifically TopoDS_Shape)
+ /* Message_Msg Msg2075("IGES_2075");
+ Msg2075.AddString("No TopoDS_Shape");
+ Msg2075.TraceEver(); */
+ }
+ //old if (isused) sout << " //! (Already Used in another Transfer)";
+ }
+ myMessenger << endl;
+ }
+
+
+ //=======================================================================
+ //function : PrintTrace
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::PrintTrace (const StartObject& theStart,
+ const Handle(Message_Messenger)& myMessenger) const
+ {
+ if (!theStart.IsNull())
+ myMessenger <<" Type:" << theStart->DynamicType()->Name();
+ }
+
+ //=======================================================================
+ //function : IsLooping
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::IsLooping (const Standard_Integer theLevel) const
+ {
+ return theLevel > NbMapped();
+ }
+
+ // #########################################################################
+ // .... RESULTS ....
+
+ //=======================================================================
+ //function : RootResult
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Iterator
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::RootResult (const Standard_Boolean isWithStart) const
+ {
+ Iterator iter(isWithStart);
+ Standard_Integer aMax = myRoots.Extent();
+ for (Standard_Integer aJ = 1; aJ <= aMax; aJ ++)
+ {
+ Standard_Integer anI = myRoots.FindKey(aJ);
+ Handle(Transfer_Binder) aBinder = MapItem(anI);
+ if (aBinder.IsNull()) continue;
+ if (isWithStart) iter.Add (aBinder,Mapped(anI));
+ else iter.Add (aBinder);
+ }
+ return iter;
+ }
+
+ //=======================================================================
+ //function : CompleteResult
+ //purpose : All Results
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Iterator
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::CompleteResult (const Standard_Boolean isWithStart) const
+ {
+ Iterator iter(isWithStart);
+ Standard_Integer aMax = NbMapped();
+ for (Standard_Integer anI = 1; anI <= aMax; anI ++) {
+ Handle(Transfer_Binder) aBinder = MapItem(anI);
+ if (aBinder.IsNull()) continue;
+ if (isWithStart) iter.Add (aBinder,Mapped(anI));
+ else iter.Add (aBinder);
+ }
+ return iter;
+ }
+
+ //=======================================================================
+ //function : AbnormalResult
+ //purpose : Transfers a problem
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Iterator
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::AbnormalResult() const
+ {
+ Iterator anIter(Standard_True);
+ Standard_Integer aMax = NbMapped();
+ for (Standard_Integer anI = 1; anI <= aMax; anI ++) {
+ Handle(Transfer_Binder) aBinder = MapItem(anI);
+ if (aBinder.IsNull()) continue;
+ Transfer_StatusExec aStatExec = aBinder->StatusExec();
+ if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone)
+ anIter.Add (aBinder,Mapped(anI)); // on note les cas "pas normaux"
+ }
+ return anIter;
+ }
+
+ //=======================================================================
+ //function : CheckList
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Interface_CheckIterator
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::CheckList (const Standard_Boolean isErrOnly) const
+ {
+ Interface_CheckIterator list;
+ Standard_Integer theNum, aMax = NbMapped();
+ for (Standard_Integer anI = 1; anI <= aMax; anI ++) {
+ Handle(Transfer_Binder) aBinder = MapItem(anI);
+ if (aBinder.IsNull()) continue;
+ Transfer_StatusExec aStatExec = aBinder->StatusExec();
+ Handle(Interface_Check) aCheck = aBinder->Check();
+ if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone &&
+ !aCheck->HasFailed())
+ aCheck->AddFail("Transfer in Abnormal Status (!= Initial or Done)");
+ if (!aCheck->HasFailed() && (isErrOnly || aCheck->NbWarnings() == 0)) continue;
+ const StartObject& ent = Mapped(anI);
+ theNum = CheckNum(ent);
+ if (theNum == 0) theNum = anI;
+ aCheck->SetEntity(ent);
+ list.Add(aCheck,theNum);
+ }
+ return list;
+ }
+
+ // #########################################################################
+ // .... RESULTS BY ENTITY ....
+
+ //=======================================================================
+ //function : ResultOne
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Iterator
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::ResultOne (const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Boolean isWithStart) const
+ {
+ Iterator anIter(isWithStart);
+ Standard_Integer aMax = NbMapped();
+ Standard_Integer anInd = MapIndex (theStart);
+ if (anInd == 0) return anIter;
+ Standard_Integer i1 = (theLevel == 0 ? anInd : 1);
+ Standard_Integer i2 = (theLevel == 0 ? anInd : aMax);
+ Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
+ for (Standard_Integer anI = i1; anI <= i2; anI ++) {
+ anInd = map->Value(anI);
+ if (anInd == 0) continue;
+ Handle(Transfer_Binder) aBinder = MapItem(anI);
+ if (aBinder.IsNull()) continue;
+ if (isWithStart) anIter.Add (aBinder,Mapped(anInd));
+ else anIter.Add (aBinder);
+ }
+ return anIter;
+ }
+
+ //=======================================================================
+ //function : CheckListOne
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Interface_CheckIterator
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::CheckListOne (const StartObject& theStart,const Standard_Integer theLevel,
+ const Standard_Boolean isErrOnly) const
+ {
+ Interface_CheckIterator aList;
+ Standard_Integer aMax = NbMapped();
+ Standard_Integer aNum, anInd = MapIndex (theStart);
+ if (anInd == 0) return aList;
+ Standard_Integer i1 = (theLevel == 0 ? anInd : 1);
+ Standard_Integer i2 = (theLevel == 0 ? anInd : aMax);
+ Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
+
+ for (Standard_Integer anI = i1; anI <= i2; anI ++) {
+ anInd = map->Value(anI);
+ if (anInd == 0) continue;
+ Handle(Transfer_Binder) aBinder = MapItem(anInd);
+ if (aBinder.IsNull()) continue;
+ Transfer_StatusExec aStatExec = aBinder->StatusExec();
+ Handle(Interface_Check) aCheck = aBinder->Check();
+ if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone &&
+ !aCheck->HasFailed())
+ aCheck->AddFail("Transfer in Abnormal Status (!= Initial or Done)");
+ if (!aCheck->HasFailed() && (isErrOnly || aCheck->NbWarnings() == 0)) continue;
+ const StartObject& anEnt = Mapped(anInd);
+ aNum = CheckNum(anEnt); if (aNum == 0) aNum = anInd;
+ aCheck->SetEntity(anEnt);
+ aList.Add(aCheck,aNum);
+ }
+ return aList;
+ }
+
+ //=======================================================================
+ //function : IsCheckListEmpty
+ //purpose :
+ //=======================================================================
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Boolean
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::IsCheckListEmpty (const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Boolean isErrOnly) const
+ {
+ Standard_Integer aMax = NbMapped();
+ Standard_Integer anInd = MapIndex (theStart);
+ if (anInd == 0) return Standard_False;
+ Standard_Integer i1 = (theLevel == 0 ? anInd : 1);
+ Standard_Integer i2 = (theLevel == 0 ? anInd : aMax);
+ Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
+
+ for (Standard_Integer anI = i1; anI <= i2; anI ++) {
+ anInd = map->Value(anI);
+ if (anInd == 0) continue;
+ Handle(Transfer_Binder) aBinder = MapItem(anInd);
+ if (aBinder.IsNull()) continue;
+
+ Transfer_StatusExec aStatExec = aBinder->StatusExec();
+ Handle(Interface_Check) aCheck = aBinder->Check();
+ if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone)
+ return Standard_False;
+ if (aCheck->HasFailed() || (!isErrOnly && aCheck->NbWarnings() > 0)) return Standard_False;
+ }
+ return Standard_True;
+ }
+
+ //=======================================================================
+ //function : RemoveResult
+ //purpose :
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::RemoveResult (const StartObject& theStart,
+ const Standard_Integer theLevel,
+ const Standard_Boolean toCompute)
+ {
+ Standard_Integer aMax = NbMapped();
+ Standard_Integer anInd = MapIndex (theStart);
+ if (anInd == 0) return;
+ Standard_Integer i1 = (theLevel == 0 ? anInd : 1);
+ Standard_Integer i2 = (theLevel == 0 ? anInd : aMax);
+ Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0);
+
+ Standard_Integer anI; // svv Jan11 2000 : porting on DEC
+ for (anI = i1; anI <= i2; anI ++) {
+ anInd = map->Value(anI);
+ if (anInd == 0) continue;
+ Handle(Transfer_Binder) aBinder = MapItem(anInd);
+ if (aBinder.IsNull()) continue;
+ }
+ }
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Standard_Integer
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::CheckNum (const StartObject& ) const
+ {
+ return 0;
+ }
+
+ //=======================================================================
+ //function : SetProgress
+ //purpose : Sets Progress indicator
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ void
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::SetProgress (const Handle(Message_ProgressIndicator)& theProgress)
+ {
+ myProgress = theProgress;
+ }
+
+ //=======================================================================
+ //function : GetProgress
+ //purpose : Returns Progress indicator
+ //=======================================================================
+
+ template <class ActorHandle, class TransferMap, class StartObject,
+ class MapHasher, class ListHandle, class Iterator>
+ Handle(Message_ProgressIndicator)
+ Transfer_TransferProcess <ActorHandle,TransferMap,StartObject,
+ MapHasher,ListHandle,Iterator>
+ ::GetProgress() const
+ {
+ return myProgress;
+ }
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <Transfer_TransientMapper.hxx>
+#include <Standard_Type.hxx>
+#include <Standard_Transient.hxx>
+#include <TColStd_MapTransientHasher.hxx>
+#include <Transfer_DataInfo.hxx>
+#include <Transfer_Finder.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(Transfer_TransientMapper)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_Finder),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(Transfer_TransientMapper)
+
+
+IMPLEMENT_DOWNCAST(Transfer_TransientMapper,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(Transfer_TransientMapper)
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_TransientMapper_HeaderFile
+#define _Transfer_TransientMapper_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Transfer_Finder.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Transfer_Finder.hxx>
+#include <Handle_Standard_Type.hxx>
+#include <Transfer_Mapper.hxx>
+#include <Transfer_DataInfo.hxx>
+#include <TColStd_MapTransientHasher.hxx>
+
+class Standard_Transient;
+class TColStd_MapTransientHasher;
+class Transfer_DataInfo;
+class Transfer_Finder;
+class Standard_Type;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Transfer_Finder);
+class Transfer_TransientMapper;
+
+DEFINE_STANDARD_HANDLE(Transfer_TransientMapper,Transfer_Finder)
+
+class Transfer_TransientMapper : public Transfer_Mapper<Handle(Standard_Transient),
+ TColStd_MapTransientHasher,
+ Transfer_DataInfo,
+ Handle(Transfer_TransientMapper)>
+ {
+ public:
+ Standard_EXPORT Transfer_TransientMapper(const Handle(Standard_Transient) theKey)
+ : Transfer_Mapper<Handle(Standard_Transient),
+ TColStd_MapTransientHasher,
+ Transfer_DataInfo,
+ Handle(Transfer_TransientMapper)>(theKey)
+ { }
+ DEFINE_STANDARD_RTTI(Transfer_TransientMapper)
+
+ };
+
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1996-09-04
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class TransientProcess from Transfer inherits ProcessForTransient
-
- ---Purpose : Adds specific features to the generic definition :
- -- TransientProcess is intended to work from an InterfaceModel
- -- to a set of application objects.
- --
- -- Hence, some informations about starting entities can be gotten
- -- from the model : for Trace, CheckList, Integrity Status
-
-uses Transient, Type,
- DictionaryOfTransient,
- InterfaceModel, HGraph, Graph, EntityIterator,
- HSequenceOfTransient from TColStd,
- Messenger from Message
-
-is
-
- Create (nb : Integer = 10000) returns mutable TransientProcess;
- ---Purpose : Sets TransientProcess at initial state, with an initial size
-
- SetModel (me : mutable; model : InterfaceModel);
- ---Purpose : Sets an InterfaceModel, used by StartTrace, CheckList, queries
- -- on Integrity, to give informations significant for each norm.
-
- Model (me) returns InterfaceModel;
- ---Purpose : Returns the Model used for StartTrace
-
- SetGraph (me : mutable; HG : HGraph);
- ---Purpose : Sets a Graph : superseedes SetModel if already done
-
- HasGraph (me) returns Boolean;
- HGraph (me) returns HGraph;
- Graph (me) returns Graph;
- ---C++ : return const &
-
- SetContext (me : mutable; name : CString; ctx : Transient);
- ---Purpose : Sets a Context : according to receiving appli, to be
- -- interpreted by the Actor
-
- GetContext (me; name : CString; type : Type; ctx : out Transient)
- returns Boolean;
- ---Purpose : Returns the Context attached to a name, if set and if it is
- -- Kind of the type, else a Null Handle
- -- Returns True if OK, False if no Context
-
- Context (me : mutable) returns DictionaryOfTransient;
- ---Purpose : Returns (modifiable) the whole definition of Context
- -- Rather for internal use (ex.: preparing and setting in once)
- ---C++ : return &
-
- PrintTrace (me; start : Transient; S : Messenger from Message) is redefined;
- ---Purpose : Specific printing to trace an entity : prints label and type
- -- (if model is set)
-
- CheckNum (me; ent : Transient) returns Integer is redefined;
- ---Purpose : Specific number of a starting object for check-list : Number
- -- in model
-
- TypedSharings (me; start : Transient; type : Type) returns EntityIterator;
- ---Purpose : Returns the list of sharings entities, AT ANY LEVEL, which are
- -- kind of a given type. Calls TypedSharings from Graph
- -- Returns an empty list if the Graph has not been aknowledged
-
- IsDataLoaded (me; ent : Transient) returns Boolean;
- ---Purpose : Tells if an entity is well loaded from file (even if its data
- -- fail on checking, they are present). Mostly often, answers
- -- True. Else, there was a syntactic error in the file.
- -- A non-loaded entity MAY NOT BE transferred, unless its Report
- -- (in the model) is interpreted
-
- IsDataFail (me; ent : Transient) returns Boolean;
- ---Purpose : Tells if an entity fails on data checking (load time,
- -- syntactic, or semantic check). Normally, should answer False.
- -- It is not prudent to try transferring an entity which fails on
- -- data checking
-
- PrintStats (me; mode : Integer; S : Messenger from Message);
- ---Purpose : Prints statistics on a given output, according mode
- RootsForTransfer(me : mutable) returns HSequenceOfTransient from TColStd;
-fields
-
- themodel : InterfaceModel;
- thegraph : HGraph;
- thectx : DictionaryOfTransient;
- thetrroots : HSequenceOfTransient from TColStd;
-end TransientProcess;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Transfer_TransientProcess.ixx>
+#include <Transfer_TransientProcess.hxx>
#include <Interface_Check.hxx>
#include <Interface_MSG.hxx>
#include <Transfer_Binder.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
+#include <Standard_Type.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Interface_HGraph.hxx>
+#include <Dico_DictionaryOfTransient.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Interface_Graph.hxx>
+#include <Standard_Transient.hxx>
+#include <Message_Messenger.hxx>
+#include <Interface_EntityIterator.hxx>
+
+IMPLEMENT_STANDARD_TYPE(Transfer_TransientProcess)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(Transfer_TransientProcess)
+
+
+IMPLEMENT_DOWNCAST(Transfer_TransientProcess,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(Transfer_TransientProcess)
//=======================================================================
//=======================================================================
Transfer_TransientProcess::Transfer_TransientProcess
- (const Standard_Integer nb) : Transfer_ProcessForTransient (nb)
+ (const Standard_Integer theNb)
+ : Transfer_TransferProcess < Handle(Transfer_ActorOfTransientProcess),
+ Transfer_TransferMapOfProcessForTransient,
+ Handle(Standard_Transient),
+ TColStd_MapTransientHasher,
+ Handle(TColStd_HSequenceOfTransient),
+ Transfer_IteratorOfProcessForTransient > (theNb)
{
- thetrroots = new TColStd_HSequenceOfTransient;
+ theTrRoots = new TColStd_HSequenceOfTransient;
}
-
//=======================================================================
//function : SetModel
//purpose :
//=======================================================================
void Transfer_TransientProcess::SetModel
- (const Handle(Interface_InterfaceModel)& model)
+ (const Handle(Interface_InterfaceModel)& theModel)
{
- themodel = model;
+ myModel = theModel;
}
Handle(Interface_InterfaceModel) Transfer_TransientProcess::Model () const
{
- return themodel;
+ return myModel;
}
-void Transfer_TransientProcess::SetGraph(const Handle(Interface_HGraph)& HG)
+void Transfer_TransientProcess::SetGraph(const Handle(Interface_HGraph)& theHGraph)
{
- thegraph = HG;
- if (!thegraph.IsNull())
- SetModel(thegraph->Graph().Model());
+ myGraph = theHGraph;
+ if (!myGraph.IsNull())
+ SetModel(myGraph->Graph().Model());
else
- themodel.Nullify();
+ myModel.Nullify();
}
Standard_Boolean Transfer_TransientProcess::HasGraph () const
{
- return !thegraph.IsNull();
+ return !myGraph.IsNull();
}
Handle(Interface_HGraph) Transfer_TransientProcess::HGraph () const
{
- return thegraph;
+ return myGraph;
}
const Interface_Graph& Transfer_TransientProcess::Graph () const
{
- return thegraph->Graph();
+ return myGraph->Graph();
}
//purpose :
//=======================================================================
-void Transfer_TransientProcess::SetContext(const Standard_CString name,
- const Handle(Standard_Transient)& ctx)
+void Transfer_TransientProcess::SetContext(const Standard_CString theName,
+ const Handle(Standard_Transient)& theCtx)
{
- if (thectx.IsNull()) thectx = new Dico_DictionaryOfTransient;
- thectx->SetItem (name,ctx);
+ if (myCtx.IsNull()) myCtx = new Dico_DictionaryOfTransient;
+ myCtx->SetItem (theName,theCtx);
}
//=======================================================================
Standard_Boolean Transfer_TransientProcess::GetContext
- (const Standard_CString name, const Handle(Standard_Type)& type,
- Handle(Standard_Transient)& ctx) const
+ (const Standard_CString theName, const Handle(Standard_Type)& theType,
+ Handle(Standard_Transient)& theCtx) const
{
- if (thectx.IsNull()) return Standard_False;
- if (!thectx->GetItem (name,ctx)) ctx.Nullify();
- if (ctx.IsNull()) return Standard_False;
- if (type.IsNull()) return Standard_True;
- if (!ctx->IsKind(type)) ctx.Nullify();
- return !ctx.IsNull();
+ if (myCtx.IsNull()) return Standard_False;
+ if (!myCtx->GetItem (theName,theCtx)) theCtx.Nullify();
+ if (theCtx.IsNull()) return Standard_False;
+ if (theType.IsNull()) return Standard_True;
+ if (!theCtx->IsKind(theType)) theCtx.Nullify();
+ return !theCtx.IsNull();
}
Handle(Dico_DictionaryOfTransient)& Transfer_TransientProcess::Context ()
{
- return thectx;
+ return myCtx;
}
//=======================================================================
void Transfer_TransientProcess::PrintTrace
- (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const
+ (const Handle(Standard_Transient)& theStart, const Handle(Message_Messenger)& theMessenger) const
{
- if (!start.IsNull()) {
- S << "Entity ";
- if (!themodel.IsNull()) {
- themodel->Print (start,S,1);
-// S<<"id "; themodel->Print (start,S);
-// S<<" Type:"<<themodel->TypeName (start);
+ if (!theStart.IsNull()) {
+ theMessenger << "Entity ";
+ if (!myModel.IsNull()) {
+ myModel->Print (theStart,theMessenger,1);
+// theMessenger<<"id "; myModel->Print (theStart,theMessenger);
+// theMessenger<<" Type:"<<myModel->TypeName (theStart);
}
- else S<<" Type:"<< Interface_InterfaceModel::ClassName(start->DynamicType()->Name());
- // << start (handle) ??
+ else theMessenger<<" Type:"<< Interface_InterfaceModel::ClassName(theStart->DynamicType()->Name());
+ // << theStart (handle) ??
}
}
//=======================================================================
Standard_Integer Transfer_TransientProcess::CheckNum
- (const Handle(Standard_Transient)& start) const
+ (const Handle(Standard_Transient)& theStart) const
{
- return (themodel.IsNull() ? 0 : themodel->Number(start));
+ return (myModel.IsNull() ? 0 : myModel->Number(theStart));
}
//=======================================================================
Interface_EntityIterator Transfer_TransientProcess::TypedSharings
- (const Handle(Standard_Transient)& start,
- const Handle(Standard_Type)& type) const
+ (const Handle(Standard_Transient)& theStart,
+ const Handle(Standard_Type)& theType) const
{
Interface_EntityIterator iter;
- if (thegraph.IsNull()) return iter;
- return thegraph->Graph().TypedSharings (start,type);
+ if (myGraph.IsNull()) return iter;
+ return myGraph->Graph().TypedSharings (theStart,theType);
}
//=======================================================================
Standard_Boolean Transfer_TransientProcess::IsDataLoaded
- (const Handle(Standard_Transient)& start) const
+ (const Handle(Standard_Transient)& theStart) const
{
- if (themodel.IsNull()) return Standard_True;
- Standard_Integer num = themodel->Number(start);
- if (num == 0) return Standard_True;
- if (themodel->IsUnknownEntity(num)) return Standard_False;
- return !themodel->IsRedefinedContent(num);
+ if (myModel.IsNull()) return Standard_True;
+ Standard_Integer aNum = myModel->Number(theStart);
+ if (aNum == 0) return Standard_True;
+ if (myModel->IsUnknownEntity(aNum)) return Standard_False;
+ return !myModel->IsRedefinedContent(aNum);
}
//=======================================================================
Standard_Boolean Transfer_TransientProcess::IsDataFail
- (const Handle(Standard_Transient)& start) const
+ (const Handle(Standard_Transient)& theStart) const
{
- if (themodel.IsNull()) return Standard_False;
- Standard_Integer num = themodel->Number(start);
- if (num == 0) return Standard_False;
- if (themodel->IsErrorEntity(num)) return Standard_True;
- const Handle(Interface_Check) ach = themodel->Check(num,Standard_False); // semantic
- return ach->HasFailed();
+ if (myModel.IsNull()) return Standard_False;
+ Standard_Integer aNum = myModel->Number(theStart);
+ if (aNum == 0) return Standard_False;
+ if (myModel->IsErrorEntity(aNum)) return Standard_True;
+ const Handle(Interface_Check) aCheck = myModel->Check(aNum,Standard_False); // semantic
+ return aCheck->HasFailed();
}
//=======================================================================
void Transfer_TransientProcess::PrintStats(const Standard_Integer /*mode*/,
- const Handle(Message_Messenger)& S) const
+ const Handle(Message_Messenger)& theMessenger) const
{
- S<<"\n*******************************************************************\n";
+ theMessenger<<"\n*******************************************************************\n";
// if (mode == 1) { // Statistiques de base
- S << "******** Basic Statistics ********"<<endl;
+ theMessenger << "******** Basic Statistics ********"<<endl;
- Handle(Interface_InterfaceModel) model = Model();
- if (model.IsNull()) S<<"**** Model unknown"<<endl;
+ Handle(Interface_InterfaceModel) aModel = Model();
+ if (aModel.IsNull()) theMessenger<<"**** Model unknown"<<endl;
else
- S<<"**** Nb Entities : "<<model->NbEntities()<<endl;
-
- Standard_Integer nbr = 0, nbe = 0, nbw = 0;
- Standard_Integer i, max = NbMapped(), nbroots = NbRoots();
- S << "**** Nb Final Results : "<<nbroots<<endl;
-
- for (i = 1; i <= max; i ++) {
- const Handle(Transfer_Binder)& binder = MapItem(i);
- if (binder.IsNull()) continue;
- const Handle(Interface_Check) ach = binder->Check();
- Transfer_StatusExec stat = binder->StatusExec();
- if (stat != Transfer_StatusInitial && stat != Transfer_StatusDone)
- nbe ++;
+ theMessenger<<"**** Nb Entities : "<< aModel->NbEntities()<<endl;
+
+ Standard_Integer aNbr = 0, aNbe = 0, aNbw = 0;
+ Standard_Integer anI, aMax = NbMapped(), aNbRoots = NbRoots();
+ theMessenger << "**** Nb Final Results : "<<aNbRoots<<endl;
+
+ for (anI = 1; anI <= aMax; anI ++) {
+ const Handle(Transfer_Binder)& aBinder = MapItem(anI);
+ if (aBinder.IsNull()) continue;
+ const Handle(Interface_Check) aCheck = aBinder->Check();
+ Transfer_StatusExec aStatus = aBinder->StatusExec();
+ if (aStatus != Transfer_StatusInitial && aStatus != Transfer_StatusDone)
+ aNbe ++;
else {
- if (ach->NbWarnings() > 0) nbw ++;
- if (binder->HasResult()) nbr ++;
+ if (aCheck->NbWarnings() > 0) aNbw ++;
+ if (aBinder->HasResult()) aNbr ++;
}
}
- if (nbr > nbroots)
- S<<"**** ( Itermediate Results : "<<nbr-nbroots<<" )\n";
- if (nbe > 0)
- S<<"**** Errors on : "<<Interface_MSG::Blanks(nbe,4)<<nbe<<" Entities\n";
- if (nbw > 0)
- S<<"**** Warnings on : "<<Interface_MSG::Blanks(nbw,4)<<nbw<<" Entities\n";
- S<<"*******************************************************************";
+ if (aNbr > aNbRoots)
+ theMessenger<<"**** ( Itermediate Results : "<<aNbr-aNbRoots<<" )\n";
+ if (aNbe > 0)
+ theMessenger<<"**** Errors on : "<<Interface_MSG::Blanks(aNbe,4)<<aNbe<<" Entities\n";
+ if (aNbw > 0)
+ theMessenger<<"**** Warnings on : "<<Interface_MSG::Blanks(aNbw,4)<<aNbw<<" Entities\n";
+ theMessenger<<"*******************************************************************";
// }
- S<<endl;
+ theMessenger<<endl;
}
Handle(TColStd_HSequenceOfTransient) Transfer_TransientProcess::RootsForTransfer()
{
- return thetrroots;
+ return theTrRoots;
}
+
+//=======================================================================
+//function : TransferProduct
+//purpose :
+//=======================================================================
+ Handle(Transfer_Binder) Transfer_TransientProcess::TransferProduct (const Handle(Standard_Transient)& theStart)
+ {
+ myLevel ++; // decrement and if == 0, root transfer
+ Handle(Transfer_Binder) aBinder;
+ Handle(Transfer_ActorOfTransientProcess) anActor = myActor;
+ while (!anActor.IsNull())
+ {
+ if (anActor->Recognize (theStart)) aBinder = anActor->Transferring(theStart,this);
+ else aBinder.Nullify();
+ if (!aBinder.IsNull()) break;
+ anActor = anActor->Next();
+ }
+ if (aBinder.IsNull()) {
+ if (myLevel > 0) myLevel --;
+ return aBinder;
+ }
+ // Managing the root level (.. a close look ..)
+ if (myRootLevel == 0 && aBinder->StatusExec() == Transfer_StatusDone)
+ myRootLevel = myLevel - 1;
+
+ if (myLevel > 0) myLevel --;
+ return aBinder;
+ }
+
+ //=======================================================================
+ //function : Transferring
+ //purpose :
+ //=======================================================================
+
+ Handle(Transfer_Binder) Transfer_TransientProcess::Transferring (const Handle(Standard_Transient)& theStart)
+ {
+ Handle(Transfer_Binder) aFormer = FindAndMask(theStart);
+
+ // Use more: note "AlreadyUsed" so result can not be changed
+ if (!aFormer.IsNull()) {
+ if (aFormer->HasResult()) {
+ aFormer->SetAlreadyUsed();
+ return aFormer;
+ }
+
+ // Initial state: perhaps already done ... or infeasible
+ Transfer_StatusExec statex = aFormer->StatusExec();
+ switch (statex) {
+ case Transfer_StatusInitial : // Transfer is prepared to do
+ break;
+ case Transfer_StatusDone : // Transfer was already done
+ myMessenger << " .. and Transfer done" << endl;
+ return aFormer;
+ case Transfer_StatusRun :
+ aFormer->SetStatusExec(Transfer_StatusLoop);
+ return aFormer;
+ case Transfer_StatusError :
+ if (myTrace) {
+ myMessenger << " *** Transfer in Error Status :" << endl;
+ StartTrace (aFormer, theStart, myLevel,0);
+ }
+ else StartTrace (aFormer, theStart,myLevel,4);
+ Transfer_TransferFailure::Raise
+ ("TransferProcess : Transfer in Error Status");
+ case Transfer_StatusLoop : // The loop is closed ...
+ if (myTrace) {
+ myMessenger << " *** Transfer Head of Dead Loop :" << endl;
+ StartTrace (aFormer, theStart, myLevel,0);
+ }
+ else StartTrace (aFormer, theStart,myLevel,4);
+ Transfer_TransferDeadLoop::Raise
+ ("TransferProcess : Transfer at Head of a Dead Loop");
+ }
+#ifdef TRANSLOG
+ cout << "Transfer,level "<<myLevel<<Message_Flush;
+#endif
+ aFormer->SetStatusExec(Transfer_StatusRun);
+ }
+#ifdef TRANSLOG
+ cout << " GO .." << endl;
+#endif
+
+ Handle(Transfer_Binder) aBinder;
+ Standard_Boolean isNewBind = Standard_False;
+ if (myToHandleErr) {
+ // Transfer under protection exceptions (for notification actually)
+ Standard_Integer anOldLevel = myLevel;
+ try {
+ OCC_CATCH_SIGNALS
+ aBinder = TransferProduct(theStart);
+ }
+ catch (Transfer_TransferDeadLoop) {
+ if (aBinder.IsNull()) {
+ myMessenger << " *** Dead Loop with no Result" << endl;
+ if (myTrace) StartTrace (aBinder, theStart, myLevel-1,0);
+ aBinder = new Transfer_VoidBinder;
+ Bind (theStart,aBinder); isNewBind = Standard_True;
+ } else if (aBinder->StatusExec() == Transfer_StatusLoop) {
+ if (myTrace) {
+ myMessenger << " *** Dead Loop : Finding head of Loop :" << endl;
+ StartTrace (aBinder, theStart, myLevel-1,0);
+ }
+ else StartTrace (aBinder, theStart,myLevel-1,4);
+ Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop");
+ } else {
+ if (myTrace) {
+ myMessenger << " *** Dead Loop : Actor in Loop :" << endl;
+ StartTrace (aBinder, theStart, myLevel-1,0);
+ }
+ }
+ aBinder->AddFail("Transfer in dead Loop");
+ myLevel = anOldLevel;
+ }
+ catch (Standard_Failure) {
+ if (aBinder.IsNull()) {
+ myMessenger << " *** Exception Raised with no Result" << endl;
+ aBinder = new Transfer_VoidBinder;
+ Bind (theStart,aBinder); isNewBind = Standard_True;
+ }
+ aBinder->AddFail("Transfer stopped by exception raising");
+ if (myTrace) {
+ myMessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl;
+ StartTrace (aBinder, theStart, myLevel-1,4);
+ }
+ myLevel = anOldLevel;
+ }
+ }
+
+ else aBinder = TransferProduct(theStart);
+
+ // Conclusion : Noter dans la Map
+
+ if (!isNewBind && !aBinder.IsNull()) {
+ if (aFormer.IsNull()) {
+ if (!IsBound(theStart)) Bind(theStart,aBinder); // result = 0 category
+ else { // gka TRJ9 for writing SDR for solid
+ Rebind(theStart,aBinder); // test_pattern.sat
+ }
+ }
+ else Rebind(theStart,aBinder);
+#ifdef TRANSLOG
+ cout << " ... OK" << endl;
+#endif
+ }
+ else
+ {
+ //= by ABV: 5 Oct 97: nothing generated, but aFormer can be in run state - drop it
+ //= ASK: may be set it to StatusInitial ?
+ if ( ! aFormer.IsNull() ) aFormer->SetStatusExec ( Transfer_StatusDone );
+ Handle(Transfer_Binder) aNullBinder;
+ return aNullBinder;
+ }
+
+ // Manage Roots (if planned)
+ if (myRootLevel >= myLevel) {
+ myRootLevel = 0;
+ if (myToManageRoot && aBinder->Status() != Transfer_StatusVoid) {
+ SetRoot (theStart);
+ }
+ }
+ return myLastBinder;
+ }
+
+ Standard_Boolean Transfer_TransientProcess::Transfer(const Handle(Standard_Transient)& theStart)
+ {
+ Handle(Transfer_Binder) aBinder = Transferring(theStart);
+ return (!aBinder.IsNull());
+ }
+
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _Transfer_TransientProcess_HeaderFile
+#define _Transfer_TransientProcess_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Standard_Transient.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Handle_Interface_HGraph.hxx>
+#include <Handle_Dico_DictionaryOfTransient.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_CString.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Standard_Type.hxx>
+#include <Handle_Message_Messenger.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <TColStd_MapTransientHasher.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Transfer_Binder.hxx>
+#include <Transfer_TransferProcess.hxx>
+#include <TColStd_MapTransientHasher.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+#include <Transfer_IteratorOfProcessForTransient.hxx>
+#include <MMgt_TShared.hxx>
+#include <Transfer_TransientProcess_Handle.hxx>
+
+class Interface_InterfaceModel;
+class Interface_HGraph;
+class Dico_DictionaryOfTransient;
+class TColStd_HSequenceOfTransient;
+class Interface_Graph;
+class Standard_Transient;
+class Standard_Type;
+class Message_Messenger;
+class Interface_EntityIterator;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+
+
+//! Adds specific features to the generic definition : <br>
+//! TransientProcess is intended to work from an InterfaceModel <br>
+//! to a set of application objects. <br>
+//! <br>
+//! Hence, some informations about starting entities can be gotten <br>
+//! from the model : for Trace, CheckList, Integrity Status <br>
+class Transfer_TransientProcess
+: public Transfer_TransferProcess < Handle(Transfer_ActorOfTransientProcess),
+ Transfer_TransferMapOfProcessForTransient,
+ Handle(Standard_Transient),
+ TColStd_MapTransientHasher,
+ Handle(TColStd_HSequenceOfTransient),
+ Transfer_IteratorOfProcessForTransient >
+{
+
+public:
+
+ //! Sets TransientProcess at initial state, with an initial size <br>
+ Standard_EXPORT Transfer_TransientProcess (const Standard_Integer theNb = 10000);
+ //! Sets an InterfaceModel, used by StartTrace, CheckList, queries <br>
+ //! on Integrity, to give informations significant for each norm. <br>
+ Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& theModel) ;
+ //! Returns the Model used for StartTrace <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model () const;
+ //! Sets a Graph : superseedes SetModel if already done <br>
+ Standard_EXPORT void SetGraph(const Handle(Interface_HGraph)& theHG) ;
+
+ Standard_EXPORT Standard_Boolean HasGraph () const;
+
+ Standard_EXPORT Handle_Interface_HGraph HGraph () const;
+
+ Standard_EXPORT const Interface_Graph& Graph () const;
+ //! Sets a Context : according to receiving appli, to be <br>
+ //! interpreted by the Actor <br>
+ Standard_EXPORT void SetContext (const Standard_CString theName,
+ const Handle(Standard_Transient)& theCtx) ;
+ //! Returns the Context attached to a name, if set and if it is <br>
+ //! Kind of the type, else a Null Handle <br>
+ //! Returns True if OK, False if no Context <br>
+ Standard_EXPORT Standard_Boolean GetContext (const Standard_CString theName,
+ const Handle(Standard_Type)& theType,
+ Handle(Standard_Transient)& theCtx) const;
+ //! Returns (modifiable) the whole definition of Context <br>
+ //! Rather for internal use (ex.: preparing and setting in once) <br>
+ Standard_EXPORT Handle_Dico_DictionaryOfTransient& Context () ;
+ //! Specific printing to trace an entity : prints label and type <br>
+ //! (if model is set) <br>
+ Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& theStart,
+ const Handle(Message_Messenger)& theMessenger) const;
+ //! Specific number of a starting object for check-list : Number <br>
+ //! in model <br>
+ Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& theEnt) const;
+ //! Returns the list of sharings entities, AT ANY LEVEL, which are <br>
+ //! kind of a given type. Calls TypedSharings from Graph <br>
+ //! Returns an empty list if the Graph has not been aknowledged <br>
+ Standard_EXPORT Interface_EntityIterator TypedSharings (const Handle(Standard_Transient)& theStart,
+ const Handle(Standard_Type)& theType) const;
+ //! Tells if an entity is well loaded from file (even if its data <br>
+ //! fail on checking, they are present). Mostly often, answers <br>
+ //! True. Else, there was a syntactic error in the file. <br>
+ //! A non-loaded entity MAY NOT BE transferred, unless its Report <br>
+ //! (in the model) is interpreted <br>
+ Standard_EXPORT Standard_Boolean IsDataLoaded (const Handle(Standard_Transient)& theEnt) const;
+ //! Tells if an entity fails on data checking (load time, <br>
+ //! syntactic, or semantic check). Normally, should answer False. <br>
+ //! It is not prudent to try transferring an entity which fails on <br>
+ //! data checking <br>
+ Standard_EXPORT Standard_Boolean IsDataFail (const Handle(Standard_Transient)& theEnt) const;
+ //! Prints statistics on a given output, according mode <br>
+ Standard_EXPORT void PrintStats (const Standard_Integer theMode,
+ const Handle(Message_Messenger)& theMessenger) const;
+
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient RootsForTransfer() ;
+
+ Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Standard_Transient)& theStart);
+
+ Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& theStart);
+
+ Standard_EXPORT Standard_Boolean Transfer(const Handle(Standard_Transient)& theStart);
+
+ DEFINE_STANDARD_RTTI(Transfer_TransientProcess)
+
+private:
+ Handle_Interface_InterfaceModel myModel;
+ Handle_Interface_HGraph myGraph;
+ Handle_Dico_DictionaryOfTransient myCtx;
+ Handle_TColStd_HSequenceOfTransient theTrRoots;
+};
+
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+// Workaround: Handles for none-cdl classes.
+// Delete this file after transformation all classes to none-cdl ones.
+
+#ifndef _Transfer_TransientProcess_Handle_HeaderFile
+#define _Transfer_TransientProcess_Handle_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <MMgt_TShared.hxx>
+
+DEFINE_STANDARD_HANDLE(Transfer_TransientProcess,MMgt_TShared)
+
+typedef Handle(Transfer_TransientProcess) Transfer_TransientProcess_Handle;
+
+#endif
--- /dev/null
+TransferBRep_Reader.hxx
+TransferBRep_Reader.cxx
+TransferBRep_ShapeMapper.hxx
+TransferBRep_ShapeMapper.cxx
+TransferBRep_ShapeMapper_Handle.hxx
+TransferBRep_BinderOfShape.hxx
+TransferBRep_BinderOfShape.cxx
+TransferBRep_ShapeBinder.hxx
+TransferBRep_ShapeBinder.cxx
\ No newline at end of file
is
- class Reader;
+ imported Reader;
-- class Analyzer;
class ShapeInfo;
- class BinderOfShape instantiates SimpleBinder from Transfer
- (Shape from TopoDS, ShapeInfo);
-
- class ShapeBinder;
+ imported BinderOfShape;
+ imported ShapeBinder;
class ShapeListBinder;
- class ShapeMapper instantiates Mapper from Transfer
- (Shape from TopoDS, ShapeMapHasher from TopTools, ShapeInfo);
- class OrientedShapeMapper instantiates Mapper from Transfer
- (Shape from TopoDS, OrientedShapeMapHasher from TopTools, ShapeInfo);
+ imported ShapeMapper;
+ imported ShapeMapper_Handle;
class TransferResultInfo;
class SequenceOfTransferResultInfo instantiates Sequence from TCollection
---Purpose : Get the Shape recorded in a Binder
-- If the Binder brings a multiple result, search for the Shape
- ShapeResult (TP : TransientProcess from Transfer; ent : Transient)
+ ShapeResult (TP : TransientProcess_Handle from Transfer; ent : Transient)
returns Shape from TopoDS;
---Purpose : Get the Shape recorded in a TransientProcess as result of the
-- Transfer of an entity. I.E. in the binder bound to that Entity
-- If no result or result not a single Shape, returns a Null Shape
- SetShapeResult (TP : mutable TransientProcess from Transfer; ent : Transient;
+ SetShapeResult (TP : TransientProcess_Handle from Transfer; ent : Transient;
result : Shape from TopoDS);
---Purpose : Sets a Shape as a result for a starting entity <ent>
-- (reverse of ShapeResult)
-- It simply creates a ShapeBinder then binds it to the entity
- Shapes (TP : TransientProcess from Transfer; rootsonly : Boolean = Standard_True)
+ Shapes (TP : TransientProcess_Handle from Transfer; rootsonly : Boolean = Standard_True)
returns HSequenceOfShape from TopTools;
---Purpose : Gets the Shapes recorded in a TransientProcess as result of a
-- Transfer, considers roots only or all results according
-- <rootsonly>, returns them as a HSequence
- Shapes (TP : TransientProcess from Transfer;
+ Shapes (TP : TransientProcess_Handle from Transfer;
list : HSequenceOfTransient from TColStd)
returns HSequenceOfShape from TopTools;
---Purpose : Gets the Shapes recorded in a TransientProcess as result of a
-- the shapes as a HSequence
- ShapeState (FP : FinderProcess from Transfer; shape : Shape from TopoDS)
+ ShapeState (FP : FinderProcess_Handle from Transfer; shape : Shape from TopoDS)
returns Orientation from TopAbs;
---Purpose : Returns a Status regarding a Shape in a FinderProcess
-- - FORWARD means bound with SAME Orientation
-- - EXTERNAL means NOT BOUND
-- - INTERNAL is not used
- ResultFromShape (FP : FinderProcess from Transfer; shape : Shape from TopoDS)
+ ResultFromShape (FP : FinderProcess_Handle from Transfer; shape : Shape from TopoDS)
returns Binder from Transfer;
---Purpose : Returns the result (as a Binder) attached to a given Shape
-- Null if none
- TransientFromShape (FP : FinderProcess from Transfer; shape : Shape from TopoDS)
+ TransientFromShape (FP : FinderProcess_Handle from Transfer; shape : Shape from TopoDS)
returns Transient;
---Purpose : Returns the result as pure Transient attached to a Shape
-- first one if multiple result
- SetTransientFromShape (FP : FinderProcess from Transfer;
+ SetTransientFromShape (FP : FinderProcess_Handle from Transfer;
shape : Shape from TopoDS; result : Transient);
---Purpose : Binds a Transient Result to a Shape in a FinderProcess
-- (as first result if multiple : does not add it to existing one)
- ShapeMapper (FP : FinderProcess from Transfer; shape : Shape from TopoDS)
- returns ShapeMapper;
+ ShapeMapper (FP : FinderProcess_Handle from Transfer; shape : Shape from TopoDS)
+ returns ShapeMapper_Handle;
---Purpose : Returns a ShapeMapper for a given Shape (location included)
-- Either <shape> is already mapped, then its Mapper is returned
-- Or it is not, then a new one is created then returned, BUT
-- Functions to collect transfer result information --
- TransferResultInfo (TP : TransientProcess from Transfer;
+ TransferResultInfo (TP : TransientProcess_Handle from Transfer;
EntityTypes: HSequenceOfTransient from TColStd;
InfoSeq : out HSequenceOfTransferResultInfo from TransferBRep);
---Purpose: Fills sequence of TransferResultInfo for each type of entity
-- compare with entities in EntityTypes.
-- TopAbs_ShapeEnum).
- TransferResultInfo (FP : FinderProcess from Transfer;
+ TransferResultInfo (FP : FinderProcess_Handle from Transfer;
ShapeTypes: HSequenceOfInteger from TColStd;
InfoSeq : out HSequenceOfTransferResultInfo from TransferBRep);
---Purpose: Fills sequence of TransferResultInfo for each type of shape
-- embedded in ShapeMapper
ResultCheckList (chl : CheckIterator from Interface;
- FP : FinderProcess from Transfer;
+ FP : FinderProcess_Handle from Transfer;
model : InterfaceModel from Interface)
returns CheckIterator from Interface;
---Purpose : Takes a starting CheckIterator which brings checks bound with
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Transfer_FinderProcess.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <TransferBRep_TransferResultInfo.hxx>
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <TransferBRep_BinderOfShape.hxx>
+
+#include <Standard_Type.hxx>
+#include <Transfer_TransferFailure.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TransferBRep_ShapeInfo.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(TransferBRep_BinderOfShape)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_Binder),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(TransferBRep_BinderOfShape)
+
+IMPLEMENT_DOWNCAST(TransferBRep_BinderOfShape,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(TransferBRep_BinderOfShape)
+
+TransferBRep_BinderOfShape::TransferBRep_BinderOfShape ()
+{ }
+
+TransferBRep_BinderOfShape::TransferBRep_BinderOfShape (const TopoDS_Shape& res)
+ : theres (res)
+{
+ SetResultPresent();
+}
+
+Handle(Standard_Type) TransferBRep_BinderOfShape::ResultType () const
+{
+ return TransferBRep_ShapeInfo::Type (theres);
+} // corresponds a "STANDARD_TYPE(TopoDS_Shape)"
+
+Standard_CString TransferBRep_BinderOfShape::ResultTypeName () const
+{
+ return TransferBRep_ShapeInfo::TypeName (theres);
+} // corresponds a "STANDARD_TYPE(TopoDS_Shape)"
+
+
+void TransferBRep_BinderOfShape::SetResult (const TopoDS_Shape& res)
+{
+ SetResultPresent();
+ theres = res;
+}
+
+const TopoDS_Shape& TransferBRep_BinderOfShape::Result () const
+{
+ return theres;
+}
+
+TopoDS_Shape& TransferBRep_BinderOfShape::CResult ()
+{
+ SetResultPresent(); return theres;
+}
\ No newline at end of file
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _TransferBRep_BinderOfShape_HeaderFile
+#define _TransferBRep_BinderOfShape_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Transfer_Binder.hxx>
+#include <Handle_Standard_Type.hxx>
+#include <Standard_CString.hxx>
+
+class Transfer_TransferFailure;
+class TopoDS_Shape;
+class TransferBRep_ShapeInfo;
+class Standard_Type;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Transfer_Binder);
+class TransferBRep_BinderOfShape;
+
+DEFINE_STANDARD_HANDLE(TransferBRep_BinderOfShape,Transfer_Binder)
+
+class TransferBRep_BinderOfShape : public Transfer_Binder
+{
+public:
+ Standard_EXPORT TransferBRep_BinderOfShape();
+
+ Standard_EXPORT TransferBRep_BinderOfShape(const TopoDS_Shape& res);
+
+ Standard_EXPORT Handle_Standard_Type ResultType() const;
+
+ Standard_EXPORT Standard_CString ResultTypeName() const;
+
+ Standard_EXPORT void SetResult(const TopoDS_Shape& res) ;
+
+ Standard_EXPORT const TopoDS_Shape& Result() const;
+
+ Standard_EXPORT TopoDS_Shape& CResult() ;
+
+ DEFINE_STANDARD_RTTI(TransferBRep_BinderOfShape)
+
+private:
+ TopoDS_Shape theres;
+};
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1994-10-03
--- Created by: Christian CAILLET
--- 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 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.
-
-class Reader from TransferBRep
-
- ---Purpose : This class offers a simple, easy to call, way of transferring
- -- data from interface files to Shapes from CasCade
- -- It must be specialized according to each norm/protocol, by :
- -- - defining how to read a file (specific method with protocol)
- -- - definig transfer, by providing an Actor
-
-uses CString, Transient, HSequenceOfTransient from TColStd,
- Shape from TopoDS, HSequenceOfShape from TopTools,
- InterfaceModel, Protocol from Interface, CheckIterator,
- TransientProcess from Transfer, ActorOfTransientProcess from Transfer
-
-raises OutOfRange
-
-is
-
- Create returns Reader;
- ---Purpose : Initializes a non-specialised Reader. Typically, for each norm
- -- or protocol, is will be required to define a specific Create
- -- to load a file and transfer it
-
- SetProtocol (me : in out; protocol : Protocol from Interface);
- ---Purpose : Records the protocol to be used for read and transfer roots
-
- Protocol (me) returns Protocol from Interface is virtual;
- ---Purpose : Returns the recorded Protocol
-
- SetActor (me : in out; actor : ActorOfTransientProcess from Transfer);
- ---Purpose : Records the actor to be used for transfers
-
- Actor (me) returns ActorOfTransientProcess is virtual;
- ---Purpose : Returns the recorded Actor
-
-
- SetFileStatus (me : in out; status : Integer);
- ---Purpose : Sets File Status to be interpreted as follows :
- -- = 0 OK
- -- < 0 file not found
- -- > 0 read error, no Model could be created
-
- FileStatus (me) returns Integer;
- ---Purpose : Returns the File Status
-
- FileNotFound (me) returns Boolean;
- ---Purpose : Returns True if FileStatus is for FileNotFound
-
- SyntaxError (me) returns Boolean;
- ---Purpose : Returns True if FileStatus is for Error during read
- -- (major error; for local error, see CheckModel)
-
- SetModel (me : in out; model : InterfaceModel);
- ---Purpose : Specifies a Model to work on
- -- Also clears the result and Done status
-
- Model (me) returns InterfaceModel;
- ---Purpose : Returns the Model to be worked on
-
- Clear (me : in out);
- ---Purpose : clears the result and Done status. But not the Model.
-
- CheckStatusModel (me; withprint : Boolean) returns Boolean;
- ---Purpose : Checks the Model. Returns True if there is NO FAIL at all
- -- (regardless Warnings)
- -- If <withprint> is True, also sends Checks on standard output
-
- CheckListModel (me) returns CheckIterator;
- ---Purpose : Checks the Model (complete : syntax + semantic) and returns
- -- the produced Check List
-
- ModeNewTransfer (me : in out) returns Boolean;
- ---Purpose : Returns (by Reference, hence can be changed) the Mode for new
- -- Transfer : True (D) means that each new Transfer produces a
- -- new TransferProcess. Else keeps the original one but each
- -- Transfer clears its (former results are not kept)
- ---C++ : return &
-
- BeginTransfer (me : in out) returns Boolean;
- ---Purpose : Initializes the Reader for a Transfer (one,roots, or list)
- -- Also calls PrepareTransfer
- -- Returns True when done, False if could not be done
-
- EndTransfer (me : in out);
- ---Purpose : Ebds a Transfer (one, roots or list) by recording its result
-
- PrepareTransfer (me : in out) is virtual;
- ---Purpose : Prepares the Transfer. Also can act on the Actor or change the
- -- TransientProcess if required.
- -- Should not set the Actor into the TransientProcess, it is done
- -- by caller. The provided default does nothing.
-
- TransferRoots (me : in out) is virtual;
- ---Purpose : Transfers all Root Entities which are recognized as Geom-Topol
- -- The result will be a list of Shapes.
- -- This method calls user redefinable PrepareTransfer
- -- Remark : former result is cleared
-
- Transfer (me : in out; num : Integer) returns Boolean is virtual;
- ---Purpose : Transfers an Entity given its rank in the Model (Root or not)
- -- Returns True if it is recognized as Geom-Topol.
- -- (But it can have failed : see IsDone)
-
- TransferList (me : in out; list : HSequenceOfTransient) is virtual;
- ---Purpose : Transfers a list of Entities (only the ones also in the Model)
- -- Remark : former result is cleared
-
- IsDone (me) returns Boolean;
- ---Purpose : Returns True if the LAST Transfer/TransferRoots was a success
-
- NbShapes (me) returns Integer;
- ---Purpose : Returns the count of produced Shapes (roots)
-
- Shapes (me) returns HSequenceOfShape;
- ---Purpose : Returns the complete list of produced Shapes
-
- Shape (me; num : Integer = 1) returns Shape from TopoDS
- ---Purpose : Returns a Shape given its rank, by default the first one
- raises OutOfRange;
- -- Error if num < 1 or num > NbShapes
- ---C++ : return const &
-
- ShapeResult (me; ent : Transient) returns Shape from TopoDS;
- ---Purpose : Returns a Shape produced from a given entity (if it was
- -- individually transferred or if an intermediate result is
- -- known). If no Shape is bound with <ent>, returns a Null Shape
- -- Warning : Runs on the last call to Transfer,TransferRoots,TransferList
-
- OneShape (me) returns Shape from TopoDS;
- ---Purpose : Returns a unique Shape for the result :
- -- - a void Shape (type = SHAPE) if result is empty
- -- - a simple Shape if result has only one : returns this one
- -- - a Compound if result has more than one Shape
-
- NbTransients (me) returns Integer;
- ---Purpose : Returns the count of produced Transient Results (roots)
-
- Transients (me) returns HSequenceOfTransient;
- ---Purpose : Returns the complete list of produced Transient Results
-
- Transient (me; num : Integer = 1) returns any Transient
- ---Purpose : Returns a Transient Root Result, given its rank (by default
- -- the first one)
- raises OutOfRange;
- -- Error if num < 1 or num > NbShapes
-
-
- CheckStatusResult (me; withprints : Boolean) returns Boolean;
- ---Purpose : Checks the Result of last Transfer (individual or roots, no
- -- cumulation on several transfers). Returns True if NO fail
- -- occured during Transfer (queries the TransientProcess)
-
- CheckListResult (me) returns CheckIterator;
- ---Purpose : Checks the Result of last Transfer (individual or roots, no
- -- cumulation on several transfers) and returns the produced list
-
- TransientProcess (me) returns TransientProcess;
- ---Purpose : Returns the TransientProcess. It records informations about
- -- the very last transfer done. Null if no transfer yet done.
- -- Can be used for queries more accurate than the default ones.
-
- Destroy (me: in out) is virtual;
- ---C++ : alias "Standard_EXPORT virtual ~TransferBRep_Reader() { Destroy(); }"
-
-
-fields
-
- theProto : Protocol from Interface;
- theActor : ActorOfTransientProcess from Transfer;
- theModel : InterfaceModel;
- theFilest : Integer;
- theDone : Boolean is protected;
- theNewpr : Boolean;
- theProc : TransientProcess is protected;
- theShapes : HSequenceOfShape;
- theTransi : HSequenceOfTransient;
-
-end Reader;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <TransferBRep_Reader.ixx>
-
+#include <TransferBRep_Reader.hxx>
+#include <Interface_Protocol.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <Interface_CheckIterator.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Standard_Transient.hxx>
#include <Interface_Macros.hxx>
#include <Interface_CheckTool.hxx>
#include <Transfer_TransferOutput.hxx>
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _TransferBRep_Reader_HeaderFile
+#define _TransferBRep_Reader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Handle_Interface_Protocol.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Boolean.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Handle_TopTools_HSequenceOfShape.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Handle_Standard_Transient.hxx>
+
+class Interface_Protocol;
+class Transfer_ActorOfTransientProcess;
+class Interface_InterfaceModel;
+class Transfer_TransientProcess;
+class TopTools_HSequenceOfShape;
+class TColStd_HSequenceOfTransient;
+class Standard_OutOfRange;
+class Interface_CheckIterator;
+class TopoDS_Shape;
+class Standard_Transient;
+
+
+//! This class offers a simple, easy to call, way of transferring <br>
+//! data from interface files to Shapes from CasCade <br>
+//! It must be specialized according to each norm/protocol, by : <br>
+//! - defining how to read a file (specific method with protocol) <br>
+//! - definig transfer, by providing an Actor <br>
+class TransferBRep_Reader
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Initializes a non-specialised Reader. Typically, for each norm <br>
+//! or protocol, is will be required to define a specific Create <br>
+//! to load a file and transfer it <br>
+ Standard_EXPORT TransferBRep_Reader();
+ //! Records the protocol to be used for read and transfer roots <br>
+ Standard_EXPORT void SetProtocol(const Handle(Interface_Protocol)& protocol) ;
+ //! Returns the recorded Protocol <br>
+ Standard_EXPORT virtual Handle_Interface_Protocol Protocol() const;
+ //! Records the actor to be used for transfers <br>
+ Standard_EXPORT void SetActor(const Handle(Transfer_ActorOfTransientProcess)& actor) ;
+ //! Returns the recorded Actor <br>
+ Standard_EXPORT virtual Handle_Transfer_ActorOfTransientProcess Actor() const;
+ //! Sets File Status to be interpreted as follows : <br>
+//! = 0 OK <br>
+//! < 0 file not found <br>
+//! > 0 read error, no Model could be created <br>
+ Standard_EXPORT void SetFileStatus(const Standard_Integer status) ;
+ //! Returns the File Status <br>
+ Standard_EXPORT Standard_Integer FileStatus() const;
+ //! Returns True if FileStatus is for FileNotFound <br>
+ Standard_EXPORT Standard_Boolean FileNotFound() const;
+ //! Returns True if FileStatus is for Error during read <br>
+//! (major error; for local error, see CheckModel) <br>
+ Standard_EXPORT Standard_Boolean SyntaxError() const;
+ //! Specifies a Model to work on <br>
+//! Also clears the result and Done status <br>
+ Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& model) ;
+ //! Returns the Model to be worked on <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model() const;
+ //! clears the result and Done status. But not the Model. <br>
+ Standard_EXPORT void Clear() ;
+ //! Checks the Model. Returns True if there is NO FAIL at all <br>
+//! (regardless Warnings) <br>
+//! If <withprint> is True, also sends Checks on standard output <br>
+ Standard_EXPORT Standard_Boolean CheckStatusModel(const Standard_Boolean withprint) const;
+ //! Checks the Model (complete : syntax + semantic) and returns <br>
+//! the produced Check List <br>
+ Standard_EXPORT Interface_CheckIterator CheckListModel() const;
+ //! Returns (by Reference, hence can be changed) the Mode for new <br>
+//! Transfer : True (D) means that each new Transfer produces a <br>
+//! new TransferProcess. Else keeps the original one but each <br>
+//! Transfer clears its (former results are not kept) <br>
+ Standard_EXPORT Standard_Boolean& ModeNewTransfer() ;
+ //! Initializes the Reader for a Transfer (one,roots, or list) <br>
+//! Also calls PrepareTransfer <br>
+//! Returns True when done, False if could not be done <br>
+ Standard_EXPORT Standard_Boolean BeginTransfer() ;
+ //! Ebds a Transfer (one, roots or list) by recording its result <br>
+ Standard_EXPORT void EndTransfer() ;
+ //! Prepares the Transfer. Also can act on the Actor or change the <br>
+//! TransientProcess if required. <br>
+//! Should not set the Actor into the TransientProcess, it is done <br>
+//! by caller. The provided default does nothing. <br>
+ Standard_EXPORT virtual void PrepareTransfer() ;
+ //! Transfers all Root Entities which are recognized as Geom-Topol <br>
+//! The result will be a list of Shapes. <br>
+//! This method calls user redefinable PrepareTransfer <br>
+//! Remark : former result is cleared <br>
+ Standard_EXPORT virtual void TransferRoots() ;
+ //! Transfers an Entity given its rank in the Model (Root or not) <br>
+//! Returns True if it is recognized as Geom-Topol. <br>
+//! (But it can have failed : see IsDone) <br>
+ Standard_EXPORT virtual Standard_Boolean Transfer(const Standard_Integer num) ;
+ //! Transfers a list of Entities (only the ones also in the Model) <br>
+//! Remark : former result is cleared <br>
+ Standard_EXPORT virtual void TransferList(const Handle(TColStd_HSequenceOfTransient)& list) ;
+ //! Returns True if the LAST Transfer/TransferRoots was a success <br>
+ Standard_EXPORT Standard_Boolean IsDone() const;
+ //! Returns the count of produced Shapes (roots) <br>
+ Standard_EXPORT Standard_Integer NbShapes() const;
+ //! Returns the complete list of produced Shapes <br>
+ Standard_EXPORT Handle_TopTools_HSequenceOfShape Shapes() const;
+ //! Returns a Shape given its rank, by default the first one <br>
+ Standard_EXPORT const TopoDS_Shape& Shape(const Standard_Integer num = 1) const;
+ //! Returns a Shape produced from a given entity (if it was <br>
+//! individually transferred or if an intermediate result is <br>
+//! known). If no Shape is bound with <ent>, returns a Null Shape <br>
+//! Warning : Runs on the last call to Transfer,TransferRoots,TransferList <br>
+ Standard_EXPORT TopoDS_Shape ShapeResult(const Handle(Standard_Transient)& ent) const;
+ //! Returns a unique Shape for the result : <br>
+//! - a void Shape (type = SHAPE) if result is empty <br>
+//! - a simple Shape if result has only one : returns this one <br>
+//! - a Compound if result has more than one Shape <br>
+ Standard_EXPORT TopoDS_Shape OneShape() const;
+ //! Returns the count of produced Transient Results (roots) <br>
+ Standard_EXPORT Standard_Integer NbTransients() const;
+ //! Returns the complete list of produced Transient Results <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient Transients() const;
+ //! Returns a Transient Root Result, given its rank (by default <br>
+//! the first one) <br>
+ Standard_EXPORT Handle_Standard_Transient Transient(const Standard_Integer num = 1) const;
+ //! Checks the Result of last Transfer (individual or roots, no <br>
+//! cumulation on several transfers). Returns True if NO fail <br>
+//! occured during Transfer (queries the TransientProcess) <br>
+ Standard_EXPORT Standard_Boolean CheckStatusResult(const Standard_Boolean withprints) const;
+ //! Checks the Result of last Transfer (individual or roots, no <br>
+//! cumulation on several transfers) and returns the produced list <br>
+ Standard_EXPORT Interface_CheckIterator CheckListResult() const;
+ //! Returns the TransientProcess. It records informations about <br>
+//! the very last transfer done. Null if no transfer yet done. <br>
+//! Can be used for queries more accurate than the default ones. <br>
+ Standard_EXPORT Handle_Transfer_TransientProcess TransientProcess() const;
+
+ Standard_EXPORT virtual void Destroy() ;
+Standard_EXPORT virtual ~TransferBRep_Reader() { Destroy(); }
+
+
+
+
+
+protected:
+
+
+
+Standard_Boolean theDone;
+Handle_Transfer_TransientProcess theProc;
+
+
+private:
+
+
+
+Handle_Interface_Protocol theProto;
+Handle_Transfer_ActorOfTransientProcess theActor;
+Handle_Interface_InterfaceModel theModel;
+Standard_Integer theFilest;
+Standard_Boolean theNewpr;
+Handle_TopTools_HSequenceOfShape theShapes;
+Handle_TColStd_HSequenceOfTransient theTransi;
+
+
+};
+#endif
+++ /dev/null
--- Created on: 1994-10-03
--- Created by: Assim
--- 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 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.
-
-class ShapeBinder from TransferBRep inherits BinderOfShape
-
- ---Purpose : A ShapeBinder is a BinderOfShape with some additional services
- -- to cast the Result under various kinds of Shapes
-
-uses ShapeEnum from TopAbs, Shape from TopoDS ,
- Vertex from TopoDS, Edge from TopoDS, Wire from TopoDS,
- Face from TopoDS, Shell from TopoDS, Solid from TopoDS,
- CompSolid from TopoDS, Compound from TopoDS
-
-raises TypeMismatch from Standard
-
-is
-
- Create returns mutable ShapeBinder;
- ---Purpose : Creates an empty ShapeBinder
-
- Create (res : Shape) returns mutable ShapeBinder;
- ---Purpose : Creates a ShapeBinder with a result
-
- ShapeType (me) returns ShapeEnum;
- ---Purpose : Returns the Type of the Shape Result (under TopAbs form)
-
- -- different sub-types for the Result. Result returns a Shape
-
- Vertex (me) returns Vertex raises TypeMismatch from Standard;
- Edge (me) returns Edge raises TypeMismatch from Standard;
- Wire (me) returns Wire raises TypeMismatch from Standard;
- Face (me) returns Face raises TypeMismatch from Standard;
- Shell (me) returns Shell raises TypeMismatch from Standard;
- Solid (me) returns Solid raises TypeMismatch from Standard;
- CompSolid (me) returns CompSolid raises TypeMismatch from Standard;
- Compound (me) returns Compound raises TypeMismatch from Standard;
-
-end ShapeBinder;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <TransferBRep_ShapeBinder.ixx>
+#include <TransferBRep_ShapeBinder.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
+#include <Standard_TypeMismatch.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <Standard_Type.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shell.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopoDS_CompSolid.hxx>
+#include <TopoDS_Compound.hxx>
#include <TopoDS.hxx>
+#include <Standard_Type.hxx>
+IMPLEMENT_STANDARD_TYPE(TransferBRep_ShapeBinder)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(TransferBRep_BinderOfShape),
+ STANDARD_TYPE(Transfer_Binder),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(TransferBRep_ShapeBinder)
+
+
+IMPLEMENT_DOWNCAST(TransferBRep_ShapeBinder,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(TransferBRep_ShapeBinder)
TransferBRep_ShapeBinder::TransferBRep_ShapeBinder () { }
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License..
+
+#ifndef _TransferBRep_ShapeBinder_HeaderFile
+#define _TransferBRep_ShapeBinder_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <TransferBRep_BinderOfShape.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+
+class Standard_TypeMismatch;
+class TopoDS_Shape;
+class TopoDS_Vertex;
+class TopoDS_Edge;
+class TopoDS_Wire;
+class TopoDS_Face;
+class TopoDS_Shell;
+class TopoDS_Solid;
+class TopoDS_CompSolid;
+class TopoDS_Compound;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(TransferBRep_BinderOfShape);
+class TransferBRep_ShapeBinder;
+
+DEFINE_STANDARD_HANDLE(TransferBRep_ShapeBinder,TransferBRep_BinderOfShape)
+
+//! A ShapeBinder is a BinderOfShape with some additional services <br>
+//! to cast the Result under various kinds of Shapes <br>
+class TransferBRep_ShapeBinder : public TransferBRep_BinderOfShape
+{
+
+public:
+
+ //! Creates an empty ShapeBinder <br>
+ Standard_EXPORT TransferBRep_ShapeBinder();
+ //! Creates a ShapeBinder with a result <br>
+ Standard_EXPORT TransferBRep_ShapeBinder(const TopoDS_Shape& res);
+ //! Returns the Type of the Shape Result (under TopAbs form) <br>
+ Standard_EXPORT TopAbs_ShapeEnum ShapeType() const;
+
+ Standard_EXPORT TopoDS_Vertex Vertex() const;
+
+ Standard_EXPORT TopoDS_Edge Edge() const;
+
+ Standard_EXPORT TopoDS_Wire Wire() const;
+
+ Standard_EXPORT TopoDS_Face Face() const;
+
+ Standard_EXPORT TopoDS_Shell Shell() const;
+
+ Standard_EXPORT TopoDS_Solid Solid() const;
+
+ Standard_EXPORT TopoDS_CompSolid CompSolid() const;
+
+ Standard_EXPORT TopoDS_Compound Compound() const;
+
+
+ DEFINE_STANDARD_RTTI(TransferBRep_ShapeBinder)
+
+};
+#endif
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#include <TransferBRep_ShapeMapper.hxx>
+#include <Standard_Type.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+#include <TransferBRep_ShapeInfo.hxx>
+#include <Transfer_Finder.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(TransferBRep_ShapeMapper)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(Transfer_Finder),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(TransferBRep_ShapeMapper)
+
+
+IMPLEMENT_DOWNCAST(TransferBRep_ShapeMapper,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(TransferBRep_ShapeMapper)
\ No newline at end of file
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _TransferBRep_ShapeMapper_HeaderFile
+#define _TransferBRep_ShapeMapper_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <Transfer_Mapper.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Transfer_Finder.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Transfer_Finder.hxx>
+#include <Handle_Standard_Type.hxx>
+#include <Standard_CString.hxx>
+#include <TransferBRep_ShapeInfo.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+
+class TopoDS_Shape;
+class TopTools_ShapeMapHasher;
+class TransferBRep_ShapeInfo;
+class Transfer_Finder;
+class Standard_Type;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(Transfer_Finder);
+
+DEFINE_STANDARD_HANDLE(TransferBRep_ShapeMapper,Transfer_Finder)
+
+
+class TransferBRep_ShapeMapper : public Transfer_Mapper<TopoDS_Shape,
+ TopTools_ShapeMapHasher,
+ TransferBRep_ShapeInfo,
+ Handle(TransferBRep_ShapeMapper)>
+ {
+public:
+ Standard_EXPORT TransferBRep_ShapeMapper(const TopoDS_Shape& theShape)
+ : Transfer_Mapper<TopoDS_Shape,
+ TopTools_ShapeMapHasher,
+ TransferBRep_ShapeInfo,
+ Handle(TransferBRep_ShapeMapper)> (theShape)
+ { }
+
+ DEFINE_STANDARD_RTTI(TransferBRep_ShapeMapper)
+ };
+#endif
--- /dev/null
+// Copyright (c) 1999-2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _TransferBRep_ShapeMapper_Handle_HeaderFile
+#define _TransferBRep_ShapeMapper_Handle_HeaderFile
+
+#include <TransferBRep_ShapeMapper.hxx>
+
+typedef Handle(TransferBRep_ShapeMapper) TransferBRep_ShapeMapper_Handle;
+
+#endif
\ No newline at end of file
WireData from ShapeExtend,
Wire from ShapeAnalysis,
Wire from ShapeFix,
- TransientProcess from Transfer,
- FinderProcess from Transfer,
+ TransientProcess_Handle from Transfer,
+ FinderProcess_Handle from Transfer,
ProgressIndicator from Message
is
-- and corrects it if necessary.
---Remark : In Open CASCADE does nothing.
- MergeTransferInfo (me; TP : TransientProcess from Transfer;
+ MergeTransferInfo (me; TP : TransientProcess_Handle from Transfer;
info: Transient;
startTPitem: Integer = 1) is virtual;
- MergeTransferInfo (me; FP : FinderProcess from Transfer;
+ MergeTransferInfo (me; FP : FinderProcess_Handle from Transfer;
info: Transient) is virtual;
---Purpose: Updates translation map (TP or FP) with information
-- resulting from ShapeProcessing
#include <UnitsMethods.hxx>
#include <ShapeCustom.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Transfer_FinderProcess.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <TransferBRep_ShapeBinder.hxx>
--- /dev/null
+XSControl_Controller.hxx
+XSControl_Controller.cxx
+XSControl_TransferReader.hxx
+XSControl_TransferReader.cxx
+XSControl_TransferWriter.hxx
+XSControl_TransferWriter.cxx
+XSControl_SelectForTransfer.hxx
+XSControl_SelectForTransfer.cxx
+XSControl_WorkSession.hxx
+XSControl_WorkSession.cxx
+XSControl_WorkSession_Handle.hxx
+XSControl_Reader.hxx
+XSControl_Reader.cxx
+XSControl_Writer.hxx
+XSControl_Writer.cxx
+XSControl_SignTransferStatus.hxx
+XSControl_SignTransferStatus.cxx
+XSControl_ConnectedShapes.hxx
+XSControl_ConnectedShapes.cxx
is
- deferred class Controller;
- class TransferReader;
- class TransferWriter;
-
- class WorkSession;
- class SelectForTransfer;
- class SignTransferStatus;
- class ConnectedShapes;
-
- class Reader;
- class Writer;
+ imported Controller;
+ imported TransferReader;
+ imported TransferWriter;
+
+ imported WorkSession;
+ imported WorkSession_Handle; --workaround to allow WOK detect handle of non-cdl class
+ imported SelectForTransfer;
+ imported SignTransferStatus;
+ imported ConnectedShapes;
+
+ imported Reader;
+ imported Writer;
class Functions;
class FuncShape;
class Utils;
class Vars;
- Session (pilot : SessionPilot from IFSelect) returns WorkSession from XSControl;
+ Session (pilot : SessionPilot from IFSelect) returns WorkSession_Handle from XSControl;
---Purpose : Returns the WorkSession of a SessionPilot, but casts it as
-- from XSControl : it then gives access to Control & Transfers
+++ /dev/null
--- Created on: 1999-02-24
--- Created by: Christian CAILLET
--- Copyright (c) 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 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.
-
-class ConnectedShapes from XSControl inherits SelectExplore from IFSelect
-
- ---Purpose : From a TopoDS_Shape, or from the entity which has produced it,
- -- searches for the shapes, and the entities which have produced
- -- them in last transfer, which are adjacent to it by VERTICES
-
-uses AsciiString, Transient, Graph, EntityIterator,
- HSequenceOfTransient from TColStd,
- Shape from TopoDS, ShapeEnum from TopAbs,
- TransientProcess from Transfer, TransferReader from XSControl
-
-is
-
- Create returns ConnectedShapes;
- ---Purpose : Creates a Selection ConnectedShapes. It remains to be set a
- -- TransferReader
-
- Create (TR : TransferReader) returns ConnectedShapes;
- ---Purpose : Creates a Selection ConnectedShapes, which will work with the
- -- current TransferProcess brought by the TransferReader
-
- SetReader (me : mutable; TR : TransferReader);
- ---Purpose : Sets a TransferReader to sort entities : it brings the
- -- TransferProcess which may change, while the TransferReader does not
-
- Explore (me; level : Integer; ent : Transient; G : Graph;
- explored : in out EntityIterator)
- returns Boolean;
- ---Purpose : Explores an entity : entities from which are connected to that
- -- produced by this entity, including itself
-
-
- ExploreLabel (me) returns AsciiString from TCollection;
- ---Purpose : Returns a text defining the criterium.
- -- "Connected Entities through produced Shapes"
-
-
- AdjacentEntities (myclass;
- ashape : Shape from TopoDS;
- TP : TransientProcess from Transfer;
- type : ShapeEnum from TopAbs)
- returns HSequenceOfTransient;
- ---Purpose : This functions considers a shape from a transfer and performs
- -- the search function explained above
-
-fields
-
- theTR : TransferReader;
-
-end ConnectedShapes;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSControl_ConnectedShapes.ixx>
+#include <XSControl_ConnectedShapes.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TransferBRep.hxx>
+#include <Standard_Type.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_Graph.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <TopoDS_Shape.hxx>
+IMPLEMENT_STANDARD_TYPE(XSControl_ConnectedShapes)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IFSelect_SelectExplore),
+ STANDARD_TYPE(IFSelect_SelectDeduct),
+ STANDARD_TYPE(IFSelect_Selection),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSControl_ConnectedShapes)
+
+
+IMPLEMENT_DOWNCAST(XSControl_ConnectedShapes,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSControl_ConnectedShapes)
XSControl_ConnectedShapes::XSControl_ConnectedShapes ()
: IFSelect_SelectExplore (1) { }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSControl_ConnectedShapes_HeaderFile
+#define _XSControl_ConnectedShapes_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <IFSelect_SelectExplore.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+
+class Standard_Transient;
+class Interface_Graph;
+class Interface_EntityIterator;
+class TCollection_AsciiString;
+class TColStd_HSequenceOfTransient;
+class Handle(Standard_Type);
+class Handle(IFSelect_SelectExplore);
+class TopoDS_Shape;
+
+DEFINE_STANDARD_HANDLE(XSControl_ConnectedShapes,IFSelect_SelectExplore)
+
+//! From a TopoDS_Shape, or from the entity which has produced it, <br>
+//! searches for the shapes, and the entities which have produced <br>
+//! them in last transfer, which are adjacent to it by VERTICES <br>
+class XSControl_ConnectedShapes : public IFSelect_SelectExplore
+{
+public:
+
+ //! Creates a Selection ConnectedShapes. It remains to be set a <br>
+ //! TransferReader <br>
+ Standard_EXPORT XSControl_ConnectedShapes();
+
+ //! Creates a Selection ConnectedShapes, which will work with the <br>
+ //! current TransferProcess brought by the TransferReader <br>
+ Standard_EXPORT XSControl_ConnectedShapes(const Handle(XSControl_TransferReader)& TR);
+
+ //! Sets a TransferReader to sort entities : it brings the <br>
+ //! TransferProcess which may change, while the TransferReader does not <br>
+ Standard_EXPORT void SetReader(const Handle(XSControl_TransferReader)& TR);
+
+ //! Explores an entity : entities from which are connected to that <br>
+ //! produced by this entity, including itself <br>
+ Standard_EXPORT Standard_Boolean Explore(const Standard_Integer level,
+ const Handle(Standard_Transient)& ent,
+ const Interface_Graph& G,
+ Interface_EntityIterator& explored) const;
+
+ //! Returns a text defining the criterium. <br>
+ //! "Connected Entities through produced Shapes" <br>
+ Standard_EXPORT TCollection_AsciiString ExploreLabel() const;
+
+ //! This functions considers a shape from a transfer and performs <br>
+ //! the search function explained above <br>
+ Standard_EXPORT static Handle_TColStd_HSequenceOfTransient AdjacentEntities(const TopoDS_Shape& ashape,
+ const Handle(Transfer_TransientProcess)& TP,
+ const TopAbs_ShapeEnum type) ;
+
+ DEFINE_STANDARD_RTTI(XSControl_ConnectedShapes)
+
+private:
+ Handle(XSControl_TransferReader) theTR;
+
+};
+#endif
+++ /dev/null
--- Created on: 1995-03-13
--- 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 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.
-
-deferred class Controller from XSControl inherits TShared
-
- ---Purpose : This class allows a general X-STEP engine to run generic
- -- functions on any interface norm, in the same way. It includes
- -- the transfer operations. I.e. it gathers the already available
- -- general modules, the engine has just to know it
- --
- -- The important point is that a given X-STEP Controller is
- -- attached to a given couple made of an Interface Norm (such as
- -- IGES-5.1) and an application data model (CasCade Shapes for
- -- instance).
- --
- -- A Controller brings a Profile, this allows to have several
- -- variants on the same basic definition, for instance keep the
- -- norm definition but give several transfer actors, etc
- --
- -- Finally, Controller can be gathered in a general dictionary then
- -- retreived later by a general call (method Recorded)
- --
- -- It does not manage the produced data, but the Actors make the
- -- link between the norm and the application
-
-uses CString, AsciiString, SequenceOfTransient, SequenceOfInteger,
- DictionaryOfTransient, DictionaryOfInteger,
- HArray1OfHAsciiString from Interface,
- HSequenceOfHAsciiString from TColStd,
- Protocol from Interface,
- Signature from IFSelect,
- InterfaceModel from Interface,
- CheckIterator from Interface,
- ActorOfTransientProcess from Transfer,
- ActorOfFinderProcess from Transfer,
- FinderProcess from Transfer,
- Shape from TopoDS,
- WorkLibrary from IFSelect,
- Profile from IFSelect,
- WorkSession from XSControl,
- ReturnStatus from IFSelect
-
-raises DomainError
-
-is
-
- Initialize (longname, shortname : CString);
- ---Purpose : Initializing with names
- -- <longname> is for the complete, official, long name
- -- <shortname> is for the short name used for resources
-
- SetNames (me : mutable; longname, shortname : CString);
- ---Purpose : Changes names
- -- if a name is empty, the formerly set one remains
- -- Remark : Does not call Record or AutoRecord
-
- AutoRecord (me) raises DomainError;
- ---Purpose : Records <me> is a general dictionary under Short and Long
- -- Names (see method Name)
-
- Record (me; name : CString) raises DomainError;
- ---Purpose : Records <me> in a general dictionary under a name
- -- Error if <name> already used for another one
-
- Recorded (myclass; name : CString) returns mutable Controller;
- ---Purpose : Returns the Controller attached to a given name
- -- Returns a Null Handle if <name> is unknown
-
- ListRecorded (myclass; mode : Integer = 0) returns HSequenceOfHAsciiString;
- ---Purpose : Returns the list of names of recorded norms, according to mode
- -- = 0 (D) : all the recorded names
- -- < 0 : for each distinct norm, its resource (short) name
- -- > 0 : for each distinct norm, its complete (long) name
-
- Name (me; rsc : Boolean = Standard_False) returns CString;
- ---Purpose : Returns a name, as given when initializing :
- -- rsc = False (D) : True Name attached to the Norm (long name)
- -- rsc = True : Name of the ressource set (i.e. short name)
-
- Profile (me) returns Profile from IFSelect;
- ---Purpose : Returns the Profile
- -- It starts with a first configuration Base (empty) and the
- -- following options :
- -- protocol for the Protocol
- -- sign-type for the SignType (Default Signature for Type)
- -- access for the WorkLibrary
- -- tr-read for ActorRead (import processor)
- -- tr-write for ActorWrite (export processor)
-
- DefineProfile (me : mutable; confname : CString);
- ---Purpose : Considers the current state of the Controller as defining a
- -- configuration, newly created or already existing
-
- SetProfile (me : mutable; confname : CString) returns Boolean;
- ---Purpose : Sets the Controller in a given Configuration of its Profile
- -- Calls SettingProfile (which can be redefined)
- --
- -- Returns True if done, False if <confname> unknown
-
- SettingProfile (me : mutable; confname : CString)
- returns Boolean is virtual;
- ---Purpose : This method is called by SetProfile, it can be redefined
- -- for specific sub-class of Controller
- -- The default does nothing
-
- ApplyProfile (me : mutable; WS : WorkSession from XSControl; confname : CString)
- returns Boolean;
- ---Purpose : Applies a Configuration of the Profile to the WorkSession
- -- I.E. calls SetProfile then fills WorkSession with definitions
-
- ApplyingProfile (me : mutable; WS : WorkSession from XSControl; confname : CString)
- returns Boolean is virtual;
- ---Purpose : Called by ApplyProfile, can be redefined for specific
- -- sub-class of Controller
- -- The default does nothing
-
-
- Protocol (me) returns Protocol from Interface;
- ---Purpose : Returns the Protocol attached to the Norm (from field)
-
- SignType (me) returns Signature from IFSelect;
- ---Purpose : Returns the SignType attached to the norm (from field)
-
- WorkLibrary (me) returns WorkLibrary from IFSelect;
- ---Purpose : Returns the WorkLibrary attached to the Norm. Remark that it
- -- has to be in phase with the Protocol (read from field)
-
- NewModel (me) returns mutable InterfaceModel from Interface is deferred;
- ---Purpose : Creates a new empty Model ready to receive data of the Norm
- -- Used to write data from Imagine to an interface file
-
- ActorRead (me; model : InterfaceModel)
- returns mutable ActorOfTransientProcess from Transfer is deferred;
- ---Purpose : Returns the Actor for Read attached to the pair (norm,appli)
- -- It can be adapted for data of the input Model, as required
- -- Can be read from field then adapted with Model as required
-
- ActorWrite (me) returns mutable ActorOfFinderProcess from Transfer
- is virtual;
- ---Purpose : Returns the Actor for Write attached to the pair (norm,appli)
- -- Read from field. Can be redefined
-
- UpdateStatics (me; mode : Integer; criter : CString = "") is virtual;
- ---Purpose : Updates static values
- -- <mode> precises the kind of updating : (see Items from Static)
- -- -1 : a precise static item : criter = its name
- -- 0 : all items of a family : criter = the family name
- -- 1 : all items which match regexp name : criter = regexp name
- -- By default (criter empty) should consider all relevant statics
- -- If <name> is defined, can consider only this static item
- -- The provided default method does nothing, to be redefined
-
-
- -- Writing Actions (can be redefined from ActorWrite using)
- -- These actions are ran under control of a TransferWriter
-
- SetModeWrite (me : mutable; modemin, modemax : Integer; shape : Boolean = Standard_True);
- ---Purpose : Sets mininum and maximum values for modetrans (write)
- -- Erases formerly recorded bounds and values
- -- Actually only for shape
- -- Then, for each value a little help can be attached
-
- SetModeWriteHelp (me : mutable; modetrans : Integer; help : CString;
- shape : Boolean = Standard_True);
- ---Purpose : Attaches a short line of help to a value of modetrans (write)
-
- ModeWriteBounds (me; modemin, modemax : out Integer;
- shape : Boolean = Standard_True) returns Boolean;
- ---Purpose : Returns recorded min and max values for modetrans (write)
- -- Actually only for shapes
- -- Returns True if bounds are set, False else (then, free value)
-
- IsModeWrite (me; modetrans : Integer; shape : Boolean = Standard_True)
- returns Boolean;
- ---Purpose : Tells if a value of <modetrans> is a good value(within bounds)
- -- Actually only for shapes
-
- ModeWriteHelp (me; modetrans : Integer; shape : Boolean = Standard_True)
- returns CString;
- ---Purpose : Returns the help line recorded for a value of modetrans
- -- empty if help not defined or not within bounds or if values are free
-
-
- RecognizeWriteTransient (me; obj : Transient; modetrans : Integer = 0)
- returns Boolean is virtual;
- ---Purpose : Tells if <obj> (an application object) is a valid candidate
- -- for a transfer to a Model.
- -- By default, asks the ActorWrite if known (through a
- -- TransientMapper). Can be redefined
-
- TransferWriteTransient (me; obj : Transient;
- FP : mutable FinderProcess from Transfer;
- model : mutable InterfaceModel from Interface;
- modetrans : Integer = 0)
- returns ReturnStatus is virtual;
- ---Purpose : Takes one Transient Object and transfers it to an
- -- InterfaceModel (already created, e.g. by NewModel)
- -- (result is recorded in the model by AddWithRefs)
- -- FP records produced results and checks
- --
- -- Default uses ActorWrite; can be redefined as necessary
- -- Returned value is a status, as follows :
- -- 0 OK , 1 No Result , 2 Fail (e.g. exception raised)
- -- -1 bad conditions , -2 bad model or null model
- -- For type of object not recognized : should return 1
-
- RecognizeWriteShape (me; shape : Shape from TopoDS; modetrans: Integer = 0)
- returns Boolean is virtual;
- ---Purpose : Tells if a shape is valid for a transfer to a model
- -- Asks the ActorWrite (through a ShapeMapper)
-
- TransferWriteShape (me; shape : Shape from TopoDS;
- FP : mutable FinderProcess from Transfer;
- model : mutable InterfaceModel from Interface;
- modetrans : Integer = 0)
- returns ReturnStatus is virtual;
- ---Purpose : Takes one Shape and transfers it to an
- -- InterfaceModel (already created, e.g. by NewModel)
- -- Default uses ActorWrite; can be redefined as necessary
- -- Returned value is a status, as follows :
- -- Done OK , Void : No Result , Fail : Fail (e.g. exception)
- -- Error : bad conditions , bad model or null model
- -- Resolution of file clusters
- -- According to each norm, there can (or not) be files of which
- -- definition is not complete but refers to other files : this defines
- -- a file cluster.
- -- It can then be resolved by two calls :
- -- - ClusterContext prepares the resolution, specific of each case
- -- - ResolveCluster performs the resolution, its result consists in
- -- having all data gathered in one final model
-
- ClusterContext (me; WS : WorkSession) returns mutable Transient is virtual;
- ---Purpose : Prepares and returns a context to resolve a cluster
- -- All data to be used are detained by the WorkSession
- -- The definition of this context is free and proper to each case
- -- remark that it is aimed to be used in ResolveCluster
- --
- -- The context must be prepared, but resolution must not have
- -- began
- --
- -- If no cluster has to be resolved, should return a null handle
- -- This is the default case, which can be redefined
-
- ResolveCluster (me; WS : mutable WorkSession; context : mutable Transient)
- returns CheckIterator is virtual;
- ---Purpose : Performs the resolution itself, from the starting data and
- -- the cluster context
- --
- -- Can fill a CheckList as necessary (especially when one or
- -- more references remain unresolved)
- --
- -- Default does nothing and returns an empty CheckList
-
- -- Additional Items as required (free list), each item is named
-
- AddControlItem (me : mutable; item : any Transient; name : CString);
- ---Purpose : Adds an item in the control list
- -- A control item of a controller is accessed by its name which
- -- is specific of a kind of item (i.e. a kind of functionnality)
- -- Adds or replaces if <name> is already recorded
-
- ControlItem (me; name : CString) returns any Transient;
- ---Purpose : Returns a control item from its name, Null if <name> unknown
- -- To be used then, it just remains to be down-casted
-
- -- To Help Session Customising --
-
- TraceStatic (me : mutable; name : CString; use : Integer);
- ---Purpose : Records the name of a Static to be traced for a given use
-
- AddSessionItem (me : mutable; item : Transient; name : CString;
- setapplied : CString = "");
- ---Purpose : Records a Session Item, to be added for customisation of the
- -- Work Session. It must have a specific name.
- -- <setapplied> is used if <item> is a GeneralModifier, to decide
- -- to which hook list it will be applied, if not empty (else,
- -- not applied to any hook list)
- -- ACTUAL : only one hook list is managed : "send"
- -- Remark : this method is to be called at Create time, the
- -- recorded items will be used by Customise
- -- Warning : if <name> conflicts, the last recorded item is kept
-
- SessionItem (me; name : CString) returns Transient;
- ---Purpose : Returns an item given its name to record in a Session
- -- If <name> is unknown, returns a Null Handle
-
- IsApplied (me; item : Transient) returns Boolean;
- ---Purpose : Returns True if <item> is recorded as <setapplied = True>
-
- Customise (me: mutable; WS : in out WorkSession) is virtual;
- ---Purpose : Customises a WorkSession, by adding to it the recorded items
- -- (by AddSessionItem), then by calling a specific method
- -- Customising, set by default to do nothing
-
- Customising (me : mutable; WS : in out WorkSession); -- is virtual
- ---Purpose : Specific customisation method, which can be redefined
- -- Default does nothing
- AdaptorSession(me) returns DictionaryOfTransient;
-
-fields
-
- theProfile : Profile;
-
- theShortName : AsciiString is protected;
- theLongName : AsciiString is protected;
-
- theAdaptorLibrary : WorkLibrary is protected;
- theAdaptorProtocol : Protocol is protected;
- theSignType : Signature is protected;
- theAdaptorRead : ActorOfTransientProcess is protected;
- theAdaptorWrite : ActorOfFinderProcess is protected;
-
- theItems : DictionaryOfTransient;
-
- theAdaptorSession : DictionaryOfTransient is protected;
- theAdaptorApplied : SequenceOfTransient;
- theAdaptorHooks : HSequenceOfHAsciiString from TColStd;
- theParams : SequenceOfTransient from TColStd;
- theParamUses : SequenceOfInteger from TColStd;
-
- theModeWriteShapeN : HArray1OfHAsciiString from Interface;
-
-end Controller;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSControl_Controller.ixx>
+#include <XSControl_Controller.hxx>
#include <IFSelect_GeneralModifier.hxx>
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
#include <Interface_Macros.hxx>
#include <Message_Messenger.hxx>
#include <Message.hxx>
+#include <Standard_Type.hxx>
+#include <IFSelect_WorkLibrary.hxx>
+#include <Interface_Protocol.hxx>
+#include <IFSelect_Signature.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Transfer_ActorOfFinderProcess.hxx>
+#include <Dico_DictionaryOfTransient.hxx>
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+#include <Interface_HArray1OfHAsciiString.hxx>
+#include <Standard_DomainError.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Standard_Transient.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Interface_CheckIterator.hxx>
+#include <XSControl_Controller.hxx>
+
+IMPLEMENT_STANDARD_TYPE(XSControl_Controller)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSControl_Controller)
+
+
+IMPLEMENT_DOWNCAST(XSControl_Controller,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSControl_Controller)
static Handle(Dico_DictionaryOfTransient)& listadapt()
{
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSControl_Controller_HeaderFile
+#define _XSControl_Controller_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <IFSelect_Profile.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <Handle_IFSelect_WorkLibrary.hxx>
+#include <Handle_Interface_Protocol.hxx>
+#include <Handle_IFSelect_Signature.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Transfer_ActorOfFinderProcess.hxx>
+#include <Handle_Dico_DictionaryOfTransient.hxx>
+#include <TColStd_SequenceOfTransient.hxx>
+#include <Handle_TColStd_HSequenceOfHAsciiString.hxx>
+#include <TColStd_SequenceOfInteger.hxx>
+#include <Handle_Interface_HArray1OfHAsciiString.hxx>
+#include <MMgt_TShared.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Transfer_FinderProcess.hxx>
+
+class IFSelect_WorkLibrary;
+class Interface_Protocol;
+class IFSelect_Signature;
+class Transfer_ActorOfTransientProcess;
+class Transfer_ActorOfFinderProcess;
+class Dico_DictionaryOfTransient;
+class TColStd_HSequenceOfHAsciiString;
+class Interface_HArray1OfHAsciiString;
+class Standard_DomainError;
+class Handle(XSControl_WorkSession);
+class Interface_InterfaceModel;
+class Standard_Transient;
+class Transfer_FinderProcess;
+class TopoDS_Shape;
+class Interface_CheckIterator;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+class XSControl_Controller;
+
+DEFINE_STANDARD_HANDLE(XSControl_Controller,MMgt_TShared)
+
+//! This class allows a general X-STEP engine to run generic <br>
+//! functions on any interface norm, in the same way. It includes <br>
+//! the transfer operations. I.e. it gathers the already available <br>
+//! general modules, the engine has just to know it <br>
+//! <br>
+//! The important point is that a given X-STEP Controller is <br>
+//! attached to a given couple made of an Interface Norm (such as <br>
+//! IGES-5.1) and an application data model (CasCade Shapes for <br>
+//! instance). <br>
+//! <br>
+//! A Controller brings a Profile, this allows to have several <br>
+//! variants on the same basic definition, for instance keep the <br>
+//! norm definition but give several transfer actors, etc <br>
+//! <br>
+//! Finally, Controller can be gathered in a general dictionary then <br>
+//! retreived later by a general call (method Recorded) <br>
+//! <br>
+//! It does not manage the produced data, but the Actors make the <br>
+//! link between the norm and the application <br>
+class XSControl_Controller : public MMgt_TShared {
+
+public:
+
+ //! Changes names <br>
+//! if a name is empty, the formerly set one remains <br>
+//! Remark : Does not call Record or AutoRecord <br>
+ Standard_EXPORT void SetNames(const Standard_CString longname,const Standard_CString shortname) ;
+ //! Records <me> is a general dictionary under Short and Long <br>
+//! Names (see method Name) <br>
+ Standard_EXPORT void AutoRecord() const;
+ //! Records <me> in a general dictionary under a name <br>
+//! Error if <name> already used for another one <br>
+ Standard_EXPORT void Record(const Standard_CString name) const;
+ //! Returns the Controller attached to a given name <br>
+//! Returns a Null Handle if <name> is unknown <br>
+ Standard_EXPORT static Handle_XSControl_Controller Recorded(const Standard_CString name) ;
+ //! Returns the list of names of recorded norms, according to mode <br>
+//! = 0 (D) : all the recorded names <br>
+//! < 0 : for each distinct norm, its resource (short) name <br>
+//! > 0 : for each distinct norm, its complete (long) name <br>
+ Standard_EXPORT static Handle_TColStd_HSequenceOfHAsciiString ListRecorded(const Standard_Integer mode = 0) ;
+ //! Returns a name, as given when initializing : <br>
+//! rsc = False (D) : True Name attached to the Norm (long name) <br>
+//! rsc = True : Name of the ressource set (i.e. short name) <br>
+ Standard_EXPORT Standard_CString Name(const Standard_Boolean rsc = Standard_False) const;
+ //! Returns the Profile <br>
+//! It starts with a first configuration Base (empty) and the <br>
+//! following options : <br>
+//! protocol for the Protocol <br>
+//! sign-type for the SignType (Default Signature for Type) <br>
+//! access for the WorkLibrary <br>
+//! tr-read for ActorRead (import processor) <br>
+//! tr-write for ActorWrite (export processor) <br>
+ Standard_EXPORT Handle_IFSelect_Profile Profile() const;
+ //! Considers the current state of the Controller as defining a <br>
+//! configuration, newly created or already existing <br>
+ Standard_EXPORT void DefineProfile(const Standard_CString confname) ;
+ //! Sets the Controller in a given Configuration of its Profile <br>
+//! Calls SettingProfile (which can be redefined) <br>
+//! <br>
+//! Returns True if done, False if <confname> unknown <br>
+ Standard_EXPORT Standard_Boolean SetProfile(const Standard_CString confname) ;
+ //! This method is called by SetProfile, it can be redefined <br>
+//! for specific sub-class of Controller <br>
+//! The default does nothing <br>
+ Standard_EXPORT virtual Standard_Boolean SettingProfile(const Standard_CString confname) ;
+ //! Applies a Configuration of the Profile to the WorkSession <br>
+//! I.E. calls SetProfile then fills WorkSession with definitions <br>
+ Standard_EXPORT Standard_Boolean ApplyProfile(const Handle(XSControl_WorkSession)& WS,const Standard_CString confname) ;
+ //! Called by ApplyProfile, can be redefined for specific <br>
+//! sub-class of Controller <br>
+//! The default does nothing <br>
+ Standard_EXPORT virtual Standard_Boolean ApplyingProfile(const Handle(XSControl_WorkSession)& WS,const Standard_CString confname) ;
+ //! Returns the Protocol attached to the Norm (from field) <br>
+ Standard_EXPORT Handle_Interface_Protocol Protocol() const;
+ //! Returns the SignType attached to the norm (from field) <br>
+ Standard_EXPORT Handle_IFSelect_Signature SignType() const;
+ //! Returns the WorkLibrary attached to the Norm. Remark that it <br>
+//! has to be in phase with the Protocol (read from field) <br>
+ Standard_EXPORT Handle_IFSelect_WorkLibrary WorkLibrary() const;
+ //! Creates a new empty Model ready to receive data of the Norm <br>
+//! Used to write data from Imagine to an interface file <br>
+ Standard_EXPORT virtual Handle_Interface_InterfaceModel NewModel() const = 0;
+ //! Returns the Actor for Read attached to the pair (norm,appli) <br>
+//! It can be adapted for data of the input Model, as required <br>
+//! Can be read from field then adapted with Model as required <br>
+ Standard_EXPORT virtual Handle_Transfer_ActorOfTransientProcess ActorRead(const Handle(Interface_InterfaceModel)& model) const = 0;
+ //! Returns the Actor for Write attached to the pair (norm,appli) <br>
+//! Read from field. Can be redefined <br>
+ Standard_EXPORT virtual Handle_Transfer_ActorOfFinderProcess ActorWrite() const;
+ //! Updates static values <br>
+//! <mode> precises the kind of updating : (see Items from Static) <br>
+//! -1 : a precise static item : criter = its name <br>
+//! 0 : all items of a family : criter = the family name <br>
+//! 1 : all items which match regexp name : criter = regexp name <br>
+//! By default (criter empty) should consider all relevant statics <br>
+//! If <name> is defined, can consider only this static item <br>
+//! The provided default method does nothing, to be redefined <br>
+ Standard_EXPORT virtual void UpdateStatics(const Standard_Integer mode,const Standard_CString criter = "") const;
+ //! Sets mininum and maximum values for modetrans (write) <br>
+//! Erases formerly recorded bounds and values <br>
+//! Actually only for shape <br>
+//! Then, for each value a little help can be attached <br>
+ Standard_EXPORT void SetModeWrite(const Standard_Integer modemin,const Standard_Integer modemax,const Standard_Boolean shape = Standard_True) ;
+ //! Attaches a short line of help to a value of modetrans (write) <br>
+ Standard_EXPORT void SetModeWriteHelp(const Standard_Integer modetrans,const Standard_CString help,const Standard_Boolean shape = Standard_True) ;
+ //! Returns recorded min and max values for modetrans (write) <br>
+//! Actually only for shapes <br>
+//! Returns True if bounds are set, False else (then, free value) <br>
+ Standard_EXPORT Standard_Boolean ModeWriteBounds(Standard_Integer& modemin,Standard_Integer& modemax,const Standard_Boolean shape = Standard_True) const;
+ //! Tells if a value of <modetrans> is a good value(within bounds) <br>
+//! Actually only for shapes <br>
+ Standard_EXPORT Standard_Boolean IsModeWrite(const Standard_Integer modetrans,const Standard_Boolean shape = Standard_True) const;
+ //! Returns the help line recorded for a value of modetrans <br>
+//! empty if help not defined or not within bounds or if values are free <br>
+ Standard_EXPORT Standard_CString ModeWriteHelp(const Standard_Integer modetrans,const Standard_Boolean shape = Standard_True) const;
+ //! Tells if <obj> (an application object) is a valid candidate <br>
+//! for a transfer to a Model. <br>
+//! By default, asks the ActorWrite if known (through a <br>
+//! TransientMapper). Can be redefined <br>
+ Standard_EXPORT virtual Standard_Boolean RecognizeWriteTransient(const Handle(Standard_Transient)& obj,const Standard_Integer modetrans = 0) const;
+ //! Takes one Transient Object and transfers it to an <br>
+//! InterfaceModel (already created, e.g. by NewModel) <br>
+//! (result is recorded in the model by AddWithRefs) <br>
+//! FP records produced results and checks <br>
+//! <br>
+//! Default uses ActorWrite; can be redefined as necessary <br>
+//! Returned value is a status, as follows : <br>
+//! 0 OK , 1 No Result , 2 Fail (e.g. exception raised) <br>
+//! -1 bad conditions , -2 bad model or null model <br>
+//! For type of object not recognized : should return 1 <br>
+ Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteTransient(const Handle(Standard_Transient)& obj,const Handle(Transfer_FinderProcess)& FP,const Handle(Interface_InterfaceModel)& model,const Standard_Integer modetrans = 0) const;
+ //! Tells if a shape is valid for a transfer to a model <br>
+//! Asks the ActorWrite (through a ShapeMapper) <br>
+ Standard_EXPORT virtual Standard_Boolean RecognizeWriteShape(const TopoDS_Shape& shape,const Standard_Integer modetrans = 0) const;
+ //! Takes one Shape and transfers it to an <br>
+//! InterfaceModel (already created, e.g. by NewModel) <br>
+//! Default uses ActorWrite; can be redefined as necessary <br>
+//! Returned value is a status, as follows : <br>
+//! Done OK , Void : No Result , Fail : Fail (e.g. exception) <br>
+//! Error : bad conditions , bad model or null model <br>
+//! Resolution of file clusters <br>
+//! According to each norm, there can (or not) be files of which <br>
+//! definition is not complete but refers to other files : this defines <br>
+//! a file cluster. <br>
+//! It can then be resolved by two calls : <br>
+//! - ClusterContext prepares the resolution, specific of each case <br>
+//! - ResolveCluster performs the resolution, its result consists in <br>
+//! having all data gathered in one final model <br>
+ Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape,const Handle(Transfer_FinderProcess)& FP,const Handle(Interface_InterfaceModel)& model,const Standard_Integer modetrans = 0) const;
+ //! Prepares and returns a context to resolve a cluster <br>
+//! All data to be used are detained by the WorkSession <br>
+//! The definition of this context is free and proper to each case <br>
+//! remark that it is aimed to be used in ResolveCluster <br>
+//! <br>
+//! The context must be prepared, but resolution must not have <br>
+//! began <br>
+//! <br>
+//! If no cluster has to be resolved, should return a null handle <br>
+//! This is the default case, which can be redefined <br>
+ Standard_EXPORT virtual Handle_Standard_Transient ClusterContext(const Handle(XSControl_WorkSession)& WS) const;
+ //! Performs the resolution itself, from the starting data and <br>
+//! the cluster context <br>
+//! <br>
+//! Can fill a CheckList as necessary (especially when one or <br>
+//! more references remain unresolved) <br>
+//! <br>
+//! Default does nothing and returns an empty CheckList <br>
+ Standard_EXPORT virtual Interface_CheckIterator ResolveCluster(const Handle(XSControl_WorkSession)& WS,const Handle(Standard_Transient)& context) const;
+ //! Adds an item in the control list <br>
+//! A control item of a controller is accessed by its name which <br>
+//! is specific of a kind of item (i.e. a kind of functionnality) <br>
+//! Adds or replaces if <name> is already recorded <br>
+ Standard_EXPORT void AddControlItem(const Handle(Standard_Transient)& item,const Standard_CString name) ;
+ //! Returns a control item from its name, Null if <name> unknown <br>
+//! To be used then, it just remains to be down-casted <br>
+ Standard_EXPORT Handle_Standard_Transient ControlItem(const Standard_CString name) const;
+ //! Records the name of a Static to be traced for a given use <br>
+ Standard_EXPORT void TraceStatic(const Standard_CString name,const Standard_Integer use) ;
+ //! Records a Session Item, to be added for customisation of the <br>
+//! Work Session. It must have a specific name. <br>
+//! <setapplied> is used if <item> is a GeneralModifier, to decide <br>
+//! to which hook list it will be applied, if not empty (else, <br>
+//! not applied to any hook list) <br>
+//! ACTUAL : only one hook list is managed : "send" <br>
+//! Remark : this method is to be called at Create time, the <br>
+//! recorded items will be used by Customise <br>
+//! Warning : if <name> conflicts, the last recorded item is kept <br>
+ Standard_EXPORT void AddSessionItem(const Handle(Standard_Transient)& item,const Standard_CString name,const Standard_CString setapplied = "") ;
+ //! Returns an item given its name to record in a Session <br>
+//! If <name> is unknown, returns a Null Handle <br>
+ Standard_EXPORT Handle_Standard_Transient SessionItem(const Standard_CString name) const;
+ //! Returns True if <item> is recorded as <setapplied = True> <br>
+ Standard_EXPORT Standard_Boolean IsApplied(const Handle(Standard_Transient)& item) const;
+ //! Customises a WorkSession, by adding to it the recorded items <br>
+//! (by AddSessionItem), then by calling a specific method <br>
+//! Customising, set by default to do nothing <br>
+ Standard_EXPORT virtual void Customise(Handle(XSControl_WorkSession)& WS) ;
+ //! Specific customisation method, which can be redefined <br>
+//! Default does nothing <br>
+ Standard_EXPORT void Customising(Handle(XSControl_WorkSession)& WS) ;
+
+ Standard_EXPORT Handle_Dico_DictionaryOfTransient AdaptorSession() const;
+
+
+
+
+ DEFINE_STANDARD_RTTI(XSControl_Controller)
+
+protected:
+
+ //! Initializing with names <br>
+//! <longname> is for the complete, official, long name <br>
+//! <shortname> is for the short name used for resources <br>
+ Standard_EXPORT XSControl_Controller(const Standard_CString longname,const Standard_CString shortname);
+
+TCollection_AsciiString theShortName;
+TCollection_AsciiString theLongName;
+Handle_IFSelect_WorkLibrary theAdaptorLibrary;
+Handle_Interface_Protocol theAdaptorProtocol;
+Handle_IFSelect_Signature theSignType;
+Handle_Transfer_ActorOfTransientProcess theAdaptorRead;
+Handle_Transfer_ActorOfFinderProcess theAdaptorWrite;
+Handle_Dico_DictionaryOfTransient theAdaptorSession;
+
+
+private:
+
+
+Handle_IFSelect_Profile theProfile;
+Handle_Dico_DictionaryOfTransient theItems;
+TColStd_SequenceOfTransient theAdaptorApplied;
+Handle_TColStd_HSequenceOfHAsciiString theAdaptorHooks;
+TColStd_SequenceOfTransient theParams;
+TColStd_SequenceOfInteger theParamUses;
+Handle_Interface_HArray1OfHAsciiString theModeWriteShapeN;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
-- basic features from user callable forms
uses CString, AsciiString from TCollection,
- WorkSession from XSControl, HSequenceOfShape from TopTools
+ WorkSession_Handle from XSControl, HSequenceOfShape from TopTools
is
Init (myclass);
---Purpose : Defines and loads all functions which work on shapes for XSControl (as ActFunc)
- MoreShapes (myclass; session : WorkSession from XSControl;
+ MoreShapes (myclass; session : WorkSession_Handle from XSControl;
list : in out mutable HSequenceOfShape from TopTools;
name : CString) returns Integer;
---Purpose : Analyses a name as designating Shapes from a Vars or from
-- completed (Append without Clear) by the Shapes found
-- Returns 0 if no Shape could be found
- FileAndVar (myclass; session : WorkSession from XSControl;
+ FileAndVar (myclass; session : WorkSession_Handle from XSControl;
file, var, def : CString;
resfile, resvar : out AsciiString from TCollection)
returns Boolean;
//#include <TransferBRep_ShapeBinder.hxx>
//#include <TransferBRep_ShapeListBinder.hxx>
//#include <TransferBRep_ShapeMapper.hxx>
-//#include <TransferBRep_OrientedShapeMapper.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_TransferReader.hxx>
+++ /dev/null
--- Created on: 1997-05-14
--- 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 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.
-
-class Reader from XSControl
-
- ---Purpose :
- -- A groundwork to convert a shape to data which complies
- -- with a particular norm. This data can be that of a whole
- -- model or that of a specific list of entities in the model.
- -- You specify the list using a single selection or a
- -- combination of selections. A selection is an operator which
- -- computes a list of entities from a list given in input. To
- -- specify the input, you can use:
- -- - A predefined selection such as "xst-transferrable-roots"
- -- - A filter based on a signature.
- -- A signature is an operator which returns a string from an
- -- entity according to its type.
- -- For example:
- -- - "xst-type" (CDL)
- -- - "iges-level"
- -- - "step-type".
- -- A filter can be based on a signature by giving a value to
- -- be matched by the string returned. For example,
- -- "xst-type(Curve)".
- -- If no list is specified, the selection computes its list of
- -- entities from the whole model. To use this class, you have to
- -- initialize the transfer norm first, as shown in the example below.
- -- Example:
- -- Control_Reader reader;
- -- IFSelect_ReturnStatus status = reader.ReadFile (filename.);
- -- When using IGESControl_Reader or STEPControl_Reader - as the
- -- above example shows - the reader initializes the norm directly.
- -- Note that loading the file only stores the data. It does
- -- not translate this data. Shapes are accumulated by
- -- successive transfers. The last shape is cleared by:
- -- - ClearShapes which allows you to handle a new batch
- -- - TransferRoots which restarts the list of shapes from scratch.
-
-uses CString, OStream, Transient,
- SequenceOfTransient from TColStd, HSequenceOfTransient from TColStd,
- InterfaceModel from Interface, WorkSession from XSControl,
- ReturnStatus from IFSelect, PrintCount from IFSelect,
- Shape from TopoDS, SequenceOfShape from TopTools
-
-is
-
- Create returns Reader;
- ---Purpose : Creates a Reader from scratch (creates an empty WorkSession)
- -- A WorkSession or a Controller must be provided before running
-
- Create (norm : CString) returns Reader;
- ---Purpose : Creates a Reader from scratch, with a norm name which
- -- identifies a Controller
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Reader;
- ---Purpose : Creates a Reader from an already existing Session, with a
- -- Controller already set
-
- ---Purpose: Virtual destructor
- ---C++ : alias "Standard_EXPORT virtual ~XSControl_Reader() {}"
-
- SetNorm (me : in out; norm : CString) returns Boolean;
- ---Purpose : Sets a specific norm to <me>
- -- Returns True if done, False if <norm> is not available
-
- SetWS (me : in out; WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True);
- ---Purpose : Sets a specific session to <me>
-
- WS (me) returns WorkSession from XSControl;
- ---Purpose : Returns the session used in <me>
-
-
- ReadFile (me : in out; filename : CString) returns ReturnStatus;
- ---Purpose : Loads a file and returns the read status
- -- Zero for a Model which compies with the Controller
-
- Model (me) returns InterfaceModel;
- ---Purpose : Returns the model. It can then be consulted (header, product)
-
- GiveList (me : in out; first, second : CString = "")
- returns HSequenceOfTransient from TColStd;
- ---Purpose : Returns a list of entities from the IGES or STEP file
- -- according to the following rules:
- -- - if first and second are empty strings, the whole file is selected.
- -- - if first is an entity number or label, the entity referred to is selected.
- -- - if first is a list of entity numbers/labels separated by commas, the entities referred to are selected,
- -- - if first is the name of a selection in the worksession and second is not defined,
- -- the list contains the standard output for that selection.
- -- - if first is the name of a selection and second is defined, the criterion defined
- -- by second is applied to the result of the first selection.
- -- A selection is an operator which computes a list of entities from a list given in
- -- input according to its type. If no list is specified, the selection computes its
- -- list of entities from the whole model.
- -- A selection can be:
- -- - A predefined selection (xst-transferrable-mode)
- -- - A filter based on a signature
- -- A Signature is an operator which returns a string from an entity according to its type. For example:
- -- - "xst-type" (CDL)
- -- - "iges-level"
- -- - "step-type".
- -- For example, if you wanted to select only the advanced_faces in a STEP file you
- -- would use the following code:
- -- Example
- -- Reader.GiveList("xst-transferrable-roots","step-type(ADVANCED_FACE)");
- -- Warning
- -- If the value given to second is incorrect, it will simply be ignored.
-
- GiveList (me : in out; first : CString; ent : Transient)
- returns HSequenceOfTransient from TColStd;
- ---Purpose : Computes a List of entities from the model as follows
- -- <first> beeing a Selection, <ent> beeing an entity or a list
- -- of entities (as a HSequenceOfTransient) :
- -- the standard result of this selection applied to this list
- -- if <first> is erroneous, a null handle is returned
-
-
- NbRootsForTransfer (me : in out) returns Integer is virtual ;
- ---Purpose : Determines the list of root entities which are candidate for
- -- a transfer to a Shape, and returns the number
- -- of entities in the list
-
- RootForTransfer (me : in out; num : Integer = 1) returns Transient;
- ---Purpose : Returns an IGES or STEP root
- -- entity for translation. The entity is identified by its
- -- rank in a list.
-
- TransferOneRoot (me : in out; num : Integer = 1) returns Boolean ;
- ---Purpose : Translates a root identified by the rank num in the model.
- -- false is returned if no shape is produced.
-
- TransferOne (me : in out; num : Integer) returns Boolean;
- ---Purpose : Translates an IGES or STEP
- -- entity identified by the rank num in the model.
- -- false is returned if no shape is produced.
-
- TransferEntity (me : in out; start : Transient) returns Boolean;
- ---Purpose : Translates an IGES or STEP
- -- entity in the model. true is returned if a shape is
- -- produced; otherwise, false is returned.
-
- TransferList (me : in out; list : HSequenceOfTransient from TColStd)
- returns Integer;
- ---Purpose : Translates a list of entities.
- -- Returns the number of IGES or STEP entities that were
- -- successfully translated. The list can be produced with GiveList.
- -- Warning - This function does not clear the existing output shapes.
-
- TransferRoots (me : in out) returns Integer;
- ---Purpose : Translates all translatable
- -- roots and returns the number of successful translations.
- -- Warning - This function clears existing output shapes first.
-
-
- ClearShapes (me : in out);
- ---Purpose : Clears the list of shapes that
- -- may have accumulated in calls to TransferOne or TransferRoot.C
-
- NbShapes (me) returns Integer;
- ---Purpose : Returns the number of shapes produced by translation.
-
- Shapes (me: in out) returns SequenceOfShape from TopTools is protected;
- ---Purpose : Returns a sequence of produced shapes
- ---C++: return &
-
- Shape (me; num : Integer = 1) returns Shape from TopoDS;
- ---Purpose : Returns the shape resulting
- -- from a translation and identified by the rank num.
- -- num equals 1 by default. In other words, the first shape
- -- resulting from the translation is returned.
-
- OneShape (me) returns Shape from TopoDS;
- ---Purpose : Returns all of the results in
- -- a single shape which is:
- -- - a null shape if there are no results,
- -- - a shape if there is one result,
- -- - a compound containing the resulting shapes if there are more than one.
-
- PrintCheckLoad (me; failsonly : Boolean; mode : PrintCount);
- ---Purpose : Prints the check list attached to loaded data, on the Standard
- -- Trace File (starts at cout)
- -- All messages or fails only, according to <failsonly>
- -- mode = 0 : per entity, prints messages
- -- mode = 1 : per message, just gives count of entities per check
- -- mode = 2 : also gives entity numbers
-
- PrintCheckTransfer (me; failsonly : Boolean; mode : PrintCount);
- ---Purpose : Displays check results for the
- -- last translation of IGES or STEP entities to Open CASCADE
- -- entities. Only fail messages are displayed if failsonly is
- -- true. All messages are displayed if failsonly is
- -- false. mode determines the contents and the order of the
- -- messages according to the terms of the IFSelect_PrintCount enumeration.
-
- PrintStatsTransfer (me; what : Integer; mode : Integer = 0);
- ---Purpose : Displays the statistics for
- -- the last translation. what defines the kind of
- -- statistics that are displayed as follows:
- -- - 0 gives general statistics (number of translated roots,
- -- number of warnings, number of fail messages),
- -- - 1 gives root results,
- -- - 2 gives statistics for all checked entities,
- -- - 3 gives the list of translated entities,
- -- - 4 gives warning and fail messages,
- -- - 5 gives fail messages only.
- -- The use of mode depends on the value of what. If what is 0,
- -- mode is ignored. If what is 1, 2 or 3, mode defines the following:
- -- - 0 lists the numbers of IGES or STEP entities in the respective model
- -- - 1 gives the number, identifier, type and result
- -- type for each IGES or STEP entity and/or its status
- -- (fail, warning, etc.)
- -- - 2 gives maximum information for each IGES or STEP entity (i.e. checks)
- -- - 3 gives the number of entities per type of IGES or STEP entity
- -- - 4 gives the number of IGES or STEP entities per result type and/or status
- -- - 5 gives the number of pairs (IGES or STEP or result type and status)
- -- - 6 gives the number of pairs (IGES or STEP or result type
- -- and status) AND the list of entity numbers in the IGES or STEP model.
- -- If what is 4 or 5, mode defines the warning and fail
- -- messages as follows:
- -- - if mode is 0 all warnings and checks per entity are returned
- -- - if mode is 2 the list of entities per warning is returned.
- -- If mode is not set, only the list of all entities per warning is given.
-
- GetStatsTransfer (me; list: HSequenceOfTransient from TColStd;
- nbMapped : out Integer;
- nbWithResult: out Integer;
- nbWithFail : out Integer);
- ---Purpose: Gives statistics about Transfer
-
-fields
-
- thesession : WorkSession from XSControl;
- therootsta : Boolean is protected; -- are roots determined
- theroots : SequenceOfTransient is protected; -- only roots available for Transfer
- theshapes : SequenceOfShape;
-
-end Reader;
// pdn 26.02.99 added initializing of compound in function OneShape
//: gka 14.04.99: S4136: apply scaling
-#include <XSControl_Reader.ixx>
+#include <XSControl_Reader.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferReader.hxx>
#include <Interface_ShareFlags.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <Transfer_TransientProcess.hxx>
#include <Transfer_Binder.hxx>
-//#include <ShapeCustom.hxx>
#include <Interface_Static.hxx>
#include <Interface_Check.hxx>
#include <Message_ProgressSentry.hxx>
-
-
-//#include <ShapeAlgo.hxx>
-//#include <ShapeAlgo_AlgoContainer.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Standard_Transient.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+#include <TopoDS_Shape.hxx>
+#include <XSControl_Reader.hxx>
//=======================================================================
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSControl_Reader_HeaderFile
+#define _XSControl_Reader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Standard_Boolean.hxx>
+#include <TColStd_SequenceOfTransient.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+#include <Standard_CString.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Standard_Integer.hxx>
+#include <IFSelect_PrintCount.hxx>
+
+class XSControl_WorkSession;
+class Interface_InterfaceModel;
+class TColStd_HSequenceOfTransient;
+class Standard_Transient;
+class TopTools_SequenceOfShape;
+class TopoDS_Shape;
+
+
+
+//! A groundwork to convert a shape to data which complies <br>
+//! with a particular norm. This data can be that of a whole <br>
+//! model or that of a specific list of entities in the model. <br>
+//! You specify the list using a single selection or a <br>
+//! combination of selections. A selection is an operator which <br>
+//! computes a list of entities from a list given in input. To <br>
+//! specify the input, you can use: <br>
+//! - A predefined selection such as "xst-transferrable-roots" <br>
+//! - A filter based on a signature. <br>
+//! A signature is an operator which returns a string from an <br>
+//! entity according to its type. <br>
+//! For example: <br>
+//! - "xst-type" (CDL) <br>
+//! - "iges-level" <br>
+//! - "step-type". <br>
+//! A filter can be based on a signature by giving a value to <br>
+//! be matched by the string returned. For example, <br>
+//! "xst-type(Curve)". <br>
+//! If no list is specified, the selection computes its list of <br>
+//! entities from the whole model. To use this class, you have to <br>
+//! initialize the transfer norm first, as shown in the example below. <br>
+//! Example: <br>
+//! Control_Reader reader; <br>
+//! IFSelect_ReturnStatus status = reader.ReadFile (filename.); <br>
+//! When using IGESControl_Reader or STEPControl_Reader - as the <br>
+//! above example shows - the reader initializes the norm directly. <br>
+//! Note that loading the file only stores the data. It does <br>
+//! not translate this data. Shapes are accumulated by <br>
+//! successive transfers. The last shape is cleared by: <br>
+//! - ClearShapes which allows you to handle a new batch <br>
+//! - TransferRoots which restarts the list of shapes from scratch. <br>
+class XSControl_Reader {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a Reader from scratch (creates an empty WorkSession) <br>
+//! A WorkSession or a Controller must be provided before running <br>
+ Standard_EXPORT XSControl_Reader();
+ //! Creates a Reader from scratch, with a norm name which <br>
+//! identifies a Controller <br>
+ Standard_EXPORT XSControl_Reader(const Standard_CString norm);
+ //! Creates a Reader from an already existing Session, with a <br>
+//! Controller already set <br>//! Virtual destructor <br>
+ Standard_EXPORT XSControl_Reader(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+Standard_EXPORT virtual ~XSControl_Reader() {}
+ //! Sets a specific norm to <me> <br>
+//! Returns True if done, False if <norm> is not available <br>
+ Standard_EXPORT Standard_Boolean SetNorm(const Standard_CString norm) ;
+ //! Sets a specific session to <me> <br>
+ Standard_EXPORT void SetWS(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True) ;
+ //! Returns the session used in <me> <br>
+ Standard_EXPORT Handle_XSControl_WorkSession WS() const;
+ //! Loads a file and returns the read status <br>
+//! Zero for a Model which compies with the Controller <br>
+ Standard_EXPORT IFSelect_ReturnStatus ReadFile(const Standard_CString filename) ;
+ //! Returns the model. It can then be consulted (header, product) <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model() const;
+ //! Returns a list of entities from the IGES or STEP file <br>
+//! according to the following rules: <br>
+//! - if first and second are empty strings, the whole file is selected. <br>
+//! - if first is an entity number or label, the entity referred to is selected. <br>
+//! - if first is a list of entity numbers/labels separated by commas, the entities referred to are selected, <br>
+//! - if first is the name of a selection in the worksession and second is not defined, <br>
+//! the list contains the standard output for that selection. <br>
+//! - if first is the name of a selection and second is defined, the criterion defined <br>
+//! by second is applied to the result of the first selection. <br>
+//! A selection is an operator which computes a list of entities from a list given in <br>
+//! input according to its type. If no list is specified, the selection computes its <br>
+//! list of entities from the whole model. <br>
+//! A selection can be: <br>
+//! - A predefined selection (xst-transferrable-mode) <br>
+//! - A filter based on a signature <br>
+//! A Signature is an operator which returns a string from an entity according to its type. For example: <br>
+//! - "xst-type" (CDL) <br>
+//! - "iges-level" <br>
+//! - "step-type". <br>
+//! For example, if you wanted to select only the advanced_faces in a STEP file you <br>
+//! would use the following code: <br>
+//! Example <br>
+//! Reader.GiveList("xst-transferrable-roots","step-type(ADVANCED_FACE)"); <br>
+//! Warning <br>
+//! If the value given to second is incorrect, it will simply be ignored. <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient GiveList(const Standard_CString first = "",const Standard_CString second = "") ;
+ //! Computes a List of entities from the model as follows <br>
+//! <first> beeing a Selection, <ent> beeing an entity or a list <br>
+//! of entities (as a HSequenceOfTransient) : <br>
+//! the standard result of this selection applied to this list <br>
+//! if <first> is erroneous, a null handle is returned <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient GiveList(const Standard_CString first,const Handle(Standard_Transient)& ent) ;
+ //! Determines the list of root entities which are candidate for <br>
+//! a transfer to a Shape, and returns the number <br>
+//! of entities in the list <br>
+ Standard_EXPORT virtual Standard_Integer NbRootsForTransfer() ;
+ //! Returns an IGES or STEP root <br>
+//! entity for translation. The entity is identified by its <br>
+//! rank in a list. <br>
+ Standard_EXPORT Handle_Standard_Transient RootForTransfer(const Standard_Integer num = 1) ;
+ //! Translates a root identified by the rank num in the model. <br>
+//! false is returned if no shape is produced. <br>
+ Standard_EXPORT Standard_Boolean TransferOneRoot(const Standard_Integer num = 1) ;
+ //! Translates an IGES or STEP <br>
+//! entity identified by the rank num in the model. <br>
+//! false is returned if no shape is produced. <br>
+ Standard_EXPORT Standard_Boolean TransferOne(const Standard_Integer num) ;
+ //! Translates an IGES or STEP <br>
+//! entity in the model. true is returned if a shape is <br>
+//! produced; otherwise, false is returned. <br>
+ Standard_EXPORT Standard_Boolean TransferEntity(const Handle(Standard_Transient)& start) ;
+ //! Translates a list of entities. <br>
+//! Returns the number of IGES or STEP entities that were <br>
+//! successfully translated. The list can be produced with GiveList. <br>
+//! Warning - This function does not clear the existing output shapes. <br>
+ Standard_EXPORT Standard_Integer TransferList(const Handle(TColStd_HSequenceOfTransient)& list) ;
+ //! Translates all translatable <br>
+//! roots and returns the number of successful translations. <br>
+//! Warning - This function clears existing output shapes first. <br>
+ Standard_EXPORT Standard_Integer TransferRoots() ;
+ //! Clears the list of shapes that <br>
+//! may have accumulated in calls to TransferOne or TransferRoot.C <br>
+ Standard_EXPORT void ClearShapes() ;
+ //! Returns the number of shapes produced by translation. <br>
+ Standard_EXPORT Standard_Integer NbShapes() const;
+ //! Returns the shape resulting <br>
+//! from a translation and identified by the rank num. <br>
+//! num equals 1 by default. In other words, the first shape <br>
+//! resulting from the translation is returned. <br>
+ Standard_EXPORT TopoDS_Shape Shape(const Standard_Integer num = 1) const;
+ //! Returns all of the results in <br>
+//! a single shape which is: <br>
+//! - a null shape if there are no results, <br>
+//! - a shape if there is one result, <br>
+//! - a compound containing the resulting shapes if there are more than one. <br>
+ Standard_EXPORT TopoDS_Shape OneShape() const;
+ //! Prints the check list attached to loaded data, on the Standard <br>
+//! Trace File (starts at cout) <br>
+//! All messages or fails only, according to <failsonly> <br>
+//! mode = 0 : per entity, prints messages <br>
+//! mode = 1 : per message, just gives count of entities per check <br>
+//! mode = 2 : also gives entity numbers <br>
+ Standard_EXPORT void PrintCheckLoad(const Standard_Boolean failsonly,const IFSelect_PrintCount mode) const;
+ //! Displays check results for the <br>
+//! last translation of IGES or STEP entities to Open CASCADE <br>
+//! entities. Only fail messages are displayed if failsonly is <br>
+//! true. All messages are displayed if failsonly is <br>
+//! false. mode determines the contents and the order of the <br>
+//! messages according to the terms of the IFSelect_PrintCount enumeration. <br>
+ Standard_EXPORT void PrintCheckTransfer(const Standard_Boolean failsonly,const IFSelect_PrintCount mode) const;
+ //! Displays the statistics for <br>
+//! the last translation. what defines the kind of <br>
+//! statistics that are displayed as follows: <br>
+//! - 0 gives general statistics (number of translated roots, <br>
+//! number of warnings, number of fail messages), <br>
+//! - 1 gives root results, <br>
+//! - 2 gives statistics for all checked entities, <br>
+//! - 3 gives the list of translated entities, <br>
+//! - 4 gives warning and fail messages, <br>
+//! - 5 gives fail messages only. <br>
+//! The use of mode depends on the value of what. If what is 0, <br>
+//! mode is ignored. If what is 1, 2 or 3, mode defines the following: <br>
+//! - 0 lists the numbers of IGES or STEP entities in the respective model <br>
+//! - 1 gives the number, identifier, type and result <br>
+//! type for each IGES or STEP entity and/or its status <br>
+//! (fail, warning, etc.) <br>
+//! - 2 gives maximum information for each IGES or STEP entity (i.e. checks) <br>
+//! - 3 gives the number of entities per type of IGES or STEP entity <br>
+//! - 4 gives the number of IGES or STEP entities per result type and/or status <br>
+//! - 5 gives the number of pairs (IGES or STEP or result type and status) <br>
+//! - 6 gives the number of pairs (IGES or STEP or result type <br>
+//! and status) AND the list of entity numbers in the IGES or STEP model. <br>
+//! If what is 4 or 5, mode defines the warning and fail <br>
+//! messages as follows: <br>
+//! - if mode is 0 all warnings and checks per entity are returned <br>
+//! - if mode is 2 the list of entities per warning is returned. <br>
+//! If mode is not set, only the list of all entities per warning is given. <br>
+ Standard_EXPORT void PrintStatsTransfer(const Standard_Integer what,const Standard_Integer mode = 0) const;
+ //! Gives statistics about Transfer <br>
+ Standard_EXPORT void GetStatsTransfer(const Handle(TColStd_HSequenceOfTransient)& list,Standard_Integer& nbMapped,Standard_Integer& nbWithResult,Standard_Integer& nbWithFail) const;
+
+protected:
+ //! Returns a sequence of produced shapes <br>
+ Standard_EXPORT TopTools_SequenceOfShape& Shapes();
+
+ Standard_Boolean therootsta;
+ TColStd_SequenceOfTransient theroots;
+
+private:
+
+ Handle_XSControl_WorkSession thesession;
+ TopTools_SequenceOfShape theshapes;
+
+
+};
+#endif
+++ /dev/null
--- Created on: 1996-03-26
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class SelectForTransfer from XSControl inherits SelectExtract from IFSelect
-
- ---Purpose : This selection selects the entities which are recognised for
- -- transfer by an Actor for Read : current one or another one.
- --
- -- An Actor is an operator which runs transfers from interface
- -- entities to objects for Imagine. It has a method to recognize
- -- the entities it can process (by default, it recognises all,
- -- this method can be redefined).
- --
- -- A TransferReader brings an Actor, according to the currently
- -- selected norm and transfer conditions.
- --
- -- This selection considers, either the current Actor (brought by
- -- the TransferReader, updated as required), or a precise one.
-
-uses AsciiString from TCollection, InterfaceModel,
- ActorOfTransientProcess, TransferReader
-
-is
-
- Create returns mutable SelectForTransfer;
- ---Purpose : Creates a SelectForTransfer, non initialised
- -- it sorts nothing, unless an Actor has been defined
-
- Create (TR : TransferReader) returns mutable SelectForTransfer;
- ---Purpose : Creates a SelectForTransfer, which will work with the
- -- currently defined Actor brought by the TransferReader
-
- SetReader (me : mutable; TR : TransferReader);
- ---Purpose : Sets a TransferReader to sort entities : it brings the Actor,
- -- which may change, while the TransferReader does not
-
- SetActor (me : mutable; act : mutable ActorOfTransientProcess);
- ---Purpose : Sets a precise actor to sort entities
- -- This definition oversedes the creation with a TransferReader
-
- Actor (me) returns ActorOfTransientProcess;
- ---Purpose : Returns the Actor used as precised one.
- -- Returns a Null Handle for a creation from a TransferReader
- -- without any further setting
-
- Reader (me) returns TransferReader;
- ---Purpose : Returns the Reader (if created with a Reader)
- -- Returns a Null Handle if not created with a Reader
-
-
- Sort (me; rank : Integer; ent : Transient; model : InterfaceModel)
- returns Boolean;
- ---Purpose : Returns True for an Entity which is recognized by the Actor,
- -- either the precised one, or the one defined by TransferReader
-
- --Sort (me; ent : in out Transient) returns Boolean;
-
- ExtractLabel (me) returns AsciiString from TCollection;
- ---Purpose : Returns a text defining the criterium : "Recognized for Transfer [(current actor)]"
-
-fields
-
- theTR : TransferReader;
- theAC : ActorOfTransientProcess;
-
-end SelectForTransfer;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSControl_SelectForTransfer.ixx>
+#include <XSControl_SelectForTransfer.hxx>
+#include <Standard_Type.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <XSControl_SelectForTransfer.hxx>
+
+IMPLEMENT_STANDARD_TYPE(XSControl_SelectForTransfer)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IFSelect_SelectExtract),
+ STANDARD_TYPE(IFSelect_SelectDeduct),
+ STANDARD_TYPE(IFSelect_Selection),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSControl_SelectForTransfer)
+
+
+IMPLEMENT_DOWNCAST(XSControl_SelectForTransfer,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSControl_SelectForTransfer)
XSControl_SelectForTransfer::XSControl_SelectForTransfer () { }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSControl_SelectForTransfer_HeaderFile
+#define _XSControl_SelectForTransfer_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <IFSelect_SelectExtract.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Handle_MMgt_TShared.hxx>
+
+class XSControl_TransferReader;
+class Transfer_ActorOfTransientProcess;
+class Standard_Transient;
+class Interface_InterfaceModel;
+class TCollection_AsciiString;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+class Handle(IFSelect_SelectExtract);
+
+DEFINE_STANDARD_HANDLE(XSControl_SelectForTransfer,IFSelect_SelectExtract)
+
+//! This selection selects the entities which are recognised for <br>
+//! transfer by an Actor for Read : current one or another one. <br>
+//! <br>
+//! An Actor is an operator which runs transfers from interface <br>
+//! entities to objects for Imagine. It has a method to recognize <br>
+//! the entities it can process (by default, it recognises all, <br>
+//! this method can be redefined). <br>
+//! <br>
+//! A TransferReader brings an Actor, according to the currently <br>
+//! selected norm and transfer conditions. <br>
+//! <br>
+//! This selection considers, either the current Actor (brought by <br>
+//! the TransferReader, updated as required), or a precise one. <br>
+class XSControl_SelectForTransfer : public IFSelect_SelectExtract {
+
+public:
+
+ //! Creates a SelectForTransfer, non initialised <br>
+//! it sorts nothing, unless an Actor has been defined <br>
+ Standard_EXPORT XSControl_SelectForTransfer();
+ //! Creates a SelectForTransfer, which will work with the <br>
+//! currently defined Actor brought by the TransferReader <br>
+ Standard_EXPORT XSControl_SelectForTransfer(const Handle(XSControl_TransferReader)& TR);
+ //! Sets a TransferReader to sort entities : it brings the Actor, <br>
+//! which may change, while the TransferReader does not <br>
+ Standard_EXPORT void SetReader(const Handle(XSControl_TransferReader)& TR) ;
+ //! Sets a precise actor to sort entities <br>
+//! This definition oversedes the creation with a TransferReader <br>
+ Standard_EXPORT void SetActor(const Handle(Transfer_ActorOfTransientProcess)& act) ;
+ //! Returns the Actor used as precised one. <br>
+//! Returns a Null Handle for a creation from a TransferReader <br>
+//! without any further setting <br>
+ Standard_EXPORT Handle_Transfer_ActorOfTransientProcess Actor() const;
+ //! Returns the Reader (if created with a Reader) <br>
+//! Returns a Null Handle if not created with a Reader <br>
+ Standard_EXPORT Handle_XSControl_TransferReader Reader() const;
+ //! Returns True for an Entity which is recognized by the Actor, <br>
+//! either the precised one, or the one defined by TransferReader <br>
+ Standard_EXPORT Standard_Boolean Sort(const Standard_Integer rank,const Handle(Standard_Transient)& ent,const Handle(Interface_InterfaceModel)& model) const;
+ //! Returns a text defining the criterium : "Recognized for Transfer [(current actor)]" <br>
+ Standard_EXPORT TCollection_AsciiString ExtractLabel() const;
+
+
+
+
+ DEFINE_STANDARD_RTTI(XSControl_SelectForTransfer)
+
+protected:
+
+
+
+
+private:
+
+
+Handle_XSControl_TransferReader theTR;
+Handle_Transfer_ActorOfTransientProcess theAC;
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
+++ /dev/null
--- Created on: 1998-07-31
--- Created by: Christian CAILLET
--- Copyright (c) 1998-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 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.
-
-class SignTransferStatus from XSControl inherits Signature from IFSelect
-
- ---Purpose : This Signatures gives the Transfer Status of an entity, as
- -- recorded in a TransferProcess. It can be :
- -- - Void : not recorded, or recorded as void with no message
- -- (attributes are not taken into account)
- -- - Warning : no result, warning message(s), no fail
- -- - Fail : no result, fail messages (with or without warning)
- -- - Result.. : result, no message (neither warning nor fail)
- -- Result.. i.e. Result:TypeName of the result
- -- - Result../Warning : result, with warning but no fail
- -- - Result../Fail : result, with fail (.e. bad result)
- -- - Fail on run : no result yet recorded, no message, but
- -- an exception occurred while recording the result
- -- (this should not appear and indicates a programming error)
-
-uses CString, Transient, InterfaceModel,
- TransientProcess, TransferReader
-
-is
-
- Create returns mutable SignTransferStatus;
- ---Purpose : Creates a SignTransferStatus, not initialised
- -- it gives nothing (empty string)
-
- Create (TR : TransferReader) returns mutable SignTransferStatus;
- ---Purpose : Creates a SignTransferStatus, which will work on the current
- -- TransientProcess brought by the TransferReader (its MapReader)
-
- SetReader (me : mutable; TR : TransferReader);
- ---Purpose : Sets a TransferReader to work
-
- SetMap (me : mutable; TP : TransientProcess);
- ---Purpose : Sets a precise map to sign entities
- -- This definition oversedes the creation with a TransferReader
-
- Map (me) returns TransientProcess;
- ---Purpose : Returns the TransientProcess used as precised one
- -- Returns a Null Handle for a creation from a TransferReader
- -- without any further setting
-
- Reader (me) returns TransferReader;
- ---Purpose : Returns the Reader (if created with a Reader)
- -- Returns a Null Handle if not created with a Reader
-
-
- Value (me; ent : any Transient; model : InterfaceModel) returns CString;
- ---Purpose : Returns the Signature for a Transient object, as its transfer
- -- status
-
-fields
-
- theTR : TransferReader;
- theTP : TransientProcess;
-
-end SignTransferStatus;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSControl_SignTransferStatus.ixx>
+#include <XSControl_SignTransferStatus.hxx>
#include <Transfer_Binder.hxx>
#include <TCollection_AsciiString.hxx>
#include <Interface_Check.hxx>
-//#include <stdio.h>
+#include <Standard_Transient.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(XSControl_SignTransferStatus)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IFSelect_Signature),
+ STANDARD_TYPE(Interface_SignType),
+ STANDARD_TYPE(MoniTool_SignText),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSControl_SignTransferStatus)
+
+
+IMPLEMENT_DOWNCAST(XSControl_SignTransferStatus,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSControl_SignTransferStatus)
static TCollection_AsciiString& themes()
{
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSControl_SignTransferStatus_HeaderFile
+#define _XSControl_SignTransferStatus_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <IFSelect_Signature.hxx>
+#include <Standard_CString.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+
+class Standard_Transient;
+class Interface_InterfaceModel;
+class Handle(Standard_Type);
+class Handle(IFSelect_Signature);
+class XSControl_SignTransferStatus;
+
+DEFINE_STANDARD_HANDLE(XSControl_SignTransferStatus,IFSelect_Signature)
+
+//! This Signatures gives the Transfer Status of an entity, as <br>
+//! recorded in a TransferProcess. It can be : <br>
+//! - Void : not recorded, or recorded as void with no message <br>
+//! (attributes are not taken into account) <br>
+//! - Warning : no result, warning message(s), no fail <br>
+//! - Fail : no result, fail messages (with or without warning) <br>
+//! - Result.. : result, no message (neither warning nor fail) <br>
+//! Result.. i.e. Result:TypeName of the result <br>
+//! - Result../Warning : result, with warning but no fail <br>
+//! - Result../Fail : result, with fail (.e. bad result) <br>
+//! - Fail on run : no result yet recorded, no message, but <br>
+//! an exception occurred while recording the result <br>
+//! (this should not appear and indicates a programming error) <br>
+class XSControl_SignTransferStatus : public IFSelect_Signature
+{
+public:
+
+ //! Creates a SignTransferStatus, not initialised <br>
+ //! it gives nothing (empty string) <br>
+ Standard_EXPORT XSControl_SignTransferStatus();
+ //! Creates a SignTransferStatus, which will work on the current <br>
+ //! TransientProcess brought by the TransferReader (its MapReader) <br>
+ Standard_EXPORT XSControl_SignTransferStatus(const Handle(XSControl_TransferReader)& TR);
+ //! Sets a TransferReader to work <br>
+ Standard_EXPORT void SetReader(const Handle(XSControl_TransferReader)& TR) ;
+ //! Sets a precise map to sign entities <br>
+ //! This definition oversedes the creation with a TransferReader <br>
+ Standard_EXPORT void SetMap(const Handle(Transfer_TransientProcess)& TP) ;
+ //! Returns the TransientProcess used as precised one <br>
+ //! Returns a Null Handle for a creation from a TransferReader <br>
+ //! without any further setting <br>
+ Standard_EXPORT Handle(Transfer_TransientProcess) Map() const;
+ //! Returns the Reader (if created with a Reader) <br>
+ //! Returns a Null Handle if not created with a Reader <br>
+ Standard_EXPORT Handle(XSControl_TransferReader) Reader() const;
+ //! Returns the Signature for a Transient object, as its transfer <br>
+ //! status <br>
+ Standard_EXPORT Standard_CString Value(const Handle(Standard_Transient)& ent,
+ const Handle(Interface_InterfaceModel)& model) const;
+
+ DEFINE_STANDARD_RTTI(XSControl_SignTransferStatus)
+
+private:
+
+ Handle(XSControl_TransferReader) theTR;
+ Handle(Transfer_TransientProcess) theTP;
+};
+#endif
+++ /dev/null
--- Created on: 1995-12-05
--- 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 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.
-
-class TransferReader from XSControl inherits TShared
-
- ---Purpose : A TransferReader performs, manages, handles results of,
- -- transfers done when reading a file (i.e. from entities of an
- -- InterfaceModel, to objects for Imagine)
- --
- -- Running is organised around basic tools : TransientProcess and
- -- its Actor, results are Binders and CheckIterators. It implies
- -- control by a Controller (which prepares the Actor as required)
- --
- -- Getting results can be done directly on TransientProcess, but
- -- these are immediate "last produced" results. Each transfer of
- -- an entity gives a final result, but also possible intermediate
- -- data, and checks, which can be attached to sub-entities.
- --
- -- Hence, final results (which intermediates and checks) are
- -- recorded as ResultFromModel and can be queried individually.
- --
- -- Some more direct access are given for results which are
- -- Transient or Shapes
-
-uses CString, AsciiString, Transient,
- DataMapOfIntegerTransient, HSequenceOfTransient, DictionaryOfTransient,
- InterfaceModel, CheckIterator, Graph, HGraph,
- TransientProcess, ActorOfTransientProcess, Binder, ResultFromModel,
- CheckStatus from Interface, Controller from XSControl,
- Shape from TopoDS, HSequenceOfShape from TopTools
-
-is
-
- Create returns mutable TransferReader;
- ---Purpose : Creates a TransferReader, empty
-
- -- General Management --
-
- SetController (me : mutable; control : mutable Controller from XSControl);
- ---Purpose : Sets a Controller. It is required to generate the Actor.
- -- Elsewhere, the Actor must be provided directly
-
- SetActor (me : mutable; actor : mutable ActorOfTransientProcess);
- ---Purpose : Sets the Actor directly : this value will be used if the
- -- Controller is not set
-
- Actor (me : mutable) returns mutable ActorOfTransientProcess;
- ---Purpose : Returns the Actor, determined by the Controller, or if this
- -- one is unknown, directly set.
- -- Once it has been defined, it can then be edited.
-
- SetModel (me : mutable; model : InterfaceModel);
- ---Purpose : Sets an InterfaceModel. This causes former results, computed
- -- from another one, to be lost (see also Clear)
-
- SetGraph (me : mutable; graph : HGraph);
- ---Purpose : Sets a Graph and its InterfaceModel (calls SetModel)
-
- Model (me) returns InterfaceModel;
- ---Purpose : Returns the currently set InterfaceModel
-
- SetContext (me : mutable; name : CString; ctx : Transient);
- ---Purpose : Sets a Context : according to receiving appli, to be
- -- interpreted by the Actor
-
- GetContext (me; name : CString; type : Type; ctx : out Transient)
- returns Boolean;
- ---Purpose : Returns the Context attached to a name, if set and if it is
- -- Kind of the type, else a Null Handle
- -- Returns True if OK, False if no Context
-
- Context (me : mutable) returns DictionaryOfTransient;
- ---Purpose : Returns (modifiable) the whole definition of Context
- -- Rather for internal use (ex.: preparing and setting in once)
- ---C++ : return &
-
- SetFileName (me : mutable; name : CString);
- ---Purpose : Sets a new value for (loaded) file name
-
- FileName (me) returns CString;
- ---Purpose : Returns actual value of file name
-
- Clear (me : mutable; mode : Integer);
- ---Purpose : Clears data, according mode :
- -- -1 all
- -- 0 nothing done
- -- +1 final results
- -- +2 working data (model, context, transfer process)
-
- TransientProcess (me) returns mutable TransientProcess;
- ---Purpose : Returns the currently used TransientProcess
- -- It is computed from the model by TransferReadRoots, or by
- -- BeginTransferRead
-
- SetTransientProcess (me : mutable; TP : mutable TransientProcess);
- ---Purpose : Forces the TransientProcess
- -- Remark : it also changes the Model and the Actor, from those
- -- recorded in the new TransientProcess
-
-
- -- Recording and Querying Results --
- -- these methods work mainly on recorded data
- -- i.e. they don't need Controller and Actor
-
- RecordResult (me : mutable; ent : Transient) returns Boolean;
- ---Purpose : Records a final result of transferring an entity
- -- This result is recorded as a ResultFromModel, taken from
- -- the TransientProcess
- -- Returns True if a result is available, False else
-
- IsRecorded (me; ent : Transient) returns Boolean;
- ---Purpose : Returns True if a final result is recorded for an entity
- -- Remark that it can bring no effective result if transfer has
- -- completely failed (FinalResult brings only fail messages ...)
-
- HasResult (me; ent : Transient) returns Boolean;
- ---Purpose : Returns True if a final result is recorded AND BRINGS AN
- -- EFFECTIVE RESULT (else, it brings only fail messages)
-
- RecordedList (me) returns HSequenceOfTransient;
- ---Purpose : Returns the list of entities to which a final result is
- -- attached (i.e. processed by RecordResult)
-
- Skip (me : mutable; ent : Transient) returns Boolean;
- ---Purpose : Note that an entity has been required for transfer but no
- -- result at all is available (typically : case not implemented)
- -- It is not an error, but it gives a specific status : Skipped
- -- Returns True if done, False if <ent> is not in starting model
-
- IsSkipped (me; ent : Transient) returns Boolean;
- ---Purpose : Returns True if an entity is noted as skipped
-
- IsMarked (me; ent : Transient) returns Boolean;
- ---Purpose : Returns True if an entity has been asked for transfert, hence
- -- it is marked, as : Recorded (a computation has ran, with or
- -- without an effective result), or Skipped (case ignored)
-
-
- FinalResult (me; ent : Transient) returns ResultFromModel;
- ---Purpose : Returns the final result recorded for an entity, as such
-
- FinalEntityLabel (me; ent : Transient) returns CString;
- ---Purpose : Returns the label attached to an entity recorded for final,
- -- or an empty string if not recorded
-
- FinalEntityNumber (me; ent : Transient) returns Integer;
- ---Purpose : Returns the number attached to the entity recorded for final,
- -- or zero if not recorded (looks in the ResultFromModel)
-
- ResultFromNumber (me; num : Integer) returns ResultFromModel;
- ---Purpose : Returns the final result recorded for a NUMBER of entity
- -- (internal use). Null if out of range
-
- TransientResult (me; ent : Transient) returns mutable Transient;
- ---Purpose : Returns the resulting object as a Transient
- -- Null Handle if no result or result not transient
-
- ShapeResult (me; ent : Transient) returns Shape from TopoDS;
- ---Purpose : Returns the resulting object as a Shape
- -- Null Shape if no result or result not a shape
-
- ClearResult (me : mutable; ent : Transient; mode : Integer) returns Boolean;
- ---Purpose : Clears recorded result for an entity, according mode
- -- <mode> = -1 : true, complete, clearing (erasing result)
- -- <mode> >= 0 : simple "stripping", see ResultFromModel,
- -- in particular, 0 for simple internal strip,
- -- 10 for all but final result,
- -- 11 for all : just label, status and filename are kept
- -- Returns True when done, False if nothing was to clear
-
-
- EntityFromResult (me; res : Transient; mode : Integer=0) returns Transient;
- ---Purpose : Returns an entity from which a given result was produced.
- -- If <mode> = 0 (D), searches in last root transfers
- -- If <mode> = 1, searches in last (root & sub) transfers
- -- If <mode> = 2, searches in root recorded results
- -- If <mode> = 3, searches in all (root & sub) recordeds
- -- <res> can be, either a transient object (result itself) or
- -- a binder. For a binder of shape, calls EntityFromShapeResult
- -- Returns a Null Handle if <res> not recorded
-
- EntityFromShapeResult (me; res : Shape from TopoDS; mode : Integer=0)
- returns Transient;
- ---Purpose : Returns an entity from which a given shape result was produced
- -- Returns a Null Handle if <res> not recorded or not a Shape
-
- EntitiesFromShapeList (me; res : HSequenceOfShape from TopTools; mode : Integer = 0)
- returns HSequenceOfTransient from TColStd;
- ---Purpose : Returns the list of entities from which some shapes were
- -- produced : it corresponds to a loop on EntityFromShapeResult,
- -- but is optimised
-
-
- CheckList (me; ent : Transient; level : Integer = 0) returns CheckIterator;
- ---Purpose : Returns the CheckList resulting from transferring <ent>, i.e.
- -- stored in its recorded form ResultFromModel
- -- (empty if transfer successful or not recorded ...)
- --
- -- If <ent> is the Model, returns the complete cumulated
- -- check-list, <level> is ignored
- --
- -- If <ent> is an entity of the Model, <level> applies as follows
- -- <level> : -1 for <ent> only, LAST transfer (TransientProcess)
- -- <level> : 0 for <ent> only (D)
- -- 1 for <ent> and its immediate subtransfers, if any
- -- 2 for <ent> and subtransferts at all levels
-
- HasChecks (me; ent : Transient; failsonly : Boolean) returns Boolean;
- ---Purpose : Returns True if an entity (with a final result) has checks :
- -- - failsonly = False : any kind of check message
- -- - failsonly = True : fails only
- -- Returns False if <ent> is not recorded
-
- CheckedList (me; ent : Transient;
- withcheck : CheckStatus = Interface_CheckAny; result : Boolean = Standard_True)
- returns HSequenceOfTransient;
- ---Purpose : Returns the list of starting entities to which a given check
- -- status is attached, IN FINAL RESULTS
- -- <ent> can be an entity, or the model to query all entities
- -- Below, "entities" are, either <ent> plus its sub-transferred,
- -- or all the entities of the model
- --
- -- <check> = -2 , all entities whatever the check (see result)
- -- <check> = -1 , entities with no fail (warning allowed)
- -- <check> = 0 , entities with no check at all
- -- <check> = 1 , entities with warning but no fail
- -- <check> = 2 , entities with fail
- -- <result> : if True, only entities with an attached result
- -- Remark : result True and check=0 will give an empty list
-
- -- Actions for Transfer (Read) --
-
- BeginTransfer (me : mutable) returns Boolean;
- ---Purpose : Defines a new TransferProcess for reading transfer
- -- Returns True if done, False if data are not properly defined
- -- (the Model, the Actor for Read)
-
- Recognize (me : mutable; ent : Transient) returns Boolean;
- ---Purpose : Tells if an entity is recognized as a valid candidate for
- -- Transfer. Calls method Recognize from the Actor (if known)
-
- TransferOne (me : mutable; ent : Transient;
- rec : Boolean = Standard_True) returns Integer;
- ---Purpose : Commands the transfer on reading for an entity to data for
- -- Imagine, using the selected Actor for Read
- -- Returns count of transferred entities, ok or with fails (0/1)
- -- If <rec> is True (D), the result is recorded by RecordResult
-
- TransferList (me : mutable; list : HSequenceOfTransient;
- rec : Boolean = Standard_True) returns Integer;
- ---Purpose : Commands the transfer on reading for a list of entities to
- -- data for Imagine, using the selected Actor for Read
- -- Returns count of transferred entities, ok or with fails (0/1)
- -- If <rec> is True (D), the results are recorded by RecordResult
-
- TransferRoots (me : mutable; G : Graph) returns Integer;
- ---Purpose : Transfers the content of the current Interface Model to
- -- data handled by Imagine, starting from its Roots (determined
- -- by the Graph <G>), using the selected Actor for Read
- -- Returns the count of performed root transfers (i.e. 0 if none)
- -- or -1 if no actor is defined
-
- TransferClear (me : mutable; ent : Transient; level : Integer = 0);
- ---Purpose : Clears the results attached to an entity
- -- if <ents> equates the starting model, clears all results
-
- PrintStats (me; what : Integer; mode : Integer = 0);
- ---Purpose : Prints statistics on current Trace File, according <what> and
- -- <mode>. See PrintStatsProcess for details
-
- -- Querying last transfer (i.e. TransientProcess) --
-
- LastCheckList (me) returns CheckIterator;
- ---Purpose : Returns the CheckList resulting from last TransferRead
- -- i.e. from TransientProcess itself, recorded from last Clear
-
- LastTransferList (me; roots : Boolean) returns HSequenceOfTransient;
- ---Purpose : Returns the list of entities recorded as lastly transferred
- -- i.e. from TransientProcess itself, recorded from last Clear
- -- If <roots> is True , considers only roots of transfer
- -- If <roots> is False, considers all entities bound with result
-
- ShapeResultList (me : mutable; rec : Boolean)
- returns HSequenceOfShape from TopTools;
- ---Purpose : Returns a list of result Shapes
- -- If <rec> is True , sees RecordedList
- -- If <rec> is False, sees LastTransferList (last ROOT transfers)
- -- For each one, if it is a Shape, it is cumulated to the list
- -- If no Shape is found, returns an empty Sequence
-
- PrintStatsProcess (myclass; TP : TransientProcess;
- what : Integer; mode : Integer = 0);
- ---Purpose : This routines prints statistics about a TransientProcess
- -- It can be called, by a TransferReader, or isolately
- -- Prints are done on the default trace file
- -- <what> defines what kind of statistics are to be printed :
- -- 0 : basic figures
- -- 1 : root results
- -- 2 : all recorded (roots, intermediate, checked entities)
- -- 3 : abnormal records
- -- 4 : check messages (warnings and fails)
- -- 5 : fail messages
- --
- -- <mode> is used according <what> :
- -- <what> = 0 : <mode> is ignored
- -- <what> = 1,2,3 : <mode> as follows :
- -- 0 (D) : just lists numbers of concerned entities in the model
- -- 1 : for each entity, gives number,label, type and result
- -- type and/or status (fail/warning...)
- -- 2 : for each entity, gives maximal information (i.e. checks)
- -- 3 : counts per type of starting entity (class type)
- -- 4 : counts per result type and/or status
- -- 5 : counts per couple (starting type / result type/status)
- -- 6 : idem plus gives for each item, the list of numbers of
- -- entities in the starting model
- --
- -- <what> = 4,5 : modes relays on an enum PrintCount :
- -- 0 (D) : ItemsByEntity (sequential list by entity)
- -- 1 : CountByItem
- -- 2 : ShortByItem (count + 5 first numbers)
- -- 3 : ListByItem (count + entity numbers)
- -- 4 : EntitiesByItem (count + entity numbers and labels)
-
- PrintStatsOnList (myclass; TP : TransientProcess;
- list : HSequenceOfTransient;
- what : Integer; mode : Integer = 0);
- ---Purpose : Works as PrintStatsProcess, but displays data only on the
- -- entities which are in <list> (filter)
-
-fields
-
- theController : Controller;
-
- theFilename : AsciiString;
- theModel : InterfaceModel;
- theGraph : HGraph;
- theContext : DictionaryOfTransient;
-
- theActor : ActorOfTransientProcess;
- theTransfer : TransientProcess;
-
- theResults : DataMapOfIntegerTransient;
- theShapeResult : HSequenceOfShape from TopTools;
-
-end TransferReader;
//: abv 09.04.99: S4136: remove parameter lastpreci
// szv#11:CASCADE30:01Feb00 BRepBuilderAPI::Precision(p) removed
-#include <XSControl_TransferReader.ixx>
+#include <XSControl_TransferReader.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_SignLabel.hxx>
#include <Interface_Check.hxx>
-
#include <Message_Messenger.hxx>
-
+#include <XSControl_Controller.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Interface_HGraph.hxx>
+#include <Dico_DictionaryOfTransient.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
+#include <Standard_Transient.hxx>
+#include <Standard_Type.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Transfer_ResultFromModel.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Interface_CheckIterator.hxx>
+#include <Interface_Graph.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <Standard_Type.hxx>
#include <ShapeFix.hxx>
#include <stdio.h>
+IMPLEMENT_STANDARD_TYPE(XSControl_TransferReader)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSControl_TransferReader)
+
+
+IMPLEMENT_DOWNCAST(XSControl_TransferReader,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSControl_TransferReader)
+
//=======================================================================
//function : XSControl_TransferReader
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSControl_TransferReader_HeaderFile
+#define _XSControl_TransferReader_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_Controller.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Handle_Interface_HGraph.hxx>
+#include <Handle_Dico_DictionaryOfTransient.hxx>
+#include <Transfer_ActorOfTransientProcess.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <TColStd_DataMapOfIntegerTransient.hxx>
+#include <Handle_TopTools_HSequenceOfShape.hxx>
+#include <MMgt_TShared.hxx>
+#include <Standard_CString.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Standard_Type.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Transfer_ResultFromModel.hxx>
+#include <Interface_CheckStatus.hxx>
+#include <Handle_IFSelect_SelectExtract.hxx>
+
+class XSControl_Controller;
+class Handle(XSControl_Controller);
+class Interface_InterfaceModel;
+class Interface_HGraph;
+class Dico_DictionaryOfTransient;
+class Transfer_ActorOfTransientProcess;
+class Transfer_TransientProcess;
+class TopTools_HSequenceOfShape;
+class Standard_Transient;
+class Standard_Type;
+class TColStd_HSequenceOfTransient;
+class Transfer_ResultFromModel;
+class TopoDS_Shape;
+class Interface_CheckIterator;
+class Interface_Graph;
+class Standard_Transient;
+class Handle(Standard_Type);
+
+DEFINE_STANDARD_HANDLE(XSControl_TransferReader,MMgt_TShared)
+
+//! A TransferReader performs, manages, handles results of, <br>
+//! transfers done when reading a file (i.e. from entities of an <br>
+//! InterfaceModel, to objects for Imagine) <br>
+//! <br>
+//! Running is organised around basic tools : TransientProcess and <br>
+//! its Actor, results are Binders and CheckIterators. It implies <br>
+//! control by a Controller (which prepares the Actor as required) <br>
+//! <br>
+//! Getting results can be done directly on TransientProcess, but <br>
+//! these are immediate "last produced" results. Each transfer of <br>
+//! an entity gives a final result, but also possible intermediate <br>
+//! data, and checks, which can be attached to sub-entities. <br>
+//! <br>
+//! Hence, final results (which intermediates and checks) are <br>
+//! recorded as ResultFromModel and can be queried individually. <br>
+//! <br>
+//! Some more direct access are given for results which are <br>
+//! Transient or Shapes <br>
+class XSControl_TransferReader : public MMgt_TShared
+{
+public:
+
+ //! Creates a TransferReader, empty <br>
+ Standard_EXPORT XSControl_TransferReader();
+ //! Sets a Controller. It is required to generate the Actor. <br>
+ //! Elsewhere, the Actor must be provided directly <br>
+ Standard_EXPORT void SetController(const Handle(XSControl_Controller)& control) ;
+ //! Sets the Actor directly : this value will be used if the <br>
+ //! Controller is not set <br>
+ Standard_EXPORT void SetActor(const Handle(Transfer_ActorOfTransientProcess)& actor) ;
+ //! Returns the Actor, determined by the Controller, or if this <br>
+ //! one is unknown, directly set. <br>
+ //! Once it has been defined, it can then be edited. <br>
+ Standard_EXPORT Handle(Transfer_ActorOfTransientProcess) Actor() ;
+ //! Sets an InterfaceModel. This causes former results, computed <br>
+ //! from another one, to be lost (see also Clear) <br>
+ Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model) ;
+ //! Sets a Graph and its InterfaceModel (calls SetModel) <br>
+ Standard_EXPORT void SetGraph (const Handle(Interface_HGraph)& graph) ;
+ //! Returns the currently set InterfaceModel <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model() const;
+ //! Sets a Context : according to receiving appli, to be <br>
+ //! interpreted by the Actor <br>
+ Standard_EXPORT void SetContext (const Standard_CString name,
+ const Handle(Standard_Transient)& ctx) ;
+ //! Returns the Context attached to a name, if set and if it is <br>
+ //! Kind of the type, else a Null Handle <br>
+ //! Returns True if OK, False if no Context <br>
+ Standard_EXPORT Standard_Boolean GetContext (const Standard_CString name,
+ const Handle(Standard_Type)& type,
+ Handle(Standard_Transient)& ctx) const;
+ //! Returns (modifiable) the whole definition of Context <br>
+ //! Rather for internal use (ex.: preparing and setting in once) <br>
+ Standard_EXPORT Handle(Dico_DictionaryOfTransient)& Context() ;
+ //! Sets a new value for (loaded) file name <br>
+ Standard_EXPORT void SetFileName(const Standard_CString name) ;
+ //! Returns actual value of file name <br>
+ Standard_EXPORT Standard_CString FileName() const;
+ //! Clears data, according mode : <br>
+ //! -1 all <br>
+ //! 0 nothing done <br>
+ //! +1 final results <br>
+ //! +2 working data (model, context, transfer process) <br>
+ Standard_EXPORT void Clear(const Standard_Integer mode) ;
+ //! Returns the currently used TransientProcess <br>
+ //! It is computed from the model by TransferReadRoots, or by <br>
+ //! BeginTransferRead <br>
+ Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const;
+ //! Forces the TransientProcess <br>
+ //! Remark : it also changes the Model and the Actor, from those <br>
+ //! recorded in the new TransientProcess <br>
+ Standard_EXPORT void SetTransientProcess (const Handle(Transfer_TransientProcess)& TP) ;
+ //! Records a final result of transferring an entity <br>
+ //! This result is recorded as a ResultFromModel, taken from <br>
+ //! the TransientProcess <br>
+ //! Returns True if a result is available, False else <br>
+ Standard_EXPORT Standard_Boolean RecordResult (const Handle(Standard_Transient)& ent) ;
+ //! Returns True if a final result is recorded for an entity <br>
+ //! Remark that it can bring no effective result if transfer has <br>
+ //! completely failed (FinalResult brings only fail messages ...) <br>
+ Standard_EXPORT Standard_Boolean IsRecorded (const Handle(Standard_Transient)& ent) const;
+ //! Returns True if a final result is recorded AND BRINGS AN <br>
+ //! EFFECTIVE RESULT (else, it brings only fail messages) <br>
+ Standard_EXPORT Standard_Boolean HasResult (const Handle(Standard_Transient)& ent) const;
+ //! Returns the list of entities to which a final result is <br>
+ //! attached (i.e. processed by RecordResult) <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient RecordedList() const;
+ //! Note that an entity has been required for transfer but no <br>
+ //! result at all is available (typically : case not implemented) <br>
+ //! It is not an error, but it gives a specific status : Skipped <br>
+ //! Returns True if done, False if <ent> is not in starting model <br>
+ Standard_EXPORT Standard_Boolean Skip (const Handle(Standard_Transient)& ent) ;
+ //! Returns True if an entity is noted as skipped <br>
+ Standard_EXPORT Standard_Boolean IsSkipped (const Handle(Standard_Transient)& ent) const;
+ //! Returns True if an entity has been asked for transfert, hence <br>
+ //! it is marked, as : Recorded (a computation has ran, with or <br>
+ //! without an effective result), or Skipped (case ignored) <br>
+ Standard_EXPORT Standard_Boolean IsMarked (const Handle(Standard_Transient)& ent) const;
+ //! Returns the final result recorded for an entity, as such <br>
+ Standard_EXPORT Handle_Transfer_ResultFromModel FinalResult (const Handle(Standard_Transient)& ent) const;
+ //! Returns the label attached to an entity recorded for final, <br>
+ //! or an empty string if not recorded <br>
+ Standard_EXPORT Standard_CString FinalEntityLabel (const Handle(Standard_Transient)& ent) const;
+ //! Returns the number attached to the entity recorded for final, <br>
+ //! or zero if not recorded (looks in the ResultFromModel) <br>
+ Standard_EXPORT Standard_Integer FinalEntityNumber (const Handle(Standard_Transient)& ent) const;
+ //! Returns the final result recorded for a NUMBER of entity <br>
+ //! (internal use). Null if out of range <br>
+ Standard_EXPORT Handle_Transfer_ResultFromModel ResultFromNumber (const Standard_Integer num) const;
+ //! Returns the resulting object as a Transient <br>
+ //! Null Handle if no result or result not transient <br>
+ Standard_EXPORT Handle_Standard_Transient TransientResult (const Handle(Standard_Transient)& ent) const;
+ //! Returns the resulting object as a Shape <br>
+ //! Null Shape if no result or result not a shape <br>
+ Standard_EXPORT TopoDS_Shape ShapeResult(const Handle(Standard_Transient)& ent) const;
+ //! Clears recorded result for an entity, according mode <br>
+//! <mode> = -1 : true, complete, clearing (erasing result) <br>
+//! <mode> >= 0 : simple "stripping", see ResultFromModel, <br>
+//! in particular, 0 for simple internal strip, <br>
+//! 10 for all but final result, <br>
+//! 11 for all : just label, status and filename are kept <br>
+//! Returns True when done, False if nothing was to clear <br>
+ Standard_EXPORT Standard_Boolean ClearResult (const Handle(Standard_Transient)& ent,
+ const Standard_Integer mode) ;
+ //! Returns an entity from which a given result was produced. <br>
+ //! If <mode> = 0 (D), searches in last root transfers <br>
+ //! If <mode> = 1, searches in last (root & sub) transfers <br>
+ //! If <mode> = 2, searches in root recorded results <br>
+ //! If <mode> = 3, searches in all (root & sub) recordeds <br>
+ //! <res> can be, either a transient object (result itself) or <br>
+ //! a binder. For a binder of shape, calls EntityFromShapeResult <br>
+ //! Returns a Null Handle if <res> not recorded <br>
+ Standard_EXPORT Handle_Standard_Transient EntityFromResult (const Handle(Standard_Transient)& res,
+ const Standard_Integer mode = 0) const;
+ //! Returns an entity from which a given shape result was produced <br>
+ //! Returns a Null Handle if <res> not recorded or not a Shape <br>
+ Standard_EXPORT Handle_Standard_Transient EntityFromShapeResult (const TopoDS_Shape& res,
+ const Standard_Integer mode = 0) const;
+ //! Returns the list of entities from which some shapes were <br>
+ //! produced : it corresponds to a loop on EntityFromShapeResult, <br>
+ //! but is optimised <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient EntitiesFromShapeList (const Handle(TopTools_HSequenceOfShape)& res,
+ const Standard_Integer mode = 0) const;
+ //! Returns the CheckList resulting from transferring <ent>, i.e. <br>
+ //! stored in its recorded form ResultFromModel <br>
+ //! (empty if transfer successful or not recorded ...) <br>
+ //! <br>
+ //! If <ent> is the Model, returns the complete cumulated <br>
+ //! check-list, <level> is ignored <br>
+ //! <br>
+ //! If <ent> is an entity of the Model, <level> applies as follows <br>
+ //! <level> : -1 for <ent> only, LAST transfer (TransientProcess) <br>
+ //! <level> : 0 for <ent> only (D) <br>
+ //! 1 for <ent> and its immediate subtransfers, if any <br>
+ //! 2 for <ent> and subtransferts at all levels <br>
+ Standard_EXPORT Interface_CheckIterator CheckList(const Handle(Standard_Transient)& ent,
+ const Standard_Integer level = 0) const;
+ //! Returns True if an entity (with a final result) has checks : <br>
+ //! - failsonly = False : any kind of check message <br>
+ //! - failsonly = True : fails only <br>
+ //! Returns False if <ent> is not recorded <br>
+ Standard_EXPORT Standard_Boolean HasChecks (const Handle(Standard_Transient)& ent,
+ const Standard_Boolean failsonly) const;
+ //! Returns the list of starting entities to which a given check <br>
+ //! status is attached, IN FINAL RESULTS <br>
+ //! <ent> can be an entity, or the model to query all entities <br>
+ //! Below, "entities" are, either <ent> plus its sub-transferred, <br>
+ //! or all the entities of the model <br>
+ //! <br>
+ //! <check> = -2 , all entities whatever the check (see result) <br>
+ //! <check> = -1 , entities with no fail (warning allowed) <br>
+ //! <check> = 0 , entities with no check at all <br>
+ //! <check> = 1 , entities with warning but no fail <br>
+ //! <check> = 2 , entities with fail <br>
+ //! <result> : if True, only entities with an attached result <br>
+ //! Remark : result True and check=0 will give an empty list <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient CheckedList(const Handle(Standard_Transient)& ent,
+ const Interface_CheckStatus withcheck = Interface_CheckAny,
+ const Standard_Boolean result = Standard_True) const;
+ //! Defines a new TransferProcess for reading transfer <br>
+ //! Returns True if done, False if data are not properly defined <br>
+ //! (the Model, the Actor for Read) <br>
+ Standard_EXPORT Standard_Boolean BeginTransfer() ;
+ //! Tells if an entity is recognized as a valid candidate for <br>
+ //! Transfer. Calls method Recognize from the Actor (if known) <br>
+ Standard_EXPORT Standard_Boolean Recognize(const Handle(Standard_Transient)& ent) ;
+ //! Commands the transfer on reading for an entity to data for <br>
+ //! Imagine, using the selected Actor for Read <br>
+ //! Returns count of transferred entities, ok or with fails (0/1) <br>
+ //! If <rec> is True (D), the result is recorded by RecordResult <br>
+ Standard_EXPORT Standard_Integer TransferOne(const Handle(Standard_Transient)& ent,
+ const Standard_Boolean rec = Standard_True);
+ //! Commands the transfer on reading for a list of entities to <br>
+ //! data for Imagine, using the selected Actor for Read <br>
+ //! Returns count of transferred entities, ok or with fails (0/1) <br>
+ //! If <rec> is True (D), the results are recorded by RecordResult <br>
+ Standard_EXPORT Standard_Integer TransferList(const Handle(TColStd_HSequenceOfTransient)& list,
+ const Standard_Boolean rec = Standard_True);
+ //! Transfers the content of the current Interface Model to <br>
+ //! data handled by Imagine, starting from its Roots (determined <br>
+ //! by the Graph <G>), using the selected Actor for Read <br>
+ //! Returns the count of performed root transfers (i.e. 0 if none) <br>
+ //! or -1 if no actor is defined <br>
+ Standard_EXPORT Standard_Integer TransferRoots(const Interface_Graph& G) ;
+ //! Clears the results attached to an entity <br>
+ //! if <ents> equates the starting model, clears all results <br>
+ Standard_EXPORT void TransferClear(const Handle(Standard_Transient)& ent,
+ const Standard_Integer level = 0) ;
+ //! Prints statistics on current Trace File, according <what> and <br>
+ //! <mode>. See PrintStatsProcess for details <br>
+ Standard_EXPORT void PrintStats(const Standard_Integer what,const Standard_Integer mode = 0) const;
+ //! Returns the CheckList resulting from last TransferRead <br>
+ //! i.e. from TransientProcess itself, recorded from last Clear <br>
+ Standard_EXPORT Interface_CheckIterator LastCheckList() const;
+ //! Returns the list of entities recorded as lastly transferred <br>
+ //! i.e. from TransientProcess itself, recorded from last Clear <br>
+ //! If <roots> is True , considers only roots of transfer <br>
+ //! If <roots> is False, considers all entities bound with result <br>
+ Standard_EXPORT Handle_TColStd_HSequenceOfTransient LastTransferList(const Standard_Boolean roots) const;
+ //! Returns a list of result Shapes <br>
+ //! If <rec> is True , sees RecordedList <br>
+ //! If <rec> is False, sees LastTransferList (last ROOT transfers) <br>
+ //! For each one, if it is a Shape, it is cumulated to the list <br>
+ //! If no Shape is found, returns an empty Sequence <br>
+ Standard_EXPORT Handle_TopTools_HSequenceOfShape ShapeResultList(const Standard_Boolean rec) ;
+ //! This routines prints statistics about a TransientProcess <br>
+ //! It can be called, by a TransferReader, or isolately <br>
+ //! Prints are done on the default trace file <br>
+ //! <what> defines what kind of statistics are to be printed : <br>
+ //! 0 : basic figures <br>
+ //! 1 : root results <br>
+ //! 2 : all recorded (roots, intermediate, checked entities) <br>
+ //! 3 : abnormal records <br>
+ //! 4 : check messages (warnings and fails) <br>
+ //! 5 : fail messages <br>
+ //! <br>
+ //! <mode> is used according <what> : <br>
+ //! <what> = 0 : <mode> is ignored <br>
+ //! <what> = 1,2,3 : <mode> as follows : <br>
+ //! 0 (D) : just lists numbers of concerned entities in the model <br>
+ //! 1 : for each entity, gives number,label, type and result <br>
+ //! type and/or status (fail/warning...) <br>
+ //! 2 : for each entity, gives maximal information (i.e. checks) <br>
+ //! 3 : counts per type of starting entity (class type) <br>
+ //! 4 : counts per result type and/or status <br>
+ //! 5 : counts per couple (starting type / result type/status) <br>
+ //! 6 : idem plus gives for each item, the list of numbers of <br>
+ //! entities in the starting model <br>
+ //! <br>
+ //! <what> = 4,5 : modes relays on an enum PrintCount : <br>
+ //! 0 (D) : ItemsByEntity (sequential list by entity) <br>
+ //! 1 : CountByItem <br>
+ //! 2 : ShortByItem (count + 5 first numbers) <br>
+ //! 3 : ListByItem (count + entity numbers) <br>
+ //! 4 : EntitiesByItem (count + entity numbers and labels) <br>
+ Standard_EXPORT static void PrintStatsProcess(const Handle(Transfer_TransientProcess)& TP,
+ const Standard_Integer what,
+ const Standard_Integer mode = 0) ;
+ //! Works as PrintStatsProcess, but displays data only on the <br>
+ //! entities which are in <list> (filter) <br>
+ Standard_EXPORT static void PrintStatsOnList(const Handle(Transfer_TransientProcess)& TP,
+ const Handle(TColStd_HSequenceOfTransient)& list,
+ const Standard_Integer what,
+ const Standard_Integer mode = 0) ;
+
+ DEFINE_STANDARD_RTTI(XSControl_TransferReader)
+
+private:
+
+
+Handle(XSControl_Controller) theController;
+TCollection_AsciiString theFilename;
+Handle(Interface_InterfaceModel) theModel;
+Handle(Interface_HGraph) theGraph;
+Handle(Dico_DictionaryOfTransient) theContext;
+Handle(Transfer_ActorOfTransientProcess) theActor;
+Handle(Transfer_TransientProcess) theTransfer;
+TColStd_DataMapOfIntegerTransient theResults;
+Handle(TopTools_HSequenceOfShape) theShapeResult;
+};
+#endif
+++ /dev/null
--- Created on: 1996-03-13
--- Created by: Christian CAILLET
--- Copyright (c) 1996-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 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.
-
-class TransferWriter from XSControl inherits TShared
-
- ---Purpose : TransferWriter gives help to control transfer to write a file
- -- after having converted data from Cascade/Imagine
- --
- -- It works with a Controller (which itself can work with an
- -- Actor to Write) and a FinderProcess. It records results and
- -- checks
-
-uses Transient,
- Shape from TopoDS,
- CheckIterator from Interface,
- InterfaceModel from Interface,
- FinderProcess, Controller, ReturnStatus
-
-is
-
- Create returns mutable TransferWriter;
- ---Purpose : Creates a TransferWriter, empty, ready to run
- -- with an empty FinderProcess (but no controller, etc)
-
- FinderProcess (me) returns mutable FinderProcess;
- ---Purpose : Returns the FinderProcess itself
-
- SetFinderProcess (me : mutable; FP : mutable FinderProcess);
- ---Purpose : Sets a new FinderProcess and forgets the former one
-
- Controller (me) returns Controller;
- ---Purpose : Returns the currently used Controller
-
- SetController (me : mutable; ctl : Controller);
- ---Purpose : Sets a new Controller, also sets a new FinderProcess
-
- Clear (me : mutable; mode : Integer);
- ---Purpose : Clears recorded data according a mode
- -- 0 clears FinderProcess (results, checks)
- -- -1 create a new FinderProcess
-
- TransferMode (me) returns Integer;
- ---Purpose : Returns the current Transfer Mode (an Integer)
- -- It will be interpreted by the Controller to run Transfers
- -- This call form could be later replaced by more specific ones
- -- (parameters suited for each norm / transfer case)
-
- SetTransferMode (me : mutable; mode : Integer);
- ---Purpose : Changes the Transfer Mode
-
- PrintStats (me; what : Integer; mode : Integer = 0);
- ---Purpose : Prints statistics on current Trace File, according what,mode
- -- See PrintStatsProcess for details
-
- -- Operations themselves
-
- RecognizeTransient (me : mutable; obj : Transient) returns Boolean;
- ---Purpose : Tells if a transient object (from an application) is a valid
- -- candidate for a transfer to a model
- -- Asks the Controller (RecognizeWriteTransient)
- -- If <obj> is a HShape, calls RecognizeShape
-
- TransferWriteTransient (me : mutable; model : mutable InterfaceModel;
- obj : Transient)
- returns ReturnStatus;
- ---Purpose : Transfers a Transient object (from an application) to a model
- -- of current norm, according to the last call to SetTransferMode
- -- Works by calling the Controller
- -- Returns status : =0 if OK, >0 if error during transfer, <0 if
- -- transfer badly initialised
-
- RecognizeShape (me : mutable; shape : Shape from TopoDS) returns Boolean;
- ---Purpose : Tells if a Shape is valid for a transfer to a model
- -- Asks the Controller (RecognizeWriteShape)
-
- TransferWriteShape (me : mutable; model : mutable InterfaceModel;
- shape : Shape from TopoDS)
- returns ReturnStatus;
- ---Purpose : Transfers a Shape from CasCade to a model of current norm,
- -- according to the last call to SetTransferMode
- -- Works by calling the Controller
- -- Returns status : =0 if OK, >0 if error during transfer, <0 if
- -- transfer badly initialised
-
- CheckList (me) returns CheckIterator;
- ---Purpose : Returns the check-list of last transfer (write), i.e. the
- -- check-list currently recorded in the FinderProcess
-
- ResultCheckList (me; model : InterfaceModel) returns CheckIterator;
- ---Purpose : Returns the check-list of last transfer (write), but tries
- -- to bind to each check, the resulting entity in the model
- -- instead of keeping the original Mapper, whenever known
-
- PrintStatsProcess (myclass; TP : FinderProcess;
- what : Integer; mode : Integer = 0);
- ---Purpose : Forecast to print statitics about a FinderProcess
-
-fields
-
- theController : Controller;
- theTransferWrite : FinderProcess;
- theTransferMode : Integer;
-
-end TransferWriter;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSControl_TransferWriter.ixx>
+#include <XSControl_TransferWriter.hxx>
#include <Standard_ErrorHandler.hxx>
+#include <Standard_Type.hxx>
#include <Standard_Failure.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransientMapper.hxx>
#include <Message_Messenger.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Check.hxx>
+#include <XSControl_Controller.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Interface_CheckIterator.hxx>
+IMPLEMENT_STANDARD_TYPE(XSControl_TransferWriter)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSControl_TransferWriter)
+
+
+IMPLEMENT_DOWNCAST(XSControl_TransferWriter,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSControl_TransferWriter)
XSControl_TransferWriter::XSControl_TransferWriter ()
{ theTransferWrite = new Transfer_FinderProcess; theTransferMode = 0; }
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef _XSControl_TransferWriter_HeaderFile
+#define _XSControl_TransferWriter_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_Controller.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <Standard_Integer.hxx>
+#include <MMgt_TShared.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+
+class Transfer_FinderProcess;
+class Standard_Transient;
+class Interface_InterfaceModel;
+class TopoDS_Shape;
+class Interface_CheckIterator;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(MMgt_TShared);
+class XSControl_TransferWriter;
+
+DEFINE_STANDARD_HANDLE(XSControl_TransferWriter,MMgt_TShared)
+
+//! TransferWriter gives help to control transfer to write a file <br>
+//! after having converted data from Cascade/Imagine <br>
+//! <br>
+//! It works with a Controller (which itself can work with an <br>
+//! Actor to Write) and a FinderProcess. It records results and <br>
+//! checks <br>
+class XSControl_TransferWriter : public MMgt_TShared {
+
+public:
+
+ //! Creates a TransferWriter, empty, ready to run <br>
+//! with an empty FinderProcess (but no controller, etc) <br>
+ Standard_EXPORT XSControl_TransferWriter();
+ //! Returns the FinderProcess itself <br>
+ Standard_EXPORT Handle_Transfer_FinderProcess FinderProcess() const;
+ //! Sets a new FinderProcess and forgets the former one <br>
+ Standard_EXPORT void SetFinderProcess(const Handle(Transfer_FinderProcess)& FP) ;
+ //! Returns the currently used Controller <br>
+ Standard_EXPORT Handle(XSControl_Controller) Controller() const;
+ //! Sets a new Controller, also sets a new FinderProcess <br>
+ Standard_EXPORT void SetController(const Handle(XSControl_Controller)& ctl) ;
+ //! Clears recorded data according a mode <br>
+//! 0 clears FinderProcess (results, checks) <br>
+//! -1 create a new FinderProcess <br>
+ Standard_EXPORT void Clear(const Standard_Integer mode) ;
+ //! Returns the current Transfer Mode (an Integer) <br>
+//! It will be interpreted by the Controller to run Transfers <br>
+//! This call form could be later replaced by more specific ones <br>
+//! (parameters suited for each norm / transfer case) <br>
+ Standard_EXPORT Standard_Integer TransferMode() const;
+ //! Changes the Transfer Mode <br>
+ Standard_EXPORT void SetTransferMode(const Standard_Integer mode) ;
+ //! Prints statistics on current Trace File, according what,mode <br>
+//! See PrintStatsProcess for details <br>
+ Standard_EXPORT void PrintStats(const Standard_Integer what,const Standard_Integer mode = 0) const;
+ //! Tells if a transient object (from an application) is a valid <br>
+//! candidate for a transfer to a model <br>
+//! Asks the Controller (RecognizeWriteTransient) <br>
+//! If <obj> is a HShape, calls RecognizeShape <br>
+ Standard_EXPORT Standard_Boolean RecognizeTransient(const Handle(Standard_Transient)& obj) ;
+ //! Transfers a Transient object (from an application) to a model <br>
+//! of current norm, according to the last call to SetTransferMode <br>
+//! Works by calling the Controller <br>
+//! Returns status : =0 if OK, >0 if error during transfer, <0 if <br>
+//! transfer badly initialised <br>
+ Standard_EXPORT IFSelect_ReturnStatus TransferWriteTransient(const Handle(Interface_InterfaceModel)& model,const Handle(Standard_Transient)& obj) ;
+ //! Tells if a Shape is valid for a transfer to a model <br>
+//! Asks the Controller (RecognizeWriteShape) <br>
+ Standard_EXPORT Standard_Boolean RecognizeShape(const TopoDS_Shape& shape) ;
+ //! Transfers a Shape from CasCade to a model of current norm, <br>
+//! according to the last call to SetTransferMode <br>
+//! Works by calling the Controller <br>
+//! Returns status : =0 if OK, >0 if error during transfer, <0 if <br>
+//! transfer badly initialised <br>
+ Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape(const Handle(Interface_InterfaceModel)& model,const TopoDS_Shape& shape) ;
+ //! Returns the check-list of last transfer (write), i.e. the <br>
+//! check-list currently recorded in the FinderProcess <br>
+ Standard_EXPORT Interface_CheckIterator CheckList() const;
+ //! Returns the check-list of last transfer (write), but tries <br>
+//! to bind to each check, the resulting entity in the model <br>
+//! instead of keeping the original Mapper, whenever known <br>
+ Standard_EXPORT Interface_CheckIterator ResultCheckList(const Handle(Interface_InterfaceModel)& model) const;
+ //! Forecast to print statitics about a FinderProcess <br>
+ Standard_EXPORT static void PrintStatsProcess(const Handle(Transfer_FinderProcess)& TP,const Standard_Integer what,const Standard_Integer mode = 0) ;
+
+ DEFINE_STANDARD_RTTI(XSControl_TransferWriter)
+
+private:
+
+
+ Handle(XSControl_Controller) theController;
+ Handle(Transfer_FinderProcess) theTransferWrite;
+ Standard_Integer theTransferMode;
+};
+#endif
+++ /dev/null
--- Created on: 1995-06-01
--- 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 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.
-
-class WorkSession from XSControl inherits WorkSession from IFSelect
-
- ---Purpose : This WorkSession completes the basic one, by adding :
- -- - use of Controller, with norm selection...
- -- - management of transfers (both ways) with auxiliary classes
- -- TransferReader and TransferWriter
- -- -> these transfers may work with a Context List : its items
- -- are given by the user, according to the transfer to be
- -- i.e. it is interpreted by the Actors
- -- Each item is accessed by a Name
-
-uses CString, Transient, DictionaryOfTransient,
- InterfaceModel, CheckIterator,
- TransientProcess, FinderProcess,
- TransferReader, TransferWriter, Controller, Vars, ReturnStatus,
- Messenger from Message,
- Shape from TopoDS
-
-is
-
- Create returns mutable WorkSession from XSControl;
-
- ClearData (me : mutable; mode : Integer) is redefined;
- ---Purpose : In addition to basic ClearData, clears Transfer and Management
- -- for interactive use, for mode = 0,1,2 and over 4
- -- Plus : mode = 5 to clear Transfers (both ways) only
- -- mode = 6 to clear enforced results
- -- mode = 7 to clear transfers, results
-
-
- -- Norm Management --
-
- SelectNorm (me : mutable; normname : CString; profile : CString = "")
- returns Boolean;
- ---Purpose : Selects a Norm defined by its name.
- -- A Norm is described and handled by a Controller
- -- Returns True if done, False if <normname> is unknown
- --
- -- A Profile may be set too. If no Profile is provided, the
- -- current Profile for this Norm is taken
- -- If the asked Profile is not defined for this Norm, it remains
- -- in current Profile, returned value is True
-
- SelectProfile (me : mutable; profile : CString) returns Boolean;
- ---Purpose : Sets a Profile as current for the current Norm
- -- Returns True if done, False if <profile> is unknown for this norm
- --
- -- For more infos on Profile, query the Profile of the Controller
-
- SetController (me : mutable; ctl : mutable Controller);
- ---Purpose : Selects a Norm defined by its Controller itself
-
- AdaptNorm (me : mutable) is virtual;
- ---Purpose : This method is called once a new norm has been successfully
- -- selected. It can be redefined, default does nothing
-
- SelectedNorm (me; rsc : Boolean = Standard_False) returns CString;
- ---Purpose : Returns the name of the last Selected Norm. If none is
- -- defined, returns an empty string
- -- By default, returns the complete name of the norm
- -- If <rsc> is True, returns the short name used for resource
-
- NormAdaptor (me) returns mutable Controller;
- ---Purpose : Returns the norm controller itself
-
- -- Context used for Transfer : it is a DictionaryOfTransient (no control here)
-
- Context (me) returns DictionaryOfTransient;
- ---Purpose : Returns the current Context List, Null if not defined
- -- The Context is given to the TransientProcess for TransferRead
-
- SetAllContext (me : mutable; context : DictionaryOfTransient);
- ---Purpose : Sets the current Context List, as a whole
- -- Sets it to the TransferReader
-
- ClearContext (me : mutable);
- ---Purpose : Clears the whole current Context (nullifies it)
-
- -- Management and Actions of Transfer (Read) --
- -- performed by TransferReader
- -- WorkSession adds some useful accesses
- -- It is actually oriented to shapes and transient objects
-
- PrintTransferStatus (me; num : Integer; wri : Boolean; S : Messenger from Message)
- returns Boolean;
- ---Purpose : Prints the transfer status of a transferred item, as beeing
- -- the Mapped n0 <num>, from MapWriter if <wri> is True, or
- -- from MapReader if <wri> is False
- -- Returns True when done, False else (i.e. num out of range)
-
- InitTransferReader (me : mutable; mode : Integer);
- ---Purpose : Sets a Transfer Reader, by internal ways, according mode :
- -- 0 recreates it clear, 1 clears it (does not recreate)
- -- 2 aligns Roots of TransientProcess from final Results
- -- 3 aligns final Results from Roots of TransientProcess
- -- 4 begins a new transfer (by BeginTransfer)
- -- 5 recreates TransferReader then begins a new transfer
-
- SetTransferReader (me : mutable; TR : mutable TransferReader);
- ---Purpose : Sets a Transfer Reader, which manages transfers on reading
-
- TransferReader (me) returns mutable TransferReader;
- ---Purpose : Returns the Transfer Reader, Null if not set
-
- MapReader (me) returns mutable TransientProcess;
- ---Purpose : Returns the TransientProcess(internal data for TransferReader)
-
- SetMapReader (me : mutable; TP : mutable TransientProcess) returns Boolean;
- ---Purpose : Changes the Map Reader, i.e. considers that the new one
- -- defines the relevant read results (forgets the former ones)
- -- Returns True when done, False in case of bad definition, i.e.
- -- if Model from TP differs from that of Session
-
- Result (me; ent : Transient; mode : Integer)
- returns mutable Transient;
- ---Purpose : Returns the result attached to a starting entity
- -- If <mode> = 0, returns Final Result
- -- If <mode> = 1, considers Last Result
- -- If <mode> = 2, considers Final, else if absent, Last
- -- returns it as Transient, if result is not transient returns
- -- the Binder
- -- <mode> = 10,11,12 idem but returns the Binder itself
- -- (if it is not, e.g. Shape, returns the Binder)
- -- <mode> = 20, returns the ResultFromModel
-
- TransferReadOne (me : mutable; ents : Transient) returns Integer;
- ---Purpose : Commands the transfer of, either one entity, or a list
- -- I.E. calls the TransferReader after having analysed <ents>
- -- It is cumulated from the last BeginTransfer
- -- <ents> is processed by GiveList, hence :
- -- - <ents> a Selection : its SelectionResult
- -- - <ents> a HSequenceOfTransient : this list
- -- - <ents> the Model : in this specific case, all the roots,
- -- with no cumulation of former transfers (TransferReadRoots)
-
- TransferReadRoots (me : mutable) returns Integer;
- ---Purpose : Commands the transfer of all the root entities of the model
- -- i.e. calls TransferRoot from the TransferReader with the Graph
- -- No cumulation with former calls to TransferReadOne
-
--- Other actions : see the class TransferReader
-
--- BeginTransferRead (me : mutable) returns Boolean; and
--- RecognizeRead (me : mutable; ent : Transient) see TransferReader
--- TransferReadOne (me : mutable; ents : Transient) -> TransferOne/List
--- TransferReadRoots (me : mutable) returns Integer;
--- TransferReadCheckList (me) returns CheckIterator; -> LastCheckList
--- TransferReadCheckOne (me; ent : Transient; level : Integer = 0)
--- -> CheckList avec en plus level = -1 (last)
--- TransferredReadList (me; ents : Transient; -> CheckedList
--- withcheck : Integer = 0; level : Integer = 0) withcheck a change
--- TransferReadClear (me : mutable; ents : Transient; level : Integer = 0);
--- ShapeResultList (me : mutable) returns HSequenceOfShape from TopTools;
--- + rec : Boolean (recorded/last)
-
-
- -- Management of Transfer (Write) --
- -- It is actually oriented to shapes
-
- NewModel (me : mutable) returns mutable InterfaceModel from Interface;
- ---Purpose : produces and returns a new Model well conditionned
- -- It is produced by the Norm Controller
- -- It can be Null (if this function is not implemented)
-
- TransferWriter (me) returns mutable TransferWriter;
- ---Purpose : Returns the Transfer Reader, Null if not set
-
- MapWriter (me) returns mutable FinderProcess;
- ---Purpose : Returns the FinderProcess (internal data for TransferWriter)
-
- SetMapWriter (me : mutable; FP : mutable FinderProcess) returns Boolean;
- ---Purpose : Changes the Map Reader, i.e. considers that the new one
- -- defines the relevant read results (forgets the former ones)
- -- Returns True when done, False if <FP> is Null
-
- SetModeWriteShape (me : mutable; mode : Integer);
- ---Purpose : Sets a mode to transfer Shapes from CasCade to entities of the
- -- current norm, which interprets it (see various Controllers)
- -- This call form could be later replaced by a more general one
-
- ModeWriteShape (me) returns Integer;
- ---Purpose : Records the current Mode to Write Shapes
-
- TransferWriteShape (me : mutable; shape : Shape from TopoDS;
- compgraph : Boolean = Standard_True)
- returns ReturnStatus;
- ---Purpose : Transfers a Shape from CasCade to a model of current norm,
- -- according to the last call to SetModeWriteShape
- -- Returns status :Done if OK, Fail if error during transfer,
- -- Error if transfer badly initialised
-
- TransferWriteCheckList (me) returns CheckIterator;
- ---Purpose : Returns the check-list of last transfer (write)
- -- It is recorded in the FinderProcess, but it must be bound with
- -- resulting entities (in the resulting file model) rather than
- -- with original objects (in fact, their mappers)
-
-
- Vars (me) returns Vars;
-
- SetVars (me : mutable; newvars : Vars);
-
- ClearBinders (me : mutable);
- ---Purpose : Clears binders
-
- Destroy(me: mutable)
- ---C++: alias ~
- is static;
-
-fields
-
- theController : Controller;
- theTransferRead : TransferReader from XSControl;
- theTransferWrite : TransferWriter from XSControl;
- theContext : DictionaryOfTransient;
- theModeWriteShape : Integer;
- theVars : Vars;
-
-end WorkSession;
//:i1 pdn 03.04.99 BUC60301
-#include <XSControl_WorkSession.ixx>
+#include <XSControl_WorkSession.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
+#include <Standard_Type.hxx>
#include <Interface_HGraph.hxx>
#include <Interface_Graph.hxx>
#include <Interface_Check.hxx>
#include <Message_Messenger.hxx>
+#include <XSControl_Controller.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <XSControl_TransferWriter.hxx>
+#include <Dico_DictionaryOfTransient.hxx>
+#include <XSControl_Vars.hxx>
+#include <Message_Messenger.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Standard_Transient.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Interface_CheckIterator.hxx>
+#include <XSControl_WorkSession.hxx>
+
+
+IMPLEMENT_STANDARD_TYPE(XSControl_WorkSession)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(IFSelect_WorkSession),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSControl_WorkSession)
+
+
+IMPLEMENT_DOWNCAST(XSControl_WorkSession,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSControl_WorkSession)
//=======================================================================
//function : XSControl_WorkSession
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef _XSControl_WorkSession_HeaderFile
+#define _XSControl_WorkSession_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_Controller.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <XSControl_TransferWriter.hxx>
+#include <Handle_Dico_DictionaryOfTransient.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_XSControl_Vars.hxx>
+#include <IFSelect_WorkSession.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_CString.hxx>
+#include <Handle_Message_Messenger.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+
+class XSControl_Controller;
+class XSControl_TransferReader;
+class XSControl_TransferWriter;
+class Dico_DictionaryOfTransient;
+class XSControl_Vars;
+class Message_Messenger;
+class Transfer_TransientProcess;
+class Standard_Transient;
+class Interface_InterfaceModel;
+class Transfer_FinderProcess;
+class TopoDS_Shape;
+class Interface_CheckIterator;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(IFSelect_WorkSession);
+
+DEFINE_STANDARD_HANDLE(XSControl_WorkSession,IFSelect_WorkSession)
+
+
+//! This WorkSession completes the basic one, by adding : <br>
+//! - use of Controller, with norm selection... <br>
+//! - management of transfers (both ways) with auxiliary classes <br>
+//! TransferReader and TransferWriter <br>
+//! -> these transfers may work with a Context List : its items <br>
+//! are given by the user, according to the transfer to be <br>
+//! i.e. it is interpreted by the Actors <br>
+//! Each item is accessed by a Name <br>
+class XSControl_WorkSession : public IFSelect_WorkSession
+{
+
+public:
+
+ Standard_EXPORT XSControl_WorkSession();
+ //! In addition to basic ClearData, clears Transfer and Management <br>
+//! for interactive use, for mode = 0,1,2 and over 4 <br>
+//! Plus : mode = 5 to clear Transfers (both ways) only <br>
+//! mode = 6 to clear enforced results <br>
+//! mode = 7 to clear transfers, results <br>
+ Standard_EXPORT virtual void ClearData(const Standard_Integer mode) ;
+ //! Selects a Norm defined by its name. <br>
+//! A Norm is described and handled by a Controller <br>
+//! Returns True if done, False if <normname> is unknown <br>
+//! <br>
+//! A Profile may be set too. If no Profile is provided, the <br>
+//! current Profile for this Norm is taken <br>
+//! If the asked Profile is not defined for this Norm, it remains <br>
+//! in current Profile, returned value is True <br>
+ Standard_EXPORT Standard_Boolean SelectNorm(const Standard_CString normname,const Standard_CString profile = "") ;
+ //! Sets a Profile as current for the current Norm <br>
+//! Returns True if done, False if <profile> is unknown for this norm <br>
+//! <br>
+//! For more infos on Profile, query the Profile of the Controller <br>
+ Standard_EXPORT Standard_Boolean SelectProfile(const Standard_CString profile) ;
+ //! Selects a Norm defined by its Controller itself <br>
+ Standard_EXPORT void SetController(const Handle(XSControl_Controller)& ctl) ;
+ //! This method is called once a new norm has been successfully <br>
+//! selected. It can be redefined, default does nothing <br>
+ Standard_EXPORT virtual void AdaptNorm() ;
+ //! Returns the name of the last Selected Norm. If none is <br>
+//! defined, returns an empty string <br>
+//! By default, returns the complete name of the norm <br>
+//! If <rsc> is True, returns the short name used for resource <br>
+ Standard_EXPORT Standard_CString SelectedNorm(const Standard_Boolean rsc = Standard_False) const;
+ //! Returns the norm controller itself <br>
+ Standard_EXPORT Handle_XSControl_Controller NormAdaptor() const;
+ //! Returns the current Context List, Null if not defined <br>
+//! The Context is given to the TransientProcess for TransferRead <br>
+ Standard_EXPORT Handle_Dico_DictionaryOfTransient Context() const;
+ //! Sets the current Context List, as a whole <br>
+//! Sets it to the TransferReader <br>
+ Standard_EXPORT void SetAllContext(const Handle(Dico_DictionaryOfTransient)& context) ;
+ //! Clears the whole current Context (nullifies it) <br>
+ Standard_EXPORT void ClearContext() ;
+ //! Prints the transfer status of a transferred item, as beeing <br>
+//! the Mapped n0 <num>, from MapWriter if <wri> is True, or <br>
+//! from MapReader if <wri> is False <br>
+//! Returns True when done, False else (i.e. num out of range) <br>
+ Standard_EXPORT Standard_Boolean PrintTransferStatus(const Standard_Integer num,const Standard_Boolean wri,const Handle(Message_Messenger)& S) const;
+ //! Sets a Transfer Reader, by internal ways, according mode : <br>
+//! 0 recreates it clear, 1 clears it (does not recreate) <br>
+//! 2 aligns Roots of TransientProcess from final Results <br>
+//! 3 aligns final Results from Roots of TransientProcess <br>
+//! 4 begins a new transfer (by BeginTransfer) <br>
+//! 5 recreates TransferReader then begins a new transfer <br>
+ Standard_EXPORT void InitTransferReader(const Standard_Integer mode) ;
+ //! Sets a Transfer Reader, which manages transfers on reading <br>
+ Standard_EXPORT void SetTransferReader(const Handle(XSControl_TransferReader)& TR) ;
+ //! Returns the Transfer Reader, Null if not set <br>
+ Standard_EXPORT Handle_XSControl_TransferReader TransferReader() const;
+ //! Returns the TransientProcess(internal data for TransferReader) <br>
+ Standard_EXPORT Handle_Transfer_TransientProcess MapReader() const;
+ //! Changes the Map Reader, i.e. considers that the new one <br>
+//! defines the relevant read results (forgets the former ones) <br>
+//! Returns True when done, False in case of bad definition, i.e. <br>
+//! if Model from TP differs from that of Session <br>
+ Standard_EXPORT Standard_Boolean SetMapReader(const Handle(Transfer_TransientProcess)& TP) ;
+ //! Returns the result attached to a starting entity <br>
+//! If <mode> = 0, returns Final Result <br>
+//! If <mode> = 1, considers Last Result <br>
+//! If <mode> = 2, considers Final, else if absent, Last <br>
+//! returns it as Transient, if result is not transient returns <br>
+//! the Binder <br>
+//! <mode> = 10,11,12 idem but returns the Binder itself <br>
+//! (if it is not, e.g. Shape, returns the Binder) <br>
+//! <mode> = 20, returns the ResultFromModel <br>
+ Standard_EXPORT Handle_Standard_Transient Result(const Handle(Standard_Transient)& ent,const Standard_Integer mode) const;
+ //! Commands the transfer of, either one entity, or a list <br>
+//! I.E. calls the TransferReader after having analysed <ents> <br>
+//! It is cumulated from the last BeginTransfer <br>
+//! <ents> is processed by GiveList, hence : <br>
+//! - <ents> a Selection : its SelectionResult <br>
+//! - <ents> a HSequenceOfTransient : this list <br>
+//! - <ents> the Model : in this specific case, all the roots, <br>
+//! with no cumulation of former transfers (TransferReadRoots) <br>
+ Standard_EXPORT Standard_Integer TransferReadOne(const Handle(Standard_Transient)& ents) ;
+ //! Commands the transfer of all the root entities of the model <br>
+//! i.e. calls TransferRoot from the TransferReader with the Graph <br>
+//! No cumulation with former calls to TransferReadOne <br>
+ Standard_EXPORT Standard_Integer TransferReadRoots() ;
+ //! produces and returns a new Model well conditionned <br>
+//! It is produced by the Norm Controller <br>
+//! It can be Null (if this function is not implemented) <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel NewModel() ;
+ //! Returns the Transfer Reader, Null if not set <br>
+ Standard_EXPORT Handle_XSControl_TransferWriter TransferWriter() const;
+ //! Returns the FinderProcess (internal data for TransferWriter) <br>
+ Standard_EXPORT Handle_Transfer_FinderProcess MapWriter() const;
+ //! Changes the Map Reader, i.e. considers that the new one <br>
+//! defines the relevant read results (forgets the former ones) <br>
+//! Returns True when done, False if <FP> is Null <br>
+ Standard_EXPORT Standard_Boolean SetMapWriter(const Handle(Transfer_FinderProcess)& FP) ;
+ //! Sets a mode to transfer Shapes from CasCade to entities of the <br>
+//! current norm, which interprets it (see various Controllers) <br>
+//! This call form could be later replaced by a more general one <br>
+ Standard_EXPORT void SetModeWriteShape(const Standard_Integer mode) ;
+ //! Records the current Mode to Write Shapes <br>
+ Standard_EXPORT Standard_Integer ModeWriteShape() const;
+ //! Transfers a Shape from CasCade to a model of current norm, <br>
+//! according to the last call to SetModeWriteShape <br>
+//! Returns status :Done if OK, Fail if error during transfer, <br>
+//! Error if transfer badly initialised <br>
+ Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape,const Standard_Boolean compgraph = Standard_True) ;
+ //! Returns the check-list of last transfer (write) <br>
+//! It is recorded in the FinderProcess, but it must be bound with <br>
+//! resulting entities (in the resulting file model) rather than <br>
+//! with original objects (in fact, their mappers) <br>
+ Standard_EXPORT Interface_CheckIterator TransferWriteCheckList() const;
+
+ Standard_EXPORT Handle_XSControl_Vars Vars() const;
+
+ Standard_EXPORT void SetVars(const Handle(XSControl_Vars)& newvars) ;
+ //! Clears binders <br>
+ Standard_EXPORT void ClearBinders() ;
+
+ Standard_EXPORT void Destroy() ;
+~XSControl_WorkSession()
+{
+ Destroy();
+}
+
+ DEFINE_STANDARD_RTTI(XSControl_WorkSession)
+
+private:
+
+Handle(XSControl_Controller) theController;
+Handle(XSControl_TransferReader) theTransferRead;
+Handle(XSControl_TransferWriter) theTransferWrite;
+Handle(Dico_DictionaryOfTransient) theContext;
+Standard_Integer theModeWriteShape;
+Handle(XSControl_Vars) theVars;
+
+};
+#endif
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef _XSControl_WorkSession_Handle_HeaderFile
+#define _XSControl_WorkSession_Handle_HeaderFile
+
+#include <XSControl_WorkSession.hxx>
+
+typedef Handle(XSControl_WorkSession) XSControl_WorkSession_Handle;
+
+#endif
\ No newline at end of file
+++ /dev/null
--- Created on: 1997-05-14
--- 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 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.
-
-class Writer from XSControl
-
- ---Purpose : This class gives a simple way to create then write a
- -- Model compliant to a given norm, from a Shape
- -- The model can then be edited by tools by other appropriate tools
-
-uses CString,
- InterfaceModel from Interface, WorkSession from XSControl,
- ReturnStatus from IFSelect,
- Shape from TopoDS
-
-is
-
- Create returns Writer;
- ---Purpose : Creates a Writer from scratch
-
- Create (norm : CString) returns Writer;
- ---Purpose : Creates a Writer from scratch, with a norm name which
- -- identifie a Controller
-
- Create (WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True) returns Writer;
- ---Purpose : Creates a Writer from an already existing Session
- -- If <scratch> is True (D), clears already recorded data
-
- SetNorm (me : in out; norm : CString) returns Boolean;
- ---Purpose : Sets a specific norm to <me>
- -- Returns True if done, False if <norm> is not available
-
- SetWS (me : in out; WS : mutable WorkSession from XSControl;
- scratch : Boolean = Standard_True);
- ---Purpose : Sets a specific session to <me>
-
- WS (me) returns WorkSession from XSControl;
- ---Purpose : Returns the session used in <me>
-
- Model (me : in out; newone : Boolean = Standard_False) returns InterfaceModel;
- ---Purpose : Returns the produced model. Produces a new one if not yet done
- -- or if <newone> is True
- -- This method allows for instance to edit product or header
- -- data before writing
-
- TransferShape (me : in out; sh : Shape from TopoDS; mode : Integer = 0)
- returns ReturnStatus;
- ---Purpose : Transfers a Shape according to the mode
-
- WriteFile (me : in out; filename : CString) returns ReturnStatus;
- ---Purpose : Writes the produced model
-
- PrintStatsTransfer (me; what : Integer; mode : Integer = 0);
- ---Purpose : Prints Statistics about Transfer
-
-fields
-
- thesession : WorkSession from XSControl;
-
-end Writer;
//:i1 gka 03.04.99 BUC60301
-#include <XSControl_Writer.ixx>
+#include <XSControl_Writer.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferWriter.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
-
+#include <XSControl_WorkSession.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <TopoDS_Shape.hxx>
XSControl_Writer::XSControl_Writer ()
{
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSControl_Writer_HeaderFile
+#define _XSControl_Writer_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Standard_Integer.hxx>
+
+class XSControl_WorkSession;
+class Interface_InterfaceModel;
+class TopoDS_Shape;
+
+
+//! This class gives a simple way to create then write a <br>
+//! Model compliant to a given norm, from a Shape <br>
+//! The model can then be edited by tools by other appropriate tools <br>
+class XSControl_Writer {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Creates a Writer from scratch <br>
+ Standard_EXPORT XSControl_Writer();
+ //! Creates a Writer from scratch, with a norm name which <br>
+ //! identifie a Controller <br>
+ Standard_EXPORT XSControl_Writer(const Standard_CString norm);
+ //! Creates a Writer from an already existing Session <br>
+ //! If <scratch> is True (D), clears already recorded data <br>
+ Standard_EXPORT XSControl_Writer(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True);
+ //! Sets a specific norm to <me> <br>
+ //! Returns True if done, False if <norm> is not available <br>
+ Standard_EXPORT Standard_Boolean SetNorm(const Standard_CString norm) ;
+ //! Sets a specific session to <me> <br>
+ Standard_EXPORT void SetWS(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True) ;
+ //! Returns the session used in <me> <br>
+ Standard_EXPORT Handle_XSControl_WorkSession WS() const;
+ //! Returns the produced model. Produces a new one if not yet done <br>
+ //! or if <newone> is True <br>
+ //! This method allows for instance to edit product or header <br>
+ //! data before writing <br>
+ Standard_EXPORT Handle_Interface_InterfaceModel Model(const Standard_Boolean newone = Standard_False) ;
+ //! Transfers a Shape according to the mode <br>
+ Standard_EXPORT IFSelect_ReturnStatus TransferShape(const TopoDS_Shape& sh,const Standard_Integer mode = 0) ;
+ //! Writes the produced model <br>
+ Standard_EXPORT IFSelect_ReturnStatus WriteFile(const Standard_CString filename) ;
+ //! Prints Statistics about Transfer <br>
+ Standard_EXPORT void PrintStatsTransfer(const Standard_Integer what,const Standard_Integer mode = 0) const;
+
+
+private:
+
+ Handle_XSControl_WorkSession thesession;
+};
+#endif
+XSDRAW.hxx
+XSDRAW.cxx
+XSDRAW_Vars.hxx
+XSDRAW_Vars.cxx
+XSDRAW_Functions.hxx
+XSDRAW_Functions.cxx
XSDRAW_Commands.hxx
+++ /dev/null
--- Created on: 1995-03-14
--- 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 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.
-
-package XSDRAW
-
- ---Purpose : Basic package to work functions of X-STEP (IFSelect & Co)
- -- under control of DRAW
- --
- -- Works with some "static" data : a SessionPilot (used to run)
- -- with its WorkSession and Model and TransferReader, a
- -- FinderProcess
-
-uses TCollection, TColStd, TopTools,
- gp, Geom, Geom2d, TopoDS, MoniTool,
- Interface, Transfer, IFSelect, XSControl, Draw, SWDRAW, Message
-
-is
-
- class Functions;
- ---Purpose : Gathers general commands for XSDRAW : initialisation control,
- -- also commands to analyse the result of a transfer
- -- (it is an appendix made of user callable functions)
- --
- -- Loaded by LoadDraw
-
- class Shape;
- ---Purpose : Gathers commands which only apply to shapes/geometry, and are
- -- not concerned by XSTEP features for files
- -- This set of functions just enriches the standard DRAW set,
- -- with either useful but lacking basic functions, or complements
- -- used in transfer operations, or specific control functions
- -- Loaded by LoadDraw
-
- class Vars;
- ---Purpose : Takes variables to/from the DRAW session
-
- --class ProgressIndicator;
- ---Purpose : Implements ProgressIndicator for DRAW
-
- -- Linking with DRAW function set
-
- ChangeCommand (oldname,newname : CString);
- ---Purpose : Changes the name under which a command of xstep is known by
- -- Draw. This allows to avoid collisions
- -- To be called before LoadDraw or any other xstep initialisation
-
- RemoveCommand (oldname : CString);
- ---Purpose : Removes a command from the interpretation list of Draw
- -- To be called before LoadDraw or any other xstep initialisation
-
- LoadSession returns Boolean;
- ---Purpose : Defines the basic context to work with a X-STEP Session :
- -- it performs the basic inits, also records the Controller
- -- If the Controller is not yet set, it must be set after
- -- (call to SetController)
- -- LoadSession is called by LoadDraw
- -- Returns True the first time, False if already called
-
- LoadDraw (theCommands : in out Interpretor from Draw);
- ---Purpose : Defines the context for using a X-STEP Session under DRAW
- -- Once the various INITs have been done, a call to LoadDraw
- -- records the defined commands for the X-STEP SessionPilot,
- -- into the DRAW interpretation list.
- -- "Set" commands are accessed under command xset
- -- SDS>xset name command ...
- -- Other commands can be accessed directly or under command xstep
- -- SDS>command ... and SDS>xstep command ... are equivalent
- --
- -- Only the command xinit is accessed directly only :
- -- SDS>xinit (from the already defined Controller)
- -- SDS>xinit iges (first defines the Controller as for "iges")
- --
- -- It also records the function to be called by DRAW (not
- -- declared because specific).
- -- And it defines the context variables, i.e. a WorkSession, then
- -- it calls SetController with the currently defined Controller
- -- Remark : at least, the standard commands are recorded
- --
- -- See also Controller : it is part of the Context, but it must
- -- be precised separately
-
- Execute (command : CString; var : CString = "") returns Integer;
- ---Purpose : Allows to execute a xstep-draw command from C++ program
- -- Fixed form : Execute("command args...");
- -- Form with a variable text part : add %s for the variable :
- -- Execute ("command args %s args..",var) [var is a CString]
- -- Returns the same value as returned by call from DRAW
-
- Pilot returns mutable SessionPilot from IFSelect;
- ---Purpose : Returns the SessionPilot (can be used for direct call)
-
- Session returns mutable WorkSession from XSControl;
- ---Purpose : Returns the WorkSession defined in AddDraw (through Pilot)
- -- It is from XSControl, it brings functionnalities for Transfers
-
- SetController (control : Controller from XSControl);
- ---Purpose : Defines a Controller for the command "xinit" and applies it
- -- (i.e. calls its method Customise)
-
- Controller returns Controller from XSControl;
- ---Purpose : Returns the Controller, a Null Handle if not yet defined
-
- SetNorm (normname : CString; profile : CString = "") returns Boolean;
- ---Purpose : Sets a norm by its name (controller recorded as <normname> )
- -- Returns True if done, False if this norm is unknown
- -- If <profile> is given, also sets the norm to <profile>
- -- (if <profile> is undefined for <normname>, it is ignored)
-
- -- Additionnal access to XSTEP data
-
- Protocol returns Protocol from Interface;
- ---Purpose : Returns the actually defined Protocol
-
- Model returns mutable InterfaceModel from Interface;
- ---Purpose : Returns the Model of the Session (it is Session()->Model() )
-
- SetModel (model : mutable InterfaceModel from Interface; file : CString = "");
- ---Purpose : Sets a Model in session (it is Session()->SetModel(model) )
- -- If <file> is defined, SetLoadedFile is also done
-
- NewModel returns InterfaceModel from Interface;
- ---Purpose : Produces a new model (from the Controller), can be Null
- -- Does not set it in the session
-
- Entity (num : Integer) returns Transient;
- ---Purpose : Returns the entity n0 <num> of the Model of the Session
- -- (it is StartingEntity)
- -- Null Handle if <num> is not suitable
-
- Number (ent : Transient) returns Integer;
- ---Purpose : Returns the number of an entity in the Model (StartingNumber)
- -- 0 if <ent> unknown in the model, or null
-
- SetTransferProcess (TP : mutable Transient);
- ---Purpose : Sets a TransferProcess in order to analyse it (see Activator)
- -- It can be either a FinderProcess or a TransientProcess, in
- -- that case a new TransferReader is created on it
-
- TransientProcess returns TransientProcess from Transfer;
- ---Purpose : Returns the TransferProcess : TransientProcess detained by
- -- the TransferReader
-
- FinderProcess returns FinderProcess from Transfer;
- ---Purpose : Returns the FinderProcess, detained by the TransferWriter
-
-
- InitTransferReader (mode : Integer);
- ---Purpose : Initialises a TransferReader, according to mode :
- -- 0 nullifies it, 1 clears it (not nullify)
- -- 2 sets it with TransientProcess & Model
- -- 3 idem plus roots of TransientProcess
- -- Remark : called with 0 at least at each SetModel/NewModel
-
- TransferReader returns TransferReader from XSControl;
- ---Purpose : Returns the current TransferReader, can be null
- -- It detains the TransientProcess
-
- -- Some useful functions
-
-
- GetEntity (name : CString = "") returns Transient;
- ---Purpose : Takes the name of an entity, either as argument, or (if <name>
- -- is empty) on keybord, and returns the entity
- -- name can be a label or a number (in alphanumeric), it is
- -- searched by NumberFromLabel from WorkSession.
- -- If <name> doesn't match en entity, a Null Handle is returned
-
- GetEntityNumber (name : CString = "") returns Integer;
- ---Purpose : Same as GetEntity, but returns the number in the model of the
- -- entity. Returns 0 for null handle
-
- GetList (first : CString = ""; second : CString = "")
- returns HSequenceOfTransient from TColStd;
- ---Purpose : Evaluates and returns a list of entity, from :
- -- keyboard if <first> and <second> are empty, see below
- -- first if second is empty : can be a number/label of an entity
- -- or the name of a selection to be evaluated (standard)
- -- first : name of a selection, evaluated from a list defined by
- -- second
- -- In case of failure, returns a Null Handle
-
- FileAndVar (file, var, def : CString;
- resfile, resvar : out AsciiString from TCollection)
- returns Boolean;
- ---Purpose : Analyses given file name and variable name, with a default
- -- name for variables. Returns resulting file name and variable
- -- name plus status "file to read"(True) or "already read"(False)
- -- In the latter case, empty resfile means no file available
- --
- -- If <file> is null or empty or equates ".", considers Session
- -- and returned status is False
- -- Else, returns resfile = file and status is True
- -- If <var> is neither null nor empty, resvar = var
- -- Else, the root part of <resfile> is considered, if defined
- -- Else, <def> is taken
-
- MoreShapes (list : in out mutable HSequenceOfShape from TopTools;
- name : CString) returns Integer;
- ---Purpose : Analyses a name as designating Shapes from DRAW variables or
- -- XSTEP transfer (last Transfer on Reading). <name> can be :
- -- "*" : all the root shapes produced by last Transfer (Read)
- -- i.e. considers roots of the TransientProcess
- -- a name : a name of a variable DRAW
- --
- -- Returns the count of designated Shapes. Their list is put in
- -- <list>. If <list> is null, it is firstly created. Then it is
- -- completed (Append without Clear) by the Shapes found
- -- Returns 0 if no Shape could be found
-
-end XSDRAW;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSDRAW.ixx>
+#include <XSDRAW.hxx>
#include <Dico_DictionaryOfInteger.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <IFSelect_Functions.hxx>
#include <IFSelect_SessionPilot.hxx>
#include <SWDRAW.hxx>
-//#include <XSDRAW_Shape.hxx>
#include <XSDRAW_Vars.hxx>
#include <XSControl_Functions.hxx>
#include <XSControl_FuncShape.hxx>
#include <Draw_Appli.hxx>
#include <XSControl.hxx>
#include <XSControl_TransferWriter.hxx>
-
#include <TopoDS_Shape.hxx>
#include <TransferBRep.hxx>
#include <DBRep.hxx>
-
#include <Interface_Macros.hxx>
#include <stdio.h>
#include <Message_Messenger.hxx>
#include <Message_PrinterOStream.hxx>
#include <Draw_Printer.hxx>
+#include <Draw_Interpretor.hxx>
+#include <IFSelect_SessionPilot.hxx>
+#include <Interface_Protocol.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Standard_Transient.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
static int deja = 0, dejald = 0;
//unused variable
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSDRAW_HeaderFile
+#define _XSDRAW_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <Handle_IFSelect_SessionPilot.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <XSControl_Controller.hxx>
+#include <Handle_Interface_Protocol.hxx>
+#include <Handle_Interface_InterfaceModel.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Transfer_FinderProcess.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <Handle_TColStd_HSequenceOfTransient.hxx>
+#include <Handle_TopTools_HSequenceOfShape.hxx>
+class Draw_Interpretor;
+class IFSelect_SessionPilot;
+class XSControl_WorkSession;
+class XSControl_Controller;
+class Interface_Protocol;
+class Interface_InterfaceModel;
+class Standard_Transient;
+class Transfer_TransientProcess;
+class Transfer_FinderProcess;
+class XSControl_TransferReader;
+class TColStd_HSequenceOfTransient;
+class TCollection_AsciiString;
+class TopTools_HSequenceOfShape;
+class XSDRAW_Functions;
+class XSDRAW_Shape;
+class XSDRAW_Vars;
+
+
+//! Basic package to work functions of X-STEP (IFSelect & Co) <br>
+//! under control of DRAW <br>
+//! <br>
+//! Works with some "static" data : a SessionPilot (used to run) <br>
+//! with its WorkSession and Model and TransferReader, a <br>
+//! FinderProcess <br>
+class XSDRAW {
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Takes variables to/from the DRAW session <br>//! Implements ProgressIndicator for DRAW <br>//! Changes the name under which a command of xstep is known by <br>
+ //! Draw. This allows to avoid collisions <br>
+ //! To be called before LoadDraw or any other xstep initialisation <br>
+ Standard_EXPORT static void ChangeCommand(const Standard_CString oldname,const Standard_CString newname) ;
+ //! Removes a command from the interpretation list of Draw <br>
+ //! To be called before LoadDraw or any other xstep initialisation <br>
+ Standard_EXPORT static void RemoveCommand(const Standard_CString oldname) ;
+ //! Defines the basic context to work with a X-STEP Session : <br>
+ //! it performs the basic inits, also records the Controller <br>
+ //! If the Controller is not yet set, it must be set after <br>
+ //! (call to SetController) <br>
+ //! LoadSession is called by LoadDraw <br>
+ //! Returns True the first time, False if already called <br>
+ Standard_EXPORT static Standard_Boolean LoadSession() ;
+ //! Defines the context for using a X-STEP Session under DRAW <br>
+ //! Once the various INITs have been done, a call to LoadDraw <br>
+ //! records the defined commands for the X-STEP SessionPilot, <br>
+ //! into the DRAW interpretation list. <br>
+ //! "Set" commands are accessed under command xset <br>
+ //! SDS>xset name command ... <br>
+ //! Other commands can be accessed directly or under command xstep <br>
+ //! SDS>command ... and SDS>xstep command ... are equivalent <br>
+ //! <br>
+ //! Only the command xinit is accessed directly only : <br>
+ //! SDS>xinit (from the already defined Controller) <br>
+ //! SDS>xinit iges (first defines the Controller as for "iges") <br>
+ //! <br>
+ //! It also records the function to be called by DRAW (not <br>
+ //! declared because specific). <br>
+ //! And it defines the context variables, i.e. a WorkSession, then <br>
+ //! it calls SetController with the currently defined Controller <br>
+ //! Remark : at least, the standard commands are recorded <br>
+ //! <br>
+ //! See also Controller : it is part of the Context, but it must <br>
+ //! be precised separately <br>
+ Standard_EXPORT static void LoadDraw(Draw_Interpretor& theCommands) ;
+ //! Allows to execute a xstep-draw command from C++ program <br>
+ //! Fixed form : Execute("command args..."); <br>
+ //! Form with a variable text part : add %s for the variable : <br>
+ //! Execute ("command args %s args..",var) [var is a CString] <br>
+ //! Returns the same value as returned by call from DRAW <br>
+ Standard_EXPORT static Standard_Integer Execute(const Standard_CString command,const Standard_CString var = "") ;
+ //! Returns the SessionPilot (can be used for direct call) <br>
+ Standard_EXPORT static Handle_IFSelect_SessionPilot Pilot() ;
+ //! Returns the WorkSession defined in AddDraw (through Pilot) <br>
+ //! It is from XSControl, it brings functionnalities for Transfers <br>
+ Standard_EXPORT static Handle_XSControl_WorkSession Session() ;
+ //! Defines a Controller for the command "xinit" and applies it <br>
+ //! (i.e. calls its method Customise) <br>
+ Standard_EXPORT static void SetController(const Handle(XSControl_Controller)& control) ;
+ //! Returns the Controller, a Null Handle if not yet defined <br>
+ Standard_EXPORT static Handle_XSControl_Controller Controller() ;
+ //! Sets a norm by its name (controller recorded as <normname> ) <br>
+ //! Returns True if done, False if this norm is unknown <br>
+ //! If <profile> is given, also sets the norm to <profile> <br>
+ //! (if <profile> is undefined for <normname>, it is ignored) <br>
+ Standard_EXPORT static Standard_Boolean SetNorm(const Standard_CString normname,const Standard_CString profile = "") ;
+ //! Returns the actually defined Protocol <br>
+ Standard_EXPORT static Handle_Interface_Protocol Protocol() ;
+ //! Returns the Model of the Session (it is Session()->Model() ) <br>
+ Standard_EXPORT static Handle_Interface_InterfaceModel Model() ;
+ //! Sets a Model in session (it is Session()->SetModel(model) ) <br>
+ //! If <file> is defined, SetLoadedFile is also done <br>
+ Standard_EXPORT static void SetModel(const Handle(Interface_InterfaceModel)& model,const Standard_CString file = "") ;
+ //! Produces a new model (from the Controller), can be Null <br>
+ //! Does not set it in the session <br>
+ Standard_EXPORT static Handle_Interface_InterfaceModel NewModel() ;
+ //! Returns the entity n0 <num> of the Model of the Session <br>
+ //! (it is StartingEntity) <br>
+ //! Null Handle if <num> is not suitable <br>
+ Standard_EXPORT static Handle_Standard_Transient Entity(const Standard_Integer num) ;
+ //! Returns the number of an entity in the Model (StartingNumber) <br>
+ //! 0 if <ent> unknown in the model, or null <br>
+ Standard_EXPORT static Standard_Integer Number(const Handle(Standard_Transient)& ent) ;
+ //! Sets a TransferProcess in order to analyse it (see Activator) <br>
+ //! It can be either a FinderProcess or a TransientProcess, in <br>
+ //! that case a new TransferReader is created on it <br>
+ Standard_EXPORT static void SetTransferProcess(const Handle(Standard_Transient)& TP) ;
+ //! Returns the TransferProcess : TransientProcess detained by <br>
+ //! the TransferReader <br>
+ Standard_EXPORT static Handle_Transfer_TransientProcess TransientProcess() ;
+ //! Returns the FinderProcess, detained by the TransferWriter <br>
+ Standard_EXPORT static Handle_Transfer_FinderProcess FinderProcess() ;
+ //! Initialises a TransferReader, according to mode : <br>
+ //! 0 nullifies it, 1 clears it (not nullify) <br>
+ //! 2 sets it with TransientProcess & Model <br>
+ //! 3 idem plus roots of TransientProcess <br>
+ //! Remark : called with 0 at least at each SetModel/NewModel <br>
+ Standard_EXPORT static void InitTransferReader(const Standard_Integer mode) ;
+ //! Returns the current TransferReader, can be null <br>
+ //! It detains the TransientProcess <br>
+ Standard_EXPORT static Handle_XSControl_TransferReader TransferReader() ;
+ //! Takes the name of an entity, either as argument, or (if <name> <br>
+ //! is empty) on keybord, and returns the entity <br>
+ //! name can be a label or a number (in alphanumeric), it is <br>
+ //! searched by NumberFromLabel from WorkSession. <br>
+ //! If <name> doesn't match en entity, a Null Handle is returned <br>
+ Standard_EXPORT static Handle_Standard_Transient GetEntity(const Standard_CString name = "") ;
+ //! Same as GetEntity, but returns the number in the model of the <br>
+ //! entity. Returns 0 for null handle <br>
+ Standard_EXPORT static Standard_Integer GetEntityNumber(const Standard_CString name = "") ;
+ //! Evaluates and returns a list of entity, from : <br>
+ //! keyboard if <first> and <second> are empty, see below <br>
+ //! first if second is empty : can be a number/label of an entity <br>
+ //! or the name of a selection to be evaluated (standard) <br>
+ //! first : name of a selection, evaluated from a list defined by <br>
+ //! second <br>
+ //! In case of failure, returns a Null Handle <br>
+ Standard_EXPORT static Handle_TColStd_HSequenceOfTransient GetList(const Standard_CString first = "",const Standard_CString second = "") ;
+ //! Analyses given file name and variable name, with a default <br>
+ //! name for variables. Returns resulting file name and variable <br>
+ //! name plus status "file to read"(True) or "already read"(False) <br>
+ //! In the latter case, empty resfile means no file available <br>
+ //! <br>
+ //! If <file> is null or empty or equates ".", considers Session <br>
+ //! and returned status is False <br>
+ //! Else, returns resfile = file and status is True <br>
+ //! If <var> is neither null nor empty, resvar = var <br>
+ //! Else, the root part of <resfile> is considered, if defined <br>
+ //! Else, <def> is taken <br>
+ Standard_EXPORT static Standard_Boolean FileAndVar(const Standard_CString file,const Standard_CString var,const Standard_CString def,TCollection_AsciiString& resfile,TCollection_AsciiString& resvar) ;
+ //! Analyses a name as designating Shapes from DRAW variables or <br>
+ //! XSTEP transfer (last Transfer on Reading). <name> can be : <br>
+ //! "*" : all the root shapes produced by last Transfer (Read) <br>
+ //! i.e. considers roots of the TransientProcess <br>
+ //! a name : a name of a variable DRAW <br>
+ //! <br>
+ //! Returns the count of designated Shapes. Their list is put in <br>
+ //! <list>. If <list> is null, it is firstly created. Then it is <br>
+ //! completed (Append without Clear) by the Shapes found <br>
+ //! Returns 0 if no Shape could be found <br>
+ Standard_EXPORT static Standard_Integer MoreShapes(Handle(TopTools_HSequenceOfShape)& list,const Standard_CString name) ;
+
+private:
+
+friend class XSDRAW_Functions;
+friend class XSDRAW_Shape;
+friend class XSDRAW_Vars;
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+
+
+#endif
+++ /dev/null
--- Created on: 1995-03-16
--- 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 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.
-
-class Functions from XSDRAW
-
- ---Purpose : Defines additionnal commands for XSDRAW to :
- -- - control of initialisation (xinit, xnorm, newmodel)
- -- - analyse of the result of a transfer (recorded in a
- -- TransientProcess for Read, FinderProcess for Write) :
- -- statistics, various lists (roots,complete,abnormal), what
- -- about one specific entity, producing a model with the
- -- abnormal result
- --
- -- This appendix of XSDRAW is compiled separately to distinguish
- -- basic features from user callable forms
-
-uses CString
-
-is
-
- Init (myclass);
- ---Purpose : Defines and loads all basic functions for XSDRAW (as ActFunc)
-
-end Functions;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSDRAW_Functions.ixx>
+#include <XSDRAW_Functions.hxx>
#include <XSControl_FuncShape.hxx>
void XSDRAW_Functions::Init ()
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSDRAW_Functions_HeaderFile
+#define _XSDRAW_Functions_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+
+//! Defines additionnal commands for XSDRAW to : <br>
+//! - control of initialisation (xinit, xnorm, newmodel) <br>
+//! - analyse of the result of a transfer (recorded in a <br>
+//! TransientProcess for Read, FinderProcess for Write) : <br>
+//! statistics, various lists (roots,complete,abnormal), what <br>
+//! about one specific entity, producing a model with the <br>
+//! abnormal result <br>
+//! <br>
+//! This appendix of XSDRAW is compiled separately to distinguish <br>
+//! basic features from user callable forms <br>
+class XSDRAW_Functions
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Defines and loads all basic functions for XSDRAW (as ActFunc) <br>
+ Standard_EXPORT static void Init() ;
+};
+#endif
+++ /dev/null
--- Created on: 1997-04-22
--- 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 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.
-
-class Shape from XSDRAW
-
- ---Purpose : Defines functions to control shapes (in way useful for XSTEP),
- -- additional features which should be basic, or call tools which
- -- are bound with transfer needs.
- -- But these functions work on shapes, geometry, nothing else
- -- (no file, no model, no entity)
-
-uses CString, Interpretor from Draw
-
-is
-
- InitCommands (myclass; theCommands : in out Interpretor from Draw);
- ---Purpose : Defines and loads all basic functions for XSDRAW on Shapes
-
-end Shape;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSDRAW_Shape.ixx>
+#include <XSDRAW_Shape.hxx>
#include <SWDRAW_ShapeTool.hxx>
+#include <Draw_Interpretor.hxx>
//unused variable
//static int initactor = 0;
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSDRAW_Shape_HeaderFile
+#define _XSDRAW_Shape_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+
+class Draw_Interpretor;
+
+
+//! Defines functions to control shapes (in way useful for XSTEP), <br>
+//! additional features which should be basic, or call tools which <br>
+//! are bound with transfer needs. <br>
+//! But these functions work on shapes, geometry, nothing else <br>
+//! (no file, no model, no entity) <br>
+class XSDRAW_Shape
+{
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+ //! Defines and loads all basic functions for XSDRAW on Shapes <br>
+ Standard_EXPORT static void InitCommands(Draw_Interpretor& theCommands);
+
+};
+
+#endif
+++ /dev/null
--- Created on: 1998-07-22
--- Created by: Christian CAILLET
--- Copyright (c) 1998-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 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.
-
-class Vars from XSDRAW inherits Vars from XSControl
-
- ---Purpose : Vars for DRAW session (i.e. DBRep and DrawTrSurf)
-
-uses CString, Transient,
- Pnt from gp, Pnt2d from gp,
- Geometry from Geom, Curve from Geom, Curve from Geom2d, Surface from Geom,
- Shape from TopoDS
-
-is
-
- Create returns mutable Vars from XSDRAW;
-
- Set (me : mutable; name : CString; val : Transient) is redefined;
-
--- Get (me; name : CString) returns Transient is redefined; unused here
-
-
- GetGeom (me; name : in out CString) returns Geometry is redefined;
-
- GetCurve2d (me; name : in out CString) returns Curve from Geom2d is redefined;
-
- GetCurve (me; name : in out CString) returns Curve from Geom is redefined;
-
- GetSurface (me; name : in out CString) returns Surface from Geom is redefined;
-
- SetPoint (me : mutable; name : CString; val : Pnt from gp) is redefined;
-
- SetPoint2d (me : mutable; name : CString; val : Pnt2d from gp) is redefined;
-
- GetPoint (me; name : in out CString; pnt : out Pnt from gp) returns Boolean is redefined;
-
- GetPoint2d (me; name : in out CString; pnt : out Pnt2d from gp) returns Boolean is redefined;
-
-
- SetShape (me : mutable; name : CString; val : Shape from TopoDS) is redefined;
-
- GetShape (me; name : in out CString) returns Shape from TopoDS is redefined;
-
-end Vars;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <XSDRAW_Vars.ixx>
+#include <XSDRAW_Vars.hxx>
#include <Geom_Geometry.hxx>
#include <Geom2d_Curve.hxx>
-
#include <DrawTrSurf.hxx>
#include <DBRep.hxx>
-
#include <Interface_Macros.hxx>
+#include <Standard_Transient.hxx>
+#include <Geom_Geometry.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <TopoDS_Shape.hxx>
+#include <XSDRAW_Vars.hxx>
+#include <Standard_Type.hxx>
+
+IMPLEMENT_STANDARD_TYPE(XSDRAW_Vars)
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
+ STANDARD_TYPE(XSControl_Vars),
+ STANDARD_TYPE(MMgt_TShared),
+ STANDARD_TYPE(Standard_Transient),
+
+IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
+IMPLEMENT_STANDARD_TYPE_END(XSDRAW_Vars)
+IMPLEMENT_DOWNCAST(XSDRAW_Vars,Standard_Transient)
+IMPLEMENT_STANDARD_RTTI(XSDRAW_Vars)
XSDRAW_Vars::XSDRAW_Vars () { }
(const Standard_CString name,
const Handle(Standard_Transient)& val)
{
- //char* nam = name;
-// selon type
DeclareAndCast(Geom_Geometry,geom,val);
if (!geom.IsNull()) {
DrawTrSurf::Set(name,geom);
DrawTrSurf::Set(name,geom);
return;
}
-// ??
}
-/*
-Handle(Standard_Transient) XSDRAW_Vars::Get (const Standard_CString name) const
-{
- Handle(Standard_Transient) val;
- if (!thevars->GetItem (name,val)) val.Nullify();
- return val;
-}
-*/
-
-
Handle(Geom_Geometry) XSDRAW_Vars::GetGeom (Standard_CString& name) const
{ //char* nam = name;
return DrawTrSurf::Get(name);
--- /dev/null
+// Copyright (c) 2013 OPEN CASCADE SAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+#ifndef _XSDRAW_Vars_HeaderFile
+#define _XSDRAW_Vars_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+#include <XSControl_Vars.hxx>
+#include <Standard_CString.hxx>
+#include <Handle_Standard_Transient.hxx>
+#include <Handle_Geom_Geometry.hxx>
+#include <Handle_Geom2d_Curve.hxx>
+#include <Handle_Geom_Curve.hxx>
+#include <Handle_Geom_Surface.hxx>
+#include <Standard_Boolean.hxx>
+
+class Standard_Transient;
+class Geom_Geometry;
+class Geom2d_Curve;
+class Geom_Curve;
+class Geom_Surface;
+class gp_Pnt;
+class gp_Pnt2d;
+class TopoDS_Shape;
+class Standard_Transient;
+class Handle(Standard_Type);
+class Handle(XSControl_Vars);
+class XSDRAW_Vars;
+
+DEFINE_STANDARD_HANDLE(XSDRAW_Vars,XSControl_Vars)
+
+//! Vars for DRAW session (i.e. DBRep and DrawTrSurf) <br>
+class XSDRAW_Vars : public XSControl_Vars {
+
+public:
+
+ Standard_EXPORT XSDRAW_Vars();
+
+ Standard_EXPORT virtual void Set(const Standard_CString name,const Handle(Standard_Transient)& val) ;
+
+ Standard_EXPORT virtual Handle_Geom_Geometry GetGeom(Standard_CString& name) const;
+
+ Standard_EXPORT virtual Handle_Geom2d_Curve GetCurve2d(Standard_CString& name) const;
+
+ Standard_EXPORT virtual Handle_Geom_Curve GetCurve(Standard_CString& name) const;
+
+ Standard_EXPORT virtual Handle_Geom_Surface GetSurface(Standard_CString& name) const;
+
+ Standard_EXPORT virtual void SetPoint(const Standard_CString name,const gp_Pnt& val) ;
+
+ Standard_EXPORT virtual void SetPoint2d(const Standard_CString name,const gp_Pnt2d& val) ;
+
+ Standard_EXPORT virtual Standard_Boolean GetPoint(Standard_CString& name,gp_Pnt& pnt) const;
+
+ Standard_EXPORT virtual Standard_Boolean GetPoint2d(Standard_CString& name,gp_Pnt2d& pnt) const;
+
+ Standard_EXPORT virtual void SetShape(const Standard_CString name,const TopoDS_Shape& val) ;
+
+ Standard_EXPORT virtual TopoDS_Shape GetShape(Standard_CString& name) const;
+
+ DEFINE_STANDARD_RTTI(XSDRAW_Vars)
+
+};
+
+#endif