1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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

View File

@@ -1,12 +1,29 @@
STEPCAFControl_DataMapOfShapeSDR.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfShapeSDR.hxx
STEPCAFControl_DataMapOfShapePD.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfShapePD.hxx
STEPCAFControl_DataMapOfSDRExternFile.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfSDRExternFile.hxx
STEPCAFControl_DataMapOfPDExternFile.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfPDExternFile.hxx
STEPCAFControl_DataMapOfLabelShape.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfLabelShape.hxx
STEPCAFControl_DataMapOfLabelExternFile.hxx
STEPCAFControl_ActorWrite.cxx
STEPCAFControl_ActorWrite.hxx
STEPCAFControl_Controller.cxx
STEPCAFControl_Controller.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfLabelExternFile.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfLabelShape.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfPDExternFile.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfSDRExternFile.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfShapePD.hxx
STEPCAFControl_DataMapIteratorOfDataMapOfShapeSDR.hxx
STEPCAFControl_DataMapOfLabelExternFile.hxx
STEPCAFControl_DataMapOfLabelShape.hxx
STEPCAFControl_DataMapOfPDExternFile.hxx
STEPCAFControl_DataMapOfSDRExternFile.hxx
STEPCAFControl_DataMapOfShapePD.hxx
STEPCAFControl_DataMapOfShapeSDR.hxx
STEPCAFControl_DictionaryOfExternFile.hxx
STEPCAFControl_DictionaryOfExternFile_0.cxx
STEPCAFControl_ExternFile.cxx
STEPCAFControl_ExternFile.hxx
STEPCAFControl_ExternFile.lxx
STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx
STEPCAFControl_IteratorOfDictionaryOfExternFile_0.cxx
STEPCAFControl_Reader.cxx
STEPCAFControl_Reader.hxx
STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx
STEPCAFControl_StackItemOfDictionaryOfExternFile_0.cxx
STEPCAFControl_Writer.cxx
STEPCAFControl_Writer.hxx

View File

@@ -1,80 +0,0 @@
-- Created on: 2000-04-09
-- Created by: Sergey MOZOKHIN
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public 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 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;
class Writer;
class ExternFile;
class ActorWrite;
class Controller;
class DictionaryOfExternFile instantiates
Dictionary from Dico (ExternFile from STEPCAFControl);
imported DataMapOfShapeSDR;
imported DataMapIteratorOfDataMapOfShapeSDR;
--- skl
imported DataMapOfShapePD;
imported DataMapIteratorOfDataMapOfShapePD;
imported DataMapOfSDRExternFile;
imported DataMapIteratorOfDataMapOfSDRExternFile;
--- skl
imported DataMapOfPDExternFile;
imported DataMapIteratorOfDataMapOfPDExternFile;
imported DataMapOfLabelShape;
imported DataMapIteratorOfDataMapOfLabelShape;
imported DataMapOfLabelExternFile;
imported DataMapIteratorOfDataMapOfLabelExternFile;
end STEPCAFControl;

View File

@@ -1,50 +0,0 @@
-- Created on: 2000-10-05
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public 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 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 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;

View File

@@ -13,13 +13,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPCAFControl_ActorWrite.ixx>
#include <Standard_Type.hxx>
#include <STEPCAFControl_ActorWrite.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : STEPCAFControl_ActorWrite
//purpose :
//=======================================================================
STEPCAFControl_ActorWrite::STEPCAFControl_ActorWrite () : myStdMode(Standard_True)
{
}

View File

@@ -0,0 +1,82 @@
// Created on: 2000-10-05
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_ActorWrite_HeaderFile
#define _STEPCAFControl_ActorWrite_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_MapOfShape.hxx>
#include <STEPControl_ActorWrite.hxx>
class TopoDS_Shape;
class STEPCAFControl_ActorWrite;
DEFINE_STANDARD_HANDLE(STEPCAFControl_ActorWrite, STEPControl_ActorWrite)
//! Extends ActorWrite from STEPControl by analysis of
//! whether shape is assembly (based on information from DECAF)
class STEPCAFControl_ActorWrite : public STEPControl_ActorWrite
{
public:
Standard_EXPORT STEPCAFControl_ActorWrite();
//! Check whether shape S is assembly
//! Returns True if shape is registered in assemblies map
Standard_EXPORT virtual Standard_Boolean IsAssembly (TopoDS_Shape& S) const Standard_OVERRIDE;
//! Set standard mode of work
//! In standard mode Actor (default) behaves exactly as its
//! ancestor, also map is cleared
Standard_EXPORT void SetStdMode (const Standard_Boolean stdmode = Standard_True);
//! Clears map of shapes registered as assemblies
Standard_EXPORT void ClearMap();
//! Registers shape to be written as assembly
//! The shape should be TopoDS_Compound (else does nothing)
Standard_EXPORT void RegisterAssembly (const TopoDS_Shape& S);
DEFINE_STANDARD_RTTI(STEPCAFControl_ActorWrite,STEPControl_ActorWrite)
protected:
private:
Standard_Boolean myStdMode;
TopTools_MapOfShape myMap;
};
#endif // _STEPCAFControl_ActorWrite_HeaderFile

View File

@@ -1,36 +0,0 @@
-- Created on: 2000-10-05
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public 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 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 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;

View File

