1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

28
src/XSControl/FILES Normal file
View File

@@ -0,0 +1,28 @@
XSControl.cxx
XSControl.hxx
XSControl_ConnectedShapes.cxx
XSControl_ConnectedShapes.hxx
XSControl_Controller.cxx
XSControl_Controller.hxx
XSControl_FuncShape.cxx
XSControl_FuncShape.hxx
XSControl_Functions.cxx
XSControl_Functions.hxx
XSControl_Reader.cxx
XSControl_Reader.hxx
XSControl_SelectForTransfer.cxx
XSControl_SelectForTransfer.hxx
XSControl_SignTransferStatus.cxx
XSControl_SignTransferStatus.hxx
XSControl_TransferReader.cxx
XSControl_TransferReader.hxx
XSControl_TransferWriter.cxx
XSControl_TransferWriter.hxx
XSControl_Utils.cxx
XSControl_Utils.hxx
XSControl_Vars.cxx
XSControl_Vars.hxx
XSControl_WorkSession.cxx
XSControl_WorkSession.hxx
XSControl_Writer.cxx
XSControl_Writer.hxx

View File

@@ -1,53 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package XSControl
---Purpose : This package provides complements to IFSelect & Co for
-- control of a session
uses Standard , MMgt, TCollection , TColStd, Dico,
Interface, Transfer, IFSelect, Message, MoniTool,
TopoDS, TopTools, TopAbs , Geom, Geom2d, gp
is
deferred class Controller;
class TransferReader;
class TransferWriter;
class WorkSession;
class SelectForTransfer;
class SignTransferStatus;
class ConnectedShapes;
class Reader;
class Writer;
class Functions;
class FuncShape;
class Utils;
class Vars;
Session (pilot : SessionPilot from IFSelect) returns WorkSession from XSControl;
---Purpose : Returns the WorkSession of a SessionPilot, but casts it as
-- from XSControl : it then gives access to Control & Transfers
Vars (pilot : SessionPilot from IFSelect) returns Vars from XSControl;
---Purpose : Returns the Vars of a SessionPilot, it is brought by Session
-- it provides access to external variables
end XSControl;

View File

@@ -11,7 +11,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl.ixx>
#include <IFSelect_SessionPilot.hxx>
#include <XSControl.hxx>
#include <XSControl_Vars.hxx>
#include <XSControl_WorkSession.hxx>
Handle(XSControl_WorkSession) XSControl::Session

View File

@@ -0,0 +1,95 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_HeaderFile
#define _XSControl_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class XSControl_WorkSession;
class IFSelect_SessionPilot;
class XSControl_Vars;
class XSControl_Controller;
class XSControl_TransferReader;
class XSControl_TransferWriter;
class XSControl_WorkSession;
class XSControl_SelectForTransfer;
class XSControl_SignTransferStatus;
class XSControl_ConnectedShapes;
class XSControl_Reader;
class XSControl_Writer;
class XSControl_Functions;
class XSControl_FuncShape;
class XSControl_Utils;
class XSControl_Vars;
//! This package provides complements to IFSelect & Co for
//! control of a session
class XSControl
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the WorkSession of a SessionPilot, but casts it as
//! from XSControl : it then gives access to Control & Transfers
Standard_EXPORT static Handle(XSControl_WorkSession) Session (const Handle(IFSelect_SessionPilot)& pilot);
//! Returns the Vars of a SessionPilot, it is brought by Session
//! it provides access to external variables
Standard_EXPORT static Handle(XSControl_Vars) Vars (const Handle(IFSelect_SessionPilot)& pilot);
protected:
private:
friend class XSControl_Controller;
friend class XSControl_TransferReader;
friend class XSControl_TransferWriter;
friend class XSControl_WorkSession;
friend class XSControl_SelectForTransfer;
friend class XSControl_SignTransferStatus;
friend class XSControl_ConnectedShapes;
friend class XSControl_Reader;
friend class XSControl_Writer;
friend class XSControl_Functions;
friend class XSControl_FuncShape;
friend class XSControl_Utils;
friend class XSControl_Vars;
};
#endif // _XSControl_HeaderFile

View File

@@ -1,66 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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;

View File

@@ -11,11 +11,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_ConnectedShapes.ixx>
#include <TopExp_Explorer.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TransferBRep.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_Graph.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <Transfer_TransientProcess.hxx>
#include <TransferBRep.hxx>
#include <XSControl_ConnectedShapes.hxx>
#include <XSControl_TransferReader.hxx>
XSControl_ConnectedShapes::XSControl_ConnectedShapes ()
: IFSelect_SelectExplore (1) { }

View File

@@ -0,0 +1,97 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_ConnectedShapes_HeaderFile
#define _XSControl_ConnectedShapes_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <IFSelect_SelectExplore.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TopAbs_ShapeEnum.hxx>
class XSControl_TransferReader;
class Standard_Transient;
class Interface_Graph;
class Interface_EntityIterator;
class TCollection_AsciiString;
class TopoDS_Shape;
class Transfer_TransientProcess;
class XSControl_ConnectedShapes;
DEFINE_STANDARD_HANDLE(XSControl_ConnectedShapes, IFSelect_SelectExplore)
//! 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
class XSControl_ConnectedShapes : public IFSelect_SelectExplore
{
public:
//! Creates a Selection ConnectedShapes. It remains to be set a
//! TransferReader
Standard_EXPORT XSControl_ConnectedShapes();
//! Creates a Selection ConnectedShapes, which will work with the
//! current TransferProcess brought by the TransferReader
Standard_EXPORT XSControl_ConnectedShapes(const Handle(XSControl_TransferReader)& TR);
//! Sets a TransferReader to sort entities : it brings the
//! TransferProcess which may change, while the TransferReader does not
Standard_EXPORT void SetReader (const Handle(XSControl_TransferReader)& TR);
//! Explores an entity : entities from which are connected to that
//! produced by this entity, including itself
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.
//! "Connected Entities through produced Shapes"
Standard_EXPORT TCollection_AsciiString ExploreLabel() const;
//! This functions considers a shape from a transfer and performs
//! the search function explained above
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,IFSelect_SelectExplore)
protected:
private:
Handle(XSControl_TransferReader) theTR;
};
#endif // _XSControl_ConnectedShapes_HeaderFile

View File

@@ -1,336 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 MoniTool,
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 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 MoniTool;
---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 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 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 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 : FinderProcess from Transfer;
model : 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 : FinderProcess from Transfer;
model : 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 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 : WorkSession; context : 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;

View File

