mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
84
src/STEPCAFControl/STEPCAFControl.cdl
Executable file
84
src/STEPCAFControl/STEPCAFControl.cdl
Executable file
@@ -0,0 +1,84 @@
|
||||
-- File: STEPCAFControl.cdl
|
||||
-- Created: Tue Apr 9 10:33:36 2000
|
||||
-- Author: Sergey MOZOKHIN
|
||||
-- <cky@fidox>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
package STEPCAFControl
|
||||
|
||||
---Purpose : This package provides external access and control for STEP,
|
||||
-- on the level of CAF (shapes with attributes, external
|
||||
-- references etc.)
|
||||
|
||||
uses
|
||||
Dico,
|
||||
TCollection,
|
||||
TColStd,
|
||||
TopTools,
|
||||
TopoDS,
|
||||
IFSelect,
|
||||
Transfer,
|
||||
XSControl,
|
||||
STEPControl,
|
||||
STEPConstruct,
|
||||
StepShape,
|
||||
StepRepr,
|
||||
StepBasic,
|
||||
ShapeBuild,
|
||||
TDF,
|
||||
TDocStd,
|
||||
XCAFDoc,
|
||||
MoniTool
|
||||
|
||||
is
|
||||
|
||||
class Reader;
|
||||
---Purpose: Reader for DECAF documents
|
||||
|
||||
class Writer;
|
||||
---Purpose: Writer for DECAF documents
|
||||
|
||||
class ExternFile;
|
||||
---Purpose: Auxiliary class to store results of translation of external file
|
||||
|
||||
class ActorWrite;
|
||||
class Controller;
|
||||
---Purpose: Extensions of standard STEP tools for DECAF specifics
|
||||
|
||||
class DictionaryOfExternFile instantiates
|
||||
Dictionary from Dico (ExternFile from STEPCAFControl);
|
||||
|
||||
class DataMapOfShapeSDR instantiates
|
||||
DataMap from TCollection (Shape from TopoDS,
|
||||
ShapeDefinitionRepresentation from StepShape,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
--- skl
|
||||
class DataMapOfShapePD instantiates
|
||||
DataMap from TCollection (Shape from TopoDS,
|
||||
ProductDefinition from StepBasic,
|
||||
ShapeMapHasher from TopTools);
|
||||
|
||||
class DataMapOfSDRExternFile instantiates
|
||||
DataMap from TCollection (ShapeDefinitionRepresentation from StepShape,
|
||||
ExternFile from STEPCAFControl,
|
||||
MapTransientHasher from TColStd);
|
||||
|
||||
--- skl
|
||||
class DataMapOfPDExternFile instantiates
|
||||
DataMap from TCollection (ProductDefinition from StepBasic,
|
||||
ExternFile from STEPCAFControl,
|
||||
MapTransientHasher from TColStd);
|
||||
|
||||
class DataMapOfLabelShape instantiates
|
||||
DataMap from TCollection (Label from TDF,
|
||||
Shape from TopoDS,
|
||||
LabelMapHasher from TDF);
|
||||
|
||||
class DataMapOfLabelExternFile instantiates
|
||||
DataMap from TCollection (Label from TDF,
|
||||
ExternFile from STEPCAFControl,
|
||||
LabelMapHasher from TDF);
|
||||
|
||||
end STEPCAFControl;
|
42
src/STEPCAFControl/STEPCAFControl_ActorWrite.cdl
Executable file
42
src/STEPCAFControl/STEPCAFControl_ActorWrite.cdl
Executable file
@@ -0,0 +1,42 @@
|
||||
-- File: STEPCAFControl_ActorWrite.cdl
|
||||
-- Created: Thu Oct 5 19:34:41 2000
|
||||
-- Author: Andrey BETENEV
|
||||
-- <abv@doomox.nnov.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
class ActorWrite from STEPCAFControl inherits ActorWrite from STEPControl
|
||||
|
||||
---Purpose: Extends ActorWrite from STEPControl by analysis of
|
||||
-- whether shape is assembly (based on information from DECAF)
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
MapOfShape from TopTools
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable ActorWrite;
|
||||
|
||||
IsAssembly (me; S: in out Shape from TopoDS) returns Boolean is redefined;
|
||||
---Purpose: Check whether shape S is assembly
|
||||
-- Returns True if shape is registered in assemblies map
|
||||
|
||||
SetStdMode (me: mutable; stdmode: Boolean = Standard_True);
|
||||
---Purpose: Set standard mode of work
|
||||
-- In standard mode Actor (default) behaves exactly as its
|
||||
-- ancestor, also map is cleared
|
||||
|
||||
ClearMap (me: mutable);
|
||||
---Purpose: Clears map of shapes registered as assemblies
|
||||
|
||||
RegisterAssembly (me: mutable; S: Shape from TopoDS);
|
||||
---Purpose: Registers shape to be written as assembly
|
||||
-- The shape should be TopoDS_Compound (else does nothing)
|
||||
|
||||
fields
|
||||
|
||||
myStdMode: Boolean;
|
||||
myMap: MapOfShape from TopTools;
|
||||
|
||||
end ActorWrite;
|
58
src/STEPCAFControl/STEPCAFControl_ActorWrite.cxx
Executable file
58
src/STEPCAFControl/STEPCAFControl_ActorWrite.cxx
Executable file
@@ -0,0 +1,58 @@
|
||||
// File: STEPCAFControl_ActorWrite.cxx
|
||||
// Created: Thu Oct 5 20:00:00 2000
|
||||
// Author: Andrey BETENEV
|
||||
// <abv@doomox.nnov.matra-dtv.fr>
|
||||
|
||||
#include <STEPCAFControl_ActorWrite.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : STEPCAFControl_ActorWrite
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
STEPCAFControl_ActorWrite::STEPCAFControl_ActorWrite () : myStdMode(Standard_True)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearMap
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void STEPCAFControl_ActorWrite::SetStdMode (const Standard_Boolean stdmode)
|
||||
{
|
||||
myStdMode = stdmode;
|
||||
if ( myStdMode ) ClearMap();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearMap
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void STEPCAFControl_ActorWrite::ClearMap ()
|
||||
{
|
||||
myMap.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RegisterAssembly
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void STEPCAFControl_ActorWrite::RegisterAssembly (const TopoDS_Shape &S)
|
||||
{
|
||||
if ( ! myStdMode && S.ShapeType() == TopAbs_COMPOUND ) myMap.Add ( S );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsAssembly
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean STEPCAFControl_ActorWrite::IsAssembly (TopoDS_Shape &S) const
|
||||
{
|
||||
if ( myStdMode ) return STEPControl_ActorWrite::IsAssembly ( S );
|
||||
return myMap.Contains ( S );
|
||||
}
|
||||
|
28
src/STEPCAFControl/STEPCAFControl_Controller.cdl
Executable file
28
src/STEPCAFControl/STEPCAFControl_Controller.cdl
Executable file
@@ -0,0 +1,28 @@
|
||||
-- File: STEPCAFControl_Controller.cdl
|
||||
-- Created: Thu Oct 5 18:49:55 2000
|
||||
-- Author: Andrey BETENEV
|
||||
-- <abv@doomox.nnov.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
class Controller from STEPCAFControl inherits Controller from STEPControl
|
||||
|
||||
---Purpose: Extends Controller from STEPControl in order to provide
|
||||
-- ActorWrite adapted for writing assemblies from DECAF
|
||||
-- Note that ActorRead from STEPControl is used for reading
|
||||
-- (inherited automatically)
|
||||
|
||||
uses
|
||||
ActorWrite from STEPCAFControl
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Controller;
|
||||
---Purpose : Initializes the use of STEP Norm (the first time)
|
||||
|
||||
Init (myclass) returns Boolean;
|
||||
---Purpose : Standard Initialisation. It creates a Controller for STEP-XCAF
|
||||
-- and records it to various names, available to select it later
|
||||
-- Returns True when done, False if could not be done
|
||||
|
||||
end Controller;
|
38
src/STEPCAFControl/STEPCAFControl_Controller.cxx
Executable file
38
src/STEPCAFControl/STEPCAFControl_Controller.cxx
Executable file
@@ -0,0 +1,38 @@
|
||||
// File: STEPCAFControl_Controller.cxx
|
||||
// Created: Thu Oct 5 19:05:26 2000
|
||||
// Author: Andrey BETENEV
|
||||
// <abv@doomox.nnov.matra-dtv.fr>
|
||||
|
||||
#include <STEPCAFControl_Controller.ixx>
|
||||
#include <STEPCAFControl_ActorWrite.hxx>
|
||||
#include <XSAlgo.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : STEPCAFControl_Controller
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
STEPCAFControl_Controller::STEPCAFControl_Controller ()
|
||||
{
|
||||
Handle(STEPCAFControl_ActorWrite) ActWrite = new STEPCAFControl_ActorWrite;
|
||||
theAdaptorWrite = ActWrite;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Init
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean STEPCAFControl_Controller::Init ()
|
||||
{
|
||||
static Standard_Boolean inic = Standard_False;
|
||||
if (inic) return Standard_True;
|
||||
inic = Standard_True;
|
||||
// self-registering
|
||||
Handle(STEPCAFControl_Controller) STEPCTL = new STEPCAFControl_Controller;
|
||||
// do XSAlgo::Init, cause it does not called before.
|
||||
XSAlgo::Init();
|
||||
// do something to avoid warnings...
|
||||
STEPCTL->AutoRecord();
|
||||
return Standard_True;
|
||||
}
|
73
src/STEPCAFControl/STEPCAFControl_ExternFile.cdl
Executable file
73
src/STEPCAFControl/STEPCAFControl_ExternFile.cdl
Executable file
@@ -0,0 +1,73 @@
|
||||
-- File: STEPCAFControl_ExternFile.cdl
|
||||
-- Created: Thu Sep 28 16:16:22 2000
|
||||
-- Author: Andrey BETENEV
|
||||
-- <abv@doomox.nnov.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
class ExternFile from STEPCAFControl inherits TShared from MMgt
|
||||
|
||||
---Purpose: Auxiliary class serving as container for data resulting
|
||||
-- from translation of external file
|
||||
|
||||
uses
|
||||
HAsciiString from TCollection,
|
||||
ReturnStatus from IFSelect,
|
||||
WorkSession from XSControl,
|
||||
Shape from TopoDS,
|
||||
Label from TDF
|
||||
|
||||
is
|
||||
|
||||
Create returns ExternFile;
|
||||
---Purpose: Creates an empty structure
|
||||
|
||||
SetWS (me: mutable; WS: WorkSession from XSControl);
|
||||
---C++: inline
|
||||
GetWS (me) returns WorkSession from XSControl;
|
||||
---C++: inline
|
||||
|
||||
SetLoadStatus (me: mutable; stat: ReturnStatus from IFSelect);
|
||||
---C++: inline
|
||||
GetLoadStatus (me) returns ReturnStatus from IFSelect;
|
||||
---C++: inline
|
||||
|
||||
SetTransferStatus (me: mutable; isok: Boolean);
|
||||
---C++: inline
|
||||
GetTransferStatus (me) returns Boolean;
|
||||
---C++: inline
|
||||
|
||||
SetWriteStatus (me: mutable; stat: ReturnStatus from IFSelect);
|
||||
---C++: inline
|
||||
GetWriteStatus (me) returns ReturnStatus from IFSelect;
|
||||
---C++: inline
|
||||
|
||||
SetName (me: mutable; name: HAsciiString from TCollection);
|
||||
---C++: inline
|
||||
GetName (me) returns HAsciiString from TCollection;
|
||||
---C++: inline
|
||||
|
||||
-- SetShape (me: mutable; S: Shape from TopoDS);
|
||||
---C++: inline
|
||||
-- GetShape (me) returns Shape from TopoDS;
|
||||
---C++: inline
|
||||
|
||||
SetLabel (me: mutable; L: Label from TDF);
|
||||
---C++: inline
|
||||
GetLabel (me) returns Label from TDF;
|
||||
---C++: inline
|
||||
|
||||
fields
|
||||
|
||||
myWS : WorkSession from XSControl;
|
||||
|
||||
myLoadStatus: ReturnStatus from IFSelect;
|
||||
myTransferStatus: Boolean;
|
||||
myWriteStatus: ReturnStatus from IFSelect;
|
||||
|
||||
myName: HAsciiString from TCollection;
|
||||
|
||||
-- myShape: Shape from TopoDS;
|
||||
myLabel: Label from TDF;
|
||||
|
||||
end ExternFile;
|
17
src/STEPCAFControl/STEPCAFControl_ExternFile.cxx
Executable file
17
src/STEPCAFControl/STEPCAFControl_ExternFile.cxx
Executable file
@@ -0,0 +1,17 @@
|
||||
// File: STEPCAFControl_ExternFile.cxx
|
||||
// Created: Thu Sep 28 16:35:48 2000
|
||||
// Author: Andrey BETENEV
|
||||
// <abv@doomox.nnov.matra-dtv.fr>
|
||||
|
||||
#include <STEPCAFControl_ExternFile.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : STEPCAFControl_ExternFile
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
STEPCAFControl_ExternFile::STEPCAFControl_ExternFile ()
|
||||
: myLoadStatus(IFSelect_RetVoid), myTransferStatus(Standard_False),
|
||||
myWriteStatus(IFSelect_RetVoid)
|
||||
{
|
||||
}
|
146
src/STEPCAFControl/STEPCAFControl_ExternFile.lxx
Executable file
146
src/STEPCAFControl/STEPCAFControl_ExternFile.lxx
Executable file
@@ -0,0 +1,146 @@
|
||||
// File: STEPCAFControl_ExternFile.lxx
|
||||
// Created: Thu Sep 28 16:38:15 2000
|
||||
// Author: Andrey BETENEV
|
||||
// <abv@doomox.nnov.matra-dtv.fr>
|
||||
|
||||
//=======================================================================
|
||||
//function : SetWS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void STEPCAFControl_ExternFile::SetWS (const Handle(XSControl_WorkSession) &WS)
|
||||
{
|
||||
myWS = WS;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetWS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(XSControl_WorkSession) STEPCAFControl_ExternFile::GetWS () const
|
||||
{
|
||||
return myWS;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLoadStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void STEPCAFControl_ExternFile::SetLoadStatus (const IFSelect_ReturnStatus stat)
|
||||
{
|
||||
myLoadStatus = stat;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetLoadStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline IFSelect_ReturnStatus STEPCAFControl_ExternFile::GetLoadStatus () const
|
||||
{
|
||||
return myLoadStatus;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransferStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void STEPCAFControl_ExternFile::SetTransferStatus (const Standard_Boolean isok)
|
||||
{
|
||||
myTransferStatus = isok;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTransferStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean STEPCAFControl_ExternFile::GetTransferStatus () const
|
||||
{
|
||||
return myTransferStatus;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetWriteStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void STEPCAFControl_ExternFile::SetWriteStatus (const IFSelect_ReturnStatus stat)
|
||||
{
|
||||
myWriteStatus = stat;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetWriteStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline IFSelect_ReturnStatus STEPCAFControl_ExternFile::GetWriteStatus () const
|
||||
{
|
||||
return myWriteStatus;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void STEPCAFControl_ExternFile::SetName (const Handle(TCollection_HAsciiString) &name)
|
||||
{
|
||||
myName = name;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(TCollection_HAsciiString) STEPCAFControl_ExternFile::GetName () const
|
||||
{
|
||||
return myName;
|
||||
}
|
||||
|
||||
/*
|
||||
//=======================================================================
|
||||
//function : SetShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void STEPCAFControl_ExternFile::SetShape (const TopoDS_Shape &Shape)
|
||||
{
|
||||
myShape = Shape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopoDS_Shape STEPCAFControl_ExternFile::GetShape () const
|
||||
{
|
||||
return myShape;
|
||||
}
|
||||
*/
|
||||
|
||||
//=======================================================================
|
||||
//function : SetLabel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void STEPCAFControl_ExternFile::SetLabel (const TDF_Label &Label)
|
||||
{
|
||||
myLabel = Label;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetLabel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TDF_Label STEPCAFControl_ExternFile::GetLabel () const
|
||||
{
|
||||
return myLabel;
|
||||
}
|
252
src/STEPCAFControl/STEPCAFControl_Reader.cdl
Executable file
252
src/STEPCAFControl/STEPCAFControl_Reader.cdl
Executable file
@@ -0,0 +1,252 @@
|
||||
-- File: STEPCAFControl_Reader.cdl
|
||||
-- Created: Tue Aug 15 12:01:29 2000
|
||||
-- Author: Andrey BETENEV
|
||||
-- <abv@doomox.nnov.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
class Reader from STEPCAFControl
|
||||
-- inherits Reader from STEPControl
|
||||
|
||||
---Purpose: Provides a tool to read STEP file and put it into
|
||||
-- DECAF document. Besides transfer of shapes (including
|
||||
-- assemblies) provided by STEPControl, supports also
|
||||
-- colors and part names
|
||||
--
|
||||
-- This reader supports reading files with external references
|
||||
-- i.e. multifile reading
|
||||
-- It behaves as usual Reader (from STEPControl) for the main
|
||||
-- file (e.g. if it is single file)
|
||||
-- Results of reading other files can be accessed by name of the
|
||||
-- file or by iterating on a readers
|
||||
|
||||
uses
|
||||
AsciiString from TCollection,
|
||||
WorkSession from XSControl,
|
||||
ReturnStatus from IFSelect,
|
||||
Shape from TopoDS,
|
||||
Document from TDocStd,
|
||||
Reader from STEPControl,
|
||||
NextAssemblyUsageOccurrence from StepRepr,
|
||||
DictionaryOfExternFile from STEPCAFControl,
|
||||
ExternFile from STEPCAFControl,
|
||||
ExternRefs from STEPConstruct,
|
||||
Tool from STEPConstruct,
|
||||
DataMapOfShapePD from STEPCAFControl,
|
||||
DataMapOfPDExternFile from STEPCAFControl,
|
||||
DataMapOfShapeLabel from XCAFDoc,
|
||||
MapOfShape from TopTools,
|
||||
ShapeTool from XCAFDoc,
|
||||
Label from TDF,
|
||||
LabelSequence from TDF,
|
||||
HSequenceOfTransient from TColStd
|
||||
|
||||
is
|
||||
|
||||
Create returns Reader;
|
||||
---Purpose: Creates a reader with an empty
|
||||
-- STEP model and sets ColorMode, LayerMode, NameMode and
|
||||
-- PropsMode to Standard_True.
|
||||
|
||||
Create (WS : mutable WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True) returns Reader;
|
||||
---Purpose: Creates a reader tool and attaches it to an already existing Session
|
||||
-- Clears the session if it was not yet set for STEP
|
||||
|
||||
Init (me: in out; WS : mutable WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True);
|
||||
---Purpose: Clears the internal data structures and attaches to a new session
|
||||
-- Clears the session if it was not yet set for STEP
|
||||
|
||||
ReadFile (me : in out; filename : CString)
|
||||
returns ReturnStatus from IFSelect;
|
||||
---Purpose: Loads a file and returns the read status
|
||||
-- Provided for use like single-file reader
|
||||
|
||||
NbRootsForTransfer (me: in out) returns Integer;
|
||||
---Purpose: Returns number of roots recognized for transfer
|
||||
-- Shortcut for Reader().NbRootsForTransfer()
|
||||
|
||||
TransferOneRoot (me: in out; num: Integer; doc: in out Document from TDocStd)
|
||||
returns Boolean;
|
||||
---Purpose: Translates currently loaded STEP file into the document
|
||||
-- Returns True if succeeded, and False in case of fail
|
||||
-- Provided for use like single-file reader
|
||||
|
||||
Transfer (me: in out; doc: in out Document from TDocStd)
|
||||
returns Boolean;
|
||||
---Purpose: Translates currently loaded STEP file into the document
|
||||
-- Returns True if succeeded, and False in case of fail
|
||||
-- Provided for use like single-file reader
|
||||
|
||||
Perform (me: in out; filename: AsciiString from TCollection;
|
||||
doc: in out Document from TDocStd) returns Boolean;
|
||||
|
||||
Perform (me: in out; filename: CString; doc: in out Document from TDocStd)
|
||||
returns Boolean;
|
||||
---Purpose: Translate STEP file given by filename into the document
|
||||
-- Return True if succeeded, and False in case of fail
|
||||
|
||||
---Scope: Access to fields
|
||||
|
||||
ExternFiles (me) returns DictionaryOfExternFile from STEPCAFControl;
|
||||
---Purpose: Returns data on external files
|
||||
-- Returns Null handle if no external files are read
|
||||
---C++: return const &
|
||||
|
||||
ExternFile (me; name: CString; ef: out ExternFile from STEPCAFControl)
|
||||
returns Boolean;
|
||||
---Purpose: Returns data on external file by its name
|
||||
-- Returns False if no external file with given name is read
|
||||
|
||||
ChangeReader (me: in out) returns Reader from STEPControl;
|
||||
---Purpose: Returns basic reader
|
||||
---C++: return &
|
||||
|
||||
Reader (me) returns Reader from STEPControl;
|
||||
---Purpose: Returns basic reader as const
|
||||
---C++: return const &
|
||||
|
||||
---Scope: Internal methods
|
||||
|
||||
Transfer (me: in out; rd: in out Reader from STEPControl;
|
||||
num: Integer;
|
||||
doc: in out Document from TDocStd;
|
||||
Lseq: out LabelSequence from TDF;
|
||||
asOne: Boolean = Standard_False)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Translates STEP file already loaded into the reader
|
||||
-- into the document
|
||||
-- If num==0, translates all roots, else only root number num
|
||||
-- Returns True if succeeded, and False in case of fail
|
||||
-- If asOne is True, in case of multiple results composes
|
||||
-- them into assembly. Fills sequence of produced labels
|
||||
|
||||
AddShape (me; S: Shape from TopoDS; STool: ShapeTool from XCAFDoc;
|
||||
NewShapesMap : MapOfShape from TopTools;
|
||||
ShapePDMap: DataMapOfShapePD from STEPCAFControl;
|
||||
PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
|
||||
ShapeLabelMap: in out DataMapOfShapeLabel from XCAFDoc)
|
||||
returns Label from TDF is protected;
|
||||
---Purpose: Add a shape to a document
|
||||
-- Depending on a case, this shape can be added as one, or
|
||||
-- as assembly, or (in case if it is associated with external
|
||||
-- reference) taken as that referred shape
|
||||
|
||||
ReadExternFile (me: in out; file, fullpath: CString; doc: in out Document from TDocStd)
|
||||
returns ExternFile from STEPCAFControl is protected;
|
||||
---Purpose: Reads (or if returns already read) extern file with
|
||||
-- given name
|
||||
|
||||
ReadColors (me; WS: WorkSession from XSControl;
|
||||
doc: in out Document from TDocStd;
|
||||
PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
|
||||
ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads style assignments from STEP model and sets
|
||||
-- corresponding color assignments in the DECAF document
|
||||
|
||||
ReadNames (me; WS: WorkSession from XSControl;
|
||||
doc: in out Document from TDocStd;
|
||||
PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
|
||||
ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads names of parts defined in the STEP model and
|
||||
-- assigns them to corresponding labels in the DECAF document
|
||||
|
||||
ReadValProps (me; WS: WorkSession from XSControl;
|
||||
doc: in out Document from TDocStd;
|
||||
PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
|
||||
ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads validation properties assigned to shapes in the STEP
|
||||
-- model and assigns them to corresponding labels in the DECAF
|
||||
-- document
|
||||
|
||||
ReadLayers (me; WS: WorkSession from XSControl;
|
||||
doc: in out Document from TDocStd)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads layers of parts defined in the STEP model and
|
||||
-- set reference between shape and layers in the DECAF document
|
||||
|
||||
ReadSHUOs (me; WS: WorkSession from XSControl;
|
||||
doc: in out Document from TDocStd;
|
||||
PDFileMap : DataMapOfPDExternFile from STEPCAFControl;
|
||||
ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads SHUO for instances defined in the STEP model and
|
||||
-- set reference between shape instances from different assemblyes
|
||||
|
||||
ReadGDTs (me; WS: WorkSession from XSControl;
|
||||
doc: in out Document from TDocStd)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads D> for instances defined in the STEP model and
|
||||
-- set reference between shape instances from different assemblyes
|
||||
|
||||
ReadMaterials (me; WS: WorkSession from XSControl;
|
||||
doc: in out Document from TDocStd;
|
||||
SeqPDS : HSequenceOfTransient from TColStd)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads materials for instances defined in the STEP model and
|
||||
-- set reference between shape instances from different assemblyes
|
||||
|
||||
FindInstance (myclass; NAUO: NextAssemblyUsageOccurrence from StepRepr;
|
||||
STool: ShapeTool from XCAFDoc;
|
||||
Tool: Tool from STEPConstruct;
|
||||
PDRFileMap : DataMapOfPDExternFile from STEPCAFControl;
|
||||
ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
|
||||
returns Label from TDF;
|
||||
---Purpose: Returns label of instance of an assembly component
|
||||
-- corresponding to a given NAUO
|
||||
|
||||
--- Work with fileds for different mode of reading STEP file.
|
||||
|
||||
SetColorMode(me: in out; colormode: Boolean from Standard);
|
||||
---Purpose: Set ColorMode for indicate read Colors or not.
|
||||
|
||||
GetColorMode(me) returns Boolean;
|
||||
|
||||
SetNameMode(me: in out; namemode: Boolean from Standard);
|
||||
---Purpose: Set NameMode for indicate read Name or not.
|
||||
|
||||
GetNameMode(me) returns Boolean;
|
||||
|
||||
SetLayerMode(me: in out; layermode: Boolean from Standard);
|
||||
---Purpose: Set LayerMode for indicate read Layers or not.
|
||||
|
||||
GetLayerMode(me) returns Boolean;
|
||||
|
||||
|
||||
SetPropsMode(me: in out; propsmode: Boolean from Standard);
|
||||
---Purpose: PropsMode for indicate read Validation properties or not.
|
||||
|
||||
GetPropsMode(me) returns Boolean;
|
||||
|
||||
SetSHUOMode(me: in out; shuomode: Boolean from Standard);
|
||||
---Purpose: Set SHUO mode for indicate write SHUO or not.
|
||||
|
||||
GetSHUOMode(me) returns Boolean;
|
||||
|
||||
SetGDTMode(me: in out; gdtmode: Boolean from Standard);
|
||||
---Purpose: Set GDT mode for indicate write GDT or not.
|
||||
|
||||
GetGDTMode(me) returns Boolean;
|
||||
|
||||
SetMatMode(me: in out; matmode: Boolean from Standard);
|
||||
---Purpose: Set Material mode
|
||||
|
||||
GetMatMode(me) returns Boolean;
|
||||
|
||||
fields
|
||||
|
||||
myReader : Reader from STEPControl;
|
||||
myFiles : DictionaryOfExternFile from STEPCAFControl;
|
||||
myColorMode : Boolean;
|
||||
myNameMode : Boolean;
|
||||
myLayerMode : Boolean;
|
||||
myPropsMode : Boolean;
|
||||
mySHUOMode : Boolean;
|
||||
myGDTMode : Boolean;
|
||||
myMatMode : Boolean;
|
||||
|
||||
end Reader;
|
2111
src/STEPCAFControl/STEPCAFControl_Reader.cxx
Executable file
2111
src/STEPCAFControl/STEPCAFControl_Reader.cxx
Executable file
File diff suppressed because it is too large
Load Diff
219
src/STEPCAFControl/STEPCAFControl_Writer.cdl
Executable file
219
src/STEPCAFControl/STEPCAFControl_Writer.cdl
Executable file
@@ -0,0 +1,219 @@
|
||||
-- File: STEPCAFControl_Writer.cdl
|
||||
-- Created: Tue Aug 15 17:23:00 2000
|
||||
-- Author: Andrey BETENEV
|
||||
-- <abv@doomox.nnov.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
class Writer from STEPCAFControl
|
||||
-- inherits Writer from STEPControl
|
||||
|
||||
---Purpose: Provides a tool to write DECAF document to the
|
||||
-- STEP file. Besides transfer of shapes (including
|
||||
-- assemblies) provided by STEPControl, supports also
|
||||
-- colors and part names
|
||||
--
|
||||
-- Also supports multifile writing
|
||||
|
||||
uses
|
||||
AsciiString from TCollection,
|
||||
ReturnStatus from IFSelect,
|
||||
WorkSession from XSControl,
|
||||
Shape from TopoDS,
|
||||
Writer from STEPControl,
|
||||
StepModelType from STEPControl,
|
||||
DictionaryOfExternFile from STEPCAFControl,
|
||||
ExternFile from STEPCAFControl,
|
||||
Label from TDF,
|
||||
LabelSequence from TDF,
|
||||
DataMapOfLabelShape from STEPCAFControl,
|
||||
DataMapOfLabelExternFile from STEPCAFControl,
|
||||
Document from TDocStd,
|
||||
DataMapOfShapeTransient from MoniTool
|
||||
|
||||
is
|
||||
|
||||
Create returns Writer;
|
||||
---Purpose: Creates a writer with an empty
|
||||
-- STEP model and sets ColorMode, LayerMode, NameMode and
|
||||
-- PropsMode to Standard_True.
|
||||
|
||||
Create (WS : mutable WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True) returns Writer;
|
||||
---Purpose: Creates a reader tool and attaches it to an already existing Session
|
||||
-- Clears the session if it was not yet set for STEP
|
||||
-- Clears the internal data structures
|
||||
|
||||
Init (me: in out; WS : mutable WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True);
|
||||
---Purpose: Clears the internal data structures and attaches to a new session
|
||||
-- Clears the session if it was not yet set for STEP
|
||||
|
||||
Write (me : in out; filename : CString)
|
||||
returns ReturnStatus from IFSelect;
|
||||
---Purpose: Writes all the produced models into file
|
||||
-- In case of multimodel with extern references,
|
||||
-- filename will be a name of root file, all other files
|
||||
-- have names of corresponding parts
|
||||
-- Provided for use like single-file writer
|
||||
|
||||
Transfer (me : in out; doc : Document from TDocStd;
|
||||
mode: StepModelType from STEPControl = STEPControl_AsIs;
|
||||
multi: CString = 0)
|
||||
returns Boolean;
|
||||
Transfer (me : in out; L: Label from TDF;
|
||||
mode: StepModelType from STEPControl = STEPControl_AsIs;
|
||||
multi: CString = 0)
|
||||
returns Boolean;
|
||||
---Purpose: Transfers a document (or single label) to a STEP model
|
||||
-- The mode of translation of shape is AsIs
|
||||
-- If multi is not null pointer, it switches to multifile
|
||||
-- mode (with external refs), and string pointed by <multi>
|
||||
-- gives prefix for names of extern files (can be empty string)
|
||||
-- Returns True if translation is OK
|
||||
|
||||
Perform (me : in out; doc : Document from TDocStd;
|
||||
filename: AsciiString from TCollection)
|
||||
returns Boolean;
|
||||
|
||||
Perform (me : in out; doc : Document from TDocStd; filename: CString)
|
||||
returns Boolean;
|
||||
---Purpose : Transfers a document and writes it to a STEP file
|
||||
-- Returns True if translation is OK
|
||||
|
||||
---Scope: Access to fields
|
||||
|
||||
ExternFiles (me) returns DictionaryOfExternFile from STEPCAFControl;
|
||||
---Purpose: Returns data on external files
|
||||
-- Returns Null handle if no external files are read
|
||||
---C++: return const &
|
||||
|
||||
ExternFile (me; L: Label from TDF; ef: out ExternFile from STEPCAFControl)
|
||||
returns Boolean;
|
||||
---Purpose: Returns data on external file by its original label
|
||||
-- Returns False if no external file with given name is read
|
||||
|
||||
ExternFile (me; name: CString; ef: out ExternFile from STEPCAFControl)
|
||||
returns Boolean;
|
||||
---Purpose: Returns data on external file by its name
|
||||
-- Returns False if no external file with given name is read
|
||||
|
||||
ChangeWriter (me: in out) returns Writer from STEPControl;
|
||||
---Purpose: Returns basic reader for root file
|
||||
---C++: return &
|
||||
|
||||
Writer (me) returns Writer from STEPControl;
|
||||
---Purpose: Returns basic reader as const
|
||||
---C++: return const &
|
||||
|
||||
---Scope: Internal methods
|
||||
|
||||
Transfer (me : in out; wr: in out Writer from STEPControl;
|
||||
labels: LabelSequence from TDF;
|
||||
mode: StepModelType from STEPControl = STEPControl_AsIs;
|
||||
multi: CString = 0;
|
||||
isExternFile: Boolean = Standard_False)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Transfers labels to a STEP model
|
||||
-- Returns True if translation is OK
|
||||
-- isExternFile setting from TransferExternFiles method
|
||||
|
||||
TransferExternFiles (me : in out; L: Label from TDF;
|
||||
mode: StepModelType from STEPControl;
|
||||
Lseq: out LabelSequence from TDF;
|
||||
prefix: CString = "")
|
||||
returns Shape from TopoDS is protected;
|
||||
---Purpose: Parses assembly structure of label L, writes all the simple
|
||||
-- shapes each to its own file named by name of its label plus
|
||||
-- prefix
|
||||
-- Returns shape representing that assembly structure
|
||||
-- in the form of nested empty compounds (and a sequence of
|
||||
-- labels which are newly written nodes of this assembly)
|
||||
|
||||
WriteExternRefs (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write external references to STEP
|
||||
|
||||
WriteColors (me: in out; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write colors assigned to specified labels, to STEP model
|
||||
|
||||
WriteNames (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write names assigned to specified labels, to STEP model
|
||||
|
||||
WriteDGTs (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write D>s assigned to specified labels, to STEP model
|
||||
|
||||
WriteMaterials (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write materials assigned to specified labels, to STEP model
|
||||
|
||||
WriteValProps (me; WS: WorkSession from XSControl;
|
||||
labels: LabelSequence from TDF; multi: CString)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write validation properties assigned to specified labels,
|
||||
-- to STEP model
|
||||
|
||||
WriteLayers (me; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write layers assigned to specified labels, to STEP model
|
||||
|
||||
WriteSHUOs (me: in out; WS: WorkSession from XSControl; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Write SHUO assigned to specified component, to STEP model
|
||||
|
||||
--- Work with fileds for different mode of writing STEP file.
|
||||
|
||||
SetColorMode(me: in out; colormode: Boolean from Standard);
|
||||
---Purpose: Set ColorMode for indicate write Colors or not.
|
||||
|
||||
GetColorMode(me) returns Boolean;
|
||||
|
||||
SetNameMode(me: in out; namemode: Boolean from Standard);
|
||||
---Purpose: Set NameMode for indicate write Name or not.
|
||||
|
||||
GetNameMode(me) returns Boolean;
|
||||
|
||||
SetLayerMode(me: in out; layermode: Boolean from Standard);
|
||||
---Purpose: Set LayerMode for indicate write Layers or not.
|
||||
|
||||
GetLayerMode(me) returns Boolean;
|
||||
|
||||
SetPropsMode(me: in out; propsmode: Boolean from Standard);
|
||||
---Purpose: PropsMode for indicate write Validation properties or not.
|
||||
|
||||
GetPropsMode(me) returns Boolean;
|
||||
|
||||
SetSHUOMode(me: in out; shuomode: Boolean from Standard);
|
||||
---Purpose: Set SHUO mode for indicate write SHUO or not.
|
||||
|
||||
GetSHUOMode(me) returns Boolean;
|
||||
|
||||
SetDimTolMode(me: in out; dimtolmode: Boolean from Standard);
|
||||
---Purpose: Set dimtolmode for indicate write D>s or not.
|
||||
|
||||
GetDimTolMode(me) returns Boolean;
|
||||
|
||||
SetMaterialMode(me: in out; matmode: Boolean from Standard);
|
||||
---Purpose: Set dimtolmode for indicate write D>s or not.
|
||||
|
||||
GetMaterialMode(me) returns Boolean;
|
||||
|
||||
fields
|
||||
|
||||
myWriter : Writer from STEPControl;
|
||||
myFiles : DictionaryOfExternFile from STEPCAFControl;
|
||||
myLabels : DataMapOfLabelShape from STEPCAFControl;
|
||||
myLabEF : DataMapOfLabelExternFile from STEPCAFControl;
|
||||
myColorMode: Boolean;
|
||||
myNameMode : Boolean;
|
||||
myLayerMode: Boolean;
|
||||
myPropsMode: Boolean;
|
||||
mySHUOMode : Boolean;
|
||||
myMapCompMDGPR : DataMapOfShapeTransient from MoniTool;
|
||||
myDGTMode : Boolean;
|
||||
myMatMode : Boolean;
|
||||
|
||||
end Writer;
|
2613
src/STEPCAFControl/STEPCAFControl_Writer.cxx
Executable file
2613
src/STEPCAFControl/STEPCAFControl_Writer.cxx
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user