mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +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:
6
src/IGESCAFControl/FILES
Normal file
6
src/IGESCAFControl/FILES
Normal file
@@ -0,0 +1,6 @@
|
||||
IGESCAFControl.cxx
|
||||
IGESCAFControl.hxx
|
||||
IGESCAFControl_Reader.cxx
|
||||
IGESCAFControl_Reader.hxx
|
||||
IGESCAFControl_Writer.cxx
|
||||
IGESCAFControl_Writer.hxx
|
@@ -1,48 +0,0 @@
|
||||
-- Created on: 2000-08-16
|
||||
-- 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.
|
||||
|
||||
package IGESCAFControl
|
||||
|
||||
---Purpose: Provides high-level API to translate IGES file
|
||||
-- to and from DECAF document
|
||||
|
||||
uses
|
||||
Quantity,
|
||||
TCollection,
|
||||
TopoDS,
|
||||
TopTools,
|
||||
TDocStd,
|
||||
TDF,
|
||||
XCAFDoc,
|
||||
XCAFPrs,
|
||||
XSControl,
|
||||
IGESControl
|
||||
|
||||
is
|
||||
|
||||
class Reader;
|
||||
|
||||
class Writer;
|
||||
---Purpose: Provides a tool for writing IGES file
|
||||
|
||||
DecodeColor (col: Integer) returns Color from Quantity;
|
||||
---Purpose: Converts IGES color index to CASCADE color
|
||||
|
||||
EncodeColor (col: Color from Quantity) returns Integer;
|
||||
---Purpose: Tries to Convert CASCADE color to IGES color index
|
||||
-- If no corresponding color defined in IGES, returns 0
|
||||
|
||||
|
||||
end IGESCAFControl;
|
@@ -13,13 +13,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IGESCAFControl.ixx>
|
||||
|
||||
#include <IGESCAFControl.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : DecodeColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Quantity_Color IGESCAFControl::DecodeColor (const Standard_Integer color)
|
||||
{
|
||||
switch ( color ) {
|
||||
|
71
src/IGESCAFControl/IGESCAFControl.hxx
Normal file
71
src/IGESCAFControl/IGESCAFControl.hxx
Normal file
@@ -0,0 +1,71 @@
|
||||
// Created on: 2000-08-16
|
||||
// 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 _IGESCAFControl_HeaderFile
|
||||
#define _IGESCAFControl_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class Quantity_Color;
|
||||
class IGESCAFControl_Reader;
|
||||
class IGESCAFControl_Writer;
|
||||
|
||||
|
||||
//! Provides high-level API to translate IGES file
|
||||
//! to and from DECAF document
|
||||
class IGESCAFControl
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Provides a tool for writing IGES file
|
||||
//! Converts IGES color index to CASCADE color
|
||||
Standard_EXPORT static Quantity_Color DecodeColor (const Standard_Integer col);
|
||||
|
||||
//! Tries to Convert CASCADE color to IGES color index
|
||||
//! If no corresponding color defined in IGES, returns 0
|
||||
Standard_EXPORT static Standard_Integer EncodeColor (const Quantity_Color& col);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class IGESCAFControl_Reader;
|
||||
friend class IGESCAFControl_Writer;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESCAFControl_HeaderFile
|
@@ -1,107 +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 IGESCAFControl inherits Reader from IGESControl
|
||||
|
||||
---Purpose: Provides a tool to read IGES file and put it into
|
||||
-- DECAF document. Besides transfer of shapes (including
|
||||
-- assemblies) provided by IGESControl, supports also
|
||||
-- colors and part names
|
||||
-- IGESCAFControl_Reader reader; Methods for translation of an IGES file:
|
||||
-- reader.ReadFile("filename");
|
||||
-- reader.Transfer(Document); or
|
||||
-- reader.Perform("filename",doc);
|
||||
-- Methods for managing reading attributes.
|
||||
-- Colors
|
||||
-- reader.SetColorMode(colormode);
|
||||
-- Standard_Boolean colormode = reader.GetColorMode();
|
||||
-- Layers
|
||||
-- reader.SetLayerMode(layermode);
|
||||
-- Standard_Boolean layermode = reader.GetLayerMode();
|
||||
-- Names
|
||||
-- reader.SetNameMode(namemode);
|
||||
-- Standard_Boolean namemode = reader.GetNameMode();
|
||||
|
||||
uses
|
||||
AsciiString from TCollection,
|
||||
WorkSession from XSControl,
|
||||
Document from TDocStd
|
||||
|
||||
is
|
||||
|
||||
Create returns Reader;
|
||||
---Purpose: Creates a reader with an empty
|
||||
-- IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
|
||||
|
||||
Create (WS : WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True) returns Reader;
|
||||
---Purpose: Creates a reader tool and attaches it to an already existing Session
|
||||
-- Clears the session if it was not yet set for IGES
|
||||
|
||||
Transfer (me: in out; doc: in out Document from TDocStd)
|
||||
returns Boolean;
|
||||
---Purpose: Translates currently loaded IGES file into the document
|
||||
-- Returns True if succeeded, and False in case of fail
|
||||
|
||||
Perform (me: in out; filename: AsciiString from TCollection;
|
||||
doc: in out Document from TDocStd) returns Boolean;
|
||||
|
||||
Perform (me: in out; filename: CString; doc: in out Document from TDocStd)
|
||||
returns Boolean;
|
||||
---Purpose: Translate IGES file given by filename into the document
|
||||
-- Return True if succeeded, and False in case of fail
|
||||
|
||||
---Scope: protected methods
|
||||
|
||||
ReadColors (me; doc: in out Document from TDocStd)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads colors of IGES entities and sets
|
||||
-- corresponding color assignments in the DECAF document
|
||||
|
||||
ReadNames (me; doc: in out Document from TDocStd)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads Names of IGES entities and sets
|
||||
-- corresponding name to label with shape in the DECAF document
|
||||
|
||||
ReadLayers (me; doc: in out Document from TDocStd)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads layers of parts defined in the IGES model and
|
||||
-- set reference between shape and layers in the DECAF document
|
||||
|
||||
--- Work with fileds for different mode of reading IGES file.
|
||||
|
||||
SetColorMode(me: in out; colormode: Boolean from Standard);
|
||||
---Purpose: Set ColorMode for indicate read Colors or not.
|
||||
|
||||
GetColorMode(me) returns Boolean;
|
||||
|
||||
SetNameMode(me: in out; namemode: Boolean from Standard);
|
||||
---Purpose: Set NameMode for indicate read Name or not.
|
||||
|
||||
GetNameMode(me) returns Boolean;
|
||||
|
||||
SetLayerMode(me: in out; layermode: Boolean from Standard);
|
||||
---Purpose: Set LayerMode for indicate read Layers or not.
|
||||
|
||||
GetLayerMode(me) returns Boolean;
|
||||
|
||||
fields
|
||||
|
||||
myColorMode: Boolean;
|
||||
myNameMode: Boolean;
|
||||
myLayerMode: Boolean;
|
||||
|
||||
end Reader;
|
||||
|
@@ -13,38 +13,41 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <IGESCAFControl_Reader.ixx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <XCAFDoc_ShapeTool.hxx>
|
||||
#include <XSControl_TransferReader.hxx>
|
||||
#include <XCAFDoc_ColorTool.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <Transfer_Binder.hxx>
|
||||
#include <TransferBRep.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <IGESBasic_SubfigureDef.hxx>
|
||||
#include <IGESCAFControl.hxx>
|
||||
#include <IGESCAFControl_Reader.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <IGESData_LevelListEntity.hxx>
|
||||
#include <IGESGraph_Color.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Transfer_TransientProcess.hxx>
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <XCAFDoc_LayerTool.hxx>
|
||||
#include <IGESData_LevelListEntity.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <XCAFDoc_ShapeMapTool.hxx>
|
||||
#include <IGESBasic_SubfigureDef.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <Transfer_Binder.hxx>
|
||||
#include <Transfer_TransientProcess.hxx>
|
||||
#include <TransferBRep.hxx>
|
||||
#include <XCAFDoc_ColorTool.hxx>
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
#include <XCAFDoc_LayerTool.hxx>
|
||||
#include <XCAFDoc_ShapeMapTool.hxx>
|
||||
#include <XCAFDoc_ShapeTool.hxx>
|
||||
#include <XSControl_TransferReader.hxx>
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IGESCAFControl_Reader
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESCAFControl_Reader::IGESCAFControl_Reader () :
|
||||
myColorMode( Standard_True ),
|
||||
myNameMode ( Standard_True ),
|
||||
|
127
src/IGESCAFControl/IGESCAFControl_Reader.hxx
Normal file
127
src/IGESCAFControl/IGESCAFControl_Reader.hxx
Normal file
@@ -0,0 +1,127 @@
|
||||
// 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 _IGESCAFControl_Reader_HeaderFile
|
||||
#define _IGESCAFControl_Reader_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <IGESControl_Reader.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class XSControl_WorkSession;
|
||||
class TDocStd_Document;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
//! Provides a tool to read IGES file and put it into
|
||||
//! DECAF document. Besides transfer of shapes (including
|
||||
//! assemblies) provided by IGESControl, supports also
|
||||
//! colors and part names
|
||||
//! IGESCAFControl_Reader reader; Methods for translation of an IGES file:
|
||||
//! reader.ReadFile("filename");
|
||||
//! reader.Transfer(Document); or
|
||||
//! reader.Perform("filename",doc);
|
||||
//! Methods for managing reading attributes.
|
||||
//! Colors
|
||||
//! reader.SetColorMode(colormode);
|
||||
//! Standard_Boolean colormode = reader.GetColorMode();
|
||||
//! Layers
|
||||
//! reader.SetLayerMode(layermode);
|
||||
//! Standard_Boolean layermode = reader.GetLayerMode();
|
||||
//! Names
|
||||
//! reader.SetNameMode(namemode);
|
||||
//! Standard_Boolean namemode = reader.GetNameMode();
|
||||
class IGESCAFControl_Reader : public IGESControl_Reader
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a reader with an empty
|
||||
//! IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
|
||||
Standard_EXPORT IGESCAFControl_Reader();
|
||||
|
||||
//! Creates a reader tool and attaches it to an already existing Session
|
||||
//! Clears the session if it was not yet set for IGES
|
||||
Standard_EXPORT IGESCAFControl_Reader(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
|
||||
|
||||
//! Translates currently loaded IGES file into the document
|
||||
//! Returns True if succeeded, and False in case of fail
|
||||
Standard_EXPORT Standard_Boolean Transfer (Handle(TDocStd_Document)& doc);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Perform (const TCollection_AsciiString& filename, Handle(TDocStd_Document)& doc);
|
||||
|
||||
//! Translate IGES file given by filename into the document
|
||||
//! Return True if succeeded, and False in case of fail
|
||||
Standard_EXPORT Standard_Boolean Perform (const Standard_CString filename, Handle(TDocStd_Document)& doc);
|
||||
|
||||
//! 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;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Reads colors of IGES entities and sets
|
||||
//! corresponding color assignments in the DECAF document
|
||||
Standard_EXPORT Standard_Boolean ReadColors (Handle(TDocStd_Document)& doc) const;
|
||||
|
||||
//! Reads Names of IGES entities and sets
|
||||
//! corresponding name to label with shape in the DECAF document
|
||||
Standard_EXPORT Standard_Boolean ReadNames (Handle(TDocStd_Document)& doc) const;
|
||||
|
||||
//! Reads layers of parts defined in the IGES model and
|
||||
//! set reference between shape and layers in the DECAF document
|
||||
Standard_EXPORT Standard_Boolean ReadLayers (Handle(TDocStd_Document)& doc) const;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myColorMode;
|
||||
Standard_Boolean myNameMode;
|
||||
Standard_Boolean myLayerMode;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESCAFControl_Reader_HeaderFile
|
@@ -1,125 +0,0 @@
|
||||
-- Created on: 2000-08-17
|
||||
-- Created by: Andrey BETENEV
|
||||
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public 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 IGESCAFControl inherits Writer from IGESControl
|
||||
|
||||
---Purpose: Provides a tool to write DECAF document to the
|
||||
-- IGES file. Besides transfer of shapes (including
|
||||
-- assemblies) provided by IGESControl, supports also
|
||||
-- colors and part names
|
||||
-- IGESCAFControl_Writer writer();
|
||||
-- Methods for writing IGES file:
|
||||
-- writer.Transfer (Document);
|
||||
-- writer.Write("filename") or writer.Write(OStream) or
|
||||
-- writer.Perform(Document,"filename");
|
||||
-- Methods for managing the writing of attributes.
|
||||
-- Colors
|
||||
-- writer.SetColorMode(colormode);
|
||||
-- Standard_Boolean colormode = writer.GetColorMode();
|
||||
-- Layers
|
||||
-- writer.SetLayerMode(layermode);
|
||||
-- Standard_Boolean layermode = writer.GetLayerMode();
|
||||
-- Names
|
||||
-- writer.SetNameMode(namemode);
|
||||
-- Standard_Boolean namemode = writer.GetNameMode();
|
||||
|
||||
uses
|
||||
AsciiString from TCollection,
|
||||
Shape from TopoDS,
|
||||
MapOfShape from TopTools,
|
||||
WorkSession from XSControl,
|
||||
Document from TDocStd,
|
||||
LabelSequence from TDF,
|
||||
Style from XCAFPrs,
|
||||
DataMapOfShapeStyle from XCAFPrs,
|
||||
DataMapOfStyleTransient from XCAFPrs
|
||||
is
|
||||
|
||||
Create returns Writer;
|
||||
---Purpose: Creates a writer with an empty
|
||||
-- IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
|
||||
|
||||
Create (WS : WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True) returns Writer;
|
||||
---Purpose: Creates a reader tool and attaches it to an already existing Session
|
||||
-- Clears the session if it was not yet set for IGES
|
||||
|
||||
Transfer (me : in out; doc : Document from TDocStd)
|
||||
returns Boolean;
|
||||
---Purpose: Transfers a document to a IGES model
|
||||
-- Returns True if translation is OK
|
||||
|
||||
Perform (me : in out; doc : Document from TDocStd;
|
||||
filename: AsciiString from TCollection)
|
||||
returns Boolean;
|
||||
|
||||
Perform (me : in out; doc : Document from TDocStd; filename: CString)
|
||||
returns Boolean;
|
||||
---Purpose : Transfers a document and writes it to a IGES file
|
||||
-- Returns True if translation is OK
|
||||
|
||||
---Scope: Internal methods
|
||||
|
||||
Transfer (me : in out; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Transfers labels to a IGES model
|
||||
-- Returns True if translation is OK
|
||||
|
||||
WriteAttributes (me: in out; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads colors from DECAF document and assigns them
|
||||
-- to corresponding IGES entities
|
||||
|
||||
MakeColors (me: in out; S: Shape from TopoDS; settings: DataMapOfShapeStyle from XCAFPrs;
|
||||
colors: in out DataMapOfStyleTransient from XCAFPrs;
|
||||
Map: in out MapOfShape from TopTools;
|
||||
inherit: Style from XCAFPrs) is private;
|
||||
---Purpose: Recursively iterates on subshapes and assigns colors
|
||||
-- to faces and edges (if set)
|
||||
|
||||
WriteLayers (me: in out; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Reads layers from DECAF document and assigns them
|
||||
-- to corresponding IGES entities
|
||||
|
||||
WriteNames (me: in out; labels: LabelSequence from TDF)
|
||||
returns Boolean is protected;
|
||||
---Purpose: Recursivile iterates on subshapes and assign names
|
||||
-- to IGES entity
|
||||
|
||||
--- Work with fileds for different mode of writing IGES file.
|
||||
|
||||
SetColorMode(me: in out; colormode: Boolean from Standard);
|
||||
---Purpose: Set ColorMode for indicate write Colors or not.
|
||||
|
||||
GetColorMode(me) returns Boolean;
|
||||
|
||||
SetNameMode(me: in out; namemode: Boolean from Standard);
|
||||
---Purpose: Set NameMode for indicate write Name or not.
|
||||
|
||||
GetNameMode(me) returns Boolean;
|
||||
|
||||
SetLayerMode(me: in out; layermode: Boolean from Standard);
|
||||
---Purpose: Set LayerMode for indicate write Layers or not.
|
||||
|
||||
GetLayerMode(me) returns Boolean;
|
||||
|
||||
fields
|
||||
|
||||
myColorMode: Boolean;
|
||||
myNameMode: Boolean;
|
||||
myLayerMode: Boolean;
|
||||
|
||||
end Writer;
|
@@ -13,40 +13,43 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IGESCAFControl_Writer.ixx>
|
||||
#include <XCAFDoc_ShapeTool.hxx>
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <XCAFDoc_ColorTool.hxx>
|
||||
#include <XCAFPrs.hxx>
|
||||
#include <TransferBRep_ShapeMapper.hxx>
|
||||
#include <TransferBRep.hxx>
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
#include <IGESGraph_Color.hxx>
|
||||
|
||||
#include <IGESCAFControl.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <Transfer_TransientListBinder.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <XCAFDoc_LayerTool.hxx>
|
||||
#include <IGESCAFControl_Writer.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <IGESData_IGESModel.hxx>
|
||||
#include <IGESData_NameEntity.hxx>
|
||||
#include <IGESGraph_Color.hxx>
|
||||
#include <IGESGraph_DefinitionLevel.hxx>
|
||||
#include <IGESSolid_Face.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfExtendedString.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <IGESData_NameEntity.hxx>
|
||||
#include <IGESSolid_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#include <TColStd_HSequenceOfExtendedString.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <IGESData_IGESEntity.hxx>
|
||||
#include <IGESData_IGESModel.hxx>
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
#include <Transfer_TransientListBinder.hxx>
|
||||
#include <TransferBRep.hxx>
|
||||
#include <TransferBRep_ShapeMapper.hxx>
|
||||
#include <XCAFDoc_ColorTool.hxx>
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
#include <XCAFDoc_LayerTool.hxx>
|
||||
#include <XCAFDoc_ShapeTool.hxx>
|
||||
#include <XCAFPrs.hxx>
|
||||
#include <XCAFPrs_Style.hxx>
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
142
src/IGESCAFControl/IGESCAFControl_Writer.hxx
Normal file
142
src/IGESCAFControl/IGESCAFControl_Writer.hxx
Normal file
@@ -0,0 +1,142 @@
|
||||
// Created on: 2000-08-17
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public 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 _IGESCAFControl_Writer_HeaderFile
|
||||
#define _IGESCAFControl_Writer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <IGESControl_Writer.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
#include <XCAFPrs_DataMapOfShapeStyle.hxx>
|
||||
#include <XCAFPrs_DataMapOfStyleTransient.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
class XSControl_WorkSession;
|
||||
class TDocStd_Document;
|
||||
class TCollection_AsciiString;
|
||||
class TopoDS_Shape;
|
||||
class XCAFPrs_Style;
|
||||
|
||||
|
||||
//! Provides a tool to write DECAF document to the
|
||||
//! IGES file. Besides transfer of shapes (including
|
||||
//! assemblies) provided by IGESControl, supports also
|
||||
//! colors and part names
|
||||
//! IGESCAFControl_Writer writer();
|
||||
//! Methods for writing IGES file:
|
||||
//! writer.Transfer (Document);
|
||||
//! writer.Write("filename") or writer.Write(OStream) or
|
||||
//! writer.Perform(Document,"filename");
|
||||
//! Methods for managing the writing of attributes.
|
||||
//! Colors
|
||||
//! writer.SetColorMode(colormode);
|
||||
//! Standard_Boolean colormode = writer.GetColorMode();
|
||||
//! Layers
|
||||
//! writer.SetLayerMode(layermode);
|
||||
//! Standard_Boolean layermode = writer.GetLayerMode();
|
||||
//! Names
|
||||
//! writer.SetNameMode(namemode);
|
||||
//! Standard_Boolean namemode = writer.GetNameMode();
|
||||
class IGESCAFControl_Writer : public IGESControl_Writer
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a writer with an empty
|
||||
//! IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
|
||||
Standard_EXPORT IGESCAFControl_Writer();
|
||||
|
||||
//! Creates a reader tool and attaches it to an already existing Session
|
||||
//! Clears the session if it was not yet set for IGES
|
||||
Standard_EXPORT IGESCAFControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
|
||||
|
||||
//! Transfers a document to a IGES model
|
||||
//! Returns True if translation is OK
|
||||
Standard_EXPORT Standard_Boolean Transfer (const Handle(TDocStd_Document)& doc);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc, const TCollection_AsciiString& filename);
|
||||
|
||||
//! Transfers a document and writes it to a IGES file
|
||||
//! Returns True if translation is OK
|
||||
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc, const Standard_CString filename);
|
||||
|
||||
//! 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;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Transfers labels to a IGES model
|
||||
//! Returns True if translation is OK
|
||||
Standard_EXPORT Standard_Boolean Transfer (const TDF_LabelSequence& labels);
|
||||
|
||||
//! Reads colors from DECAF document and assigns them
|
||||
//! to corresponding IGES entities
|
||||
Standard_EXPORT Standard_Boolean WriteAttributes (const TDF_LabelSequence& labels);
|
||||
|
||||
//! Reads layers from DECAF document and assigns them
|
||||
//! to corresponding IGES entities
|
||||
Standard_EXPORT Standard_Boolean WriteLayers (const TDF_LabelSequence& labels);
|
||||
|
||||
//! Recursivile iterates on subshapes and assign names
|
||||
//! to IGES entity
|
||||
Standard_EXPORT Standard_Boolean WriteNames (const TDF_LabelSequence& labels);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Recursively iterates on subshapes and assigns colors
|
||||
//! to faces and edges (if set)
|
||||
Standard_EXPORT void MakeColors (const TopoDS_Shape& S, const XCAFPrs_DataMapOfShapeStyle& settings, XCAFPrs_DataMapOfStyleTransient& colors, TopTools_MapOfShape& Map, const XCAFPrs_Style& inherit);
|
||||
|
||||
|
||||
Standard_Boolean myColorMode;
|
||||
Standard_Boolean myNameMode;
|
||||
Standard_Boolean myLayerMode;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESCAFControl_Writer_HeaderFile
|
Reference in New Issue
Block a user