@@ -11,62 +11,64 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_Controller.ixx>
#include <IFSelect_GeneralModifier.hxx>
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
#include <TColStd_IndexedMapOfTransient.hxx>
#include <MoniTool_Option.hxx>
#include <Dico_DictionaryOfTransient.hxx>
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
#include <IFSelect_DispPerCount.hxx>
#include <IFSelect_DispPerFiles.hxx>
#include <IFSelect_DispPerOne.hxx>
#include <IFSelect_DispPerSignature.hxx>
#include <IFSelect_EditForm.hxx>
#include <IFSelect_GeneralModifier.hxx>
#include <IFSelect_GraphCounter.hxx>
#include <IFSelect_IntParam.hxx>
#include <IFSelect_ParamEditor.hxx>
#include <IFSelect_SelectModelEntities.hxx>
#include <IFSelect_SelectModelRoots.hxx>
#include <IFSelect_SelectPointed.hxx>
#include <IFSelect_SelectSharing.hxx>
#include <IFSelect_SelectShared.hxx>
#include <IFSelect_SelectSharing.hxx>
#include <IFSelect_ShareOut.hxx>
#include <IFSelect_GraphCounter.hxx>
#include <XSControl_SelectForTransfer.hxx>
#include <IFSelect_SignAncestor.hxx>
#include <IFSelect_Signature.hxx>
#include <IFSelect_SignCategory.hxx>
#include <IFSelect_SignCounter.hxx>
#include <IFSelect_SignType.hxx>
#include <IFSelect_SignValidity.hxx>
#include <IFSelect_WorkLibrary.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Protocol.hxx>
#include <Interface_Static.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <MoniTool_Option.hxx>
#include <MoniTool_Profile.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <TColStd_IndexedMapOfTransient.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_ActorOfFinderProcess.hxx>
#include <Transfer_ActorOfTransientProcess.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransientMapper.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <XSControl_ConnectedShapes.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_SelectForTransfer.hxx>
#include <XSControl_SignTransferStatus.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
#include <IFSelect_SignType.hxx>
#include <IFSelect_SignCounter.hxx>
#include <IFSelect_SignCategory.hxx>
#include <IFSelect_SignValidity.hxx>
#include <IFSelect_SignAncestor.hxx>
#include <IFSelect_DispPerOne.hxx>
#include <IFSelect_DispPerCount.hxx>
#include <IFSelect_DispPerFiles.hxx>
#include <IFSelect_DispPerSignature.hxx>
#include <IFSelect_IntParam.hxx>
// ParamEditor
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <Interface_Static.hxx>
#include <IFSelect_ParamEditor.hxx>
#include <IFSelect_EditForm.hxx>
#include <IFSelect_SelectModelRoots.hxx>
// Transferts
#include <Transfer_Binder.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransientMapper.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <Standard_DomainError.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <Message_Messenger.hxx>
#include <Message.hxx>
#include <Interface_Protocol.hxx>
#include <IFSelect_Signature.hxx>
#include <IFSelect_WorkLibrary.hxx>
#include <Transfer_ActorOfTransientProcess.hxx>
#include <Transfer_ActorOfFinderProcess.hxx>
static Handle(Dico_DictionaryOfTransient)& listadapt()
{
static Handle(Dico_DictionaryOfTransient) listad;

View File

@@ -0,0 +1,338 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_Controller_HeaderFile
#define _XSControl_Controller_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_SequenceOfTransient.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_CString.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <IFSelect_ReturnStatus.hxx>
class MoniTool_Profile;
class IFSelect_WorkLibrary;
class Interface_Protocol;
class IFSelect_Signature;
class Transfer_ActorOfTransientProcess;
class Transfer_ActorOfFinderProcess;
class Dico_DictionaryOfTransient;
class Standard_DomainError;
class XSControl_WorkSession;
class Interface_InterfaceModel;
class Standard_Transient;
class Transfer_FinderProcess;
class TopoDS_Shape;
class Interface_CheckIterator;
class XSControl_Controller;
DEFINE_STANDARD_HANDLE(XSControl_Controller, MMgt_TShared)
//! 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
class XSControl_Controller : public MMgt_TShared
{
public:
//! Changes names
//! if a name is empty, the formerly set one remains
//! Remark : Does not call Record or AutoRecord
Standard_EXPORT void SetNames (const Standard_CString longname, const Standard_CString shortname);
//! Records <me> is a general dictionary under Short and Long
//! Names (see method Name)
Standard_EXPORT void AutoRecord() const;
//! Records <me> in a general dictionary under a name
//! Error if <name> already used for another one
Standard_EXPORT void Record (const Standard_CString name) const;
//! Returns the Controller attached to a given name
//! Returns a Null Handle if <name> is unknown
Standard_EXPORT static Handle(XSControl_Controller) Recorded (const Standard_CString name);
//! 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
Standard_EXPORT static Handle(TColStd_HSequenceOfHAsciiString) ListRecorded (const Standard_Integer mode = 0);
//! 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)
Standard_EXPORT Standard_CString Name (const Standard_Boolean rsc = Standard_False) const;
//! 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)
Standard_EXPORT Handle(MoniTool_Profile) Profile() const;
//! Considers the current state of the Controller as defining a
//! configuration, newly created or already existing
Standard_EXPORT void DefineProfile (const Standard_CString confname);
//! Sets the Controller in a given Configuration of its Profile
//! Calls SettingProfile (which can be redefined)
//!
//! Returns True if done, False if <confname> unknown
Standard_EXPORT Standard_Boolean SetProfile (const Standard_CString confname);
//! This method is called by SetProfile, it can be redefined
//! for specific sub-class of Controller
//! The default does nothing
Standard_EXPORT virtual Standard_Boolean SettingProfile (const Standard_CString confname);
//! Applies a Configuration of the Profile to the WorkSession
//! I.E. calls SetProfile then fills WorkSession with definitions
Standard_EXPORT Standard_Boolean ApplyProfile (const Handle(XSControl_WorkSession)& WS, const Standard_CString confname);
//! Called by ApplyProfile, can be redefined for specific
//! sub-class of Controller
//! The default does nothing
Standard_EXPORT virtual Standard_Boolean ApplyingProfile (const Handle(XSControl_WorkSession)& WS, const Standard_CString confname);
//! Returns the Protocol attached to the Norm (from field)
Standard_EXPORT Handle(Interface_Protocol) Protocol() const;
//! Returns the SignType attached to the norm (from field)
Standard_EXPORT Handle(IFSelect_Signature) SignType() const;
//! Returns the WorkLibrary attached to the Norm. Remark that it
//! has to be in phase with the Protocol (read from field)
Standard_EXPORT Handle(IFSelect_WorkLibrary) WorkLibrary() const;
//! Creates a new empty Model ready to receive data of the Norm
//! Used to write data from Imagine to an interface file
Standard_EXPORT virtual Handle(Interface_InterfaceModel) NewModel() const = 0;
//! 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
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)
//! Read from field. Can be redefined
Standard_EXPORT virtual Handle(Transfer_ActorOfFinderProcess) ActorWrite() const;
//! 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
Standard_EXPORT virtual void UpdateStatics (const Standard_Integer mode, const Standard_CString criter = "") const;
//! 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
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)
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)
//! Actually only for shapes
//! Returns True if bounds are set, False else (then, free value)
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)
//! Actually only for shapes
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
//! empty if help not defined or not within bounds or if values are free
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
//! for a transfer to a Model.
//! By default, asks the ActorWrite if known (through a
//! TransientMapper). Can be redefined
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
//! 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
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
//! Asks the ActorWrite (through a ShapeMapper)
Standard_EXPORT virtual Standard_Boolean RecognizeWriteShape (const TopoDS_Shape& shape, const Standard_Integer modetrans = 0) const;
//! 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
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
//! 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
Standard_EXPORT virtual Handle(Standard_Transient) ClusterContext (const Handle(XSControl_WorkSession)& WS) const;
//! 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
Standard_EXPORT virtual Interface_CheckIterator ResolveCluster (const Handle(XSControl_WorkSession)& WS, const Handle(Standard_Transient)& context) const;
//! 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
Standard_EXPORT void AddControlItem (const Handle(Standard_Transient)& item, const Standard_CString name);
//! Returns a control item from its name, Null if <name> unknown
//! To be used then, it just remains to be down-casted
Standard_EXPORT Handle(Standard_Transient) ControlItem (const Standard_CString name) const;
//! Records the name of a Static to be traced for a given use
Standard_EXPORT void TraceStatic (const Standard_CString name, const Standard_Integer use);
//! 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
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
//! If <name> is unknown, returns a Null Handle
Standard_EXPORT Handle(Standard_Transient) SessionItem (const Standard_CString name) const;
//! Returns True if <item> is recorded as <setapplied = True>
Standard_EXPORT Standard_Boolean IsApplied (const Handle(Standard_Transient)& item) const;
//! 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
Standard_EXPORT virtual void Customise (Handle(XSControl_WorkSession)& WS);
//! Specific customisation method, which can be redefined
//! Default does nothing
Standard_EXPORT void Customising (Handle(XSControl_WorkSession)& WS);
Standard_EXPORT Handle(Dico_DictionaryOfTransient) AdaptorSession() const;
DEFINE_STANDARD_RTTI(XSControl_Controller,MMgt_TShared)
protected:
//! Initializing with names
//! <longname> is for the complete, official, long name
//! <shortname> is for the short name used for resources
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(MoniTool_Profile) theProfile;
Handle(Dico_DictionaryOfTransient) theItems;
TColStd_SequenceOfTransient theAdaptorApplied;
Handle(TColStd_HSequenceOfHAsciiString) theAdaptorHooks;
TColStd_SequenceOfTransient theParams;
TColStd_SequenceOfInteger theParamUses;
Handle(Interface_HArray1OfHAsciiString) theModeWriteShapeN;
};
#endif // _XSControl_Controller_HeaderFile

View File