@@ -13,16 +13,17 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPCAFControl_Controller.ixx>
#include <STEPCAFControl_ActorWrite.hxx>
#include <XSAlgo.hxx>
#include <Interface_Static.hxx>
#include <Standard_Type.hxx>
#include <STEPCAFControl_ActorWrite.hxx>
#include <STEPCAFControl_Controller.hxx>
#include <XSAlgo.hxx>
//=======================================================================
//function : STEPCAFControl_Controller
//purpose :
//=======================================================================
STEPCAFControl_Controller::STEPCAFControl_Controller ()
{
Handle(STEPCAFControl_ActorWrite) ActWrite = new STEPCAFControl_ActorWrite;

View File

@@ -0,0 +1,70 @@
// Created on: 2000-10-05
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_Controller_HeaderFile
#define _STEPCAFControl_Controller_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <STEPControl_Controller.hxx>
#include <Standard_Boolean.hxx>
class STEPCAFControl_Controller;
DEFINE_STANDARD_HANDLE(STEPCAFControl_Controller, STEPControl_Controller)
//! 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)
class STEPCAFControl_Controller : public STEPControl_Controller
{
public:
//! Initializes the use of STEP Norm (the first time)
Standard_EXPORT STEPCAFControl_Controller();
//! 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
Standard_EXPORT static Standard_Boolean Init();
DEFINE_STANDARD_RTTI(STEPCAFControl_Controller,STEPControl_Controller)
protected:
private:
};
#endif // _STEPCAFControl_Controller_HeaderFile

View File

@@ -0,0 +1,143 @@
// Created on: 2000-04-09
// Created by: Sergey MOZOKHIN
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_DictionaryOfExternFile_HeaderFile
#define _STEPCAFControl_DictionaryOfExternFile_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Character.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Standard_Size.hxx>
#include <Standard_Integer.hxx>
class STEPCAFControl_ExternFile;
class Standard_NoSuchObject;
class STEPCAFControl_IteratorOfDictionaryOfExternFile;
class STEPCAFControl_StackItemOfDictionaryOfExternFile;
class TCollection_AsciiString;
class STEPCAFControl_DictionaryOfExternFile;
DEFINE_STANDARD_HANDLE(STEPCAFControl_DictionaryOfExternFile, MMgt_TShared)
class STEPCAFControl_DictionaryOfExternFile : public MMgt_TShared
{
public:
Standard_EXPORT STEPCAFControl_DictionaryOfExternFile();
Standard_EXPORT Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact = Standard_False) const;
Standard_EXPORT Standard_Boolean HasItem (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Item (const Standard_CString name, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Item (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT Standard_Boolean GetItem (const Standard_CString name, Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT Standard_Boolean GetItem (const TCollection_AsciiString& name, Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT void SetItem (const Standard_CString name, const Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True);
Standard_EXPORT void SetItem (const TCollection_AsciiString& name, const Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Handle(STEPCAFControl_ExternFile)& NewItem (const Standard_CString name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Handle(STEPCAFControl_ExternFile)& NewItem (const TCollection_AsciiString& name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Standard_Boolean RemoveItem (const TCollection_AsciiString& name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True);
Standard_EXPORT void Clean();
Standard_EXPORT Standard_Boolean IsEmpty() const;
Standard_EXPORT void Clear();
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Copy() const;
Standard_EXPORT Standard_Boolean Complete (Handle(STEPCAFControl_DictionaryOfExternFile)& acell) const;
friend class STEPCAFControl_IteratorOfDictionaryOfExternFile;
DEFINE_STANDARD_RTTI(STEPCAFControl_DictionaryOfExternFile,MMgt_TShared)
protected:
private:
Standard_EXPORT void SetChar (const Standard_Character car);
Standard_EXPORT Standard_Boolean HasSub() const;
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Sub() const;
Standard_EXPORT Standard_Boolean HasNext() const;
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Next() const;
Standard_EXPORT void SetSub (const Handle(STEPCAFControl_DictionaryOfExternFile)& acell);
Standard_EXPORT void SetNext (const Handle(STEPCAFControl_DictionaryOfExternFile)& acell);
Standard_EXPORT void SearchCell (const Standard_CString name, const Standard_Size lmax, const Standard_Character car, const Standard_Size level, Handle(STEPCAFControl_DictionaryOfExternFile)& acell, Standard_Size& reslev, Standard_Integer& stat) const;
Standard_EXPORT void NewCell (const Standard_CString name, const Standard_Size namlen, Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const Standard_Size reslev, const Standard_Integer stat);
Standard_EXPORT Standard_Boolean HasIt() const;
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& It() const;
Standard_EXPORT Handle(STEPCAFControl_ExternFile)& ItAdr();
Standard_EXPORT void SetIt (const Handle(STEPCAFControl_ExternFile)& anitem);
Standard_EXPORT void DeclIt();
Standard_EXPORT void RemoveIt();
Standard_EXPORT Standard_Character CellChar() const;
Standard_EXPORT void GetCopied (const Handle(STEPCAFControl_DictionaryOfExternFile)& fromcell);
Standard_Character thecars[4];
Handle(STEPCAFControl_DictionaryOfExternFile) thesub;
Handle(STEPCAFControl_DictionaryOfExternFile) thenext;
Handle(STEPCAFControl_ExternFile) theitem;
};
#endif // _STEPCAFControl_DictionaryOfExternFile_HeaderFile

View File

@@ -0,0 +1,47 @@
// Created on: 2000-04-09
// Created by: Sergey MOZOKHIN
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
#include <Standard_Type.hxx>
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
#include <STEPCAFControl_ExternFile.hxx>
#include <Standard_NoSuchObject.hxx>
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#include <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
#include <TCollection_AsciiString.hxx>
#define TheItem Handle(STEPCAFControl_ExternFile)
#define TheItem_hxx <STEPCAFControl_ExternFile.hxx>
#define Dico_Iterator STEPCAFControl_IteratorOfDictionaryOfExternFile
#define Dico_Iterator_hxx <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#define Dico_StackItem STEPCAFControl_StackItemOfDictionaryOfExternFile
#define Dico_StackItem_hxx <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
#define Handle_Dico_StackItem Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)
#define Dico_Dictionary STEPCAFControl_DictionaryOfExternFile
#define Dico_Dictionary_hxx <STEPCAFControl_DictionaryOfExternFile.hxx>
#define Handle_Dico_Dictionary Handle(STEPCAFControl_DictionaryOfExternFile)
#include <Dico_Dictionary.gxx>

View File

@@ -1,81 +0,0 @@
-- Created on: 2000-09-28
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public 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 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;

View File

@@ -13,13 +13,17 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPCAFControl_ExternFile.ixx>
#include <Standard_Type.hxx>
#include <STEPCAFControl_ExternFile.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TDF_Label.hxx>
#include <XSControl_WorkSession.hxx>
//=======================================================================
//function : STEPCAFControl_ExternFile
//purpose :
//=======================================================================
STEPCAFControl_ExternFile::STEPCAFControl_ExternFile ()
: myLoadStatus(IFSelect_RetVoid), myTransferStatus(Standard_False),
myWriteStatus(IFSelect_RetVoid)

View File

@@ -0,0 +1,99 @@
// Created on: 2000-09-28
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_ExternFile_HeaderFile
#define _STEPCAFControl_ExternFile_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <IFSelect_ReturnStatus.hxx>
#include <Standard_Boolean.hxx>
#include <TDF_Label.hxx>
#include <MMgt_TShared.hxx>
class XSControl_WorkSession;
class TCollection_HAsciiString;
class TDF_Label;
class STEPCAFControl_ExternFile;
DEFINE_STANDARD_HANDLE(STEPCAFControl_ExternFile, MMgt_TShared)
//! Auxiliary class serving as container for data resulting
//! from translation of external file
class STEPCAFControl_ExternFile : public MMgt_TShared
{
public:
//! Creates an empty structure
Standard_EXPORT STEPCAFControl_ExternFile();
void SetWS (const Handle(XSControl_WorkSession)& WS);
Handle(XSControl_WorkSession) GetWS() const;
void SetLoadStatus (const IFSelect_ReturnStatus stat);
IFSelect_ReturnStatus GetLoadStatus() const;
void SetTransferStatus (const Standard_Boolean isok);
Standard_Boolean GetTransferStatus() const;
void SetWriteStatus (const IFSelect_ReturnStatus stat);
IFSelect_ReturnStatus GetWriteStatus() const;
void SetName (const Handle(TCollection_HAsciiString)& name);
Handle(TCollection_HAsciiString) GetName() const;
void SetLabel (const TDF_Label& L);
TDF_Label GetLabel() const;
DEFINE_STANDARD_RTTI(STEPCAFControl_ExternFile,MMgt_TShared)
protected:
private:
Handle(XSControl_WorkSession) myWS;
IFSelect_ReturnStatus myLoadStatus;
Standard_Boolean myTransferStatus;
IFSelect_ReturnStatus myWriteStatus;
Handle(TCollection_HAsciiString) myName;
TDF_Label myLabel;
};
#include <STEPCAFControl_ExternFile.lxx>
#endif // _STEPCAFControl_ExternFile_HeaderFile

View File

@@ -0,0 +1,90 @@
// Created on: 2000-04-09
// Created by: Sergey MOZOKHIN
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_IteratorOfDictionaryOfExternFile_HeaderFile
#define _STEPCAFControl_IteratorOfDictionaryOfExternFile_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TCollection_AsciiString.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
class STEPCAFControl_DictionaryOfExternFile;
class STEPCAFControl_StackItemOfDictionaryOfExternFile;
class Standard_NoSuchObject;
class STEPCAFControl_ExternFile;
class TCollection_AsciiString;
class STEPCAFControl_IteratorOfDictionaryOfExternFile
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell);
Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const Standard_CString basename);
Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const TCollection_AsciiString& basename);
Standard_EXPORT void Start();
Standard_EXPORT Standard_Boolean More();
Standard_EXPORT void Next();
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Value() const;
Standard_EXPORT TCollection_AsciiString Name() const;
protected:
private:
Standard_EXPORT void AppendStack (const Handle(STEPCAFControl_DictionaryOfExternFile)& val);
Handle(STEPCAFControl_DictionaryOfExternFile) thebase;
TCollection_AsciiString thename;
Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile) thelast;
Standard_Integer thenb;
Standard_Boolean themore;
Standard_Boolean theinit;
Standard_Boolean thenext;
};
#endif // _STEPCAFControl_IteratorOfDictionaryOfExternFile_HeaderFile

View File

@@ -0,0 +1,36 @@
// Created on: 2000-04-09
// Created by: Sergey MOZOKHIN
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
#include <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
#include <Standard_NoSuchObject.hxx>
#include <STEPCAFControl_ExternFile.hxx>
#include <TCollection_AsciiString.hxx>
#define TheItem Handle(STEPCAFControl_ExternFile)
#define TheItem_hxx <STEPCAFControl_ExternFile.hxx>
#define Dico_Iterator STEPCAFControl_IteratorOfDictionaryOfExternFile
#define Dico_Iterator_hxx <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#define Dico_StackItem STEPCAFControl_StackItemOfDictionaryOfExternFile
#define Dico_StackItem_hxx <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
#define Handle_Dico_StackItem Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)
#define Dico_Dictionary STEPCAFControl_DictionaryOfExternFile
#define Dico_Dictionary_hxx <STEPCAFControl_DictionaryOfExternFile.hxx>
#define Handle_Dico_Dictionary Handle(STEPCAFControl_DictionaryOfExternFile)
#include <Dico_Iterator.gxx>

View File

@@ -1,308 +0,0 @@
-- Created on: 2000-08-15
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public 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 STEPCAFControl
-- inherits Reader from STEPControl
---Purpose: Provides a tool to read STEP file and put it into
-- DECAF document. Besides transfer of shapes (including
-- assemblies) provided by STEPControl, supports also
-- colors and part names
--
-- This reader supports reading files with external references
-- i.e. multifile reading
-- It behaves as usual Reader (from STEPControl) for the main
-- file (e.g. if it is single file)
-- Results of reading other files can be accessed by name of the
-- file or by iterating on a readers
uses
AsciiString from TCollection,
WorkSession from XSControl,
ReturnStatus from IFSelect,
Shape from TopoDS,
Document from TDocStd,
Reader from STEPControl,
NextAssemblyUsageOccurrence from StepRepr,
DictionaryOfExternFile from STEPCAFControl,
ExternFile from STEPCAFControl,
ExternRefs from STEPConstruct,
Tool from STEPConstruct,
DataMapOfShapePD from STEPCAFControl,
DataMapOfPDExternFile from STEPCAFControl,
DataMapOfShapeLabel from XCAFDoc,
MapOfShape from TopTools,
ShapeTool from XCAFDoc,
Label from TDF,
LabelSequence from TDF,
HSequenceOfTransient from TColStd,
RepresentationItem from StepRepr,
TransientProcess from Transfer,
ConnectedFaceSet from StepShape
is
Create returns Reader;
---Purpose: Creates a reader with an empty
-- STEP model and sets ColorMode, LayerMode, NameMode and
-- PropsMode to Standard_True.
Create (WS : 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 : 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&GT for instances defined in the STEP model and
-- set reference between shape instances from different assemblyes
ReadMaterials (me; WS: WorkSession from XSControl;
doc: in out Document from TDocStd;
SeqPDS : HSequenceOfTransient from TColStd)
returns Boolean is protected;
---Purpose: Reads materials for instances defined in the STEP model and
-- set reference between shape instances from different assemblyes
SettleShapeData(me; theItem: RepresentationItem from StepRepr;
theLab: out Label from TDF;
theShapeTool: ShapeTool from XCAFDoc;
theTP: TransientProcess from Transfer)
returns Label from TDF is protected;
--- Purpose: Populates the sub-Label of the passed TDF Label with shape
-- data associated with the given STEP Representation Item,
-- including naming and topological information.
ExpandSubShapes(me; theShapeTool: ShapeTool from XCAFDoc;
theShapeLabelMap: DataMapOfShapeLabel from XCAFDoc;
theShapePDMap: DataMapOfShapePD from STEPCAFControl)
is protected;
--- Purpose: Given the maps of already translated shapes, this method
-- expands their correspondent Labels in XDE Document so that
-- to have a dedicated sub-Label for each sub-shape coming
-- with associated name in its STEP Representation Item.
ExpandManifoldSolidBrep(me; theLab: out Label from TDF;
theItem: RepresentationItem from StepRepr;
theTP: TransientProcess from Transfer;
theShapeTool: ShapeTool from XCAFDoc)
is protected;
--- Purpose: Expands the topological structure of Manifold Solid BRep
-- STEP entity to OCAF sub-tree. Entities having no names
-- associated via their Representation Items are skipped.
ExpandSBSM(me; theLab: out Label from TDF;
theItem: RepresentationItem from StepRepr;
theTP: TransientProcess from Transfer;
theShapeTool: ShapeTool from XCAFDoc)
is protected;
--- Purpose: Expands the topological structure of Shell-Based Surface
-- Model STEP entity to OCAF sub-tree. Entities having no names
-- associated via their Representation Items are skipped.
ExpandShell(me; theShell: ConnectedFaceSet from StepShape;
theLab: out Label from TDF;
theTP: TransientProcess from Transfer;
theShapeTool: ShapeTool from XCAFDoc)
is protected;
--- Purpose: Expands STEP Shell structure to OCAF sub-tree. Entities
-- having no names associated via their Representation Items
-- are skipped.
FindInstance (myclass; NAUO: NextAssemblyUsageOccurrence from StepRepr;
STool: ShapeTool from XCAFDoc;
Tool: Tool from STEPConstruct;
PDRFileMap : DataMapOfPDExternFile from STEPCAFControl;
ShapeLabelMap: DataMapOfShapeLabel from XCAFDoc)
returns Label from TDF;
---Purpose: Returns label of instance of an assembly component
-- corresponding to a given NAUO
--- Work with fileds for different mode of reading STEP file.
SetColorMode(me: in out; colormode: Boolean from Standard);
---Purpose: Set ColorMode for indicate read Colors or not.
GetColorMode(me) returns Boolean;
SetNameMode(me: in out; namemode: Boolean from Standard);
---Purpose: Set NameMode for indicate read Name or not.
GetNameMode(me) returns Boolean;
SetLayerMode(me: in out; layermode: Boolean from Standard);
---Purpose: Set LayerMode for indicate read Layers or not.
GetLayerMode(me) returns Boolean;
SetPropsMode(me: in out; propsmode: Boolean from Standard);
---Purpose: PropsMode for indicate read Validation properties or not.
GetPropsMode(me) returns Boolean;
SetSHUOMode(me: in out; shuomode: Boolean from Standard);
---Purpose: Set SHUO mode for indicate write SHUO or not.
GetSHUOMode(me) returns Boolean;
SetGDTMode(me: in out; gdtmode: Boolean from Standard);
---Purpose: Set GDT mode for indicate write GDT or not.
GetGDTMode(me) returns Boolean;
SetMatMode(me: in out; matmode: Boolean from Standard);
---Purpose: Set Material mode
GetMatMode(me) returns Boolean;
fields
myReader : Reader from STEPControl;
myFiles : DictionaryOfExternFile from STEPCAFControl;
myColorMode : Boolean;
myNameMode : Boolean;
myLayerMode : Boolean;
myPropsMode : Boolean;
mySHUOMode : Boolean;
myGDTMode : Boolean;
myMatMode : Boolean;
end Reader;

View File

@@ -13,112 +13,159 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPCAFControl_Reader.ixx>
#include <Quantity_Color.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopoDS_Compound.hxx>
#include <Transfer_TransientProcess.hxx>
#include <TransferBRep.hxx>
#include <Transfer_Binder.hxx>
#include <Interface_InterfaceModel.hxx>
#include <XSControl_TransferReader.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionRelationship.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_MeasureRepresentationItem.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
#include <StepRepr_SequenceOfRepresentationItem.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepAP214_AppliedExternalIdentificationAssignment.hxx>
#include <STEPConstruct.hxx>
#include <STEPConstruct_Styles.hxx>
#include <STEPConstruct_ExternRefs.hxx>
#include <STEPConstruct_UnitContext.hxx>
#include <STEPCAFControl_Controller.hxx>
#include <STEPCAFControl_DataMapOfSDRExternFile.hxx>
#include <TDataStd_Name.hxx>
#include <TDF_Label.hxx>
#include <XCAFDoc_ColorTool.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFDoc_DocumentTool.hxx>
#include <XCAFDoc_DimTolTool.hxx>
#include <XCAFDoc_MaterialTool.hxx>
#include <XCAFDoc_DataMapOfShapeLabel.hxx>
#include <STEPConstruct_ValidationProps.hxx>
#include <StepRepr_Representation.hxx>
#include <XCAFDoc_Area.hxx>
#include <XCAFDoc_Volume.hxx>
#include <XCAFDoc_Centroid.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <StepVisual_LayeredItem.hxx>
#include <XCAFDoc_LayerTool.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepRepr_ShapeRepresentationRelationship.hxx>
#include <STEPConstruct_Assembly.hxx>
#include <TDF_Tool.hxx>
#include <StepVisual_Invisibility.hxx>
#include <TDataStd_UAttribute.hxx>
#include <XCAFDoc.hxx>
#include <OSD_Path.hxx>
#include <TColStd_SequenceOfHAsciiString.hxx>
#include <TDataStd_TreeNode.hxx>
#include <TNaming_NamedShape.hxx>
#include <BRep_Builder.hxx>
#include <STEPCAFControl_DataMapOfShapePD.hxx>
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_StyleContextSelect.hxx>
#include <StepRepr_RepresentedDefinition.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
#include <XCAFDoc_GraphNode.hxx>
#include <STEPCAFControl_Reader.hxx>
// skl 21.08.2003 for reading G&DT
#include <StepShape_DimensionalSize.hxx>
#include <StepDimTol_GeometricTolerance.hxx>
#include <StepShape_EdgeCurve.hxx>
#include <StepShape_DimensionalCharacteristicRepresentation.hxx>
#include <StepShape_ShapeDimensionRepresentation.hxx>
#include <StepRepr_ValueRange.hxx>
#include <StepRepr_ReprItemAndLengthMeasureWithUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
#include <StepDimTol_ModifiedGeometricTolerance.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
//#include <StepRepr_CompoundItemDefinition.hxx>
//#include <StepRepr_CompoundItemDefinitionMember.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
//#include <StepBasic_ConversionBasedUnit.hxx>
#include <StepBasic_Unit.hxx>
#include <StepBasic_NamedUnit.hxx>
#include <StepBasic_SiUnit.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Static.hxx>
#include <NCollection_DataMap.hxx>
#include <OSD_Path.hxx>
#include <Quantity_Color.hxx>
#include <StepAP214_AppliedExternalIdentificationAssignment.hxx>
#include <StepBasic_ConversionBasedUnitAndLengthUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndMassUnit.hxx>
#include <StepBasic_DerivedUnit.hxx>
#include <StepBasic_DerivedUnitElement.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_NamedUnit.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_ProductDefinitionRelationship.hxx>
#include <StepBasic_SiUnit.hxx>
#include <StepBasic_Unit.hxx>
#include <STEPCAFControl_Controller.hxx>
#include <STEPCAFControl_DataMapIteratorOfDataMapOfShapePD.hxx>
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
#include <STEPCAFControl_DataMapOfSDRExternFile.hxx>
#include <STEPCAFControl_DataMapOfShapePD.hxx>
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
#include <STEPCAFControl_ExternFile.hxx>
#include <STEPCAFControl_Reader.hxx>
#include <STEPConstruct.hxx>
#include <STEPConstruct_Assembly.hxx>
#include <STEPConstruct_ExternRefs.hxx>
#include <STEPConstruct_Styles.hxx>
#include <STEPConstruct_Tool.hxx>
#include <STEPConstruct_UnitContext.hxx>
#include <STEPConstruct_ValidationProps.hxx>
#include <STEPControl_Reader.hxx>
#include <StepDimTol_AngularityTolerance.hxx>
#include <StepDimTol_CircularRunoutTolerance.hxx>
#include <StepDimTol_CoaxialityTolerance.hxx>
#include <StepDimTol_ConcentricityTolerance.hxx>
#include <StepDimTol_CylindricityTolerance.hxx>
#include <StepDimTol_Datum.hxx>
#include <StepDimTol_DatumFeature.hxx>
#include <StepDimTol_DatumReference.hxx>
#include <StepDimTol_FlatnessTolerance.hxx>
#include <StepDimTol_GeometricTolerance.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
#include <StepDimTol_HArray1OfDatumReference.hxx>
#include <StepDimTol_LineProfileTolerance.hxx>
#include <StepDimTol_ModifiedGeometricTolerance.hxx>
#include <StepDimTol_ParallelismTolerance.hxx>
#include <StepDimTol_PerpendicularityTolerance.hxx>
#include <StepDimTol_PositionTolerance.hxx>
#include <StepDimTol_RoundnessTolerance.hxx>
#include <StepDimTol_StraightnessTolerance.hxx>
#include <StepDimTol_SurfaceProfileTolerance.hxx>
#include <StepDimTol_SymmetryTolerance.hxx>
#include <StepDimTol_TotalRunoutTolerance.hxx>
#include <StepRepr_AssemblyComponentUsage.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_MeasureRepresentationItem.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_PropertyDefinitionRepresentation.hxx>
#include <StepRepr_Representation.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepRepr_RepresentationRelationship.hxx>
#include <StepRepr_RepresentedDefinition.hxx>
#include <StepRepr_ReprItemAndLengthMeasureWithUnit.hxx>
#include <StepRepr_SequenceOfRepresentationItem.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
#include <StepRepr_ShapeRepresentationRelationship.hxx>
#include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
#include <StepRepr_ValueRange.hxx>
#include <StepShape_AdvancedFace.hxx>
#include <StepShape_ClosedShell.hxx>
#include <StepShape_ConnectedFaceSet.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepShape_DimensionalCharacteristicRepresentation.hxx>
#include <StepShape_DimensionalSize.hxx>
#include <StepShape_EdgeCurve.hxx>
#include <StepShape_EdgeLoop.hxx>
#include <StepShape_GeometricSet.hxx>
#include <StepShape_HArray1OfFace.hxx>
#include <StepShape_HArray1OfFaceBound.hxx>
#include <StepShape_HArray1OfOrientedEdge.hxx>
#include <StepShape_HArray1OfShell.hxx>
#include <StepShape_Loop.hxx>
#include <StepShape_ManifoldSolidBrep.hxx>
#include <StepShape_OpenShell.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeDimensionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepShape_ShellBasedSurfaceModel.hxx>
#include <StepShape_SolidModel.hxx>
#include <StepShape_Vertex.hxx>
#include <StepVisual_Invisibility.hxx>
#include <StepVisual_LayeredItem.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_StyleContextSelect.hxx>
#include <StepVisual_StyledItem.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <TColStd_SequenceOfHAsciiString.hxx>
#include <TDataStd_Name.hxx>
#include <TDataStd_TreeNode.hxx>
#include <TDataStd_UAttribute.hxx>
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <TDocStd_Document.hxx>
#include <TNaming_NamedShape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_TransientProcess.hxx>
#include <TransferBRep.hxx>
#include <XCAFDoc.hxx>
#include <XCAFDoc_Area.hxx>
#include <XCAFDoc_Centroid.hxx>
#include <XCAFDoc_ColorTool.hxx>
#include <XCAFDoc_DataMapOfShapeLabel.hxx>
#include <XCAFDoc_DimTolTool.hxx>
#include <XCAFDoc_DocumentTool.hxx>
#include <XCAFDoc_GraphNode.hxx>
#include <XCAFDoc_LayerTool.hxx>
#include <XCAFDoc_MaterialTool.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFDoc_Volume.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
// skl 21.08.2003 for reading G&DT
//#include <StepRepr_CompoundItemDefinition.hxx>
//#include <StepRepr_CompoundItemDefinitionMember.hxx>
//#include <StepBasic_ConversionBasedUnit.hxx>
//#include <TDataStd_Real.hxx>
//#include <TDataStd_Constraint.hxx>
//#include <TDataStd_ConstraintEnum.hxx>
@@ -129,58 +176,6 @@
//#include <TPrsStd_Position.hxx>
//#include <TPrsStd_AISPresentation.hxx>
//#include <TNaming_Builder.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <StepShape_AdvancedFace.hxx>
#include <StepDimTol_HArray1OfDatumReference.hxx>
#include <StepDimTol_DatumReference.hxx>
#include <StepDimTol_Datum.hxx>
#include <StepDimTol_DatumFeature.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
#include <StepDimTol_AngularityTolerance.hxx>
#include <StepDimTol_CircularRunoutTolerance.hxx>
#include <StepDimTol_CoaxialityTolerance.hxx>
#include <StepDimTol_ConcentricityTolerance.hxx>
#include <StepDimTol_ParallelismTolerance.hxx>
#include <StepDimTol_PerpendicularityTolerance.hxx>
#include <StepDimTol_SymmetryTolerance.hxx>
#include <StepDimTol_TotalRunoutTolerance.hxx>
#include <StepDimTol_CylindricityTolerance.hxx>
#include <StepDimTol_FlatnessTolerance.hxx>
#include <StepDimTol_LineProfileTolerance.hxx>
#include <StepDimTol_PositionTolerance.hxx>
#include <StepDimTol_RoundnessTolerance.hxx>
#include <StepDimTol_StraightnessTolerance.hxx>
#include <StepDimTol_SurfaceProfileTolerance.hxx>
#include <StepShape_SolidModel.hxx>
#include <StepShape_ShellBasedSurfaceModel.hxx>
#include <StepShape_GeometricSet.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <NCollection_DataMap.hxx>
#include <StepShape_ManifoldSolidBrep.hxx>
#include <Interface_Static.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <STEPCAFControl_DataMapIteratorOfDataMapOfShapePD.hxx>
#include <StepShape_ClosedShell.hxx>
#include <StepShape_HArray1OfFace.hxx>
#include <StepShape_HArray1OfFaceBound.hxx>
#include <StepShape_Loop.hxx>
#include <StepShape_EdgeLoop.hxx>
#include <StepShape_HArray1OfOrientedEdge.hxx>
#include <StepShape_HArray1OfShell.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepShape_OpenShell.hxx>
#include <StepShape_Vertex.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_AssemblyComponentUsage.hxx>
#include <StepRepr_PropertyDefinitionRepresentation.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepRepr_RepresentationRelationship.hxx>
#ifdef OCCT_DEBUG
//! Converts address of the passed shape (TShape) to string.
//! \param theShape [in] Shape to dump.

View File

@@ -0,0 +1,263 @@
// Created on: 2000-08-15
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_Reader_HeaderFile
#define _STEPCAFControl_Reader_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <STEPControl_Reader.hxx>
#include <Standard_Boolean.hxx>
#include <IFSelect_ReturnStatus.hxx>
#include <Standard_CString.hxx>
#include <Standard_Integer.hxx>
#include <TDF_LabelSequence.hxx>
#include <TopTools_MapOfShape.hxx>
#include <STEPCAFControl_DataMapOfShapePD.hxx>
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
#include <XCAFDoc_DataMapOfShapeLabel.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
class STEPCAFControl_DictionaryOfExternFile;
class XSControl_WorkSession;
class TDocStd_Document;
class TCollection_AsciiString;
class STEPCAFControl_ExternFile;
class STEPControl_Reader;
class TDF_Label;
class TopoDS_Shape;
class XCAFDoc_ShapeTool;
class StepRepr_RepresentationItem;
class Transfer_TransientProcess;
class StepShape_ConnectedFaceSet;
class StepRepr_NextAssemblyUsageOccurrence;
class STEPConstruct_Tool;
//! Provides a tool to read STEP file and put it into
//! 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
class STEPCAFControl_Reader
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a reader with an empty
//! STEP model and sets ColorMode, LayerMode, NameMode and
//! PropsMode to Standard_True.
Standard_EXPORT STEPCAFControl_Reader();
//! Creates a reader tool and attaches it to an already existing Session
//! Clears the session if it was not yet set for STEP
Standard_EXPORT STEPCAFControl_Reader(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! Clears the internal data structures and attaches to a new session
//! Clears the session if it was not yet set for STEP
Standard_EXPORT void Init (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! Loads a file and returns the read status
//! Provided for use like single-file reader
Standard_EXPORT IFSelect_ReturnStatus ReadFile (const Standard_CString filename);
//! Returns number of roots recognized for transfer
//! Shortcut for Reader().NbRootsForTransfer()
Standard_EXPORT Standard_Integer NbRootsForTransfer();
//! 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
Standard_EXPORT Standard_Boolean TransferOneRoot (const Standard_Integer num, Handle(TDocStd_Document)& doc);
//! 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
Standard_EXPORT Standard_Boolean Transfer (Handle(TDocStd_Document)& doc);
Standard_EXPORT Standard_Boolean Perform (const TCollection_AsciiString& filename, Handle(TDocStd_Document)& doc);
//! Translate STEP file given by filename into the document
//! Return True if succeeded, and False in case of fail
Standard_EXPORT Standard_Boolean Perform (const Standard_CString filename, Handle(TDocStd_Document)& doc);
//! Returns data on external files
//! Returns Null handle if no external files are read
Standard_EXPORT const Handle(STEPCAFControl_DictionaryOfExternFile)& ExternFiles() const;
//! Returns data on external file by its name
//! Returns False if no external file with given name is read
Standard_EXPORT Standard_Boolean ExternFile (const Standard_CString name, Handle(STEPCAFControl_ExternFile)& ef) const;
//! Returns basic reader
Standard_EXPORT STEPControl_Reader& ChangeReader();
//! Returns basic reader as const
Standard_EXPORT const STEPControl_Reader& Reader() const;
//! Returns label of instance of an assembly component
//! corresponding to a given NAUO
Standard_EXPORT static TDF_Label FindInstance (const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO, const Handle(XCAFDoc_ShapeTool)& STool, const STEPConstruct_Tool& Tool, const STEPCAFControl_DataMapOfPDExternFile& PDRFileMap, const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap);
//! Set ColorMode for indicate read Colors or not.
Standard_EXPORT void SetColorMode (const Standard_Boolean colormode);
Standard_EXPORT Standard_Boolean GetColorMode() const;
//! Set NameMode for indicate read Name or not.
Standard_EXPORT void SetNameMode (const Standard_Boolean namemode);
Standard_EXPORT Standard_Boolean GetNameMode() const;
//! Set LayerMode for indicate read Layers or not.
Standard_EXPORT void SetLayerMode (const Standard_Boolean layermode);
Standard_EXPORT Standard_Boolean GetLayerMode() const;
//! PropsMode for indicate read Validation properties or not.
Standard_EXPORT void SetPropsMode (const Standard_Boolean propsmode);
Standard_EXPORT Standard_Boolean GetPropsMode() const;
//! Set SHUO mode for indicate write SHUO or not.
Standard_EXPORT void SetSHUOMode (const Standard_Boolean shuomode);
Standard_EXPORT Standard_Boolean GetSHUOMode() const;
//! Set GDT mode for indicate write GDT or not.
Standard_EXPORT void SetGDTMode (const Standard_Boolean gdtmode);
Standard_EXPORT Standard_Boolean GetGDTMode() const;
//! Set Material mode
Standard_EXPORT void SetMatMode (const Standard_Boolean matmode);
Standard_EXPORT Standard_Boolean GetMatMode() const;
protected:
//! 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
Standard_EXPORT Standard_Boolean Transfer (STEPControl_Reader& rd, const Standard_Integer num, Handle(TDocStd_Document)& doc, TDF_LabelSequence& Lseq, const Standard_Boolean asOne = Standard_False);
//! Add a shape to a document
//! 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
Standard_EXPORT TDF_Label AddShape (const TopoDS_Shape& S, const Handle(XCAFDoc_ShapeTool)& STool, const TopTools_MapOfShape& NewShapesMap, const STEPCAFControl_DataMapOfShapePD& ShapePDMap, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap, XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
//! Reads (or if returns already read) extern file with
//! given name
Standard_EXPORT Handle(STEPCAFControl_ExternFile) ReadExternFile (const Standard_CString file, const Standard_CString fullpath, Handle(TDocStd_Document)& doc);
//! Reads style assignments from STEP model and sets
//! corresponding color assignments in the DECAF document
Standard_EXPORT Standard_Boolean ReadColors (const Handle(XSControl_WorkSession)& WS, Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap, const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
//! Reads names of parts defined in the STEP model and
//! assigns them to corresponding labels in the DECAF document
Standard_EXPORT Standard_Boolean ReadNames (const Handle(XSControl_WorkSession)& WS, Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap, const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
//! Reads validation properties assigned to shapes in the STEP
//! model and assigns them to corresponding labels in the DECAF
//! document
Standard_EXPORT Standard_Boolean ReadValProps (const Handle(XSControl_WorkSession)& WS, Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap, const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
//! Reads layers of parts defined in the STEP model and
//! set reference between shape and layers in the DECAF document
Standard_EXPORT Standard_Boolean ReadLayers (const Handle(XSControl_WorkSession)& WS, Handle(TDocStd_Document)& doc) const;
//! Reads SHUO for instances defined in the STEP model and
//! set reference between shape instances from different assemblyes
Standard_EXPORT Standard_Boolean ReadSHUOs (const Handle(XSControl_WorkSession)& WS, Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap, const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap) const;
//! Reads D&GT for instances defined in the STEP model and
//! set reference between shape instances from different assemblyes
Standard_EXPORT Standard_Boolean ReadGDTs (const Handle(XSControl_WorkSession)& WS, Handle(TDocStd_Document)& doc) const;
//! Reads materials for instances defined in the STEP model and
//! set reference between shape instances from different assemblyes
Standard_EXPORT Standard_Boolean ReadMaterials (const Handle(XSControl_WorkSession)& WS, Handle(TDocStd_Document)& doc, const Handle(TColStd_HSequenceOfTransient)& SeqPDS) const;
//! Populates the sub-Label of the passed TDF Label with shape
//! data associated with the given STEP Representation Item,
//! including naming and topological information.
Standard_EXPORT TDF_Label SettleShapeData (const Handle(StepRepr_RepresentationItem)& theItem, TDF_Label& theLab, const Handle(XCAFDoc_ShapeTool)& theShapeTool, const Handle(Transfer_TransientProcess)& theTP) const;
//! Given the maps of already translated shapes, this method
//! expands their correspondent Labels in XDE Document so that
//! to have a dedicated sub-Label for each sub-shape coming
//! with associated name in its STEP Representation Item.
Standard_EXPORT void ExpandSubShapes (const Handle(XCAFDoc_ShapeTool)& theShapeTool, const XCAFDoc_DataMapOfShapeLabel& theShapeLabelMap, const STEPCAFControl_DataMapOfShapePD& theShapePDMap) const;
//! Expands the topological structure of Manifold Solid BRep
//! STEP entity to OCAF sub-tree. Entities having no names
//! associated via their Representation Items are skipped.
Standard_EXPORT void ExpandManifoldSolidBrep (TDF_Label& theLab, const Handle(StepRepr_RepresentationItem)& theItem, const Handle(Transfer_TransientProcess)& theTP, const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
//! Expands the topological structure of Shell-Based Surface
//! Model STEP entity to OCAF sub-tree. Entities having no names
//! associated via their Representation Items are skipped.
Standard_EXPORT void ExpandSBSM (TDF_Label& theLab, const Handle(StepRepr_RepresentationItem)& theItem, const Handle(Transfer_TransientProcess)& theTP, const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
//! Expands STEP Shell structure to OCAF sub-tree. Entities
//! having no names associated via their Representation Items
//! are skipped.
Standard_EXPORT void ExpandShell (const Handle(StepShape_ConnectedFaceSet)& theShell, TDF_Label& theLab, const Handle(Transfer_TransientProcess)& theTP, const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
private:
STEPControl_Reader myReader;
Handle(STEPCAFControl_DictionaryOfExternFile) myFiles;
Standard_Boolean myColorMode;
Standard_Boolean myNameMode;
Standard_Boolean myLayerMode;
Standard_Boolean myPropsMode;
Standard_Boolean mySHUOMode;
Standard_Boolean myGDTMode;
Standard_Boolean myMatMode;
};
#endif // _STEPCAFControl_Reader_HeaderFile

View File

@@ -0,0 +1,73 @@
// Created on: 2000-04-09
// Created by: Sergey MOZOKHIN
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_StackItemOfDictionaryOfExternFile_HeaderFile
#define _STEPCAFControl_StackItemOfDictionaryOfExternFile_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
class STEPCAFControl_DictionaryOfExternFile;
class STEPCAFControl_ExternFile;
class STEPCAFControl_IteratorOfDictionaryOfExternFile;
class STEPCAFControl_StackItemOfDictionaryOfExternFile;
DEFINE_STANDARD_HANDLE(STEPCAFControl_StackItemOfDictionaryOfExternFile, MMgt_TShared)
class STEPCAFControl_StackItemOfDictionaryOfExternFile : public MMgt_TShared
{
public:
Standard_EXPORT STEPCAFControl_StackItemOfDictionaryOfExternFile();
Standard_EXPORT STEPCAFControl_StackItemOfDictionaryOfExternFile(const Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)& previous);
Standard_EXPORT Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile) Previous() const;
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Value() const;
Standard_EXPORT void SetValue (const Handle(STEPCAFControl_DictionaryOfExternFile)& cval);
DEFINE_STANDARD_RTTI(STEPCAFControl_StackItemOfDictionaryOfExternFile,MMgt_TShared)
protected:
private:
Handle(STEPCAFControl_DictionaryOfExternFile) thevalue;
Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile) theprev;
};
#endif // _STEPCAFControl_StackItemOfDictionaryOfExternFile_HeaderFile

View File

@@ -0,0 +1,45 @@
// Created on: 2000-04-09
// Created by: Sergey MOZOKHIN
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
#include <Standard_Type.hxx>
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
#include <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
#include <STEPCAFControl_ExternFile.hxx>
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#define TheItem Handle(STEPCAFControl_ExternFile)
#define TheItem_hxx <STEPCAFControl_ExternFile.hxx>
#define Dico_Iterator STEPCAFControl_IteratorOfDictionaryOfExternFile
#define Dico_Iterator_hxx <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#define Dico_StackItem STEPCAFControl_StackItemOfDictionaryOfExternFile
#define Dico_StackItem_hxx <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
#define Handle_Dico_StackItem Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)
#define Dico_Dictionary STEPCAFControl_DictionaryOfExternFile
#define Dico_Dictionary_hxx <STEPCAFControl_DictionaryOfExternFile.hxx>
#define Handle_Dico_Dictionary Handle(STEPCAFControl_DictionaryOfExternFile)
#include <Dico_StackItem.gxx>

View File

@@ -1,227 +0,0 @@
-- Created on: 2000-08-15
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public 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 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 : 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 : 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&GTs 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&GTs or not.
GetDimTolMode(me) returns Boolean;
SetMaterialMode(me: in out; matmode: Boolean from Standard);
---Purpose: Set dimtolmode for indicate write D&GTs 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;

View File

@@ -20,159 +20,159 @@
// (analysis of SDRs which the CDSR links should be done)
// Names and validation props are supported for top-level shapes only
#include <STEPCAFControl_Writer.ixx>
#include <STEPControl_StepModelType.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <TDF_LabelSequence.hxx>
#include <TopoDS_Shape.hxx>
#include <XCAFPrs_DataMapOfShapeStyle.hxx>
#include <XCAFPrs.hxx>
#include <XCAFPrs_DataMapOfStyleShape.hxx>
#include <XCAFPrs_Style.hxx>
#include <XCAFPrs_DataMapIteratorOfDataMapOfStyleShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Iterator.hxx>
#include <STEPConstruct_Styles.hxx>
#include <XCAFDoc_ColorTool.hxx>
#include <STEPConstruct.hxx>
#include <TopTools_MapOfShape.hxx>
#include <XSControl_TransferWriter.hxx>
#include <TDataStd_Name.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <TransferBRep.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_Product.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TCollection_AsciiString.hxx>
#include <Transfer_FinderProcess.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <XCAFDoc_DocumentTool.hxx>
#include <TDF_Label.hxx>
#include <STEPCAFControl_Controller.hxx>
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#include <STEPConstruct_ExternRefs.hxx>
#include <Interface_Static.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <Transfer_ActorOfFinderProcess.hxx>
#include <STEPCAFControl_ActorWrite.hxx>
#include <STEPConstruct_ValidationProps.hxx>
#include <XCAFDoc_Area.hxx>
#include <XCAFDoc_Volume.hxx>
#include <XCAFDoc_Centroid.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepBasic_ProductDefinitionRelationship.hxx>
#include <XCAFDoc_GraphNode.hxx>
#include <XCAFDoc_LayerTool.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <XCAFDoc.hxx>
#include <StepVisual_HArray1OfLayeredItem.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TDF_Tool.hxx>
#include <Message_Messenger.hxx>
#include <TDF_ChildIterator.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_TransientListBinder.hxx>
#include <StepVisual_InvisibleItem.hxx>
#include <TDataStd_UAttribute.hxx>
#include <StepVisual_Invisibility.hxx>
#include <StepVisual_HArray1OfInvisibleItem.hxx>
#include <HeaderSection_FileSchema.hxx>
#include <StepData_StepModel.hxx>
#include <StepAP214_Protocol.hxx>
#include <OSD_Path.hxx>
#include <XSControl_WorkSession.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <MoniTool_DataMapIteratorOfDataMapOfShapeTransient.hxx>
#include <StepRepr_Representation.hxx>
#include <StepVisual_MechanicalDesignGeometricPresentationRepresentation.hxx>
#include <Quantity_TypeOfColor.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_HArray1OfPresentationStyleSelect.hxx>
#include <StepVisual_PointStyle.hxx>
#include <StepVisual_CurveStyle.hxx>
#include <StepVisual_SurfaceStyleUsage.hxx>
#include <TDF_AttributeSequence.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
// added by skl 15.01.2004 for D&GT writing
#include <XCAFDoc_DimTolTool.hxx>
#include <XCAFDoc_DimTol.hxx>
#include <XCAFDoc_Datum.hxx>
#include <Interface_Static.hxx>
#include <Message_Messenger.hxx>
#include <MoniTool_DataMapIteratorOfDataMapOfShapeTransient.hxx>
#include <OSD_Path.hxx>
#include <Quantity_TypeOfColor.hxx>
#include <StepAP214_Protocol.hxx>
#include <StepBasic_DerivedUnit.hxx>
#include <StepBasic_DerivedUnitElement.hxx>
#include <StepBasic_HArray1OfDerivedUnitElement.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_ProductDefinitionRelationship.hxx>
#include <StepBasic_SiUnitAndLengthUnit.hxx>
#include <StepBasic_SiUnitAndMassUnit.hxx>
#include <STEPCAFControl_ActorWrite.hxx>
#include <STEPCAFControl_Controller.hxx>
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
#include <STEPCAFControl_ExternFile.hxx>
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
#include <STEPCAFControl_Writer.hxx>
#include <STEPConstruct.hxx>
#include <STEPConstruct_DataMapOfAsciiStringTransient.hxx>
#include <STEPConstruct_DataMapOfPointTransient.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepBasic_SiUnitAndLengthUnit.hxx>
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
#include <StepGeom_Surface.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepShape_EdgeCurve.hxx>
#include <StepShape_AdvancedFace.hxx>
#include <StepShape_OrientedEdge.hxx>
#include <StepShape_EdgeLoop.hxx>
#include <StepShape_FaceBound.hxx>
#include <StepShape_ConnectedFaceSet.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepShape_DimensionalSize.hxx>
#include <StepShape_ShapeDimensionRepresentation.hxx>
#include <StepShape_DimensionalCharacteristicRepresentation.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
#include <StepRepr_ReprItemAndLengthMeasureWithUnit.hxx>
//#include <StepRepr_CompoundItemDefinition.hxx>
//#include <StepRepr_CompoundItemDefinitionMember.hxx>
#include <StepRepr_ValueRange.hxx>
#include <STEPConstruct_ExternRefs.hxx>
#include <STEPConstruct_Styles.hxx>
#include <STEPConstruct_ValidationProps.hxx>
#include <STEPControl_StepModelType.hxx>
#include <STEPControl_Writer.hxx>
#include <StepData_Logical.hxx>
#include <StepDimTol_DatumFeature.hxx>
#include <StepDimTol_Datum.hxx>
#include <StepDimTol_DatumReference.hxx>
#include <StepDimTol_HArray1OfDatumReference.hxx>
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
#include <StepDimTol_ModifiedGeometricTolerance.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
#include <StepData_StepModel.hxx>
#include <StepDimTol_AngularityTolerance.hxx>
#include <StepDimTol_CircularRunoutTolerance.hxx>
#include <StepDimTol_CoaxialityTolerance.hxx>
#include <StepDimTol_ConcentricityTolerance.hxx>
#include <StepDimTol_CylindricityTolerance.hxx>
#include <StepDimTol_Datum.hxx>
#include <StepDimTol_DatumFeature.hxx>
#include <StepDimTol_DatumReference.hxx>
#include <StepDimTol_FlatnessTolerance.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
#include <StepDimTol_HArray1OfDatumReference.hxx>
#include <StepDimTol_LineProfileTolerance.hxx>
#include <StepDimTol_ModifiedGeometricTolerance.hxx>
#include <StepDimTol_ParallelismTolerance.hxx>
#include <StepDimTol_PerpendicularityTolerance.hxx>
#include <StepDimTol_SymmetryTolerance.hxx>
#include <StepDimTol_TotalRunoutTolerance.hxx>
#include <StepDimTol_CylindricityTolerance.hxx>
#include <StepDimTol_FlatnessTolerance.hxx>
#include <StepDimTol_LineProfileTolerance.hxx>
#include <StepDimTol_PositionTolerance.hxx>
#include <StepDimTol_RoundnessTolerance.hxx>
#include <StepDimTol_StraightnessTolerance.hxx>
#include <StepDimTol_SurfaceProfileTolerance.hxx>
#include <StepDimTol_SymmetryTolerance.hxx>
#include <StepDimTol_TotalRunoutTolerance.hxx>
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
#include <StepGeom_Surface.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_MeasureRepresentationItem.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_Representation.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepRepr_ReprItemAndLengthMeasureWithUnit.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
#include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
#include <StepRepr_ValueRange.hxx>
#include <StepShape_AdvancedFace.hxx>
#include <StepShape_ConnectedFaceSet.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepShape_DimensionalCharacteristicRepresentation.hxx>
#include <StepShape_DimensionalSize.hxx>
#include <StepShape_EdgeCurve.hxx>
#include <StepShape_EdgeLoop.hxx>
#include <StepShape_FaceBound.hxx>
#include <StepShape_OrientedEdge.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeDimensionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepVisual_CurveStyle.hxx>
#include <StepVisual_HArray1OfInvisibleItem.hxx>
#include <StepVisual_HArray1OfLayeredItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_HArray1OfPresentationStyleSelect.hxx>
#include <StepVisual_Invisibility.hxx>
#include <StepVisual_InvisibleItem.hxx>
#include <StepVisual_MechanicalDesignGeometricPresentationRepresentation.hxx>
#include <StepVisual_PointStyle.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <StepVisual_PresentationRepresentation.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_SurfaceStyleUsage.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfTransient.hxx>
// added by skl 12.02.2004 for writing materials
#include <XCAFDoc_MaterialTool.hxx>
#include <XCAFDoc_Material.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <TDataStd_Name.hxx>
#include <TDataStd_TreeNode.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
#include <StepBasic_SiUnitAndMassUnit.hxx>
#include <StepBasic_DerivedUnitElement.hxx>
#include <StepBasic_HArray1OfDerivedUnitElement.hxx>
#include <StepBasic_DerivedUnit.hxx>
#include <StepRepr_MeasureRepresentationItem.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepVisual_PresentationRepresentation.hxx>
#include <TDataStd_UAttribute.hxx>
#include <TDF_AttributeSequence.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelSequence.hxx>
#include <TDF_Tool.hxx>
#include <TDocStd_Document.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <Transfer_ActorOfFinderProcess.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_TransientListBinder.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <XCAFDoc.hxx>
#include <XCAFDoc_Area.hxx>
#include <XCAFDoc_Centroid.hxx>
#include <XCAFDoc_ColorTool.hxx>
#include <XCAFDoc_Datum.hxx>
#include <XCAFDoc_DimTol.hxx>
#include <XCAFDoc_DimTolTool.hxx>
#include <XCAFDoc_DocumentTool.hxx>
#include <XCAFDoc_GraphNode.hxx>
#include <XCAFDoc_LayerTool.hxx>
#include <XCAFDoc_Material.hxx>
#include <XCAFDoc_MaterialTool.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFDoc_Volume.hxx>
#include <XCAFPrs.hxx>
#include <XCAFPrs_DataMapIteratorOfDataMapOfStyleShape.hxx>
#include <XCAFPrs_DataMapOfShapeStyle.hxx>
#include <XCAFPrs_DataMapOfStyleShape.hxx>
#include <XCAFPrs_Style.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_WorkSession.hxx>
// added by skl 15.01.2004 for D&GT writing
//#include <StepRepr_CompoundItemDefinition.hxx>
//#include <StepRepr_CompoundItemDefinitionMember.hxx>
// added by skl 12.02.2004 for writing materials
//=======================================================================
//function : GetLabelName
//purpose : auxilary function: take name of label and append it to str

View File

@@ -0,0 +1,218 @@
// Created on: 2000-08-15
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public 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 _STEPCAFControl_Writer_HeaderFile
#define _STEPCAFControl_Writer_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <STEPControl_Writer.hxx>
#include <STEPCAFControl_DataMapOfLabelShape.hxx>
#include <STEPCAFControl_DataMapOfLabelExternFile.hxx>
#include <Standard_Boolean.hxx>
#include <MoniTool_DataMapOfShapeTransient.hxx>
#include <IFSelect_ReturnStatus.hxx>
#include <Standard_CString.hxx>
#include <STEPControl_StepModelType.hxx>
#include <TDF_LabelSequence.hxx>
class STEPCAFControl_DictionaryOfExternFile;
class XSControl_WorkSession;
class TDocStd_Document;
class TDF_Label;
class TCollection_AsciiString;
class STEPCAFControl_ExternFile;
class STEPControl_Writer;
class TopoDS_Shape;
//! 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
class STEPCAFControl_Writer
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a writer with an empty
//! STEP model and sets ColorMode, LayerMode, NameMode and
//! PropsMode to Standard_True.
Standard_EXPORT STEPCAFControl_Writer();
//! 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
Standard_EXPORT STEPCAFControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! Clears the internal data structures and attaches to a new session
//! Clears the session if it was not yet set for STEP
Standard_EXPORT void Init (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! 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
Standard_EXPORT IFSelect_ReturnStatus Write (const Standard_CString filename);
Standard_EXPORT Standard_Boolean Transfer (const Handle(TDocStd_Document)& doc, const STEPControl_StepModelType mode = STEPControl_AsIs, const Standard_CString multi = 0);
//! Transfers a document (or single label) to a STEP model
//! 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
Standard_EXPORT Standard_Boolean Transfer (const TDF_Label& L, const STEPControl_StepModelType mode = STEPControl_AsIs, const Standard_CString multi = 0);
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc, const TCollection_AsciiString& filename);
//! Transfers a document and writes it to a STEP file
//! Returns True if translation is OK
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc, const Standard_CString filename);
//! Returns data on external files
//! Returns Null handle if no external files are read
Standard_EXPORT const Handle(STEPCAFControl_DictionaryOfExternFile)& ExternFiles() const;
//! Returns data on external file by its original label
//! Returns False if no external file with given name is read
Standard_EXPORT Standard_Boolean ExternFile (const TDF_Label& L, Handle(STEPCAFControl_ExternFile)& ef) const;
//! Returns data on external file by its name
//! Returns False if no external file with given name is read
Standard_EXPORT Standard_Boolean ExternFile (const Standard_CString name, Handle(STEPCAFControl_ExternFile)& ef) const;
//! Returns basic reader for root file
Standard_EXPORT STEPControl_Writer& ChangeWriter();
//! Returns basic reader as const
Standard_EXPORT const STEPControl_Writer& Writer() const;
//! Set ColorMode for indicate write Colors or not.
Standard_EXPORT void SetColorMode (const Standard_Boolean colormode);
Standard_EXPORT Standard_Boolean GetColorMode() const;
//! Set NameMode for indicate write Name or not.
Standard_EXPORT void SetNameMode (const Standard_Boolean namemode);
Standard_EXPORT Standard_Boolean GetNameMode() const;
//! Set LayerMode for indicate write Layers or not.
Standard_EXPORT void SetLayerMode (const Standard_Boolean layermode);
Standard_EXPORT Standard_Boolean GetLayerMode() const;
//! PropsMode for indicate write Validation properties or not.
Standard_EXPORT void SetPropsMode (const Standard_Boolean propsmode);
Standard_EXPORT Standard_Boolean GetPropsMode() const;
//! Set SHUO mode for indicate write SHUO or not.
Standard_EXPORT void SetSHUOMode (const Standard_Boolean shuomode);
Standard_EXPORT Standard_Boolean GetSHUOMode() const;
//! Set dimtolmode for indicate write D&GTs or not.
Standard_EXPORT void SetDimTolMode (const Standard_Boolean dimtolmode);
Standard_EXPORT Standard_Boolean GetDimTolMode() const;
//! Set dimtolmode for indicate write D&GTs or not.
Standard_EXPORT void SetMaterialMode (const Standard_Boolean matmode);
Standard_EXPORT Standard_Boolean GetMaterialMode() const;
protected:
//! Transfers labels to a STEP model
//! Returns True if translation is OK
//! isExternFile setting from TransferExternFiles method
Standard_EXPORT Standard_Boolean Transfer (STEPControl_Writer& wr, const TDF_LabelSequence& labels, const STEPControl_StepModelType mode = STEPControl_AsIs, const Standard_CString multi = 0, const Standard_Boolean isExternFile = Standard_False);
//! Parses assembly structure of label L, writes all the simple
//! 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)
Standard_EXPORT TopoDS_Shape TransferExternFiles (const TDF_Label& L, const STEPControl_StepModelType mode, TDF_LabelSequence& Lseq, const Standard_CString prefix = "");
//! Write external references to STEP
Standard_EXPORT Standard_Boolean WriteExternRefs (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
//! Write colors assigned to specified labels, to STEP model
Standard_EXPORT Standard_Boolean WriteColors (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels);
//! Write names assigned to specified labels, to STEP model
Standard_EXPORT Standard_Boolean WriteNames (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
//! Write D&GTs assigned to specified labels, to STEP model
Standard_EXPORT Standard_Boolean WriteDGTs (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
//! Write materials assigned to specified labels, to STEP model
Standard_EXPORT Standard_Boolean WriteMaterials (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
//! Write validation properties assigned to specified labels,
//! to STEP model
Standard_EXPORT Standard_Boolean WriteValProps (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels, const Standard_CString multi) const;
//! Write layers assigned to specified labels, to STEP model
Standard_EXPORT Standard_Boolean WriteLayers (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels) const;
//! Write SHUO assigned to specified component, to STEP model
Standard_EXPORT Standard_Boolean WriteSHUOs (const Handle(XSControl_WorkSession)& WS, const TDF_LabelSequence& labels);
private:
STEPControl_Writer myWriter;
Handle(STEPCAFControl_DictionaryOfExternFile) myFiles;
STEPCAFControl_DataMapOfLabelShape myLabels;
STEPCAFControl_DataMapOfLabelExternFile myLabEF;
Standard_Boolean myColorMode;
Standard_Boolean myNameMode;
Standard_Boolean myLayerMode;
Standard_Boolean myPropsMode;
Standard_Boolean mySHUOMode;
MoniTool_DataMapOfShapeTransient myMapCompMDGPR;
Standard_Boolean myDGTMode;
Standard_Boolean myMatMode;
};
#endif // _STEPCAFControl_Writer_HeaderFile