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:
11
src/STEPControl/FILES
Normal file
11
src/STEPControl/FILES
Normal file
@@ -0,0 +1,11 @@
|
||||
STEPControl_ActorRead.cxx
|
||||
STEPControl_ActorRead.hxx
|
||||
STEPControl_ActorWrite.cxx
|
||||
STEPControl_ActorWrite.hxx
|
||||
STEPControl_Controller.cxx
|
||||
STEPControl_Controller.hxx
|
||||
STEPControl_Reader.cxx
|
||||
STEPControl_Reader.hxx
|
||||
STEPControl_StepModelType.hxx
|
||||
STEPControl_Writer.cxx
|
||||
STEPControl_Writer.hxx
|
@@ -1,75 +0,0 @@
|
||||
-- Created on: 1996-04-09
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package STEPControl
|
||||
|
||||
---Purpose : This package provides external access and control for STEP,
|
||||
-- especially to deal with Shapes
|
||||
|
||||
uses
|
||||
Standard,
|
||||
gp,
|
||||
TColStd,
|
||||
TCollection,
|
||||
Interface,
|
||||
Transfer,
|
||||
IFSelect,
|
||||
XSControl,
|
||||
TopoDS,
|
||||
TopTools,
|
||||
StepBasic,
|
||||
StepData,
|
||||
StepGeom,
|
||||
StepShape,
|
||||
StepRepr,
|
||||
STEPConstruct,
|
||||
TransferBRep,
|
||||
StepToTopoDS, -- Non-manifold topology: STEP -> TopoDS (ssv; 13.11.2010)
|
||||
MoniTool -- Non-manifold topology: TopoDS -> STEP (ssv; 13.11.2010)
|
||||
is
|
||||
|
||||
enumeration StepModelType is
|
||||
AsIs,
|
||||
ManifoldSolidBrep,
|
||||
BrepWithVoids,
|
||||
FacetedBrep,
|
||||
FacetedBrepAndBrepWithVoids,
|
||||
ShellBasedSurfaceModel,
|
||||
GeometricCurveSet,
|
||||
Hybrid
|
||||
end StepModelType;
|
||||
---Purpose: Gives you the choice of translation mode for an Open
|
||||
-- CASCADE shape that is being translated to STEP.
|
||||
-- - STEPControl_AsIs translates an Open CASCADE shape to its
|
||||
-- highest possible STEP representation.
|
||||
-- - STEPControl_ManifoldSolidBrep translates an Open CASCADE shape
|
||||
-- to a STEP manifold_solid_brep or brep_with_voids entity.
|
||||
-- - STEPControl_FacetedBrep translates an Open CASCADE shape
|
||||
-- into a STEP faceted_brep entity.
|
||||
-- - STEPControl_ShellBasedSurfaceModel translates an Open CASCADE shape
|
||||
-- into a STEP shell_based_surface_model entity.
|
||||
-- - STEPControl_GeometricCurveSet
|
||||
-- translates an Open CASCADE shape into a STEP geometric_curve_set entity.
|
||||
|
||||
class Controller;
|
||||
|
||||
class Reader;
|
||||
class Writer;
|
||||
|
||||
class ActorRead;
|
||||
class ActorWrite;
|
||||
|
||||
end STEPControl;
|
@@ -1,158 +0,0 @@
|
||||
-- Created on: 1994-12-21
|
||||
-- Created by: Dieter THIEMANN
|
||||
-- Copyright (c) 1994-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public 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 ActorRead from STEPControl
|
||||
inherits ActorOfTransientProcess from Transfer
|
||||
|
||||
---Purpose : This class performs the transfer of an Entity from
|
||||
-- AP214 and AP203, either Geometric or Topologic.
|
||||
--
|
||||
-- I.E. for each type of Entity, it invokes the appropriate Tool
|
||||
-- then returns the Binder which contains the Result
|
||||
|
||||
uses
|
||||
|
||||
TransientProcess from Transfer,
|
||||
Binder from Transfer,
|
||||
Trsf from gp,
|
||||
Axis2Placement3d from StepGeom,
|
||||
Representation from StepRepr,
|
||||
RepresentationRelationship from StepRepr,
|
||||
ProductDefinition from StepBasic,
|
||||
NextAssemblyUsageOccurrence from StepRepr,
|
||||
ShapeRepresentation from StepShape,
|
||||
ContextDependentShapeRepresentation from StepShape,
|
||||
ShapeRepresentationRelationship from StepRepr,
|
||||
GeometricRepresentationItem from StepGeom,
|
||||
MappedItem from StepRepr,
|
||||
FaceSurface from StepShape,
|
||||
ShapeBinder from TransferBRep,
|
||||
NMTool from StepToTopoDS, -- To proceed with non-manifold cases (ssv; 13.11.2010)
|
||||
Shell from TopoDS,
|
||||
ListOfShape from TopTools,
|
||||
Compound from TopoDS,
|
||||
IndexedDataMapOfShapeListOfShape from TopTools
|
||||
|
||||
is
|
||||
|
||||
Create returns ActorRead from STEPControl;
|
||||
|
||||
Recognize (me : mutable; start : Transient) returns Boolean is redefined;
|
||||
|
||||
Transfer (me : mutable; start : Transient;
|
||||
TP : TransientProcess from Transfer)
|
||||
returns Binder from Transfer is redefined;
|
||||
-- calls TransferShape
|
||||
|
||||
TransferShape (me : mutable;
|
||||
start : Transient;
|
||||
TP : TransientProcess from Transfer;
|
||||
isManifold : Boolean = Standard_True)
|
||||
returns Binder from Transfer;
|
||||
|
||||
---Private: unit and uncertainty context management
|
||||
|
||||
PrepareUnits (me : mutable; rep: Representation from StepRepr;
|
||||
TP: TransientProcess from Transfer);
|
||||
---Purpose: set units and tolerances context by given ShapeRepresentation
|
||||
|
||||
ResetUnits (me: mutable);
|
||||
---Purpose: reset units and tolerances context to default
|
||||
--- (mm, radians, read.precision.val, etc.)
|
||||
|
||||
ComputeTransformation (me: mutable; Origin, Target: Axis2Placement3d from StepGeom;
|
||||
OrigContext, TargContext: Representation from StepRepr;
|
||||
TP: TransientProcess from Transfer;
|
||||
Trsf: out Trsf from gp)
|
||||
returns Boolean;
|
||||
---Purpose: Computes transformation defined by two axis placements (in MAPPED_ITEM
|
||||
-- or ITEM_DEFINED_TRANSFORMATION) taking into account their
|
||||
-- representation contexts (i.e. units, which may be different)
|
||||
-- Returns True if transformation is computed and is not an identity.
|
||||
|
||||
ComputeSRRWT (me: mutable; SRR: RepresentationRelationship from StepRepr;
|
||||
TP: TransientProcess from Transfer;
|
||||
Trsf: out Trsf from gp)
|
||||
returns Boolean;
|
||||
---Purpose: Computes transformation defined by given
|
||||
-- REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
|
||||
|
||||
TransferEntity(me: mutable; PD : ProductDefinition from StepBasic;
|
||||
TP : TransientProcess from Transfer) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers product definition entity
|
||||
|
||||
|
||||
TransferEntity(me: mutable; NAUO : NextAssemblyUsageOccurrence from StepRepr;
|
||||
TP : TransientProcess from Transfer) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers next assembly usage occurence entity
|
||||
|
||||
TransferEntity(me: mutable; sr : ShapeRepresentation from StepShape;
|
||||
TP : TransientProcess from Transfer;
|
||||
isBound : out Boolean ) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers shape representation entity
|
||||
|
||||
|
||||
TransferEntity(me: mutable; CDSR : ContextDependentShapeRepresentation from StepShape;
|
||||
TP : TransientProcess from Transfer) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers context dependent shape representation entity
|
||||
|
||||
TransferEntity(me: mutable; und : ShapeRepresentationRelationship from StepRepr;
|
||||
TP : TransientProcess from Transfer;
|
||||
nbrep : Integer =0) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers shape representation relationship entity
|
||||
|
||||
|
||||
TransferEntity(me : mutable;
|
||||
git : GeometricRepresentationItem from StepGeom;
|
||||
TP : TransientProcess from Transfer;
|
||||
isManifold : Boolean) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers geometric representation item entity such as ManifoldSolidBRep ,...etc
|
||||
|
||||
TransferEntity(me: mutable; mapit : MappedItem from StepRepr;
|
||||
TP : TransientProcess from Transfer) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers mapped item
|
||||
|
||||
TransferEntity(me: mutable; fs : FaceSurface from StepShape;
|
||||
TP : TransientProcess from Transfer) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Transfers FaceSurface entity
|
||||
|
||||
OldWay(me: mutable; start : Transient;
|
||||
TP : TransientProcess from Transfer) returns ShapeBinder from TransferBRep is protected;
|
||||
---Purpose:Tranlates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off.
|
||||
|
||||
closeIDEASShell(me : mutable;
|
||||
shell : in Shell from TopoDS;
|
||||
closingShells : in ListOfShape from TopTools)
|
||||
returns Shell from TopoDS
|
||||
is private;
|
||||
|
||||
computeIDEASClosings(me : mutable;
|
||||
comp : in Compound from TopoDS;
|
||||
shellClosingMap : in out IndexedDataMapOfShapeListOfShape from TopTools)
|
||||
is private;
|
||||
|
||||
fields
|
||||
|
||||
-- theUnitFactor : Real; -- Conversion unit factor.
|
||||
-- theVTol : Real; -- Tolerance for Vertices
|
||||
-- theETol : Real; -- Tolerance for Edges
|
||||
-- theFTol : Real; -- Tolerance for Faces
|
||||
myNMTool : NMTool from StepToTopoDS; -- To proceed with non-manifold cases (ssv; 13.11.2010)
|
||||
myPrecision : Real;
|
||||
myMaxTol : Real;
|
||||
mySRContext: Representation from StepRepr; -- context for unuts
|
||||
|
||||
end ActorRead;
|
@@ -15,119 +15,111 @@
|
||||
//:n4 abv 11.02.99 S4132: recognition of GeometricSet (instead of GeometricCurveSet)
|
||||
// gka 05.04.99 S4136: eliminate parameter lastpreci
|
||||
//gka,abv 14.04.99 S4136: maintain unit context, precision and maxtolerance values
|
||||
#include <STEPControl_ActorRead.ixx>
|
||||
#include <OSD_Timer.hxx>
|
||||
|
||||
// #include <Interface_InterfaceModel.hxx> // pour mise au point
|
||||
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
#include <StepShape_FacetedBrepAndBrepWithVoids.hxx>
|
||||
#include <StepShape_FacetedBrep.hxx>
|
||||
#include <StepShape_ShellBasedSurfaceModel.hxx>
|
||||
#include <StepShape_ManifoldSolidBrep.hxx>
|
||||
#include <StepShape_BrepWithVoids.hxx>
|
||||
#include <StepShape_GeometricSet.hxx>
|
||||
|
||||
// MappedItem :
|
||||
#include <StepRepr_MappedItem.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <StepRepr_RepresentationMap.hxx>
|
||||
#include <StepToTopoDS_MakeTransformed.hxx>
|
||||
|
||||
// FaceSurface :
|
||||
#include <StepShape_FaceSurface.hxx>
|
||||
#include <StepToTopoDS_Tool.hxx>
|
||||
#include <StepToTopoDS_DataMapOfTRI.hxx>
|
||||
#include <StepToTopoDS_TranslateFace.hxx>
|
||||
|
||||
// Unites :
|
||||
#include <StepRepr_RepresentationContext.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
//#include <StepBasic_UncertaintyMeasureWithUnit.hxx>
|
||||
#include <StepBasic_ProductRelatedProductCategory.hxx>
|
||||
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
|
||||
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
|
||||
|
||||
#include <STEPConstruct_UnitContext.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
|
||||
// Representation Relationship & cie
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <TransferBRep.hxx>
|
||||
#include <StepShape_ContextDependentShapeRepresentation.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationship.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
#include <StepRepr_Transformation.hxx>
|
||||
#include <StepRepr_ItemDefinedTransformation.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <StepToTopoDS_Builder.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <TransferBRep_ShapeBinder.hxx>
|
||||
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
|
||||
#include <StepBasic_ProductDefinition.hxx>
|
||||
#include <StepRepr_ProductDefinitionShape.hxx>
|
||||
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
|
||||
#include <STEPConstruct_Assembly.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <StepToGeom_MakeTransformation3d.hxx>
|
||||
#include <StepToGeom_MakeAxis2Placement.hxx>
|
||||
#include <BRepCheck_Shell.hxx>
|
||||
#include <BRepCheck_Status.hxx>
|
||||
#include <Geom_Axis2Placement.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <XSAlgo.hxx>
|
||||
#include <XSAlgo_AlgoContainer.hxx>
|
||||
#include <StepShape_EdgeBasedWireframeModel.hxx>
|
||||
#include <StepShape_FaceBasedSurfaceModel.hxx>
|
||||
|
||||
#include <StepShape_AdvancedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_FacetedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_ManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_EdgeBasedWireframeShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricallyBoundedSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <Message_ProgressSentry.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <HeaderSection_FileName.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <StepRepr_HSequenceOfRepresentationItem.hxx>
|
||||
#include <StepBasic_ProductDefinition.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Message_ProgressSentry.hxx>
|
||||
#include <OSD_Timer.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StepBasic_ProductDefinition.hxx>
|
||||
#include <StepBasic_ProductRelatedProductCategory.hxx>
|
||||
#include <STEPConstruct_Assembly.hxx>
|
||||
#include <STEPConstruct_UnitContext.hxx>
|
||||
#include <STEPControl_ActorRead.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <StepDimTol_DatumFeature.hxx>
|
||||
#include <StepDimTol_GeometricTolerance.hxx>
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
|
||||
|
||||
// For non-manifold topology processing (ssv; 12.11.2010)
|
||||
#include <StepShape_NonManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <BRepCheck_Shell.hxx>
|
||||
#include <BRepCheck_Status.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <HeaderSection_FileName.hxx>
|
||||
#include <StepGeom_GeometricRepresentationItem.hxx>
|
||||
#include <StepRepr_Representation.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <StepGeom_CartesianTransformationOperator3d.hxx>
|
||||
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
|
||||
#include <StepGeom_GeometricRepresentationItem.hxx>
|
||||
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
#include <StepRepr_HSequenceOfRepresentationItem.hxx>
|
||||
#include <StepRepr_ItemDefinedTransformation.hxx>
|
||||
#include <StepRepr_MappedItem.hxx>
|
||||
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
|
||||
#include <StepRepr_ProductDefinitionShape.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
#include <StepRepr_Representation.hxx>
|
||||
#include <StepRepr_RepresentationContext.hxx>
|
||||
#include <StepRepr_RepresentationMap.hxx>
|
||||
#include <StepRepr_RepresentationRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationship.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
#include <StepRepr_Transformation.hxx>
|
||||
#include <StepShape_AdvancedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_BrepWithVoids.hxx>
|
||||
#include <StepShape_ContextDependentShapeRepresentation.hxx>
|
||||
#include <StepShape_EdgeBasedWireframeModel.hxx>
|
||||
#include <StepShape_EdgeBasedWireframeShapeRepresentation.hxx>
|
||||
#include <StepShape_FaceBasedSurfaceModel.hxx>
|
||||
#include <StepShape_FaceSurface.hxx>
|
||||
#include <StepShape_FacetedBrep.hxx>
|
||||
#include <StepShape_FacetedBrepAndBrepWithVoids.hxx>
|
||||
#include <StepShape_FacetedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricallyBoundedSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricSet.hxx>
|
||||
#include <StepShape_ManifoldSolidBrep.hxx>
|
||||
#include <StepShape_ManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_NonManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
#include <StepShape_ShellBasedSurfaceModel.hxx>
|
||||
#include <StepToGeom_MakeAxis2Placement.hxx>
|
||||
#include <StepToGeom_MakeTransformation3d.hxx>
|
||||
#include <StepToTopoDS_Builder.hxx>
|
||||
#include <StepToTopoDS_DataMapOfTRI.hxx>
|
||||
#include <StepToTopoDS_MakeTransformed.hxx>
|
||||
#include <StepToTopoDS_Tool.hxx>
|
||||
#include <StepToTopoDS_TranslateFace.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.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 <TransferBRep_ShapeBinder.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
#include <XSAlgo.hxx>
|
||||
#include <XSAlgo_AlgoContainer.hxx>
|
||||
|
||||
// #include <Interface_InterfaceModel.hxx> // pour mise au point
|
||||
// MappedItem :
|
||||
// FaceSurface :
|
||||
// Unites :
|
||||
//#include <StepBasic_UncertaintyMeasureWithUnit.hxx>
|
||||
// Representation Relationship & cie
|
||||
// For non-manifold topology processing (ssv; 12.11.2010)
|
||||
#define TRANSLOG
|
||||
|
||||
// ============================================================================
|
||||
|
147
src/STEPControl/STEPControl_ActorRead.hxx
Normal file
147
src/STEPControl/STEPControl_ActorRead.hxx
Normal file
@@ -0,0 +1,147 @@
|
||||
// Created on: 1994-12-21
|
||||
// Created by: Dieter THIEMANN
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public 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 _STEPControl_ActorRead_HeaderFile
|
||||
#define _STEPControl_ActorRead_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepToTopoDS_NMTool.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Transfer_ActorOfTransientProcess.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
class StepRepr_Representation;
|
||||
class Standard_Transient;
|
||||
class Transfer_Binder;
|
||||
class Transfer_TransientProcess;
|
||||
class StepGeom_Axis2Placement3d;
|
||||
class gp_Trsf;
|
||||
class StepRepr_RepresentationRelationship;
|
||||
class TransferBRep_ShapeBinder;
|
||||
class StepBasic_ProductDefinition;
|
||||
class StepRepr_NextAssemblyUsageOccurrence;
|
||||
class StepShape_ShapeRepresentation;
|
||||
class StepShape_ContextDependentShapeRepresentation;
|
||||
class StepRepr_ShapeRepresentationRelationship;
|
||||
class StepGeom_GeometricRepresentationItem;
|
||||
class StepRepr_MappedItem;
|
||||
class StepShape_FaceSurface;
|
||||
class TopoDS_Shell;
|
||||
class TopoDS_Compound;
|
||||
|
||||
|
||||
class STEPControl_ActorRead;
|
||||
DEFINE_STANDARD_HANDLE(STEPControl_ActorRead, Transfer_ActorOfTransientProcess)
|
||||
|
||||
//! This class performs the transfer of an Entity from
|
||||
//! AP214 and AP203, either Geometric or Topologic.
|
||||
//!
|
||||
//! I.E. for each type of Entity, it invokes the appropriate Tool
|
||||
//! then returns the Binder which contains the Result
|
||||
class STEPControl_ActorRead : public Transfer_ActorOfTransientProcess
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT STEPControl_ActorRead();
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Handle(Transfer_Binder) Transfer (const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Transfer_Binder) TransferShape (const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP, const Standard_Boolean isManifold = Standard_True);
|
||||
|
||||
//! set units and tolerances context by given ShapeRepresentation
|
||||
Standard_EXPORT void PrepareUnits (const Handle(StepRepr_Representation)& rep, const Handle(Transfer_TransientProcess)& TP);
|
||||
|
||||
//! reset units and tolerances context to default
|
||||
//! (mm, radians, read.precision.val, etc.)
|
||||
Standard_EXPORT void ResetUnits();
|
||||
|
||||
//! Computes transformation defined by two axis placements (in MAPPED_ITEM
|
||||
//! or ITEM_DEFINED_TRANSFORMATION) taking into account their
|
||||
//! representation contexts (i.e. units, which may be different)
|
||||
//! Returns True if transformation is computed and is not an identity.
|
||||
Standard_EXPORT Standard_Boolean ComputeTransformation (const Handle(StepGeom_Axis2Placement3d)& Origin, const Handle(StepGeom_Axis2Placement3d)& Target, const Handle(StepRepr_Representation)& OrigContext, const Handle(StepRepr_Representation)& TargContext, const Handle(Transfer_TransientProcess)& TP, gp_Trsf& Trsf);
|
||||
|
||||
//! Computes transformation defined by given
|
||||
//! REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
|
||||
Standard_EXPORT Standard_Boolean ComputeSRRWT (const Handle(StepRepr_RepresentationRelationship)& SRR, const Handle(Transfer_TransientProcess)& TP, gp_Trsf& Trsf);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Transfers product definition entity
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepBasic_ProductDefinition)& PD, const Handle(Transfer_TransientProcess)& TP);
|
||||
|
||||
//! Transfers next assembly usage occurence entity
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO, const Handle(Transfer_TransientProcess)& TP);
|
||||
|
||||
//! Transfers shape representation entity
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepShape_ShapeRepresentation)& sr, const Handle(Transfer_TransientProcess)& TP, Standard_Boolean& isBound);
|
||||
|
||||
//! Transfers context dependent shape representation entity
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR, const Handle(Transfer_TransientProcess)& TP);
|
||||
|
||||
//! Transfers shape representation relationship entity
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepRepr_ShapeRepresentationRelationship)& und, const Handle(Transfer_TransientProcess)& TP, const Standard_Integer nbrep = 0);
|
||||
|
||||
//! Transfers geometric representation item entity such as ManifoldSolidBRep ,...etc
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepGeom_GeometricRepresentationItem)& git, const Handle(Transfer_TransientProcess)& TP, const Standard_Boolean isManifold);
|
||||
|
||||
//! Transfers mapped item
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepRepr_MappedItem)& mapit, const Handle(Transfer_TransientProcess)& TP);
|
||||
|
||||
//! Transfers FaceSurface entity
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepShape_FaceSurface)& fs, const Handle(Transfer_TransientProcess)& TP);
|
||||
|
||||
//! Tranlates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off.
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) OldWay (const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT TopoDS_Shell closeIDEASShell (const TopoDS_Shell& shell, const TopTools_ListOfShape& closingShells);
|
||||
|
||||
Standard_EXPORT void computeIDEASClosings (const TopoDS_Compound& comp, TopTools_IndexedDataMapOfShapeListOfShape& shellClosingMap);
|
||||
|
||||
StepToTopoDS_NMTool myNMTool;
|
||||
Standard_Real myPrecision;
|
||||
Standard_Real myMaxTol;
|
||||
Handle(StepRepr_Representation) mySRContext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPControl_ActorRead_HeaderFile
|
@@ -1,116 +0,0 @@
|
||||
-- Created on: 1995-01-31
|
||||
-- Created by: Dieter THIEMANN
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public 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 STEPControl
|
||||
inherits ActorOfFinderProcess from Transfer
|
||||
|
||||
---Purpose : This class performs the transfer of a Shape from TopoDS
|
||||
-- to AP203 or AP214 (CD2 or DIS)
|
||||
|
||||
|
||||
uses FinderProcess, TransientProcess, Binder, Finder, StepModel from StepData,
|
||||
Shape from TopoDS,
|
||||
StepModelType from STEPControl,
|
||||
Axis2Placement3d from StepGeom,
|
||||
ShapeRepresentation from StepShape,
|
||||
ShapeDefinitionRepresentation from StepShape,
|
||||
HAsciiString from TCollection,
|
||||
ContextTool from STEPConstruct,
|
||||
Part from STEPConstruct,
|
||||
HSequenceOfShape from TopTools, -- For non-manifold topology processing (ssv; 13.11.2010)
|
||||
NonManifoldSurfaceShapeRepresentation from StepShape -- For non-manifold topology processing (ssv; 13.11.2010)
|
||||
|
||||
is
|
||||
|
||||
Create returns ActorWrite from STEPControl;
|
||||
|
||||
Recognize (me : mutable; start : Finder) returns Boolean is redefined;
|
||||
|
||||
Transfer (me : mutable; start : Finder; FP : FinderProcess)
|
||||
returns Binder is redefined;
|
||||
-- enchains : TransferShape , MakeProductData , and manages mode
|
||||
-- "simple" or in Assembly
|
||||
|
||||
TransferSubShape (me : mutable; start : Finder;
|
||||
SDR : ShapeDefinitionRepresentation from StepShape;
|
||||
AX1 : out Axis2Placement3d from StepGeom;
|
||||
FP : FinderProcess;
|
||||
shapeGroup : HSequenceOfShape from TopTools = NULL;
|
||||
isManifold : Boolean = Standard_True)
|
||||
returns Binder;
|
||||
|
||||
TransferShape (me : mutable; start : Finder;
|
||||
SDR : ShapeDefinitionRepresentation from StepShape;
|
||||
FP : FinderProcess;
|
||||
shapeGroup : HSequenceOfShape from TopTools = NULL;
|
||||
isManifold : Boolean = Standard_True)
|
||||
returns Binder;
|
||||
|
||||
TransferCompound (me : mutable; start : Finder;
|
||||
SDR : ShapeDefinitionRepresentation from StepShape;
|
||||
FP : FinderProcess)
|
||||
returns Binder;
|
||||
|
||||
-- InitProductData (me: mutable) returns Part from STEPConstruct;
|
||||
|
||||
-- MakeProductData (me : mutable;
|
||||
-- SR : ShapeRepresentation from StepShape;
|
||||
-- SDRTool : Part from STEPConstruct;
|
||||
-- model : StepModel from StepData;
|
||||
-- addPRPC : Boolean)
|
||||
-- returns Binder;
|
||||
|
||||
|
||||
SetMode (me : mutable; M : StepModelType from STEPControl);
|
||||
|
||||
Mode (me) returns StepModelType from STEPControl;
|
||||
|
||||
SetGroupMode (me : mutable; mode : Integer);
|
||||
-- Default is 0 (no group item)
|
||||
-- 1 for REPRESENTATION_RELATIONSHIP with ITEM_DEFINED_TRANSFORMATION
|
||||
-- other positive values if needed (not implemented)
|
||||
|
||||
GroupMode (me) returns Integer;
|
||||
|
||||
SetTolerance (me : mutable; Tol : Real);
|
||||
-- Tol <= 0 means Unset
|
||||
|
||||
IsAssembly (me; S: in out Shape from TopoDS) returns Boolean is virtual;
|
||||
---Purpose: Customizable method to check whether shape S should
|
||||
-- be written as assembly or not
|
||||
-- Default implementation uses flag GroupMode and analyses
|
||||
-- the shape itself
|
||||
-- NOTE: this method can modify shape
|
||||
|
||||
getNMSSRForGroup (me;
|
||||
shapeGroup : HSequenceOfShape from TopTools;
|
||||
FP : FinderProcess;
|
||||
isNMSSRCreated : in out Boolean)
|
||||
returns NonManifoldSurfaceShapeRepresentation from StepShape
|
||||
is private;
|
||||
---Purpose: Non-manifold shapes are stored in NMSSR group
|
||||
-- (NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION).
|
||||
-- Use this method to get the corresponding NMSSR (or
|
||||
-- to create a new one if doesn't exist yet)
|
||||
-- (ssv; 13.11.2010)
|
||||
|
||||
fields
|
||||
|
||||
mygroup : Integer;
|
||||
mytoler : Real;
|
||||
myContext: ContextTool from STEPConstruct;
|
||||
|
||||
end ActorWrite;
|
@@ -16,114 +16,103 @@
|
||||
//abv,gka 05.04.99: S4136: change parameters and update units
|
||||
// PTV 22.08.2002 OCC609 transfer solo vertices into step file.
|
||||
// PTV 16.09.2002 OCC725 transfer compound of vertices into one geometrical curve set.
|
||||
#include <STEPControl_ActorWrite.ixx>
|
||||
#include <STEPControl_StepModelType.hxx>
|
||||
|
||||
// Transfer
|
||||
#include <Transfer_SimpleBinderOfTransient.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools_Modifier.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <StepGeom_Point.hxx>
|
||||
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
|
||||
|
||||
#include <STEPConstruct_Part.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Interface_MSG.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
#include <MoniTool_DataMapOfShapeTransient.hxx>
|
||||
#include <OSD_Timer.hxx>
|
||||
#include <ShapeAnalysis_ShapeTolerance.hxx>
|
||||
#include <ShapeExtend_Explorer.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StepBasic_ApplicationProtocolDefinition.hxx>
|
||||
#include <StepBasic_HArray1OfProduct.hxx>
|
||||
#include <STEPConstruct_AP203Context.hxx>
|
||||
#include <STEPConstruct_Assembly.hxx>
|
||||
#include <STEPConstruct_ContextTool.hxx>
|
||||
#include <STEPConstruct_Part.hxx>
|
||||
#include <STEPConstruct_UnitContext.hxx>
|
||||
|
||||
// TransferShape
|
||||
#include <STEPControl_ActorWrite.hxx>
|
||||
#include <STEPControl_StepModelType.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
|
||||
#include <StepGeom_Point.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationship.hxx>
|
||||
#include <StepShape_AdvancedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_BrepWithVoids.hxx>
|
||||
#include <StepShape_FacetedBrep.hxx>
|
||||
#include <StepShape_FacetedBrepAndBrepWithVoids.hxx>
|
||||
#include <StepShape_FacetedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricCurveSet.hxx>
|
||||
#include <StepShape_GeometricSetSelect.hxx>
|
||||
#include <StepShape_HArray1OfGeometricSetSelect.hxx>
|
||||
#include <StepShape_ManifoldSolidBrep.hxx>
|
||||
#include <StepShape_ManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_NonManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
#include <StepShape_ShellBasedSurfaceModel.hxx>
|
||||
#include <StepShape_TopologicalRepresentationItem.hxx>
|
||||
#include <StepShape_VertexPoint.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDSToStep.hxx>
|
||||
#include <TopoDSToStep_Builder.hxx>
|
||||
#include <TopoDSToStep_FacetedTool.hxx>
|
||||
#include <TopoDSToStep_Tool.hxx>
|
||||
#include <TopoDSToStep_MakeManifoldSolidBrep.hxx>
|
||||
#include <TopoDSToStep_MakeBrepWithVoids.hxx>
|
||||
#include <TopoDSToStep_MakeFacetedBrep.hxx>
|
||||
#include <TopoDSToStep_MakeFacetedBrepAndBrepWithVoids.hxx>
|
||||
#include <TopoDSToStep_MakeGeometricCurveSet.hxx>
|
||||
#include <TopoDSToStep_MakeManifoldSolidBrep.hxx>
|
||||
#include <TopoDSToStep_MakeShellBasedSurfaceModel.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_FacetedBrepAndBrepWithVoids.hxx>
|
||||
#include <StepShape_FacetedBrep.hxx>
|
||||
#include <StepShape_GeometricCurveSet.hxx>
|
||||
#include <StepShape_ShellBasedSurfaceModel.hxx>
|
||||
#include <StepShape_ManifoldSolidBrep.hxx>
|
||||
#include <StepShape_BrepWithVoids.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
#include <StepBasic_HArray1OfProduct.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepShape_AdvancedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_FacetedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_TopologicalRepresentationItem.hxx>
|
||||
#include <StepShape_ManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <StepBasic_ApplicationProtocolDefinition.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
#include <Transfer_TransientProcess.hxx>
|
||||
#include <TopoDSToStep_MakeStepVertex.hxx>
|
||||
#include <TopoDSToStep_Tool.hxx>
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <Transfer_Binder.hxx>
|
||||
#include <Transfer_Finder.hxx>
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
#include <TransferBRep_ShapeMapper.hxx>
|
||||
#include <Transfer_SequenceOfBinder.hxx>
|
||||
#include <Transfer_SimpleBinderOfTransient.hxx>
|
||||
#include <Transfer_TransientProcess.hxx>
|
||||
#include <TransferBRep.hxx>
|
||||
#include <OSD_Timer.hxx>
|
||||
|
||||
#include <ShapeExtend_Explorer.hxx>
|
||||
#include <ShapeAnalysis_ShapeTolerance.hxx>
|
||||
#include <Interface_MSG.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopoDS_Iterator.hxx> //:d6
|
||||
#include <TransferBRep_ShapeMapper.hxx>
|
||||
#include <UnitsMethods.hxx>
|
||||
#include <STEPConstruct_AP203Context.hxx>
|
||||
#include <BRepTools_Modifier.hxx>
|
||||
|
||||
#include <XSAlgo.hxx>
|
||||
#include <XSAlgo_AlgoContainer.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationship.hxx>
|
||||
#include <Transfer_SequenceOfBinder.hxx>
|
||||
|
||||
#include <TopoDSToStep_MakeStepVertex.hxx>
|
||||
#include <StepShape_VertexPoint.hxx>
|
||||
#include <MoniTool_DataMapOfShapeTransient.hxx>
|
||||
#include <StepShape_HArray1OfGeometricSetSelect.hxx>
|
||||
#include <StepShape_GeometricSetSelect.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
// Transfer
|
||||
// TransferShape
|
||||
//:d6
|
||||
// Non-manifold topology processing (ssv; 10.11.2010)
|
||||
#include <StepShape_NonManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
|
||||
// ============================================================================
|
||||
// Function: DumpWhatIs
|
||||
// Purpose: Use it in debug mode to dump your shapes
|
||||
// ============================================================================
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
static void DumpWhatIs(const TopoDS_Shape& S) {
|
||||
|
||||
|
112
src/STEPControl/STEPControl_ActorWrite.hxx
Normal file
112
src/STEPControl/STEPControl_ActorWrite.hxx
Normal file
@@ -0,0 +1,112 @@
|
||||
// Created on: 1995-01-31
|
||||
// Created by: Dieter THIEMANN
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public 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 _STEPControl_ActorWrite_HeaderFile
|
||||
#define _STEPControl_ActorWrite_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <STEPConstruct_ContextTool.hxx>
|
||||
#include <Transfer_ActorOfFinderProcess.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
#include <STEPControl_StepModelType.hxx>
|
||||
class Transfer_Finder;
|
||||
class Transfer_Binder;
|
||||
class Transfer_FinderProcess;
|
||||
class StepShape_ShapeDefinitionRepresentation;
|
||||
class StepGeom_Axis2Placement3d;
|
||||
class TopoDS_Shape;
|
||||
class StepShape_NonManifoldSurfaceShapeRepresentation;
|
||||
|
||||
|
||||
class STEPControl_ActorWrite;
|
||||
DEFINE_STANDARD_HANDLE(STEPControl_ActorWrite, Transfer_ActorOfFinderProcess)
|
||||
|
||||
//! This class performs the transfer of a Shape from TopoDS
|
||||
//! to AP203 or AP214 (CD2 or DIS)
|
||||
class STEPControl_ActorWrite : public Transfer_ActorOfFinderProcess
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT STEPControl_ActorWrite();
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Transfer_Finder)& start) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Handle(Transfer_Binder) Transfer (const Handle(Transfer_Finder)& start, const Handle(Transfer_FinderProcess)& FP) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Transfer_Binder) TransferSubShape (const Handle(Transfer_Finder)& start, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR, Handle(StepGeom_Axis2Placement3d)& AX1, const Handle(Transfer_FinderProcess)& FP, const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, const Standard_Boolean isManifold = Standard_True);
|
||||
|
||||
Standard_EXPORT Handle(Transfer_Binder) TransferShape (const Handle(Transfer_Finder)& start, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR, const Handle(Transfer_FinderProcess)& FP, const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, const Standard_Boolean isManifold = Standard_True);
|
||||
|
||||
Standard_EXPORT Handle(Transfer_Binder) TransferCompound (const Handle(Transfer_Finder)& start, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR, const Handle(Transfer_FinderProcess)& FP);
|
||||
|
||||
Standard_EXPORT void SetMode (const STEPControl_StepModelType M);
|
||||
|
||||
Standard_EXPORT STEPControl_StepModelType Mode() const;
|
||||
|
||||
Standard_EXPORT void SetGroupMode (const Standard_Integer mode);
|
||||
|
||||
Standard_EXPORT Standard_Integer GroupMode() const;
|
||||
|
||||
Standard_EXPORT void SetTolerance (const Standard_Real Tol);
|
||||
|
||||
//! Customizable method to check whether shape S should
|
||||
//! be written as assembly or not
|
||||
//! Default implementation uses flag GroupMode and analyses
|
||||
//! the shape itself
|
||||
//! NOTE: this method can modify shape
|
||||
Standard_EXPORT virtual Standard_Boolean IsAssembly (TopoDS_Shape& S) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(STEPControl_ActorWrite,Transfer_ActorOfFinderProcess)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Non-manifold shapes are stored in NMSSR group
|
||||
//! (NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION).
|
||||
//! Use this method to get the corresponding NMSSR (or
|
||||
//! to create a new one if doesn't exist yet)
|
||||
//! (ssv; 13.11.2010)
|
||||
Standard_EXPORT Handle(StepShape_NonManifoldSurfaceShapeRepresentation) getNMSSRForGroup (const Handle(TopTools_HSequenceOfShape)& shapeGroup, const Handle(Transfer_FinderProcess)& FP, Standard_Boolean& isNMSSRCreated) const;
|
||||
|
||||
Standard_Integer mygroup;
|
||||
Standard_Real mytoler;
|
||||
STEPConstruct_ContextTool myContext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPControl_ActorWrite_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1995-02-20
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public 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 STEPControl inherits Controller from XSControl
|
||||
|
||||
---Purpose : defines basic controller for STEP processor
|
||||
|
||||
uses
|
||||
|
||||
CString,
|
||||
Protocol from Interface,
|
||||
InterfaceModel from Interface,
|
||||
WorkLibrary from IFSelect,
|
||||
ReturnStatus from IFSelect,
|
||||
ActorOfTransientProcess from Transfer,
|
||||
FinderProcess from Transfer,
|
||||
ActorOfFinderProcess from Transfer,
|
||||
Shape from TopoDS,
|
||||
WorkSession from XSControl
|
||||
|
||||
is
|
||||
|
||||
Create returns Controller from STEPControl;
|
||||
---Purpose : Initializes the use of STEP Norm (the first time) and
|
||||
-- returns a Controller
|
||||
|
||||
NewModel (me) returns InterfaceModel from Interface;
|
||||
---Purpose : Creates a new empty Model ready to receive data of the Norm.
|
||||
-- It is taken from STEP Template Model
|
||||
|
||||
ActorRead (me; model : InterfaceModel)
|
||||
returns ActorOfTransientProcess from Transfer;
|
||||
---Purpose : Returns a new Actor for Read attached to the pair (norm,appli)
|
||||
-- It is a PmsToTopoDSAct_Actor
|
||||
|
||||
-- Redefined Transfer for Write (using Actor) --
|
||||
Customise (me: mutable; WS : in out WorkSession from XSControl) is redefined;
|
||||
|
||||
TransferWriteShape (me; shape : Shape from TopoDS;
|
||||
FP : FinderProcess from Transfer;
|
||||
model : InterfaceModel from Interface;
|
||||
modetrans : Integer = 0) returns ReturnStatus
|
||||
is redefined;
|
||||
---Purpose : Takes one Shape and transfers it to the InterfaceModel
|
||||
-- (already created by NewModel for instance)
|
||||
-- <modeshape> is to be interpreted by each kind of XstepAdaptor
|
||||
-- Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape
|
||||
-- -2 bad model (requires a StepModel)
|
||||
-- modeshape : 1 Facetted BRep, 2 Shell, 3 Manifold Solid
|
||||
|
||||
-- for global initialisation
|
||||
|
||||
Init (myclass) returns Boolean;
|
||||
---Purpose : Standard Initialisation. It creates a Controller for STEP
|
||||
-- and records it to various names, available to select it later
|
||||
-- Returns True when done, False if could not be done
|
||||
|
||||
end Controller;
|
@@ -13,50 +13,49 @@
|
||||
|
||||
//:j4 gka 16.03.99 S4134
|
||||
// gka 05.04.99 S4136: parameters definitions changed
|
||||
#include <STEPControl_Controller.ixx>
|
||||
#include <StepSelect_WorkLibrary.hxx>
|
||||
|
||||
#include <APIHeaderSection_EditHeader.hxx>
|
||||
#include <APIHeaderSection_MakeHeader.hxx>
|
||||
#include <HeaderSection.hxx>
|
||||
#include <IFSelect_EditForm.hxx>
|
||||
#include <IFSelect_SelectModelRoots.hxx>
|
||||
#include <IFSelect_SelectSignature.hxx>
|
||||
#include <IFSelect_SignAncestor.hxx>
|
||||
#include <IFSelect_SignCounter.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
#include <MoniTool_Option.hxx>
|
||||
#include <MoniTool_Profile.hxx>
|
||||
|
||||
//#include <StepAP214.hxx>
|
||||
#include <RWStepAP214.hxx>
|
||||
|
||||
#include <Standard_Version.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <APIHeaderSection_MakeHeader.hxx>
|
||||
#include <StepData_FileProtocol.hxx>
|
||||
#include <HeaderSection.hxx>
|
||||
#include <RWHeaderSection.hxx>
|
||||
#include <IFSelect_SignCounter.hxx>
|
||||
#include <IFSelect_SelectSignature.hxx>
|
||||
#include <StepSelect_StepType.hxx>
|
||||
|
||||
// Pour NewModel et Write : definition de produit (temporaire ...)
|
||||
#include <RWStepAP214.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Version.hxx>
|
||||
#include <STEPControl_ActorRead.hxx>
|
||||
#include <STEPControl_ActorWrite.hxx>
|
||||
|
||||
#include <STEPControl_Controller.hxx>
|
||||
#include <StepData_FileProtocol.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <STEPEdit.hxx>
|
||||
#include <STEPEdit_EditContext.hxx>
|
||||
#include <STEPEdit_EditSDR.hxx>
|
||||
|
||||
#include <APIHeaderSection_EditHeader.hxx>
|
||||
#include <IFSelect_EditForm.hxx>
|
||||
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <IFSelect_SignAncestor.hxx>
|
||||
#include <STEPSelections_SelectFaces.hxx>
|
||||
#include <StepSelect_StepType.hxx>
|
||||
#include <StepSelect_WorkLibrary.hxx>
|
||||
#include <STEPSelections_SelectAssembly.hxx>
|
||||
#include <STEPSelections_SelectDerived.hxx>
|
||||
#include <STEPSelections_SelectFaces.hxx>
|
||||
#include <STEPSelections_SelectForTransfer.hxx>
|
||||
#include <STEPSelections_SelectGSCurves.hxx>
|
||||
#include <STEPSelections_SelectInstances.hxx>
|
||||
#include <STEPSelections_SelectAssembly.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Transfer_ActorOfTransientProcess.hxx>
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
#include <XSAlgo.hxx>
|
||||
#include <STEPSelections_SelectForTransfer.hxx>
|
||||
#include <IFSelect_SelectModelRoots.hxx>
|
||||
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
|
||||
//#include <StepAP214.hxx>
|
||||
// Pour NewModel et Write : definition de produit (temporaire ...)
|
||||
STEPControl_Controller::STEPControl_Controller ()
|
||||
: XSControl_Controller ("STEP", "step")
|
||||
{
|
||||
|
94
src/STEPControl/STEPControl_Controller.hxx
Normal file
94
src/STEPControl/STEPControl_Controller.hxx
Normal file
@@ -0,0 +1,94 @@
|
||||
// Created on: 1995-02-20
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public 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 _STEPControl_Controller_HeaderFile
|
||||
#define _STEPControl_Controller_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <XSControl_Controller.hxx>
|
||||
#include <IFSelect_ReturnStatus.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_InterfaceModel;
|
||||
class Transfer_ActorOfTransientProcess;
|
||||
class XSControl_WorkSession;
|
||||
class TopoDS_Shape;
|
||||
class Transfer_FinderProcess;
|
||||
|
||||
|
||||
class STEPControl_Controller;
|
||||
DEFINE_STANDARD_HANDLE(STEPControl_Controller, XSControl_Controller)
|
||||
|
||||
//! defines basic controller for STEP processor
|
||||
class STEPControl_Controller : public XSControl_Controller
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes the use of STEP Norm (the first time) and
|
||||
//! returns a Controller
|
||||
Standard_EXPORT STEPControl_Controller();
|
||||
|
||||
//! Creates a new empty Model ready to receive data of the Norm.
|
||||
//! It is taken from STEP Template Model
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) NewModel() const;
|
||||
|
||||
//! Returns a new Actor for Read attached to the pair (norm,appli)
|
||||
//! It is a PmsToTopoDSAct_Actor
|
||||
Standard_EXPORT Handle(Transfer_ActorOfTransientProcess) ActorRead (const Handle(Interface_InterfaceModel)& model) const;
|
||||
|
||||
Standard_EXPORT virtual void Customise (Handle(XSControl_WorkSession)& WS) Standard_OVERRIDE;
|
||||
|
||||
//! Takes one Shape and transfers it to the InterfaceModel
|
||||
//! (already created by NewModel for instance)
|
||||
//! <modeshape> is to be interpreted by each kind of XstepAdaptor
|
||||
//! Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape
|
||||
//! -2 bad model (requires a StepModel)
|
||||
//! modeshape : 1 Facetted BRep, 2 Shell, 3 Manifold Solid
|
||||
Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape& shape, const Handle(Transfer_FinderProcess)& FP, const Handle(Interface_InterfaceModel)& model, const Standard_Integer modetrans = 0) const Standard_OVERRIDE;
|
||||
|
||||
//! Standard Initialisation. It creates a Controller for STEP
|
||||
//! and records it to various names, available to select it later
|
||||
//! Returns True when done, False if could not be done
|
||||
Standard_EXPORT static Standard_Boolean Init();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(STEPControl_Controller,XSControl_Controller)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPControl_Controller_HeaderFile
|
@@ -1,102 +0,0 @@
|
||||
-- Created on: 1996-07-08
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public 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 STEPControl inherits Reader from XSControl
|
||||
|
||||
---Purpose : Reads STEP files, checks them and translates their contents
|
||||
-- into Open CASCADE models. The STEP data can be that of
|
||||
-- a whole model or that of a specific list of entities in the model.
|
||||
-- As in XSControl_Reader, you specify the list using a selection.
|
||||
-- For the translation of iges files it is possible to use next sequence:
|
||||
-- To change translation parameters
|
||||
-- class Interface_Static should be used before beginning of
|
||||
-- translation (see STEP Parameters and General Parameters)
|
||||
-- Creation of reader - STEPControl_Reader reader;
|
||||
-- To load s file in a model use method reader.ReadFile("filename.stp")
|
||||
-- To print load results reader.PrintCheckLoad(failsonly,mode)
|
||||
-- where mode is equal to the value of enumeration IFSelect_PrintCount
|
||||
-- For definition number of candidates :
|
||||
-- Standard_Integer nbroots = reader. NbRootsForTransfer();
|
||||
-- To transfer entities from a model the following methods can be used:
|
||||
-- for the whole model - reader.TransferRoots();
|
||||
-- to transfer a list of entities: reader.TransferList(list);
|
||||
-- to transfer one entity Handle(Standard_Transient)
|
||||
-- ent = reader.RootForTransfer(num);
|
||||
-- reader.TransferEntity(ent), or
|
||||
-- reader.TransferOneRoot(num), or
|
||||
-- reader.TransferOne(num), or
|
||||
-- reader.TransferRoot(num)
|
||||
-- To obtain the result the following method can be used:
|
||||
-- reader.NbShapes() and reader.Shape(num); or reader.OneShape();
|
||||
-- To print the results of transfer use method:
|
||||
-- reader.PrintCheckTransfer(failwarn,mode);
|
||||
-- where printfail is equal to the value of enumeration
|
||||
-- IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer();
|
||||
-- Gets correspondence between a STEP entity and a result
|
||||
-- shape obtained from it.
|
||||
-- Handle(XSControl_WorkSession)
|
||||
-- WS = reader.WS();
|
||||
-- if ( WS->TransferReader()->HasResult(ent) )
|
||||
-- TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent);
|
||||
|
||||
uses
|
||||
|
||||
CString, OStream, Transient, SequenceOfTransient from TColStd,
|
||||
StepModel from StepData, WorkSession from XSControl,
|
||||
ReturnStatus from IFSelect, PrintCount from IFSelect,
|
||||
Shape from TopoDS, SequenceOfShape from TopTools,
|
||||
SequenceOfAsciiString from TColStd,
|
||||
Array1OfAsciiString from TColStd,
|
||||
Array1OfReal from TColStd,
|
||||
SequenceOfAsciiString from TColStd,
|
||||
RepresentationContext from StepRepr
|
||||
is
|
||||
|
||||
Create returns Reader;
|
||||
---Purpose : Creates a reader object with an empty STEP model.
|
||||
|
||||
Create (WS : WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True) returns Reader;
|
||||
---Purpose : Creates a Reader for STEP from an already existing Session
|
||||
-- Clears the session if it was not yet set for STEP
|
||||
|
||||
StepModel (me) returns StepModel;
|
||||
---Purpose : Returns the model as a StepModel.
|
||||
-- It can then be consulted (header, product)
|
||||
|
||||
TransferRoot (me : in out; num : Integer = 1) returns Boolean;
|
||||
---Purpose : Transfers a root given its rank in the list of candidate roots
|
||||
-- Default is the first one
|
||||
-- Returns True if a shape has resulted, false else
|
||||
-- Same as inherited TransferOneRoot, kept for compatibility
|
||||
|
||||
NbRootsForTransfer (me : in out) returns Integer is redefined;
|
||||
---Purpose : Determines the list of root entities from Model which are candidate for
|
||||
-- a transfer to a Shape (type of entities is PRODUCT)
|
||||
|
||||
FileUnits(me : in out; theUnitLengthNames : in out SequenceOfAsciiString from TColStd;
|
||||
theUnitAngleNames : in out SequenceOfAsciiString from TColStd;
|
||||
theUnitSolidAngleNames : in out SequenceOfAsciiString from TColStd );
|
||||
---Purpose : Returns sequence of all unit names for shape representations
|
||||
-- found in file
|
||||
|
||||
findUnits(me : in out ; theReprContext : RepresentationContext from StepRepr;
|
||||
theNameUnits : in out Array1OfAsciiString from TColStd;
|
||||
theFactorUnits : in out Array1OfReal from TColStd) returns Boolean is private;
|
||||
---Purpose : Returns units for length , angle and solidangle for shape representations
|
||||
|
||||
|
||||
end Reader;
|
@@ -11,72 +11,66 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <STEPControl_Reader.ixx>
|
||||
#include <STEPControl_Controller.hxx>
|
||||
#include <XSControl_Controller.hxx>
|
||||
#include <XSControl_TransferReader.hxx>
|
||||
#include <Interface_ShareFlags.hxx>
|
||||
|
||||
#include <STEPControl_ActorRead.hxx>
|
||||
|
||||
#include <StepBasic_ProductDefinition.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_ShareFlags.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
|
||||
#include <StepBasic_ProductDefinitionContext.hxx>
|
||||
#include <StepBasic_ApplicationContext.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
|
||||
#include <StepBasic_DocumentProductEquivalence.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
#include <StepRepr_RepresentationRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ProductDefinitionShape.hxx>
|
||||
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
|
||||
#include <StepRepr_RepresentationMap.hxx>
|
||||
#include <StepRepr_MappedItem.hxx>
|
||||
#include <Transfer_TransientProcess.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TColStd_MapOfAsciiString.hxx>
|
||||
#include <StepBasic_SiUnitName.hxx>
|
||||
#include <StepBasic_SiPrefix.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepRepr_RepresentationContext.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
|
||||
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
|
||||
#include <StepBasic_HArray1OfNamedUnit.hxx>
|
||||
#include <StepBasic_NamedUnit.hxx>
|
||||
#include <StepBasic_ConversionBasedUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndLengthUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndLengthUnit.hxx>
|
||||
#include <StepBasic_SolidAngleUnit.hxx>
|
||||
#include <StepBasic_MeasureWithUnit.hxx>
|
||||
#include <StepBasic_DocumentProductEquivalence.hxx>
|
||||
#include <StepBasic_HArray1OfNamedUnit.hxx>
|
||||
#include <StepBasic_LengthMeasureWithUnit.hxx>
|
||||
#include <StepBasic_MeasureWithUnit.hxx>
|
||||
#include <StepBasic_NamedUnit.hxx>
|
||||
#include <StepBasic_PlaneAngleMeasureWithUnit.hxx>
|
||||
#include <StepBasic_SolidAngleMeasureWithUnit.hxx>
|
||||
#include <STEPConstruct_UnitContext.hxx>
|
||||
#include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndSolidAngleUnit.hxx>
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <StepRepr_RepresentationContext.hxx>
|
||||
#include <TColStd_Array1OfAsciiString.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <StepBasic_ProductDefinition.hxx>
|
||||
#include <StepBasic_ProductDefinitionContext.hxx>
|
||||
#include <StepBasic_ProductDefinitionFormation.hxx>
|
||||
#include <StepBasic_ProductDefinitionFormationRelationship.hxx>
|
||||
#include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
|
||||
#include <StepBasic_SiPrefix.hxx>
|
||||
#include <StepBasic_SiUnit.hxx>
|
||||
|
||||
#include <StepBasic_SiUnitAndLengthUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndSolidAngleUnit.hxx>
|
||||
#include <StepBasic_SiUnitName.hxx>
|
||||
#include <StepBasic_SolidAngleMeasureWithUnit.hxx>
|
||||
#include <StepBasic_SolidAngleUnit.hxx>
|
||||
#include <STEPConstruct_UnitContext.hxx>
|
||||
#include <STEPControl_ActorRead.hxx>
|
||||
#include <STEPControl_Controller.hxx>
|
||||
#include <STEPControl_Reader.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
|
||||
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepRepr_MappedItem.hxx>
|
||||
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
|
||||
#include <StepRepr_ProductDefinitionShape.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
#include <StepRepr_RepresentationContext.hxx>
|
||||
#include <StepRepr_RepresentationMap.hxx>
|
||||
#include <StepRepr_RepresentationRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_Array1OfAsciiString.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TColStd_MapOfAsciiString.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <Transfer_TransientProcess.hxx>
|
||||
#include <XSControl_Controller.hxx>
|
||||
#include <XSControl_TransferReader.hxx>
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : STEPControl_Reader
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
STEPControl_Reader::STEPControl_Reader ()
|
||||
{
|
||||
STEPControl_Controller::Init();
|
||||
|
128
src/STEPControl/STEPControl_Reader.hxx
Normal file
128
src/STEPControl/STEPControl_Reader.hxx
Normal file
@@ -0,0 +1,128 @@
|
||||
// Created on: 1996-07-08
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public 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 _STEPControl_Reader_HeaderFile
|
||||
#define _STEPControl_Reader_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <XSControl_Reader.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <TColStd_Array1OfAsciiString.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class XSControl_WorkSession;
|
||||
class StepData_StepModel;
|
||||
class StepRepr_RepresentationContext;
|
||||
|
||||
|
||||
//! Reads STEP files, checks them and translates their contents
|
||||
//! into Open CASCADE models. The STEP data can be that of
|
||||
//! a whole model or that of a specific list of entities in the model.
|
||||
//! As in XSControl_Reader, you specify the list using a selection.
|
||||
//! For the translation of iges files it is possible to use next sequence:
|
||||
//! To change translation parameters
|
||||
//! class Interface_Static should be used before beginning of
|
||||
//! translation (see STEP Parameters and General Parameters)
|
||||
//! Creation of reader - STEPControl_Reader reader;
|
||||
//! To load s file in a model use method reader.ReadFile("filename.stp")
|
||||
//! To print load results reader.PrintCheckLoad(failsonly,mode)
|
||||
//! where mode is equal to the value of enumeration IFSelect_PrintCount
|
||||
//! For definition number of candidates :
|
||||
//! Standard_Integer nbroots = reader. NbRootsForTransfer();
|
||||
//! To transfer entities from a model the following methods can be used:
|
||||
//! for the whole model - reader.TransferRoots();
|
||||
//! to transfer a list of entities: reader.TransferList(list);
|
||||
//! to transfer one entity Handle(Standard_Transient)
|
||||
//! ent = reader.RootForTransfer(num);
|
||||
//! reader.TransferEntity(ent), or
|
||||
//! reader.TransferOneRoot(num), or
|
||||
//! reader.TransferOne(num), or
|
||||
//! reader.TransferRoot(num)
|
||||
//! To obtain the result the following method can be used:
|
||||
//! reader.NbShapes() and reader.Shape(num); or reader.OneShape();
|
||||
//! To print the results of transfer use method:
|
||||
//! reader.PrintCheckTransfer(failwarn,mode);
|
||||
//! where printfail is equal to the value of enumeration
|
||||
//! IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer();
|
||||
//! Gets correspondence between a STEP entity and a result
|
||||
//! shape obtained from it.
|
||||
//! Handle(XSControl_WorkSession)
|
||||
//! WS = reader.WS();
|
||||
//! if ( WS->TransferReader()->HasResult(ent) )
|
||||
//! TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent);
|
||||
class STEPControl_Reader : public XSControl_Reader
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a reader object with an empty STEP model.
|
||||
Standard_EXPORT STEPControl_Reader();
|
||||
|
||||
//! Creates a Reader for STEP from an already existing Session
|
||||
//! Clears the session if it was not yet set for STEP
|
||||
Standard_EXPORT STEPControl_Reader(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
|
||||
|
||||
//! Returns the model as a StepModel.
|
||||
//! It can then be consulted (header, product)
|
||||
Standard_EXPORT Handle(StepData_StepModel) StepModel() const;
|
||||
|
||||
//! Transfers a root given its rank in the list of candidate roots
|
||||
//! Default is the first one
|
||||
//! Returns True if a shape has resulted, false else
|
||||
//! Same as inherited TransferOneRoot, kept for compatibility
|
||||
Standard_EXPORT Standard_Boolean TransferRoot (const Standard_Integer num = 1);
|
||||
|
||||
//! Determines the list of root entities from Model which are candidate for
|
||||
//! a transfer to a Shape (type of entities is PRODUCT)
|
||||
Standard_EXPORT virtual Standard_Integer NbRootsForTransfer() Standard_OVERRIDE;
|
||||
|
||||
//! Returns sequence of all unit names for shape representations
|
||||
//! found in file
|
||||
Standard_EXPORT void FileUnits (TColStd_SequenceOfAsciiString& theUnitLengthNames, TColStd_SequenceOfAsciiString& theUnitAngleNames, TColStd_SequenceOfAsciiString& theUnitSolidAngleNames);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Returns units for length , angle and solidangle for shape representations
|
||||
Standard_EXPORT Standard_Boolean findUnits (const Handle(StepRepr_RepresentationContext)& theReprContext, TColStd_Array1OfAsciiString& theNameUnits, TColStd_Array1OfReal& theFactorUnits);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPControl_Reader_HeaderFile
|
44
src/STEPControl/STEPControl_StepModelType.hxx
Normal file
44
src/STEPControl/STEPControl_StepModelType.hxx
Normal file
@@ -0,0 +1,44 @@
|
||||
// Created on: 1996-04-09
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _STEPControl_StepModelType_HeaderFile
|
||||
#define _STEPControl_StepModelType_HeaderFile
|
||||
|
||||
//! Gives you the choice of translation mode for an Open
|
||||
//! CASCADE shape that is being translated to STEP.
|
||||
//! - STEPControl_AsIs translates an Open CASCADE shape to its
|
||||
//! highest possible STEP representation.
|
||||
//! - STEPControl_ManifoldSolidBrep translates an Open CASCADE shape
|
||||
//! to a STEP manifold_solid_brep or brep_with_voids entity.
|
||||
//! - STEPControl_FacetedBrep translates an Open CASCADE shape
|
||||
//! into a STEP faceted_brep entity.
|
||||
//! - STEPControl_ShellBasedSurfaceModel translates an Open CASCADE shape
|
||||
//! into a STEP shell_based_surface_model entity.
|
||||
//! - STEPControl_GeometricCurveSet
|
||||
//! translates an Open CASCADE shape into a STEP geometric_curve_set entity.
|
||||
enum STEPControl_StepModelType
|
||||
{
|
||||
STEPControl_AsIs,
|
||||
STEPControl_ManifoldSolidBrep,
|
||||
STEPControl_BrepWithVoids,
|
||||
STEPControl_FacetedBrep,
|
||||
STEPControl_FacetedBrepAndBrepWithVoids,
|
||||
STEPControl_ShellBasedSurfaceModel,
|
||||
STEPControl_GeometricCurveSet,
|
||||
STEPControl_Hybrid
|
||||
};
|
||||
|
||||
#endif // _STEPControl_StepModelType_HeaderFile
|
@@ -1,111 +0,0 @@
|
||||
-- Created on: 1996-07-08
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public 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 STEPControl
|
||||
|
||||
---Purpose : This class creates and writes
|
||||
-- STEP files from Open CASCADE models. A STEP file can be
|
||||
-- written to an existing STEP file or to a new one.
|
||||
-- Translation can be performed in one or several operations. Each
|
||||
-- translation operation outputs a distinct root entity in the STEP file.
|
||||
|
||||
uses
|
||||
|
||||
CString,
|
||||
StepModel from StepData, WorkSession from XSControl,
|
||||
ReturnStatus from IFSelect,
|
||||
Shape from TopoDS,
|
||||
StepModelType from STEPControl
|
||||
|
||||
is
|
||||
|
||||
Create returns Writer;
|
||||
---Purpose : Creates a Writer from scratch
|
||||
|
||||
Create (WS : WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True) returns Writer;
|
||||
---Purpose : Creates a Writer from an already existing Session
|
||||
-- If <scratch> is True (D), clears already recorded data
|
||||
|
||||
SetTolerance (me : in out; Tol : Real);
|
||||
---Purpose : Sets a length-measure value that
|
||||
-- will be written to uncertainty-measure-with-unit
|
||||
-- when the next shape is translated.
|
||||
|
||||
UnsetTolerance (me : in out);
|
||||
---Purpose : Unsets the tolerance formerly forced by SetTolerance
|
||||
|
||||
SetWS (me : in out; WS : WorkSession from XSControl;
|
||||
scratch : Boolean = Standard_True);
|
||||
---Purpose : Sets a specific session to <me>
|
||||
|
||||
WS (me) returns WorkSession from XSControl;
|
||||
---Purpose : Returns the session used in <me>
|
||||
|
||||
Model (me : in out; newone : Boolean = Standard_False) returns StepModel;
|
||||
---Purpose : Returns the produced model. Produces a new one if not yet done
|
||||
-- or if <newone> is True
|
||||
-- This method allows for instance to edit product or header
|
||||
-- data before writing.
|
||||
|
||||
Transfer (me : in out; sh : Shape from TopoDS;
|
||||
mode : StepModelType from STEPControl;
|
||||
compgraph : Boolean = Standard_True)
|
||||
returns ReturnStatus;
|
||||
---Purpose : Translates shape sh to a STEP
|
||||
-- entity. mode defines the STEP entity type to be output:
|
||||
-- - STEPControlStd_AsIs translates a shape to its highest possible
|
||||
-- STEP representation.
|
||||
-- - STEPControlStd_ManifoldSolidBrep translates a shape to a STEP
|
||||
-- manifold_solid_brep or brep_with_voids entity.
|
||||
-- - STEPControlStd_FacetedBrep translates a shape into a STEP
|
||||
-- faceted_brep entity.
|
||||
-- - STEPControlStd_ShellBasedSurfaceModel translates a shape into a STEP
|
||||
-- shell_based_surface_model entity.
|
||||
-- - STEPControlStd_GeometricCurveSet translates a shape into a STEP
|
||||
-- geometric_curve_set entity.
|
||||
|
||||
|
||||
Write (me : in out; filename : CString) returns ReturnStatus;
|
||||
---Purpose : Writes a STEP model in the file identified by filename.
|
||||
|
||||
PrintStatsTransfer (me; what : Integer; mode : Integer = 0);
|
||||
---Purpose : Displays the statistics for the
|
||||
-- last translation. what defines the kind of statistics that are displayed:
|
||||
-- - 0 gives general statistics (number of translated roots,
|
||||
-- number of warnings, number of fail messages),
|
||||
-- - 1 gives root results,
|
||||
-- - 2 gives statistics for all checked entities,
|
||||
-- - 3 gives the list of translated entities,
|
||||
-- - 4 gives warning and fail messages,
|
||||
-- - 5 gives fail messages only.
|
||||
-- mode is used according to the use of what. If what is 0, mode is
|
||||
-- ignored. If what is 1, 2 or 3, mode defines the following:
|
||||
-- - 0 lists the numbers of STEP entities in a STEP model,
|
||||
-- - 1 gives the number, identifier, type and result type for each
|
||||
-- STEP entity and/or its status (fail, warning, etc.),
|
||||
-- - 2 gives maximum information for each STEP entity (i.e. checks),
|
||||
-- - 3 gives the number of entities by the type of a STEP entity,
|
||||
-- - 4 gives the number of of STEP entities per result type and/or status,
|
||||
-- - 5 gives the number of pairs (STEP or result type and status),
|
||||
-- - 6 gives the number of pairs (STEP or result type and status)
|
||||
-- AND the list of entity numbers in the STEP model.
|
||||
|
||||
fields
|
||||
|
||||
thesession : WorkSession from XSControl;
|
||||
|
||||
end Writer;
|
@@ -11,22 +11,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <STEPControl_Writer.ixx>
|
||||
#include <STEPControl_Controller.hxx>
|
||||
#include <STEPControl_ActorWrite.hxx>
|
||||
#include <XSControl_TransferWriter.hxx>
|
||||
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Message_ProgressIndicator.hxx>
|
||||
#include <STEPControl_ActorWrite.hxx>
|
||||
#include <STEPControl_Controller.hxx>
|
||||
#include <STEPControl_Writer.hxx>
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
|
||||
#include <XSControl_TransferWriter.hxx>
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : STEPControl_Writer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
STEPControl_Writer::STEPControl_Writer ()
|
||||
{
|
||||
STEPControl_Controller::Init();
|
||||
|
137
src/STEPControl/STEPControl_Writer.hxx
Normal file
137
src/STEPControl/STEPControl_Writer.hxx
Normal file
@@ -0,0 +1,137 @@
|
||||
// Created on: 1996-07-08
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public 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 _STEPControl_Writer_HeaderFile
|
||||
#define _STEPControl_Writer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <IFSelect_ReturnStatus.hxx>
|
||||
#include <STEPControl_StepModelType.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class XSControl_WorkSession;
|
||||
class StepData_StepModel;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! This class creates and writes
|
||||
//! STEP files from Open CASCADE models. A STEP file can be
|
||||
//! written to an existing STEP file or to a new one.
|
||||
//! Translation can be performed in one or several operations. Each
|
||||
//! translation operation outputs a distinct root entity in the STEP file.
|
||||
class STEPControl_Writer
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a Writer from scratch
|
||||
Standard_EXPORT STEPControl_Writer();
|
||||
|
||||
//! Creates a Writer from an already existing Session
|
||||
//! If <scratch> is True (D), clears already recorded data
|
||||
Standard_EXPORT STEPControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
|
||||
|
||||
//! Sets a length-measure value that
|
||||
//! will be written to uncertainty-measure-with-unit
|
||||
//! when the next shape is translated.
|
||||
Standard_EXPORT void SetTolerance (const Standard_Real Tol);
|
||||
|
||||
//! Unsets the tolerance formerly forced by SetTolerance
|
||||
Standard_EXPORT void UnsetTolerance();
|
||||
|
||||
//! Sets a specific session to <me>
|
||||
Standard_EXPORT void SetWS (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
|
||||
|
||||
//! Returns the session used in <me>
|
||||
Standard_EXPORT Handle(XSControl_WorkSession) WS() const;
|
||||
|
||||
//! Returns the produced model. Produces a new one if not yet done
|
||||
//! or if <newone> is True
|
||||
//! This method allows for instance to edit product or header
|
||||
//! data before writing.
|
||||
Standard_EXPORT Handle(StepData_StepModel) Model (const Standard_Boolean newone = Standard_False);
|
||||
|
||||
//! Translates shape sh to a STEP
|
||||
//! entity. mode defines the STEP entity type to be output:
|
||||
//! - STEPControlStd_AsIs translates a shape to its highest possible
|
||||
//! STEP representation.
|
||||
//! - STEPControlStd_ManifoldSolidBrep translates a shape to a STEP
|
||||
//! manifold_solid_brep or brep_with_voids entity.
|
||||
//! - STEPControlStd_FacetedBrep translates a shape into a STEP
|
||||
//! faceted_brep entity.
|
||||
//! - STEPControlStd_ShellBasedSurfaceModel translates a shape into a STEP
|
||||
//! shell_based_surface_model entity.
|
||||
//! - STEPControlStd_GeometricCurveSet translates a shape into a STEP
|
||||
//! geometric_curve_set entity.
|
||||
Standard_EXPORT IFSelect_ReturnStatus Transfer (const TopoDS_Shape& sh, const STEPControl_StepModelType mode, const Standard_Boolean compgraph = Standard_True);
|
||||
|
||||
//! Writes a STEP model in the file identified by filename.
|
||||
Standard_EXPORT IFSelect_ReturnStatus Write (const Standard_CString filename);
|
||||
|
||||
//! Displays the statistics for the
|
||||
//! last translation. what defines the kind of statistics that are displayed:
|
||||
//! - 0 gives general statistics (number of translated roots,
|
||||
//! number of warnings, number of fail messages),
|
||||
//! - 1 gives root results,
|
||||
//! - 2 gives statistics for all checked entities,
|
||||
//! - 3 gives the list of translated entities,
|
||||
//! - 4 gives warning and fail messages,
|
||||
//! - 5 gives fail messages only.
|
||||
//! mode is used according to the use of what. If what is 0, mode is
|
||||
//! ignored. If what is 1, 2 or 3, mode defines the following:
|
||||
//! - 0 lists the numbers of STEP entities in a STEP model,
|
||||
//! - 1 gives the number, identifier, type and result type for each
|
||||
//! STEP entity and/or its status (fail, warning, etc.),
|
||||
//! - 2 gives maximum information for each STEP entity (i.e. checks),
|
||||
//! - 3 gives the number of entities by the type of a STEP entity,
|
||||
//! - 4 gives the number of of STEP entities per result type and/or status,
|
||||
//! - 5 gives the number of pairs (STEP or result type and status),
|
||||
//! - 6 gives the number of pairs (STEP or result type and status)
|
||||
//! AND the list of entity numbers in the STEP model.
|
||||
Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(XSControl_WorkSession) thesession;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPControl_Writer_HeaderFile
|
Reference in New Issue
Block a user