@@ -1,69 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class FuncShape from XSControl
---Purpose : Defines additionnal commands for XSControl 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 XSControl is compiled separately to distinguish
-- basic features from user callable forms
uses CString, AsciiString from TCollection,
WorkSession 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;
list : in out HSequenceOfShape from TopTools;
name : CString) returns Integer;
---Purpose : Analyses a name as designating Shapes from a Vars or from
-- 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
FileAndVar (myclass; session : WorkSession from XSControl;
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
end FuncShape;

View File

@@ -11,67 +11,58 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_FuncShape.ixx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Geometry.hxx>
#include <IFSelect_Act.hxx>
#include <IFSelect_CheckCounter.hxx>
#include <IFSelect_Functions.hxx>
#include <IFSelect_SessionPilot.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <ShapeExtend_Explorer.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <XSControl.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSControl_Vars.hxx>
#include <IFSelect_Act.hxx>
#include <IFSelect_SessionPilot.hxx>
#include <IFSelect_Functions.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Transfer_TransientProcess.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_Finder.hxx>
#include <Transfer_Binder.hxx>
#include <Interface_CheckIterator.hxx>
//#include <TransferBRep_Analyzer.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <TransferBRep_ShapeListBinder.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <XSControl_ConnectedShapes.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_TransferReader.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <TransferBRep.hxx>
#include <BRepTools.hxx>
#include <TopoDS.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TopExp_Explorer.hxx>
#include <Geom_Geometry.hxx>
#include <Geom2d_Curve.hxx>
#include <IFSelect_CheckCounter.hxx>
#include <ShapeExtend_Explorer.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_Finder.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransientListBinder.hxx>
#include <Transfer_TransientProcess.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <TransferBRep_ShapeListBinder.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <XSControl.hxx>
#include <XSControl_ConnectedShapes.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_FuncShape.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_Vars.hxx>
#include <XSControl_WorkSession.hxx>
#include <Message_Messenger.hxx>
#include <Message.hxx>
#include <stdio.h>
//#include <TransferBRep_Analyzer.hxx>
// ######################################################################
// #### ####
// #### COMMANDS ####
// #### ####
// ######################################################################
//=======================================================================
//function : XSControl_tpdraw
//purpose :

View File

@@ -0,0 +1,100 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_FuncShape_HeaderFile
#define _XSControl_FuncShape_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
class XSControl_WorkSession;
class TCollection_AsciiString;
//! Defines additionnal commands for XSControl 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 XSControl is compiled separately to distinguish
//! basic features from user callable forms
class XSControl_FuncShape
{
public:
DEFINE_STANDARD_ALLOC
//! Defines and loads all functions which work on shapes for XSControl (as ActFunc)
Standard_EXPORT static void Init();
//! Analyses a name as designating Shapes from a Vars or from
//! 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
Standard_EXPORT static Standard_Integer MoreShapes (const Handle(XSControl_WorkSession)& session, Handle(TopTools_HSequenceOfShape)& list, const Standard_CString name);
//! 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
Standard_EXPORT static Standard_Boolean FileAndVar (const Handle(XSControl_WorkSession)& session, const Standard_CString file, const Standard_CString var, const Standard_CString def, TCollection_AsciiString& resfile, TCollection_AsciiString& resvar);
protected:
private:
};
#endif // _XSControl_FuncShape_HeaderFile

View File

@@ -1,32 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Functions from XSControl
---Purpose : Functions from XSControl gives access to actions which can be
-- commanded with the resources provided by XSControl: especially
-- Controller and Transfer
--
-- It works by adding functions by method Init
uses CString
is
Init (myclass);
---Purpose : Defines and loads all functions for XSControl (as ActFunc)
end Functions;

View File

@@ -11,49 +11,43 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_Functions.ixx>
#include <XSControl.hxx>
#include <XSControl_Controller.hxx>
#include <MoniTool_Profile.hxx>
#include <MoniTool_Option.hxx>
#include <MoniTool_TypedValue.hxx>
#include <Interface_Static.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <XSControl_WorkSession.hxx>
#include <IFSelect_Act.hxx>
#include <IFSelect_SessionPilot.hxx>
#include <IFSelect_Functions.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Transfer_TransientProcess.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_Binder.hxx>
#include <Interface_CheckIterator.hxx>
#include <IFSelect_CheckCounter.hxx>
#include <Transfer_TransferIterator.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
#include <IFSelect_Act.hxx>
#include <IFSelect_CheckCounter.hxx>
#include <IFSelect_Functions.hxx>
#include <IFSelect_SessionPilot.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Static.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <MoniTool_Option.hxx>
#include <MoniTool_Profile.hxx>
#include <MoniTool_TypedValue.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <Transfer_TransferIterator.hxx>
#include <Transfer_TransientProcess.hxx>
#include <XSControl.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_Functions.hxx>
#include <XSControl_SelectForTransfer.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_WorkSession.hxx>
//#include <TransferBRep_ShapeBinder.hxx>
//#include <TransferBRep_ShapeListBinder.hxx>
//#include <TransferBRep_ShapeMapper.hxx>
//#include <TransferBRep_OrientedShapeMapper.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_TransferReader.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <XSControl_SelectForTransfer.hxx>
#include <Interface_Macros.hxx>
#include <Message_Messenger.hxx>
#include <Message.hxx>
// #######################################################################
// ## ##
// ## ##
@@ -61,8 +55,6 @@
// ## ##
// ## ##
// #######################################################################
//=======================================================================
//function : xinit
//=======================================================================

View File

@@ -0,0 +1,64 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_Functions_HeaderFile
#define _XSControl_Functions_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
//! Functions from XSControl gives access to actions which can be
//! commanded with the resources provided by XSControl: especially
//! Controller and Transfer
//!
//! It works by adding functions by method Init
class XSControl_Functions
{
public:
DEFINE_STANDARD_ALLOC
//! Defines and loads all functions for XSControl (as ActFunc)
Standard_EXPORT static void Init();
protected:
private:
};
#endif // _XSControl_Functions_HeaderFile

View File

@@ -1,251 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 : 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 : 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;

View File

@@ -13,33 +13,33 @@
// pdn 26.02.99 added initializing of compound in function OneShape
//: gka 14.04.99: S4136: apply scaling
#include <XSControl_Reader.ixx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferReader.hxx>
#include <Interface_ShareFlags.hxx>
#include <IFSelect_Functions.hxx>
#include <ShapeExtend_Explorer.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <IFSelect_Functions.hxx>
#include <Interface_Check.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_ShareFlags.hxx>
#include <Interface_Static.hxx>
#include <Message_ProgressSentry.hxx>
#include <ShapeExtend_Explorer.hxx>
#include <Standard_Transient.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <Transfer_TransientProcess.hxx>
#include <Transfer_Binder.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_Reader.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
//#include <ShapeCustom.hxx>
#include <Interface_Static.hxx>
#include <Interface_Check.hxx>
#include <Message_ProgressSentry.hxx>
//#include <ShapeAlgo.hxx>
//#include <ShapeAlgo_AlgoContainer.hxx>
//=======================================================================
//function : XSControl_Reader
//purpose :
//=======================================================================
XSControl_Reader::XSControl_Reader ()
{
SetWS (new XSControl_WorkSession);

View File

@@ -0,0 +1,275 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_Reader_HeaderFile
#define _XSControl_Reader_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_SequenceOfTransient.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <Standard_CString.hxx>
#include <IFSelect_ReturnStatus.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <Standard_Integer.hxx>
#include <IFSelect_PrintCount.hxx>
class XSControl_WorkSession;
class Interface_InterfaceModel;
class Standard_Transient;
class TopoDS_Shape;
//! 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.
class XSControl_Reader
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a Reader from scratch (creates an empty WorkSession)
//! A WorkSession or a Controller must be provided before running
Standard_EXPORT XSControl_Reader();
//! Creates a Reader from scratch, with a norm name which
//! identifies a Controller
Standard_EXPORT XSControl_Reader(const Standard_CString norm);
//! Creates a Reader from an already existing Session, with a
//! Controller already set
//! Virtual destructor
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>
//! Returns True if done, False if <norm> is not available
Standard_EXPORT Standard_Boolean SetNorm (const Standard_CString norm);
//! Sets a specific session to <me>
Standard_EXPORT void SetWS (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! Returns the session used in <me>
Standard_EXPORT Handle(XSControl_WorkSession) WS() const;
//! Loads a file and returns the read status
//! Zero for a Model which compies with the Controller
Standard_EXPORT IFSelect_ReturnStatus ReadFile (const Standard_CString filename);
//! Returns the model. It can then be consulted (header, product)
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
//! 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.
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GiveList (const Standard_CString first = "", const Standard_CString second = "");
//! 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
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
//! a transfer to a Shape, and returns the number
//! of entities in the list
Standard_EXPORT virtual Standard_Integer NbRootsForTransfer();
//! Returns an IGES or STEP root
//! entity for translation. The entity is identified by its
//! rank in a list.
Standard_EXPORT Handle(Standard_Transient) RootForTransfer (const Standard_Integer num = 1);
//! Translates a root identified by the rank num in the model.
//! false is returned if no shape is produced.
Standard_EXPORT Standard_Boolean TransferOneRoot (const Standard_Integer num = 1);
//! Translates an IGES or STEP
//! entity identified by the rank num in the model.
//! false is returned if no shape is produced.
Standard_EXPORT Standard_Boolean TransferOne (const Standard_Integer num);
//! Translates an IGES or STEP
//! entity in the model. true is returned if a shape is
//! produced; otherwise, false is returned.
Standard_EXPORT Standard_Boolean TransferEntity (const Handle(Standard_Transient)& start);
//! 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.
Standard_EXPORT Standard_Integer TransferList (const Handle(TColStd_HSequenceOfTransient)& list);
//! Translates all translatable
//! roots and returns the number of successful translations.
//! Warning - This function clears existing output shapes first.
Standard_EXPORT Standard_Integer TransferRoots();
//! Clears the list of shapes that
//! may have accumulated in calls to TransferOne or TransferRoot.C
Standard_EXPORT void ClearShapes();
//! Returns the number of shapes produced by translation.
Standard_EXPORT Standard_Integer NbShapes() const;
//! 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.
Standard_EXPORT TopoDS_Shape Shape (const Standard_Integer num = 1) const;
//! 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.
Standard_EXPORT TopoDS_Shape OneShape() const;
//! 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
Standard_EXPORT void PrintCheckLoad (const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const;
//! 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.
Standard_EXPORT void PrintCheckTransfer (const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const;
//! 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.
Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
//! Gives statistics about Transfer
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
Standard_EXPORT TopTools_SequenceOfShape& Shapes();
Standard_Boolean therootsta;
TColStd_SequenceOfTransient theroots;
private:
Handle(XSControl_WorkSession) thesession;
TopTools_SequenceOfShape theshapes;
};
#endif // _XSControl_Reader_HeaderFile

View File

@@ -1,79 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 SelectForTransfer;
---Purpose : Creates a SelectForTransfer, non initialised
-- it sorts nothing, unless an Actor has been defined
Create (TR : TransferReader) returns 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 : 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;

View File

@@ -11,7 +11,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_SelectForTransfer.ixx>
#include <Interface_InterfaceModel.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <Transfer_ActorOfTransientProcess.hxx>
#include <XSControl_SelectForTransfer.hxx>
#include <XSControl_TransferReader.hxx>
XSControl_SelectForTransfer::XSControl_SelectForTransfer () { }

View File

@@ -0,0 +1,112 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_SelectForTransfer_HeaderFile
#define _XSControl_SelectForTransfer_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <IFSelect_SelectExtract.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class XSControl_TransferReader;
class Transfer_ActorOfTransientProcess;
class Standard_Transient;
class Interface_InterfaceModel;
class TCollection_AsciiString;
class XSControl_SelectForTransfer;
DEFINE_STANDARD_HANDLE(XSControl_SelectForTransfer, IFSelect_SelectExtract)
//! 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.
class XSControl_SelectForTransfer : public IFSelect_SelectExtract
{
public:
//! Creates a SelectForTransfer, non initialised
//! it sorts nothing, unless an Actor has been defined
Standard_EXPORT XSControl_SelectForTransfer();
//! Creates a SelectForTransfer, which will work with the
//! currently defined Actor brought by the TransferReader
Standard_EXPORT XSControl_SelectForTransfer(const Handle(XSControl_TransferReader)& TR);
//! Sets a TransferReader to sort entities : it brings the Actor,
//! which may change, while the TransferReader does not
Standard_EXPORT void SetReader (const Handle(XSControl_TransferReader)& TR);
//! Sets a precise actor to sort entities
//! This definition oversedes the creation with a TransferReader
Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfTransientProcess)& act);
//! Returns the Actor used as precised one.
//! Returns a Null Handle for a creation from a TransferReader
//! without any further setting
Standard_EXPORT Handle(Transfer_ActorOfTransientProcess) Actor() const;
//! Returns the Reader (if created with a Reader)
//! Returns a Null Handle if not created with a Reader
Standard_EXPORT Handle(XSControl_TransferReader) Reader() const;
//! Returns True for an Entity which is recognized by the Actor,
//! either the precised one, or the one defined by TransferReader
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)]"
Standard_EXPORT TCollection_AsciiString ExtractLabel() const;
DEFINE_STANDARD_RTTI(XSControl_SelectForTransfer,IFSelect_SelectExtract)
protected:
private:
Handle(XSControl_TransferReader) theTR;
Handle(Transfer_ActorOfTransientProcess) theAC;
};
#endif // _XSControl_SelectForTransfer_HeaderFile

View File

@@ -1,72 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 SignTransferStatus;
---Purpose : Creates a SignTransferStatus, not initialised
-- it gives nothing (empty string)
Create (TR : TransferReader) returns 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;

View File

@@ -11,12 +11,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_SignTransferStatus.ixx>
#include <Transfer_Binder.hxx>
#include <TCollection_AsciiString.hxx>
#include <Interface_Check.hxx>
//#include <stdio.h>
#include <Interface_Check.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_TransientProcess.hxx>
#include <XSControl_SignTransferStatus.hxx>
#include <XSControl_TransferReader.hxx>
//#include <stdio.h>
static TCollection_AsciiString& themes()
{
static TCollection_AsciiString tm;

View File

@@ -0,0 +1,106 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_SignTransferStatus_HeaderFile
#define _XSControl_SignTransferStatus_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <IFSelect_Signature.hxx>
#include <Standard_CString.hxx>
class XSControl_TransferReader;
class Transfer_TransientProcess;
class Standard_Transient;
class Interface_InterfaceModel;
class XSControl_SignTransferStatus;
DEFINE_STANDARD_HANDLE(XSControl_SignTransferStatus, IFSelect_Signature)
//! 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)
class XSControl_SignTransferStatus : public IFSelect_Signature
{
public:
//! Creates a SignTransferStatus, not initialised
//! it gives nothing (empty string)
Standard_EXPORT XSControl_SignTransferStatus();
//! Creates a SignTransferStatus, which will work on the current
//! TransientProcess brought by the TransferReader (its MapReader)
Standard_EXPORT XSControl_SignTransferStatus(const Handle(XSControl_TransferReader)& TR);
//! Sets a TransferReader to work
Standard_EXPORT void SetReader (const Handle(XSControl_TransferReader)& TR);
//! Sets a precise map to sign entities
//! This definition oversedes the creation with a TransferReader
Standard_EXPORT void SetMap (const Handle(Transfer_TransientProcess)& TP);
//! Returns the TransientProcess used as precised one
//! Returns a Null Handle for a creation from a TransferReader
//! without any further setting
Standard_EXPORT Handle(Transfer_TransientProcess) Map() const;
//! Returns the Reader (if created with a Reader)
//! Returns a Null Handle if not created with a Reader
Standard_EXPORT Handle(XSControl_TransferReader) Reader() const;
//! Returns the Signature for a Transient object, as its transfer
//! status
Standard_EXPORT Standard_CString Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const;
DEFINE_STANDARD_RTTI(XSControl_SignTransferStatus,IFSelect_Signature)
protected:
private:
Handle(XSControl_TransferReader) theTR;
Handle(Transfer_TransientProcess) theTP;
};
#endif // _XSControl_SignTransferStatus_HeaderFile

View File

@@ -1,358 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 TransferReader;
---Purpose : Creates a TransferReader, empty
-- General Management --
SetController (me : mutable; control : 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 : ActorOfTransientProcess);
---Purpose : Sets the Actor directly : this value will be used if the
-- Controller is not set
Actor (me : mutable) returns 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 TransientProcess;
---Purpose : Returns the currently used TransientProcess
-- It is computed from the model by TransferReadRoots, or by
-- BeginTransferRead
SetTransientProcess (me : mutable; TP : 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 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;

View File

@@ -13,54 +13,54 @@
//: abv 09.04.99: S4136: remove parameter lastpreci
// szv#11:CASCADE30:01Feb00 BRepBuilderAPI::Precision(p) removed
#include <XSControl_TransferReader.ixx>
#include <BRepBuilderAPI.hxx>
#include <BRepLib.hxx>
#include <Dico_DictionaryOfTransient.hxx>
#include <IFSelect_CheckCounter.hxx>
#include <IFSelect_SignatureList.hxx>
#include <Interface_Check.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_Graph.hxx>
#include <Interface_HGraph.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <Interface_MSG.hxx>
#include <Interface_SignLabel.hxx>
#include <Interface_Static.hxx>
#include <Message_Messenger.hxx>
#include <ShapeFix.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TopoDS_HShape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <Transfer_ActorOfTransientProcess.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <Transfer_ResultFromTransient.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransferOutput.hxx>
#include <Transfer_TransientProcess.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_BinderOfShape.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <TopoDS_HShape.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_Utils.hxx>
#include <TopTools_MapOfShape.hxx>
// Precision :
#include <Interface_Static.hxx>
#include <BRepBuilderAPI.hxx>
// Pour les regularites
#include <BRepLib.hxx>
#include <Interface_EntityIterator.hxx>
#include <IFSelect_SignatureList.hxx>
#include <Interface_MSG.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <Transfer_IteratorOfProcessForTransient.hxx>
#include <IFSelect_CheckCounter.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_SignLabel.hxx>
#include <Interface_Check.hxx>
#include <Message_Messenger.hxx>
#include <ShapeFix.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <stdio.h>
// Precision :
// Pour les regularites
//=======================================================================
//function : XSControl_TransferReader
//purpose :
//=======================================================================
XSControl_TransferReader::XSControl_TransferReader ()
{
}

View File

@@ -0,0 +1,375 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_TransferReader_HeaderFile
#define _XSControl_TransferReader_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_DataMapOfIntegerTransient.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <Interface_CheckStatus.hxx>
class XSControl_Controller;
class Interface_InterfaceModel;
class Interface_HGraph;
class Dico_DictionaryOfTransient;
class Transfer_ActorOfTransientProcess;
class Transfer_TransientProcess;
class Standard_Transient;
class Transfer_ResultFromModel;
class TopoDS_Shape;
class Interface_CheckIterator;
class Interface_Graph;
class XSControl_TransferReader;
DEFINE_STANDARD_HANDLE(XSControl_TransferReader, MMgt_TShared)
//! 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
class XSControl_TransferReader : public MMgt_TShared
{
public:
//! Creates a TransferReader, empty
Standard_EXPORT XSControl_TransferReader();
//! Sets a Controller. It is required to generate the Actor.
//! Elsewhere, the Actor must be provided directly
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& control);
//! Sets the Actor directly : this value will be used if the
//! Controller is not set
Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfTransientProcess)& actor);
//! 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.
Standard_EXPORT Handle(Transfer_ActorOfTransientProcess) Actor();
//! Sets an InterfaceModel. This causes former results, computed
//! from another one, to be lost (see also Clear)
Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model);
//! Sets a Graph and its InterfaceModel (calls SetModel)
Standard_EXPORT void SetGraph (const Handle(Interface_HGraph)& graph);
//! Returns the currently set InterfaceModel
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
//! Sets a Context : according to receiving appli, to be
//! interpreted by the Actor
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
//! Kind of the type, else a Null Handle
//! Returns True if OK, False if no Context
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
//! Rather for internal use (ex.: preparing and setting in once)
Standard_EXPORT Handle(Dico_DictionaryOfTransient)& Context();
//! Sets a new value for (loaded) file name
Standard_EXPORT void SetFileName (const Standard_CString name);
//! Returns actual value of file name
Standard_EXPORT Standard_CString FileName() const;
//! Clears data, according mode :
//! -1 all
//! 0 nothing done
//! +1 final results
//! +2 working data (model, context, transfer process)
Standard_EXPORT void Clear (const Standard_Integer mode);
//! Returns the currently used TransientProcess
//! It is computed from the model by TransferReadRoots, or by
//! BeginTransferRead
Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const;
//! Forces the TransientProcess
//! Remark : it also changes the Model and the Actor, from those
//! recorded in the new TransientProcess
Standard_EXPORT void SetTransientProcess (const Handle(Transfer_TransientProcess)& TP);
//! 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
Standard_EXPORT Standard_Boolean RecordResult (const Handle(Standard_Transient)& ent);
//! 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 ...)
Standard_EXPORT Standard_Boolean IsRecorded (const Handle(Standard_Transient)& ent) const;
//! Returns True if a final result is recorded AND BRINGS AN
//! EFFECTIVE RESULT (else, it brings only fail messages)
Standard_EXPORT Standard_Boolean HasResult (const Handle(Standard_Transient)& ent) const;
//! Returns the list of entities to which a final result is
//! attached (i.e. processed by RecordResult)
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) RecordedList() const;
//! 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
Standard_EXPORT Standard_Boolean Skip (const Handle(Standard_Transient)& ent);
//! Returns True if an entity is noted as skipped
Standard_EXPORT Standard_Boolean IsSkipped (const Handle(Standard_Transient)& ent) const;
//! 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)
Standard_EXPORT Standard_Boolean IsMarked (const Handle(Standard_Transient)& ent) const;
//! Returns the final result recorded for an entity, as such
Standard_EXPORT Handle(Transfer_ResultFromModel) FinalResult (const Handle(Standard_Transient)& ent) const;
//! Returns the label attached to an entity recorded for final,
//! or an empty string if not recorded
Standard_EXPORT Standard_CString FinalEntityLabel (const Handle(Standard_Transient)& ent) const;
//! Returns the number attached to the entity recorded for final,
//! or zero if not recorded (looks in the ResultFromModel)
Standard_EXPORT Standard_Integer FinalEntityNumber (const Handle(Standard_Transient)& ent) const;
//! Returns the final result recorded for a NUMBER of entity
//! (internal use). Null if out of range
Standard_EXPORT Handle(Transfer_ResultFromModel) ResultFromNumber (const Standard_Integer num) const;
//! Returns the resulting object as a Transient
//! Null Handle if no result or result not transient
Standard_EXPORT Handle(Standard_Transient) TransientResult (const Handle(Standard_Transient)& ent) const;
//! Returns the resulting object as a Shape
//! Null Shape if no result or result not a shape
Standard_EXPORT TopoDS_Shape ShapeResult (const Handle(Standard_Transient)& ent) const;
//! 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
Standard_EXPORT Standard_Boolean ClearResult (const Handle(Standard_Transient)& ent, const Standard_Integer mode);
//! 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
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
//! Returns a Null Handle if <res> not recorded or not a Shape
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
//! produced : it corresponds to a loop on EntityFromShapeResult,
//! but is optimised
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.
//! 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
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 :
//! - failsonly = False : any kind of check message
//! - failsonly = True : fails only
//! Returns False if <ent> is not recorded
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
//! 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
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
//! Returns True if done, False if data are not properly defined
//! (the Model, the Actor for Read)
Standard_EXPORT Standard_Boolean BeginTransfer();
//! Tells if an entity is recognized as a valid candidate for
//! Transfer. Calls method Recognize from the Actor (if known)
Standard_EXPORT Standard_Boolean Recognize (const Handle(Standard_Transient)& ent);
//! 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
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
//! 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
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
//! 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
Standard_EXPORT Standard_Integer TransferRoots (const Interface_Graph& G);
//! Clears the results attached to an entity
//! if <ents> equates the starting model, clears all results
Standard_EXPORT void TransferClear (const Handle(Standard_Transient)& ent, const Standard_Integer level = 0);
//! Prints statistics on current Trace File, according <what> and
//! <mode>. See PrintStatsProcess for details
Standard_EXPORT void PrintStats (const Standard_Integer what, const Standard_Integer mode = 0) const;
//! Returns the CheckList resulting from last TransferRead
//! i.e. from TransientProcess itself, recorded from last Clear
Standard_EXPORT Interface_CheckIterator LastCheckList() const;
//! 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
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) LastTransferList (const Standard_Boolean roots) const;
//! 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
Standard_EXPORT Handle(TopTools_HSequenceOfShape) ShapeResultList (const Standard_Boolean rec);
//! 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)
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
//! entities which are in <list> (filter)
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,MMgt_TShared)
protected:
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 // _XSControl_TransferReader_HeaderFile

View File

@@ -1,117 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 TransferWriter;
---Purpose : Creates a TransferWriter, empty, ready to run
-- with an empty FinderProcess (but no controller, etc)
FinderProcess (me) returns FinderProcess;
---Purpose : Returns the FinderProcess itself
SetFinderProcess (me : mutable; FP : 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 : 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 : 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;

View File

@@ -11,19 +11,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_TransferWriter.ixx>
#include <Interface_Check.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <Message_Messenger.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_ActorOfFinderProcess.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransientMapper.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_Utils.hxx>
#include <Message_Messenger.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Check.hxx>
XSControl_TransferWriter::XSControl_TransferWriter ()
{ theTransferWrite = new Transfer_FinderProcess; theTransferMode = 0; }

View File

@@ -0,0 +1,146 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_TransferWriter_HeaderFile
#define _XSControl_TransferWriter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Boolean.hxx>
#include <IFSelect_ReturnStatus.hxx>
class XSControl_Controller;
class Transfer_FinderProcess;
class Standard_Transient;
class Interface_InterfaceModel;
class TopoDS_Shape;
class Interface_CheckIterator;
class XSControl_TransferWriter;
DEFINE_STANDARD_HANDLE(XSControl_TransferWriter, MMgt_TShared)
//! 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
class XSControl_TransferWriter : public MMgt_TShared
{
public:
//! Creates a TransferWriter, empty, ready to run
//! with an empty FinderProcess (but no controller, etc)
Standard_EXPORT XSControl_TransferWriter();
//! Returns the FinderProcess itself
Standard_EXPORT Handle(Transfer_FinderProcess) FinderProcess() const;
//! Sets a new FinderProcess and forgets the former one
Standard_EXPORT void SetFinderProcess (const Handle(Transfer_FinderProcess)& FP);
//! Returns the currently used Controller
Standard_EXPORT Handle(XSControl_Controller) Controller() const;
//! Sets a new Controller, also sets a new FinderProcess
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& ctl);
//! Clears recorded data according a mode
//! 0 clears FinderProcess (results, checks)
//! -1 create a new FinderProcess
Standard_EXPORT void Clear (const Standard_Integer mode);
//! 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)
Standard_EXPORT Standard_Integer TransferMode() const;
//! Changes the Transfer Mode
Standard_EXPORT void SetTransferMode (const Standard_Integer mode);
//! Prints statistics on current Trace File, according what,mode
//! See PrintStatsProcess for details
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
//! candidate for a transfer to a model
//! Asks the Controller (RecognizeWriteTransient)
//! If <obj> is a HShape, calls RecognizeShape
Standard_EXPORT Standard_Boolean RecognizeTransient (const Handle(Standard_Transient)& obj);
//! 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
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
//! Asks the Controller (RecognizeWriteShape)
Standard_EXPORT Standard_Boolean RecognizeShape (const TopoDS_Shape& shape);
//! 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
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
//! check-list currently recorded in the FinderProcess
Standard_EXPORT Interface_CheckIterator CheckList() const;
//! 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
Standard_EXPORT Interface_CheckIterator ResultCheckList (const Handle(Interface_InterfaceModel)& model) const;
//! Forecast to print statitics about a FinderProcess
Standard_EXPORT static void PrintStatsProcess (const Handle(Transfer_FinderProcess)& TP, const Standard_Integer what, const Standard_Integer mode = 0);
DEFINE_STANDARD_RTTI(XSControl_TransferWriter,MMgt_TShared)
protected:
private:
Handle(XSControl_Controller) theController;
Handle(Transfer_FinderProcess) theTransferWrite;
Standard_Integer theTransferMode;
};
#endif // _XSControl_TransferWriter_HeaderFile

View File

@@ -1,216 +0,0 @@
-- Created on: 1995-12-04
-- Created by: Christian CAILLET
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Utils from XSControl
---Purpose : This class provides various useful utility routines, to
-- facilitate handling of most common data structures :
-- transients (type, type name ...),
-- strings (ascii or extended, pointed or handled or ...),
-- shapes (reading, writing, testing ...),
-- sequences & arrays (of strings, of transients, of shapes ...),
-- ...
--
-- Also it gives some helps on some data structures from XSTEP,
-- such as printing on standard trace file, recignizing most
-- currently used auxiliary types (Binder,Mapper ...)
uses CString, ExtString, Transient,
AsciiString, HAsciiString, ExtendedString, HExtendedString,
HSequenceOfInteger from TColStd,
HSequenceOfTransient, HSequenceOfHAsciiString, HSequenceOfHExtendedString,
Shape from TopoDS, HSequenceOfShape from TopTools, ShapeEnum from TopAbs,
Binder from Transfer
raises TypeMismatch
is
Create returns Utils;
---Purpose : the only use of this, is to allow a frontal to get one
-- distinct "Utils" set per separate engine
-- Trace File
-- the class TraceFile gives enough functions to work from ccl
-- except to print a line to the default trace file (ccl can't call it)
TraceLine (me; line : CString);
---Purpose : Just prints a line into the current Trace File. This allows to
-- better characterise the various trace outputs, as desired.
TraceLines (me; lines : Transient);
---Purpose : Just prints a line or a set of lines into the current Trace
-- File. <lines> can be a HAscii/ExtendedString (produces a print
-- without ending line) or a HSequence or HArray1 Of ..
-- (one new line per item)
-- General Functions on Sequences : below
-- Simple Transient Objects (complements) --
IsKind (me; item : Transient; what : Type) returns Boolean;
-- simply IsKind from Transient
TypeName (me; item : Transient; nopk : Boolean = Standard_False)
returns CString;
---Purpose : Returns the name of the dynamic type of an object, i.e. :
-- If it is a Type, its Name
-- If it is a object not a type, the Name of its DynamicType
-- If it is Null, an empty string
-- If <nopk> is False (D), gives complete name
-- If <nopk> is True, returns class name without package
-- List of Transients (HSequence or HArray1) --
TraValue (me; list : Transient; num : Integer)
returns Transient;
-- allowed : HSequenceOfTransient -> Transient,
-- HSequenceOfHAsciiString -> HAsciiString
-- out of range gives Null Handle
NewSeqTra (me) returns HSequenceOfTransient; -- empty new
AppendTra (me; seqval : HSequenceOfTransient;
traval : Transient);
-- Dates
DateString (me; yy,mm,dd,hh,mn,ss : Integer) returns CString;
DateValues (me; text : CString; yy,mm,dd,hh,mn,ss : out Integer);
-- -- Strings -- --
-- Ascii --
ToCString (me; strval : HAsciiString) returns CString;
ToCString (me; strval : AsciiString) returns CString;
ToHString (me; strcon : CString) returns HAsciiString;
ToAString (me; strcon : CString) returns AsciiString;
-- Extended --
ToEString (me; strval : HExtendedString) returns ExtString;
ToEString (me; strval : ExtendedString) returns ExtString;
ToHString (me; strcon : ExtString) returns HExtendedString;
ToXString (me; strcon : ExtString) returns ExtendedString;
-- Ascii <-> Extended --
AsciiToExtended (me; str : CString) returns ExtString;
IsAscii (me; str : ExtString) returns Boolean;
ExtendedToAscii (me; str : ExtString) returns CString;
-- List of Strings --
CStrValue (me; list : Transient; num : Integer) returns CString;
EStrValue (me; list : Transient; num : Integer) returns ExtString;
-- list : HSequence or HArray1 of (H)AsciiString or (H)ExtendedString
-- conversions Ascii<->Extended are done if required
-- out of range gives empty string
NewSeqCStr (me) returns HSequenceOfHAsciiString; -- empty
AppendCStr (me; seqval : HSequenceOfHAsciiString;
strval : CString);
NewSeqEStr (me) returns HSequenceOfHExtendedString; -- empty
AppendEStr (me; seqval : HSequenceOfHExtendedString;
strval : ExtString);
-- -- Shapes -- --
-- Direct Handling, Read-Write --
WriteShape (me; shape : Shape from TopoDS; filename : CString)
returns Boolean;
---Purpose : Writes a Shape under the internal BRepTools form
-- (an internal help utility)
-- Returns True if writing has succeeded, False else
NewShape (me) returns Shape from TopoDS;
---Purpose : Returns a new empty, undefined Shape, which can then be filled
-- by ReadShape
ReadShape (me; shape : in out Shape from TopoDS; filename : CString)
returns Boolean;
---Purpose : Reads a Shape from the internal BRepTools form and returns it
-- (an internal help utility)
-- Returns True if reading has succeeded, False else
IsNullShape (me; shape : Shape from TopoDS) returns Boolean;
---Purpose : Returns True if a Shape is Null
CompoundFromSeq (me; seqval : HSequenceOfShape)
returns Shape from TopoDS;
---Purpose : Converts a list of Shapes to a Compound (a kind of Shape)
ShapeType (me; shape : Shape from TopoDS; compound : Boolean)
returns ShapeEnum;
---Purpose : Returns the type of a Shape : true type if <compound> is False
-- If <compound> is True and <shape> is a Compound, iterates on
-- its items. If all are of the same type, returns this type.
-- Else, returns COMPOUND. If it is empty, returns SHAPE
-- For a Null Shape, returns SHAPE
SortedCompound (me; shape : Shape from TopoDS; type : ShapeEnum;
explore : Boolean; compound : Boolean)
returns Shape from TopoDS;
---Purpose : From a Shape, builds a Compound as follows :
-- explores it level by level
-- If <explore> is False, only COMPOUND items. Else, all items
-- Adds to the result, shapes which comply to <type>
-- + if <type> is WIRE, considers free edges (and makes wires)
-- + if <type> is SHELL, considers free faces (and makes shells)
-- If <compound> is True, gathers items in compounds which
-- correspond to starting COMPOUND,SOLID or SHELL containers, or
-- items directly contained in a Compound
-- -- List of Shapes -- --
ShapeValue (me; seqv : HSequenceOfShape from TopTools; num : Integer)
returns Shape from TopoDS;
-- out of range gives Null Handle
NewSeqShape (me) returns HSequenceOfShape; -- empty new
AppendShape (me; seqv : HSequenceOfShape;
shape : Shape from TopoDS);
-- Shape <-> Transient --
ShapeBinder (me; shape : Shape from TopoDS; hs : Boolean = Standard_True)
returns Transient;
---Purpose : Creates a Transient Object from a Shape : it is either a Binder
-- (used by functions which require a Transient but can process
-- a Shape, such as viewing functions) or a HShape (according to hs)
-- Default is a HShape
BinderShape (me; tr : Transient) returns Shape from TopoDS;
---Purpose : From a Transient, returns a Shape.
-- In fact, recognizes ShapeBinder ShapeMapper and HShape
-- -- Lists : others functions -- --
SeqLength (me; list : Transient) returns Integer;
-- list : HSequence of Transient,(H)Ascii/ExtendedString,Shape,Integer
SeqToArr (me; seq : Transient; first : Integer = 1)
returns Transient raises TypeMismatch;
-- <first> gives the lower index of produced array
-- empty sequence gives a null handle
ArrToSeq (me; arr : Transient)
returns Transient raises TypeMismatch;
-- allowed combinations :
-- HSequenceOfTransient <-> HArray1OfTransient
-- HSequenceOfHAsciiString <-> HArray1OfHAsciiString (from Interface)
-- Arrays are build from index <first>, by default 1
SeqIntValue (me; list : HSequenceOfInteger from TColStd; num : Integer)
returns Integer;
end Utils;

View File

@@ -11,32 +11,36 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_Utils.ixx>
#include <Message_Messenger.hxx>
#include <Message.hxx>
#include <Interface_Macros.hxx>
#include <Interface_MSG.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <TColStd_HSequenceOfExtendedString.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <TopoDS_HShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp_Explorer.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <Interface_Macros.hxx>
#include <Interface_MSG.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Transient.hxx>
#include <Standard_TypeMismatch.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TCollection_HExtendedString.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <TColStd_HSequenceOfExtendedString.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_HShape.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Wire.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeBinder.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <XSControl_Utils.hxx>
static TCollection_AsciiString bufasc;
static TCollection_ExtendedString bufext;

View File

@@ -0,0 +1,215 @@
// Created on: 1995-12-04
// Created by: Christian CAILLET
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_Utils_HeaderFile
#define _XSControl_Utils_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <Standard_ExtString.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <TColStd_HSequenceOfHExtendedString.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TColStd_HSequenceOfInteger.hxx>
class Standard_TypeMismatch;
class Standard_Transient;
class TCollection_HAsciiString;
class TCollection_AsciiString;
class TCollection_HExtendedString;
class TCollection_ExtendedString;
class TopoDS_Shape;
//! This class provides various useful utility routines, to
//! facilitate handling of most common data structures :
//! transients (type, type name ...),
//! strings (ascii or extended, pointed or handled or ...),
//! shapes (reading, writing, testing ...),
//! sequences & arrays (of strings, of transients, of shapes ...),
//! ...
//!
//! Also it gives some helps on some data structures from XSTEP,
//! such as printing on standard trace file, recignizing most
//! currently used auxiliary types (Binder,Mapper ...)
class XSControl_Utils
{
public:
DEFINE_STANDARD_ALLOC
//! the only use of this, is to allow a frontal to get one
//! distinct "Utils" set per separate engine
Standard_EXPORT XSControl_Utils();
//! Just prints a line into the current Trace File. This allows to
//! better characterise the various trace outputs, as desired.
Standard_EXPORT void TraceLine (const Standard_CString line) const;
//! Just prints a line or a set of lines into the current Trace
//! File. <lines> can be a HAscii/ExtendedString (produces a print
//! without ending line) or a HSequence or HArray1 Of ..
//! (one new line per item)
Standard_EXPORT void TraceLines (const Handle(Standard_Transient)& lines) const;
Standard_EXPORT Standard_Boolean IsKind (const Handle(Standard_Transient)& item, const Handle(Standard_Type)& what) const;
//! Returns the name of the dynamic type of an object, i.e. :
//! If it is a Type, its Name
//! If it is a object not a type, the Name of its DynamicType
//! If it is Null, an empty string
//! If <nopk> is False (D), gives complete name
//! If <nopk> is True, returns class name without package
Standard_EXPORT Standard_CString TypeName (const Handle(Standard_Transient)& item, const Standard_Boolean nopk = Standard_False) const;
Standard_EXPORT Handle(Standard_Transient) TraValue (const Handle(Standard_Transient)& list, const Standard_Integer num) const;
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) NewSeqTra() const;
Standard_EXPORT void AppendTra (const Handle(TColStd_HSequenceOfTransient)& seqval, const Handle(Standard_Transient)& traval) const;
Standard_EXPORT Standard_CString DateString (const Standard_Integer yy, const Standard_Integer mm, const Standard_Integer dd, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss) const;
Standard_EXPORT void DateValues (const Standard_CString text, Standard_Integer& yy, Standard_Integer& mm, Standard_Integer& dd, Standard_Integer& hh, Standard_Integer& mn, Standard_Integer& ss) const;
Standard_EXPORT Standard_CString ToCString (const Handle(TCollection_HAsciiString)& strval) const;
Standard_EXPORT Standard_CString ToCString (const TCollection_AsciiString& strval) const;
Standard_EXPORT Handle(TCollection_HAsciiString) ToHString (const Standard_CString strcon) const;
Standard_EXPORT TCollection_AsciiString ToAString (const Standard_CString strcon) const;
Standard_EXPORT Standard_ExtString ToEString (const Handle(TCollection_HExtendedString)& strval) const;
Standard_EXPORT Standard_ExtString ToEString (const TCollection_ExtendedString& strval) const;
Standard_EXPORT Handle(TCollection_HExtendedString) ToHString (const Standard_ExtString strcon) const;
Standard_EXPORT TCollection_ExtendedString ToXString (const Standard_ExtString strcon) const;
Standard_EXPORT Standard_ExtString AsciiToExtended (const Standard_CString str) const;
Standard_EXPORT Standard_Boolean IsAscii (const Standard_ExtString str) const;
Standard_EXPORT Standard_CString ExtendedToAscii (const Standard_ExtString str) const;
Standard_EXPORT Standard_CString CStrValue (const Handle(Standard_Transient)& list, const Standard_Integer num) const;
Standard_EXPORT Standard_ExtString EStrValue (const Handle(Standard_Transient)& list, const Standard_Integer num) const;
Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) NewSeqCStr() const;
Standard_EXPORT void AppendCStr (const Handle(TColStd_HSequenceOfHAsciiString)& seqval, const Standard_CString strval) const;
Standard_EXPORT Handle(TColStd_HSequenceOfHExtendedString) NewSeqEStr() const;
Standard_EXPORT void AppendEStr (const Handle(TColStd_HSequenceOfHExtendedString)& seqval, const Standard_ExtString strval) const;
//! Writes a Shape under the internal BRepTools form
//! (an internal help utility)
//! Returns True if writing has succeeded, False else
Standard_EXPORT Standard_Boolean WriteShape (const TopoDS_Shape& shape, const Standard_CString filename) const;
//! Returns a new empty, undefined Shape, which can then be filled
//! by ReadShape
Standard_EXPORT TopoDS_Shape NewShape() const;
//! Reads a Shape from the internal BRepTools form and returns it
//! (an internal help utility)
//! Returns True if reading has succeeded, False else
Standard_EXPORT Standard_Boolean ReadShape (TopoDS_Shape& shape, const Standard_CString filename) const;
//! Returns True if a Shape is Null
Standard_EXPORT Standard_Boolean IsNullShape (const TopoDS_Shape& shape) const;
//! Converts a list of Shapes to a Compound (a kind of Shape)
Standard_EXPORT TopoDS_Shape CompoundFromSeq (const Handle(TopTools_HSequenceOfShape)& seqval) const;
//! Returns the type of a Shape : true type if <compound> is False
//! If <compound> is True and <shape> is a Compound, iterates on
//! its items. If all are of the same type, returns this type.
//! Else, returns COMPOUND. If it is empty, returns SHAPE
//! For a Null Shape, returns SHAPE
Standard_EXPORT TopAbs_ShapeEnum ShapeType (const TopoDS_Shape& shape, const Standard_Boolean compound) const;
//! From a Shape, builds a Compound as follows :
//! explores it level by level
//! If <explore> is False, only COMPOUND items. Else, all items
//! Adds to the result, shapes which comply to <type>
//! + if <type> is WIRE, considers free edges (and makes wires)
//! + if <type> is SHELL, considers free faces (and makes shells)
//! If <compound> is True, gathers items in compounds which
//! correspond to starting COMPOUND,SOLID or SHELL containers, or
//! items directly contained in a Compound
Standard_EXPORT TopoDS_Shape SortedCompound (const TopoDS_Shape& shape, const TopAbs_ShapeEnum type, const Standard_Boolean explore, const Standard_Boolean compound) const;
Standard_EXPORT TopoDS_Shape ShapeValue (const Handle(TopTools_HSequenceOfShape)& seqv, const Standard_Integer num) const;
Standard_EXPORT Handle(TopTools_HSequenceOfShape) NewSeqShape() const;
Standard_EXPORT void AppendShape (const Handle(TopTools_HSequenceOfShape)& seqv, const TopoDS_Shape& shape) const;
//! Creates a Transient Object from a Shape : it is either a Binder
//! (used by functions which require a Transient but can process
//! a Shape, such as viewing functions) or a HShape (according to hs)
//! Default is a HShape
Standard_EXPORT Handle(Standard_Transient) ShapeBinder (const TopoDS_Shape& shape, const Standard_Boolean hs = Standard_True) const;
//! From a Transient, returns a Shape.
//! In fact, recognizes ShapeBinder ShapeMapper and HShape
Standard_EXPORT TopoDS_Shape BinderShape (const Handle(Standard_Transient)& tr) const;
Standard_EXPORT Standard_Integer SeqLength (const Handle(Standard_Transient)& list) const;
Standard_EXPORT Handle(Standard_Transient) SeqToArr (const Handle(Standard_Transient)& seq, const Standard_Integer first = 1) const;
Standard_EXPORT Handle(Standard_Transient) ArrToSeq (const Handle(Standard_Transient)& arr) const;
Standard_EXPORT Standard_Integer SeqIntValue (const Handle(TColStd_HSequenceOfInteger)& list, const Standard_Integer num) const;
protected:
private:
};
#endif // _XSControl_Utils_HeaderFile

View File

@@ -1,69 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Vars from XSControl inherits TShared from MMgt
---Purpose : Defines a receptacle for externally defined variables, each
-- one has a name
--
-- I.E. a WorkSession for XSTEP is generally used inside a
-- context, which brings variables, especially shapes and
-- geometries. For instance DRAW or an application engine
--
-- This class provides a common form for this. It also provides
-- a default implementation (locally recorded variables in a
-- dictionary), but which is aimed to be redefined
uses CString, Transient, DictionaryOfTransient,
Pnt from gp, Pnt2d from gp,
Geometry from Geom, Curve from Geom, Curve from Geom2d, Surface from Geom,
Shape from TopoDS
is
Create returns Vars;
Set (me : mutable; name : CString; val : Transient) is virtual;
Get (me; name : in out CString) returns Transient is virtual;
GetGeom (me; name : in out CString) returns Geometry is virtual;
GetCurve2d (me; name : in out CString) returns Curve from Geom2d is virtual;
GetCurve (me; name : in out CString) returns Curve from Geom is virtual;
GetSurface (me; name : in out CString) returns Surface from Geom is virtual;
SetPoint (me : mutable; name : CString; val : Pnt from gp) is virtual;
SetPoint2d (me : mutable; name : CString; val : Pnt2d from gp) is virtual;
GetPoint (me; name : in out CString; pnt : out Pnt from gp) returns Boolean is virtual;
GetPoint2d (me; name : in out CString; pnt : out Pnt2d from gp) returns Boolean is virtual;
SetShape (me : mutable; name : CString; val : Shape from TopoDS) is virtual;
GetShape (me; name : in out CString) returns Shape from TopoDS is virtual;
fields
thevars : DictionaryOfTransient;
end Vars;

View File

@@ -11,13 +11,22 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XSControl_Vars.ixx>
#include <Geom_CartesianPoint.hxx>
#include <Dico_DictionaryOfTransient.hxx>
#include <Geom2d_CartesianPoint.hxx>
#include <TopoDS_HShape.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Geometry.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <Interface_Macros.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_HShape.hxx>
#include <TopoDS_Shape.hxx>
#include <XSControl_Vars.hxx>
XSControl_Vars::XSControl_Vars ()
{ thevars = new Dico_DictionaryOfTransient; }

View File

@@ -0,0 +1,106 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_Vars_HeaderFile
#define _XSControl_Vars_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
class Dico_DictionaryOfTransient;
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 XSControl_Vars;
DEFINE_STANDARD_HANDLE(XSControl_Vars, MMgt_TShared)
//! Defines a receptacle for externally defined variables, each
//! one has a name
//!
//! I.E. a WorkSession for XSTEP is generally used inside a
//! context, which brings variables, especially shapes and
//! geometries. For instance DRAW or an application engine
//!
//! This class provides a common form for this. It also provides
//! a default implementation (locally recorded variables in a
//! dictionary), but which is aimed to be redefined
class XSControl_Vars : public MMgt_TShared
{
public:
Standard_EXPORT XSControl_Vars();
Standard_EXPORT virtual void Set (const Standard_CString name, const Handle(Standard_Transient)& val);
Standard_EXPORT virtual Handle(Standard_Transient) Get (Standard_CString& name) const;
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(XSControl_Vars,MMgt_TShared)
protected:
private:
Handle(Dico_DictionaryOfTransient) thevars;
};
#endif // _XSControl_Vars_HeaderFile

View File

@@ -1,235 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 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 : 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 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 : TransferReader);
---Purpose : Sets a Transfer Reader, which manages transfers on reading
TransferReader (me) returns TransferReader;
---Purpose : Returns the Transfer Reader, Null if not set
MapReader (me) returns TransientProcess;
---Purpose : Returns the TransientProcess(internal data for TransferReader)
SetMapReader (me : mutable; TP : 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 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 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 TransferWriter;
---Purpose : Returns the Transfer Reader, Null if not set
MapWriter (me) returns FinderProcess;
---Purpose : Returns the FinderProcess (internal data for TransferWriter)
SetMapWriter (me : mutable; FP : 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;

View File

@@ -13,40 +13,43 @@
//:i1 pdn 03.04.99 BUC60301
#include <XSControl_WorkSession.ixx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Interface_HGraph.hxx>
#include <Interface_Graph.hxx>
#include <MoniTool_Profile.hxx>
#include <Transfer_TransientProcess.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <Transfer_ResultFromTransient.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TransferBRep.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_Finder.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
// tpent
#include <Interface_IntVal.hxx>
#include <Geom2d_Point.hxx>
#include <Dico_DictionaryOfTransient.hxx>
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
#include <Interface_Macros.hxx>
#include <Geom2d_Point.hxx>
#include <Interface_Check.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_Graph.hxx>
#include <Interface_HGraph.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_IntVal.hxx>
#include <Interface_Macros.hxx>
#include <Message_Messenger.hxx>
#include <MoniTool_Profile.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_Finder.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_ResultFromModel.hxx>
#include <Transfer_ResultFromTransient.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransientProcess.hxx>
#include <TransferBRep.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_Vars.hxx>
#include <XSControl_WorkSession.hxx>
// tpent
//=======================================================================
//function : XSControl_WorkSession
//purpose :
//=======================================================================
XSControl_WorkSession::XSControl_WorkSession ()
{
theModeWriteShape = 0;

View File

@@ -0,0 +1,243 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_WorkSession_HeaderFile
#define _XSControl_WorkSession_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <IFSelect_WorkSession.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.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 XSControl_WorkSession;
DEFINE_STANDARD_HANDLE(XSControl_WorkSession, IFSelect_WorkSession)
//! 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
class XSControl_WorkSession : public IFSelect_WorkSession
{
public:
Standard_EXPORT XSControl_WorkSession();
//! 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
Standard_EXPORT virtual void ClearData (const Standard_Integer mode) Standard_OVERRIDE;
//! 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
Standard_EXPORT Standard_Boolean SelectNorm (const Standard_CString normname, const Standard_CString profile = "");
//! 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
Standard_EXPORT Standard_Boolean SelectProfile (const Standard_CString profile);
//! Selects a Norm defined by its Controller itself
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& ctl);
//! This method is called once a new norm has been successfully
//! selected. It can be redefined, default does nothing
Standard_EXPORT virtual void AdaptNorm();
//! 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
Standard_EXPORT Standard_CString SelectedNorm (const Standard_Boolean rsc = Standard_False) const;
//! Returns the norm controller itself
Standard_EXPORT Handle(XSControl_Controller) NormAdaptor() const;
//! Returns the current Context List, Null if not defined
//! The Context is given to the TransientProcess for TransferRead
Standard_EXPORT Handle(Dico_DictionaryOfTransient) Context() const;
//! Sets the current Context List, as a whole
//! Sets it to the TransferReader
Standard_EXPORT void SetAllContext (const Handle(Dico_DictionaryOfTransient)& context);
//! Clears the whole current Context (nullifies it)
Standard_EXPORT void ClearContext();
//! 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)
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 :
//! 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
Standard_EXPORT void InitTransferReader (const Standard_Integer mode);
//! Sets a Transfer Reader, which manages transfers on reading
Standard_EXPORT void SetTransferReader (const Handle(XSControl_TransferReader)& TR);
//! Returns the Transfer Reader, Null if not set
Standard_EXPORT Handle(XSControl_TransferReader) TransferReader() const;
//! Returns the TransientProcess(internal data for TransferReader)
Standard_EXPORT Handle(Transfer_TransientProcess) MapReader() const;
//! 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
Standard_EXPORT Standard_Boolean SetMapReader (const Handle(Transfer_TransientProcess)& TP);
//! 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
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
//! 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)
Standard_EXPORT Standard_Integer TransferReadOne (const Handle(Standard_Transient)& ents);
//! 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
Standard_EXPORT Standard_Integer TransferReadRoots();
//! 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)
Standard_EXPORT Handle(Interface_InterfaceModel) NewModel();
//! Returns the Transfer Reader, Null if not set
Standard_EXPORT Handle(XSControl_TransferWriter) TransferWriter() const;
//! Returns the FinderProcess (internal data for TransferWriter)
Standard_EXPORT Handle(Transfer_FinderProcess) MapWriter() const;
//! 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
Standard_EXPORT Standard_Boolean SetMapWriter (const Handle(Transfer_FinderProcess)& FP);
//! 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
Standard_EXPORT void SetModeWriteShape (const Standard_Integer mode);
//! Records the current Mode to Write Shapes
Standard_EXPORT Standard_Integer ModeWriteShape() const;
//! 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
Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape& shape, const Standard_Boolean compgraph = Standard_True);
//! 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)
Standard_EXPORT Interface_CheckIterator TransferWriteCheckList() const;
Standard_EXPORT Handle(XSControl_Vars) Vars() const;
Standard_EXPORT void SetVars (const Handle(XSControl_Vars)& newvars);
//! Clears binders
Standard_EXPORT void ClearBinders();
Standard_EXPORT void Destroy();
~XSControl_WorkSession()
{
Destroy();
}
DEFINE_STANDARD_RTTI(XSControl_WorkSession,IFSelect_WorkSession)
protected:
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 // _XSControl_WorkSession_HeaderFile

View File

@@ -1,73 +0,0 @@
-- 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 License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 : 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 : 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;

View File

@@ -13,12 +13,13 @@
//:i1 gka 03.04.99 BUC60301
#include <XSControl_Writer.ixx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferWriter.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Macros.hxx>
#include <TopoDS_Shape.hxx>
#include <XSControl_Controller.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSControl_Writer.hxx>
XSControl_Writer::XSControl_Writer ()
{

View File

@@ -0,0 +1,103 @@
// 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 License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XSControl_Writer_HeaderFile
#define _XSControl_Writer_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.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
//! Model compliant to a given norm, from a Shape
//! The model can then be edited by tools by other appropriate tools
class XSControl_Writer
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a Writer from scratch
Standard_EXPORT XSControl_Writer();
//! Creates a Writer from scratch, with a norm name which
//! identifie a Controller
Standard_EXPORT XSControl_Writer(const Standard_CString norm);
//! Creates a Writer from an already existing Session
//! If <scratch> is True (D), clears already recorded data
Standard_EXPORT XSControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! Sets a specific norm to <me>
//! Returns True if done, False if <norm> is not available
Standard_EXPORT Standard_Boolean SetNorm (const Standard_CString norm);
//! Sets a specific session to <me>
Standard_EXPORT void SetWS (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! Returns the session used in <me>
Standard_EXPORT Handle(XSControl_WorkSession) WS() const;
//! 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
Standard_EXPORT Handle(Interface_InterfaceModel) Model (const Standard_Boolean newone = Standard_False);
//! Transfers a Shape according to the mode
Standard_EXPORT IFSelect_ReturnStatus TransferShape (const TopoDS_Shape& sh, const Standard_Integer mode = 0);
//! Writes the produced model
Standard_EXPORT IFSelect_ReturnStatus WriteFile (const Standard_CString filename);
//! Prints Statistics about Transfer
Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
protected:
private:
Handle(XSControl_WorkSession) thesession;
};
#endif // _XSControl_Writer_HeaderFile