mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f501c6ffe2 | ||
|
4c8350dd52 | ||
|
c51df6bfd2 | ||
|
5e43274280 | ||
|
efe960751c | ||
|
6b9e0dc3f8 | ||
|
2ef94c994e | ||
|
1dd4b902c0 | ||
|
a846d36326 |
@@ -45,6 +45,7 @@ user_guides/visualization/visualization.md
|
||||
user_guides/iges/iges.md
|
||||
user_guides/step/step.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/de_wrapper/de_wrapper.md
|
||||
user_guides/ocaf/ocaf.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
user_guides/inspector/inspector.md
|
||||
|
@@ -20,6 +20,7 @@ user_guides/vis/vis.md
|
||||
user_guides/iges/iges.md
|
||||
user_guides/step/step.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/de_wrapper/de_wrapper.md
|
||||
user_guides/inspector/inspector.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
|
||||
|
413
dox/user_guides/de_wrapper/de_wrapper.md
Normal file
413
dox/user_guides/de_wrapper/de_wrapper.md
Normal file
@@ -0,0 +1,413 @@
|
||||
Data Exchange Wrapper (DE_Wrapper) {#occt_user_guides__de_wrapper}
|
||||
============================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section occt_de_wrapper_1 Introduction
|
||||
|
||||
This guide explains how to use the **Data Exchange Wrapper** (DE Wrapper).
|
||||
It provides basic directions on setup, usage and file creation via DE_Wrapper.
|
||||
|
||||
The Data Exchange Wrapper (DE Wrapper) module allows reading and writing supported CAD formats to shape objects or special XDE documents, setting up the transfer process for all CAD files.
|
||||
|
||||
It is also possible to add support for new CAD formats by prototyping existing tools.
|
||||
|
||||
The DE Wrapper component requires @ref occt_user_guides__xde "XDE" toolkit for operation.
|
||||
|
||||
This guide mainly explains how to convert CAD files to Open CASCADE Technology (OCCT) shapes and vice versa.
|
||||
This guide principally deals with the following OCCT classes:
|
||||
* The Provider class, which loads CAD files and translates their contents to OCCT shapes or XDE documents, or translates OCCT shapes or XDE documents to CAD entities and then writes those entities to a CAD file.
|
||||
* The Configuration class, which contains all information for the transfer process, such as the units, tolerance, and all internal information for the OCC readers or writers.
|
||||
* The wrapper class, which contains all loaded configuration objects with own CAD format, reads or writes CAD files in the format derived from file extension or contents and saves or loads configuration settings for loaded configuration objects.
|
||||
|
||||
@section occt_de_wrapper_2 Supported CAD formats
|
||||
|
||||
| CAD format | Extensions | RW support | Thread Safety | Presentation | Package |
|
||||
| :--------- | :--------- | :--------- | :----------- | :----------- | :------ |
|
||||
| STEP | .stp, .step .stepz | RW | No | BRep, Mesh | STEPCAFControl |
|
||||
| XCAF | .xbf | RW | Yes | BRep, Mesh | DEXCAFCascade |
|
||||
| BREP | .brep | RW | Yes | BRep, Mesh | DEBRepCascade |
|
||||
| IGES | .igs, .iges | RW | No | BRep | IGESCAFControl |
|
||||
| OBJ | .obj | RW | Yes | Mesh | RWObj |
|
||||
| STL | .stl | RW | Yes | Mesh | RWStl |
|
||||
| PLY | .ply | W | Yes | Mesh | RWPly |
|
||||
| GLTF | .glTF .glb | RW | Yes | Mesh | RWGltf |
|
||||
| VRML | .wrl .vrml | RW | Yes | Mesh | Vrml |
|
||||
|
||||
**Note** :
|
||||
* The format names in the first column match the FormatName values used for configuration nodes.
|
||||
* The VendorName for all listed CAD formats is "OCC".
|
||||
|
||||
@section occt_de_wrapper_3 DE Session Configuration
|
||||
|
||||
Any providers can have their own read/write parameters. The transfer process is set up using DE configuration nodes, which hold all relevant parameters. There are two ways to change the parameter values: directly from code or by an external resource file/string.
|
||||
The session is a global or static DE_Wrapper object that stores registered DE configuration nodes and wraps DE commands to work with them. It has some configuration parameters of its own and also keeps track of loaded nodes and specilal global parameters.
|
||||
|
||||
@subsection occt_de_wrapper_3_1 Getting a DE session. Code sample
|
||||
|
||||
Working with a DE session requires a DE_Wrapper object to be loaded or created first.
|
||||
|
||||
Getting the global DE_Wrapping object:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
~~~~
|
||||
Creating a local DE_Wrapper:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = new DE_Wrapper();
|
||||
~~~~
|
||||
It is recommended to create a local one-time copy to work with the session, if no global changes are intended.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aOneTimeSession = aSession->Copy();
|
||||
~~~~
|
||||
@subsection occt_de_wrapper_3_2 Configuration resource
|
||||
|
||||
Configuration resource is an external file or string of the following format:
|
||||
~~~~{.cpp}
|
||||
global.priority.STEP : OCC DTK
|
||||
global.general.length.unit : 1
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_1 Configuration resource: graph of scopes
|
||||
* **global.** is a scope of global parameters
|
||||
* **priority.** is a scope of priority to use vendors with their providers.
|
||||
* **general.** is a scope of global configuration parameter values
|
||||
* <strong>"..."</strong> is an internal configuration with any internal scopes
|
||||
* <strong>". : "</strong> is a separator of key-value
|
||||
* __...__ parameter value, can't contain new line symbols.
|
||||
* **provider.** is a scope of configuration providers
|
||||
* **STEP.** is a scope of CAD format to configure
|
||||
* **OCC.** is a scope of a vendor or provider
|
||||
* <strong>"..."</strong> is an internal configuration with any internal scopes
|
||||
* <strong>". : "</strong> is a separator of key-value
|
||||
* <strong>"..."</strong> parameter value, can't contain new line symbols.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_2 Loading configuration resources. Configuring DE Session
|
||||
|
||||
The resource should be loaded after the registration of all providers that should be configured. The resource only impacts registered parameters. To configure a new registered provider it is necessary to load the resource again. Parameters not present in the resource will remain unchanged.
|
||||
|
||||
There are two ways to check what parameters are available:
|
||||
* C++: Open ConfigureNode file and check the InternalParameter field. Each parameter will be described with a comment. To check the global parameters, use the DE_Wrapper class public methods.
|
||||
* Resource: Register all available Nodes to the session, then save the configuration and view all existing parameters.
|
||||
|
||||
There are two options for loading a resource: recursive and global parameters only. Recursive is the default option to configure all global parameters (units, priority, enable status) and all registered providers. Non-recursive configures only global parameters and ignores all provider settings. This option is the best for updating provider priority.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_3 Loading configuration resources. Code sample
|
||||
|
||||
Configuring using a resource string:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aString =
|
||||
"global.priority.STEP : OCC DTK\n"
|
||||
"global.general.length.unit : 1\n"
|
||||
"provider.STEP.OCC.read.precision.val : 0.\n";
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
if (!aSession->Load(aString, aIsRecursive))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is incorrect";
|
||||
}
|
||||
~~~~
|
||||
Configuring using a resource file:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "";
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
if (!aSession->Load(aPathToFile, aIsRecursive))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is incorrect";
|
||||
}
|
||||
~~~~
|
||||
@subsubsection occt_de_wrapper_3_2_4 Loading configuration resources. DRAW sample
|
||||
|
||||
Configuring using a resource string:
|
||||
~~~~{.cpp}
|
||||
set conf "
|
||||
global.priority.STEP : OCC
|
||||
global.general.length.unit : 1
|
||||
provider.STEP.OCC.read.iges.bspline.continuity : 1
|
||||
provider.STEP.OCC.read.precision.mode : 0
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
"
|
||||
LoadConfiguration ${conf} -recursive on
|
||||
~~~~
|
||||
|
||||
Configuring using a resource file:
|
||||
~~~~{.cpp}
|
||||
set pathToFile ""
|
||||
LoadConfiguration ${pathToFile} -recursive on
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_5 Saving configuration resources. Dump of configuration DE Session
|
||||
|
||||
Saving the configuration of a DE Session involves dumping all parameters of registered providers.
|
||||
If a parameter did not change during the session, its value remains as default.
|
||||
|
||||
There are two ways to save a resource: recursive and global parameters only. Recursive is the way to dump all registered provider information. Non-recursive dumps only global parameters, for example, save priority of vendors or the length unit.
|
||||
|
||||
It is possible to filter what vendors or providers to save by providing the correct name of the vendor or provider.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_6 Saving configuration resources. Code sample
|
||||
|
||||
Dump to resource string. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TColStd_ListOfAsciiString aFormats;
|
||||
TColStd_ListOfAsciiString aVendors;
|
||||
aFormats.Appends("STEP");
|
||||
aVendors.Appends("OCC");
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
TCollection_AsciiString aConf = aSession->aConf->Save(aIsRecursive, aFormats, aVendors);
|
||||
~~~~
|
||||
Configure using a resource file. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "";
|
||||
TColStd_ListOfAsciiString aFormats;
|
||||
TColStd_ListOfAsciiString aVendors;
|
||||
aFormats.Appends("STEP");
|
||||
aVendors.Appends("OCC");
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
if (!aSession->Save(aPathToFile, aIsRecursive, aFormats,aVendors))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is not saved";
|
||||
}
|
||||
~~~~
|
||||
@subsubsection occt_de_wrapper_3_2_7 Saving configuration resources. DRAW sample
|
||||
|
||||
Dump configuration to string. If no list of vendors is passed or it is empty, all vendors are saved. If no providers list is passed or it is empty, all providers of valid vendors are saved.
|
||||
~~~~{.cpp}
|
||||
set vendors "OCC"
|
||||
set format "STEP"
|
||||
set dump_conf [DumpConfiguration -recursive on -format ${format} -vendor ${vendors}]
|
||||
~~~~
|
||||
|
||||
Dump configuration to file. If no vendors list are set as an argument or it is empty, saves all vendors. If no providers list as argument or it is empty, saves all providers of valid vendors:
|
||||
~~~~{.cpp}
|
||||
set vendors "OCC"
|
||||
set format "STEP"
|
||||
set pathToFile ""
|
||||
DumpConfiguration -path ${pathToFile} -recursive on -format ${format} -vendor ${vendors}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_3_3 Registering providers
|
||||
|
||||
To transfer a CAD file using DE Wrapper, it is necessary to register a CAD provider.
|
||||
The provider contains internal and global parameters that have default values in the creation stage.
|
||||
All registered providers are set to the map with information about its vendor and kept as smart handles. Therefore, it is possible to change the values via handle from external code.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_3_1 Registering providers. Code sample
|
||||
|
||||
It is nesessary to register only one ConfigurationNode for all needed formats.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
Handle(DE_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
|
||||
aSession->Bind(aNode);
|
||||
~~~~
|
||||
@subsubsection occt_de_wrapper_3_3_2 Registering providers. DRAW Sample
|
||||
|
||||
Use DRAW with all providers registered by the following command:
|
||||
~~~~{.cpp}
|
||||
pload XDE
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_3_3 Realtime initialization. Code sample
|
||||
|
||||
It is possible to change a paramater from code using a smart pointer.
|
||||
|
||||
~~~~{.cpp}
|
||||
// global variable
|
||||
static Handle(STEPCAFControl_ConfigurationNode) THE_STEP_NODE;
|
||||
|
||||
static Handle(DE_ConfigurationNode) RegisterStepNode()
|
||||
{
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
if (!THE_STEP_NODE.IsNull())
|
||||
{
|
||||
return THE_STEP_NODE;
|
||||
}
|
||||
|
||||
THE_STEP_NODE = new STEPCAFControl_ConfigurationNode();
|
||||
aSession->Bind(THE_STEP_NODE);
|
||||
return THE_STEP_NODE;
|
||||
}
|
||||
|
||||
// Change parameter value
|
||||
THE_STEP_NODE->InternalParameters.ReadRelationship = false;
|
||||
THE_STEP_NODE->InternalParameters.ReadName = false;
|
||||
THE_STEP_NODE->InternalParameters.ReadProps = false;
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_3_4 Priority of Vendors
|
||||
|
||||
DE session is able to work with several vendors with the same supported CAD format. To choose the preffered vendor for each format, use a special priority list.
|
||||
|
||||
If the high priority vendor's provider is not supported, a transfer operation is needed (write/read), then the next vendor will be chosen.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_4_1 Priority of Vendors. Code sample
|
||||
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aFormat = "STEP";
|
||||
TColStd_ListOfAsciiString aVendors;
|
||||
aVendors.Appends("OCC"); // high priority
|
||||
aVendors.Appends("DTK");
|
||||
// Flag to disable not choosen vendors, in this case configuration is possible
|
||||
// otherwise, lower their priority and continue to check ability to transfer
|
||||
Standard_Boolean aToDisable = Standard_True;
|
||||
aSession->ChangePriority(aFormat, aVendors, aToDisable);
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_4_2 Priority of Vendors. DRAW Sample
|
||||
|
||||
It is recommended to disable recursion and update only global parameters.
|
||||
~~~~{.cpp}
|
||||
set conf "
|
||||
global.priority.STEP : OCC DTK
|
||||
"
|
||||
LoadConfiguration ${conf} -recursive off
|
||||
~~~~
|
||||
|
||||
@section occt_de_wrapper_4 Transfer of CAD files
|
||||
|
||||
To transfer from a CAD file to OCC or from OCC to a CAD file, it is necessary to use a configured DE_Wrapper object. It can be local, one-time or global. Global configuration of DE_Wrapper propagates to all nodes via transfer. There are two options for transferring: using OCC shape or XCAF document. It is possible to work only with real path to/from the file. Streaming is not supported (yet).
|
||||
|
||||
The format of input/output file is automatically determined by its extension or contents.
|
||||
|
||||
@subsection occt_de_wrapper_4_1 Transfer of CAD files. Code samples
|
||||
|
||||
Reading STEP file to Shape.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
TopoDS_Shape aShRes;
|
||||
if (!aSession->Read(aPathToFile, aShRes))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
Writing Shape to STEP file.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
TopoDS_Shape aShFrom = ...;
|
||||
if (!aSession->Write(aPathToFile, aShRes))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't write file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
Reading STEP file into XCAF document.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
Handle(TDocStd_Document) aDoc = ...;
|
||||
if (!aSession->Read(aPathToFile, aDoc))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
Writing XCAF document into STEP.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
Handle(TDocStd_Document) aDoc = ...;
|
||||
if (!aSession->Write(aPathToFile, aDoc))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't write file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_4_2 Transfer of CAD files. DRAW samples
|
||||
|
||||
Reading a STEP file into a Shape.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
readfile shape ${fileName}
|
||||
~~~~
|
||||
|
||||
Writing a Shape into STEP.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
writefile shape ${fileName}
|
||||
~~~~
|
||||
|
||||
Reading STEP into XCAF document.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
ReadFile D ${fileName}
|
||||
~~~~
|
||||
|
||||
Writing XCAF document into STEP.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
WriteFile D ${fileName}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_4_3 Transfer using DE Provider. Code sample
|
||||
|
||||
It is possible to read and write CAD files directly from a special provider.
|
||||
|
||||
~~~~{.cpp}
|
||||
// Creating or getting node
|
||||
Handle(STEPCAFControl_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
|
||||
// Creationg an one-time provider
|
||||
Handle(DE_Provider) aProvider = aNode->BuildProvider();
|
||||
// Setting configuration with all parameters
|
||||
aProvider->SetNode(aNode);
|
||||
if (!aProvider->Read(...))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read STEP file";
|
||||
}
|
||||
if (!aProvider->Write(...))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't write STEP file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_4_4 Temporary configuration via transfer
|
||||
|
||||
It is possible to change the configuration of only one transfer operation. To avoid changing parameters in a session, one-time clone of the session can be created and used for transfer. This way is recommended for use in multithreaded mode.
|
||||
|
||||
@subsubsection occt_de_wrapper_4_4_1 Temporary configuration via transfer. Code sample
|
||||
|
||||
Code sample to configure via transfer.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper()->Copy();
|
||||
TCollection_AsciiString aString =
|
||||
"global.priority.STEP : OCC DTK\n"
|
||||
"global.general.length.unit : 1\n"
|
||||
"provider.STEP.OCC.read.precision.val : 0.\n";
|
||||
if (!aSession->Load(aString, aIsRecursive))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is incorrect";
|
||||
}
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
TopoDS_Shape aShRes;
|
||||
if (!aSession->Read(aPathToFile, aShRes))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_4_4_2 Temporary configuration via transfer. DRAW sample
|
||||
|
||||
Code sample to configure via transfer within DRAW command.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
readfile S5 $filename -conf "global.general.length.unit : 1000 "
|
||||
~~~~
|
||||
|
||||
Code sample to configure via transfer as variable.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
set conf "
|
||||
global.priority.STEP : OCC
|
||||
global.general.length.unit : 1
|
||||
provider.STEP.OCC.read.iges.bspline.continuity : 1
|
||||
provider.STEP.OCC.read.precision.mode : 0
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
"
|
||||
readfile S5 $filename -conf ${conf}
|
||||
~~~~
|
@@ -13,6 +13,7 @@ OCCT User Guides are organized by OCCT modules:
|
||||
* @subpage occt_user_guides__iges "IGES Translator"
|
||||
* @subpage occt_user_guides__step "STEP Translator"
|
||||
* @subpage occt_user_guides__xde "Extended Data Exchange (XDE)"
|
||||
* @subpage occt_user_guides__de_wrapper "Data Exchange Wrapper (DE Wrapper)"
|
||||
* @subpage occt_user_guides__ocaf "Open CASCADE Application Framework (OCAF)"
|
||||
* @subpage occt_user_guides__test_harness "DRAW Test Harness"
|
||||
* @subpage occt_user_guides__inspector "Inspector"
|
||||
|
@@ -62,6 +62,7 @@
|
||||
#include <IntTools_SequenceOfCurves.hxx>
|
||||
#include <IntTools_SequenceOfPntOn2Faces.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
@@ -578,14 +579,12 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
|
||||
Standard_Integer i, nF1, nF2, aNbC, aNbP, j;
|
||||
Standard_Integer nV1, nV2;
|
||||
Standard_Real aT1, aT2;
|
||||
Handle(NCollection_BaseAllocator) aAllocator;
|
||||
Handle(NCollection_BaseAllocator) aAllocator = new NCollection_IncAllocator;
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
|
||||
TopoDS_Edge aES;
|
||||
Handle(BOPDS_PaveBlock) aPBOut;
|
||||
//
|
||||
//-----------------------------------------------------scope f
|
||||
aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
//
|
||||
TColStd_ListOfInteger aLSE(aAllocator), aLBV(aAllocator);
|
||||
TColStd_MapOfInteger aMVOnIn(100, aAllocator), aMVCommon(100, aAllocator),
|
||||
|
@@ -322,7 +322,8 @@ Standard_Boolean IGESCAFControl_Reader::Transfer (const Handle(TDocStd_Document)
|
||||
|
||||
//Checks that current entity is a subfigure
|
||||
Handle(IGESBasic_SubfigureDef) aSubfigure = Handle(IGESBasic_SubfigureDef)::DownCast (ent);
|
||||
if (GetNameMode() && !aSubfigure.IsNull() && STool->Search (S, L, Standard_True, Standard_True))
|
||||
if (GetNameMode() && !aSubfigure.IsNull() && !aSubfigure->Name().IsNull() &&
|
||||
STool->Search(S, L, Standard_True, Standard_True))
|
||||
{
|
||||
//In this case we attach subfigure name to the label, instead of default "COMPOUND"
|
||||
Handle(TCollection_HAsciiString) aName = aSubfigure->Name();
|
||||
|
@@ -633,34 +633,55 @@ Standard_Boolean IGESData_ParamReader::ReadXYZ
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadText
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean IGESData_ParamReader::ReadText
|
||||
(const IGESData_ParamCursor& PC, const Message_Msg& amsg,
|
||||
Handle(TCollection_HAsciiString)& val)
|
||||
Standard_Boolean IGESData_ParamReader::ReadText(const IGESData_ParamCursor& thePC,
|
||||
const Message_Msg& theMsg,
|
||||
Handle(TCollection_HAsciiString)& theVal)
|
||||
{
|
||||
if (!PrepareRead(PC,Standard_False)) return Standard_False;
|
||||
const Interface_FileParameter& FP = theparams->Value(theindex+thebase);
|
||||
if (FP.ParamType() != Interface_ParamText) {
|
||||
if (FP.ParamType() == Interface_ParamVoid) {
|
||||
val = new TCollection_HAsciiString("");
|
||||
if (!PrepareRead(thePC, Standard_False))
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
const Interface_FileParameter& aFP = theparams->Value(theindex + thebase);
|
||||
if (aFP.ParamType() != Interface_ParamText)
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
if (aFP.ParamType() == Interface_ParamVoid)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
SendFail (amsg);
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
}
|
||||
Handle(TCollection_HAsciiString) tval = new TCollection_HAsciiString (FP.CValue());
|
||||
Standard_Integer lnt = tval->Length();
|
||||
Standard_Integer lnh = tval->Location(1,'H',1,lnt);
|
||||
if (lnh <= 1 || lnh >= lnt) {
|
||||
SendFail (amsg);
|
||||
const Handle(TCollection_HAsciiString) aBaseValue = new TCollection_HAsciiString(aFP.CValue());
|
||||
const Standard_Integer aBaseLength = aBaseValue->Length();
|
||||
const Standard_Integer aSymbolLocation = aBaseValue->Location(1, 'H', 1, aBaseLength);
|
||||
if (aSymbolLocation <= 1 || aSymbolLocation > aBaseLength)
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
} else {
|
||||
Standard_Integer hol = atoi (tval->SubString(1,lnh-1)->ToCString());
|
||||
if (hol != (lnt-lnh)) SendWarning (amsg);
|
||||
}
|
||||
val = new TCollection_HAsciiString(tval->SubString(lnh+1,lnt)->ToCString());
|
||||
const TCollection_AsciiString aSpecialSubString = aBaseValue->String().SubString(1, aSymbolLocation - 1);
|
||||
if (!aSpecialSubString.IsIntegerValue())
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
}
|
||||
Standard_Integer aResLength = aSpecialSubString.IntegerValue();
|
||||
if (aResLength != (aBaseLength - aSymbolLocation))
|
||||
{
|
||||
SendWarning(theMsg);
|
||||
aResLength = aBaseLength - aSymbolLocation;
|
||||
}
|
||||
TCollection_AsciiString aResString;
|
||||
if (aResLength > 0)
|
||||
{
|
||||
aResString = aBaseValue->String().SubString(aSymbolLocation + 1, aBaseLength);
|
||||
}
|
||||
theVal = new TCollection_HAsciiString(aResString);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -200,7 +200,7 @@ public:
|
||||
//! For Message
|
||||
Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XYZ& val);
|
||||
|
||||
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TCollection_HAsciiString)& val);
|
||||
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& thePC, const Message_Msg& theMsg, Handle(TCollection_HAsciiString)& theVal);
|
||||
|
||||
//! Reads a Text value from parameter "num", as a String from
|
||||
//! Collection, that is, Hollerith text without leading "nnnH"
|
||||
|
@@ -226,304 +226,270 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferCurveAndSurface
|
||||
//function : TransferGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
||||
(const Handle(IGESData_IGESEntity)& start,
|
||||
(const Handle(IGESData_IGESEntity)& theStart,
|
||||
const Message_ProgressRange& theProgress)
|
||||
{
|
||||
// Declaration of messages//
|
||||
// DCE 22/12/98
|
||||
//Message_Msg msg1005("IGES_1005"); // Software error : start IsNull.
|
||||
//Message_Msg msg1015("IGES_1015"); // invalid type or exception raising (software error).
|
||||
//Message_Msg msg1010("IGES_1010"); // Not sameparameter.
|
||||
// Message_Msg msg1015("IGES_1015");
|
||||
//Message_Msg msg210 ("XSTEP_210");
|
||||
//Message_Msg msg202 ("XSTEP_202");
|
||||
////////////////////////////
|
||||
TopoDS_Shape res;
|
||||
gp_Trsf T408;
|
||||
if (start.IsNull()) {
|
||||
Message_Msg msg1005("IGES_1005"); // Software error : start IsNull.
|
||||
SendFail(start, msg1005);
|
||||
return res;
|
||||
// Declaration of messages//
|
||||
// DCE 22/12/98
|
||||
//Message_Msg aMsg1005("IGES_1001"); // The type of the Start is not recognized
|
||||
//Message_Msg aMsg1005("IGES_1005"); // Software error : the Start IsNull.
|
||||
//Message_Msg aMsg1015("IGES_1015"); // invalid type or exception raising (software error).
|
||||
//Message_Msg aMsg1010("IGES_1010"); // Not sameparameter.
|
||||
//Message_Msg aMsg1015("IGES_1020"); // Associated entity IsNull
|
||||
//Message_Msg aMsg1015("IGES_1025"); // No shape is found for the associated entity for the type 308
|
||||
//Message_Msg aMsg1015("IGES_1030"); // No shape is found for the associated entity for the type 402
|
||||
//Message_Msg aMsg1015("IGES_1035"); // The conversion of a Location is not possible
|
||||
//Message_Msg aMsg210 ("XSTEP_210"); // No associated entities for the type 308
|
||||
//Message_Msg aMsg202 ("XSTEP_202"); // No associated entities for the type 402
|
||||
////////////////////////////
|
||||
TopoDS_Shape aRes;
|
||||
gp_Trsf aT408;
|
||||
if (theStart.IsNull())
|
||||
{
|
||||
const Message_Msg aMsg1005("IGES_1005"); // Software error : start IsNull.
|
||||
SendFail(theStart, aMsg1005);
|
||||
return aRes;
|
||||
}
|
||||
|
||||
// Read of the DE number and the type number of the entity
|
||||
Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(start);
|
||||
//Standard_Integer typeNumber = start->TypeNumber();
|
||||
|
||||
// sln 13.06.2002 OCC448: Avoid transferring invisible sub entities which
|
||||
// logically depend on the one
|
||||
Standard_Integer onlyvisible = Interface_Static::IVal("read.iges.onlyvisible");
|
||||
|
||||
if (IGESToBRep::IsCurveAndSurface(start)) {
|
||||
if(onlyvisible && start->BlankStatus() == 1)
|
||||
return res;
|
||||
try {
|
||||
const Standard_Integer anOnlyvisible = Interface_Static::IVal("read.iges.onlyvisible");
|
||||
|
||||
if (IGESToBRep::IsCurveAndSurface(theStart))
|
||||
{
|
||||
if(anOnlyvisible && theStart->BlankStatus() == 1)
|
||||
return aRes;
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS
|
||||
res = TransferCurveAndSurface(start, theProgress);
|
||||
aRes = TransferCurveAndSurface(theStart, theProgress);
|
||||
}
|
||||
catch(Standard_Failure const&) {
|
||||
Message_Msg msg1015("IGES_1015");
|
||||
SendFail(start, msg1015);
|
||||
catch(Standard_Failure const&)
|
||||
{
|
||||
const Message_Msg aMsg1015("IGES_1015");
|
||||
SendFail(theStart, aMsg1015);
|
||||
}
|
||||
return res;
|
||||
return aRes;
|
||||
}
|
||||
|
||||
//408 : SingularSubfigure
|
||||
if (start->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
|
||||
if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
|
||||
{
|
||||
if(onlyvisible && start->BlankStatus() == 1)
|
||||
return res;
|
||||
|
||||
DeclareAndCast(IGESBasic_SingularSubfigure, st408, start);
|
||||
Handle (IGESBasic_SubfigureDef) stsub = st408->Subfigure();
|
||||
gp_XYZ trans = st408->Translation();
|
||||
gp_Vec vectr(trans);
|
||||
Standard_Real scunit = GetUnitFactor();
|
||||
vectr.Multiply(scunit);
|
||||
T408.SetTranslation(vectr);
|
||||
if (st408->HasScaleFactor()) {
|
||||
Standard_Real scalef = st408->ScaleFactor();
|
||||
T408.SetScaleFactor(scalef);
|
||||
}
|
||||
if (HasShapeResult(stsub)) {
|
||||
res = GetShapeResult(stsub);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
res = TransferGeometry(stsub, theProgress);
|
||||
}
|
||||
catch(Standard_Failure const&) {
|
||||
res.Nullify();
|
||||
Message_Msg msg1015("IGES_1015");
|
||||
SendFail( st408, msg1015);
|
||||
}
|
||||
if (!res.IsNull()) {
|
||||
SetShapeResult(stsub,res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 308 : SubfigureDefinition
|
||||
else if (start->IsKind(STANDARD_TYPE(IGESBasic_SubfigureDef))) {
|
||||
DeclareAndCast(IGESBasic_SubfigureDef, st308, start);
|
||||
TopoDS_Compound group;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound (group);
|
||||
if (st308->NbEntities() < 1) {
|
||||
Message_Msg msg210 ("XSTEP_210");
|
||||
SendFail( st308, msg210);
|
||||
return res;
|
||||
}
|
||||
Message_ProgressScope PS (theProgress, "Subfigure item", st308->NbEntities());
|
||||
for (Standard_Integer i=1; i <= st308->NbEntities() && PS.More(); i++)
|
||||
{
|
||||
Message_ProgressRange aRange = PS.Next();
|
||||
TopoDS_Shape item;
|
||||
if (st308->AssociatedEntity(i).IsNull()) {
|
||||
Message_Msg msg1020("IGES_1020");
|
||||
msg1020.Arg(i);
|
||||
SendWarning( st308, msg1020);
|
||||
continue;
|
||||
}
|
||||
if(onlyvisible && st308->AssociatedEntity(i)->BlankStatus() == 1 )
|
||||
continue;
|
||||
|
||||
if (HasShapeResult(st308->AssociatedEntity(i)))
|
||||
{
|
||||
item = GetShapeResult(st308->AssociatedEntity(i));
|
||||
}
|
||||
else {
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
item = TransferGeometry (st308->AssociatedEntity(i), aRange);
|
||||
}
|
||||
catch(Standard_Failure const&) {
|
||||
item.Nullify();
|
||||
Message_Msg msg1015("IGES_1015");
|
||||
SendFail( st308->AssociatedEntity(i), msg1015);
|
||||
}
|
||||
}
|
||||
if (item.IsNull()) {
|
||||
Message_Msg msg1025("IGES_1025");
|
||||
msg1025.Arg(i);
|
||||
SendWarning (start,msg1025);
|
||||
}
|
||||
else {
|
||||
B.Add(group, item);
|
||||
SetShapeResult (st308->AssociatedEntity(i),item);
|
||||
}
|
||||
}
|
||||
res = group;
|
||||
}
|
||||
else if (start->IsKind(STANDARD_TYPE(IGESBasic_Group))) {
|
||||
if(onlyvisible && start->BlankStatus() == 1)
|
||||
return res;
|
||||
|
||||
DeclareAndCast(IGESBasic_Group, st402f1, start);
|
||||
TopoDS_Compound group;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound (group);
|
||||
if (st402f1->NbEntities() < 1) {
|
||||
Message_Msg msg202 ("XSTEP_202");
|
||||
msg202.Arg(st402f1->FormNumber());
|
||||
SendFail(st402f1, msg202);
|
||||
return res;
|
||||
}
|
||||
Message_ProgressScope PS (theProgress, "Group item", st402f1->NbEntities());
|
||||
Standard_Boolean ProblemInGroup = Standard_False;
|
||||
for (Standard_Integer i=1; i <= st402f1->NbEntities() && PS.More(); i++)
|
||||
{
|
||||
Message_ProgressRange aRange = PS.Next();
|
||||
TopoDS_Shape item;
|
||||
if (st402f1->Entity(i).IsNull()) {
|
||||
Message_Msg msg1020("IGES_1020");
|
||||
msg1020.Arg(i);
|
||||
SendFail( st402f1, msg1020);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(onlyvisible && st402f1->Entity(i)->BlankStatus() == 1)
|
||||
continue;
|
||||
|
||||
if (HasShapeResult(st402f1->Entity(i))) {
|
||||
item = GetShapeResult(st402f1->Entity(i));
|
||||
}
|
||||
else {
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
item = TransferGeometry (st402f1->Entity(i), aRange);
|
||||
}
|
||||
catch(Standard_Failure const&) {
|
||||
item.Nullify();
|
||||
Message_Msg msg1015("IGES_1015");
|
||||
SendFail(st402f1->Entity(i),msg1015);
|
||||
}
|
||||
}
|
||||
if (item.IsNull()) {
|
||||
//Message_Msg msg1030("IGES_1030");
|
||||
//msg1030.Arg(st402f1->FormNumber());
|
||||
//msg1030.Arg(i);
|
||||
//SendWarning (st402f1,msg1030);
|
||||
ProblemInGroup = Standard_True;
|
||||
}
|
||||
else {
|
||||
B.Add(group, item);
|
||||
SetShapeResult (st402f1->Entity(i),item);
|
||||
}
|
||||
}
|
||||
res = group;
|
||||
if(ProblemInGroup) {
|
||||
Message_Msg msg1030("IGES_1030");
|
||||
msg1030.Arg(st402f1->FormNumber());
|
||||
SendWarning (st402f1,msg1030);
|
||||
}
|
||||
}
|
||||
else if (start->IsKind(STANDARD_TYPE(IGESBasic_GroupWithoutBackP))) {
|
||||
|
||||
if(onlyvisible && start->BlankStatus() == 1)
|
||||
return res;
|
||||
|
||||
DeclareAndCast(IGESBasic_GroupWithoutBackP, st402f7, start);
|
||||
TopoDS_Compound group;
|
||||
//unused Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(st402f7);
|
||||
BRep_Builder B;
|
||||
B.MakeCompound (group);
|
||||
if (st402f7->NbEntities() < 1) {
|
||||
Message_Msg msg202 ("XSTEP_202");
|
||||
msg202.Arg(st402f7->FormNumber());
|
||||
SendFail(st402f7, msg202);
|
||||
return res;
|
||||
}
|
||||
Message_ProgressScope PS (theProgress, "Group item", st402f7->NbEntities());
|
||||
Standard_Boolean ProblemInGroup = Standard_False;
|
||||
for (Standard_Integer i=1; i <= st402f7->NbEntities() && PS.More(); i++)
|
||||
{
|
||||
Message_ProgressRange aRange = PS.Next();
|
||||
TopoDS_Shape item;
|
||||
if (st402f7->Entity(i).IsNull()) {
|
||||
Message_Msg msg1020("IGES_1020");
|
||||
msg1020.Arg(i);
|
||||
SendFail( st402f7, msg1020);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(onlyvisible && st402f7->Entity(i)->BlankStatus() == 1 )
|
||||
continue;
|
||||
if(anOnlyvisible && theStart->BlankStatus() == 1)
|
||||
return aRes;
|
||||
|
||||
if (HasShapeResult(st402f7->Entity(i))) {
|
||||
item = GetShapeResult(st402f7->Entity(i));
|
||||
DeclareAndCast(IGESBasic_SingularSubfigure, aSt408, theStart);
|
||||
Handle (IGESBasic_SubfigureDef) aStsub = aSt408->Subfigure();
|
||||
const gp_XYZ aTrans = aSt408->Translation();
|
||||
gp_Vec aVectr(aTrans);
|
||||
const Standard_Real aScunit = GetUnitFactor();
|
||||
aVectr.Multiply(aScunit);
|
||||
aT408.SetTranslation(aVectr);
|
||||
if (aSt408->HasScaleFactor())
|
||||
{
|
||||
const Standard_Real aScalef = aSt408->ScaleFactor();
|
||||
aT408.SetScaleFactor(aScalef);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
item = TransferGeometry (st402f7->Entity(i), aRange);
|
||||
}
|
||||
catch(Standard_Failure const&) {
|
||||
item.Nullify();
|
||||
Message_Msg msg1015("IGES_1015");
|
||||
SendFail(st402f7->Entity(i),msg1015);
|
||||
}
|
||||
if (HasShapeResult(aStsub))
|
||||
{
|
||||
aRes = GetShapeResult(aStsub);
|
||||
}
|
||||
if (item.IsNull()) {
|
||||
//Message_Msg msg1030("IGES_1030");
|
||||
//msg1030.Arg(st402f7->FormNumber());
|
||||
//msg1030.Arg(i);
|
||||
//SendWarning (st402f7,msg1030);
|
||||
ProblemInGroup = Standard_True;
|
||||
}
|
||||
else {
|
||||
B.Add(group, item);
|
||||
SetShapeResult (st402f7->Entity(i),item);
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS
|
||||
aRes = TransferGeometry(aStsub, theProgress);
|
||||
}
|
||||
catch(Standard_Failure const&)
|
||||
{
|
||||
aRes.Nullify();
|
||||
const Message_Msg aMsg1015("IGES_1015");
|
||||
SendFail(aSt408, aMsg1015);
|
||||
}
|
||||
if (!aRes.IsNull())
|
||||
{
|
||||
SetShapeResult(aStsub, aRes);
|
||||
}
|
||||
}
|
||||
}
|
||||
res = group;
|
||||
if(ProblemInGroup) {
|
||||
Message_Msg msg1030("IGES_1030");
|
||||
msg1030.Arg(st402f7->FormNumber());
|
||||
SendWarning (st402f7,msg1030);
|
||||
|
||||
// 308 : SubfigureDefinition
|
||||
else if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SubfigureDef)))
|
||||
{
|
||||
DeclareAndCast(IGESBasic_SubfigureDef, aSt308, theStart);
|
||||
TopoDS_Compound aGroup;
|
||||
BRep_Builder aBuilder;
|
||||
aBuilder.MakeCompound (aGroup);
|
||||
if (aSt308->NbEntities() < 1)
|
||||
{
|
||||
const Message_Msg aMsg210 ("XSTEP_210");
|
||||
SendFail(aSt308, aMsg210);
|
||||
return aRes;
|
||||
}
|
||||
Message_ProgressScope aPS (theProgress, "Subfigure item", aSt308->NbEntities());
|
||||
for (Standard_Integer anIndx =1; anIndx <= aSt308->NbEntities() && aPS.More(); anIndx++)
|
||||
{
|
||||
Message_ProgressRange aRange = aPS.Next();
|
||||
TopoDS_Shape anItem;
|
||||
if (aSt308->AssociatedEntity(anIndx).IsNull())
|
||||
{
|
||||
Message_Msg aMsg1020("IGES_1020");
|
||||
aMsg1020.Arg(anIndx);
|
||||
SendWarning(aSt308, aMsg1020);
|
||||
continue;
|
||||
}
|
||||
if(anOnlyvisible && aSt308->AssociatedEntity(anIndx)->BlankStatus() == 1)
|
||||
continue;
|
||||
|
||||
if (HasShapeResult(aSt308->AssociatedEntity(anIndx)))
|
||||
{
|
||||
anItem = GetShapeResult(aSt308->AssociatedEntity(anIndx));
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS
|
||||
anItem = TransferGeometry (aSt308->AssociatedEntity(anIndx), aRange);
|
||||
}
|
||||
catch(Standard_Failure const&)
|
||||
{
|
||||
anItem.Nullify();
|
||||
const Message_Msg aMsg1015("IGES_1015");
|
||||
SendFail(aSt308->AssociatedEntity(anIndx), aMsg1015);
|
||||
}
|
||||
}
|
||||
if (anItem.IsNull())
|
||||
{
|
||||
Message_Msg aMsg1025("IGES_1025");
|
||||
aMsg1025.Arg(anIndx);
|
||||
SendWarning (theStart, aMsg1025);
|
||||
}
|
||||
else
|
||||
{
|
||||
aBuilder.Add(aGroup, anItem);
|
||||
SetShapeResult (aSt308->AssociatedEntity(anIndx), anItem);
|
||||
}
|
||||
}
|
||||
aRes = aGroup;
|
||||
}
|
||||
// 402 : Group Associativity
|
||||
else if (theStart->IsKind(STANDARD_TYPE(IGESBasic_Group)))
|
||||
{
|
||||
if(anOnlyvisible && theStart->BlankStatus() == 1)
|
||||
return aRes;
|
||||
|
||||
DeclareAndCast(IGESBasic_Group, aSt402, theStart);
|
||||
TopoDS_Compound aGroup;
|
||||
BRep_Builder aBuilder;
|
||||
aBuilder.MakeCompound (aGroup);
|
||||
const Standard_Integer aNbEnt = aSt402->NbEntities();
|
||||
if (aNbEnt < 1)
|
||||
{
|
||||
Message_Msg aMsg202 ("XSTEP_202");
|
||||
aMsg202.Arg(aSt402->FormNumber());
|
||||
SendFail(aSt402, aMsg202);
|
||||
return aRes;
|
||||
}
|
||||
Message_ProgressScope aPS (theProgress, "Group item", aNbEnt);
|
||||
Standard_Boolean aProblemInGroup = Standard_False;
|
||||
for (Standard_Integer anIndx=1; anIndx <= aNbEnt && aPS.More(); anIndx++)
|
||||
{
|
||||
Message_ProgressRange aRange = aPS.Next();
|
||||
TopoDS_Shape anItem;
|
||||
if (aSt402->Entity(anIndx).IsNull())
|
||||
{
|
||||
Message_Msg aMsg1020("IGES_1020");
|
||||
aMsg1020.Arg(anIndx);
|
||||
SendFail(aSt402, aMsg1020);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(anOnlyvisible && aSt402->Entity(anIndx)->BlankStatus() == 1)
|
||||
continue;
|
||||
|
||||
if (HasShapeResult(aSt402->Entity(anIndx)))
|
||||
{
|
||||
anItem = GetShapeResult(aSt402->Entity(anIndx));
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS
|
||||
anItem = TransferGeometry (aSt402->Entity(anIndx), aRange);
|
||||
}
|
||||
catch(Standard_Failure const&)
|
||||
{
|
||||
anItem.Nullify();
|
||||
const Message_Msg aMsg1015("IGES_1015");
|
||||
SendFail(aSt402->Entity(anIndx), aMsg1015);
|
||||
}
|
||||
}
|
||||
if (anItem.IsNull())
|
||||
{
|
||||
aProblemInGroup = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
aBuilder.Add(aGroup, anItem);
|
||||
SetShapeResult (aSt402->Entity(anIndx), anItem);
|
||||
}
|
||||
}
|
||||
aRes = aGroup;
|
||||
if(aProblemInGroup)
|
||||
{
|
||||
Message_Msg aMsg1030("IGES_1030");
|
||||
aMsg1030.Arg(aSt402->FormNumber());
|
||||
SendWarning (aSt402, aMsg1030);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Message_Msg msg1001("IGES_1001");
|
||||
msg1001.Arg(start->FormNumber());
|
||||
SendFail (start,msg1001);
|
||||
return res;
|
||||
else
|
||||
{
|
||||
Message_Msg aMsg1001("IGES_1001");
|
||||
aMsg1001.Arg(theStart->FormNumber());
|
||||
SendFail (theStart, aMsg1001);
|
||||
return aRes;
|
||||
}
|
||||
|
||||
if (start->HasTransf()) {
|
||||
gp_Trsf T;
|
||||
|
||||
if (theStart->HasTransf())
|
||||
{
|
||||
gp_Trsf aT;
|
||||
SetEpsilon(1.E-04);
|
||||
if (IGESData_ToolLocation::ConvertLocation(GetEpsilon(),start->CompoundLocation(),
|
||||
T,GetUnitFactor())) {
|
||||
if (start->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
|
||||
{
|
||||
gp_XYZ tra = T.TranslationPart();
|
||||
gp_XYZ trans = T408.TranslationPart();
|
||||
tra.Add(trans);
|
||||
T.SetTranslationPart(tra);
|
||||
Standard_Real sc = T.ScaleFactor();
|
||||
Standard_Real scalef = T408.ScaleFactor();
|
||||
sc = sc*scalef;
|
||||
T.SetScaleFactor(sc);
|
||||
}
|
||||
TopLoc_Location L(T);
|
||||
res.Move(L, Standard_False);
|
||||
if (IGESData_ToolLocation::ConvertLocation(GetEpsilon(), theStart->CompoundLocation(),
|
||||
aT, GetUnitFactor()))
|
||||
{
|
||||
if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
|
||||
{
|
||||
gp_XYZ aTra = aT.TranslationPart();
|
||||
const gp_XYZ aTrans = aT408.TranslationPart();
|
||||
aTra.Add(aTrans);
|
||||
aT.SetTranslationPart(aTra);
|
||||
Standard_Real aSc = aT.ScaleFactor();
|
||||
const Standard_Real aScalef = aT408.ScaleFactor();
|
||||
aSc = aSc*aScalef;
|
||||
aT.SetScaleFactor(aSc);
|
||||
}
|
||||
const TopLoc_Location aLoc(aT);
|
||||
aRes.Move(aLoc, Standard_False);
|
||||
}
|
||||
else {
|
||||
Message_Msg msg1035("IGES_1035");
|
||||
SendWarning (start,msg1035);
|
||||
else
|
||||
{
|
||||
const Message_Msg aMsg1035("IGES_1035");
|
||||
SendWarning (theStart, aMsg1035);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (start->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure))) {
|
||||
TopLoc_Location L(T408);
|
||||
res.Move(L);
|
||||
else
|
||||
{
|
||||
if (theStart->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)))
|
||||
{
|
||||
const TopLoc_Location aLoc(aT408);
|
||||
aRes.Move(aLoc);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return aRes;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -225,6 +225,14 @@ static Resource_KindOfLine WhatKindOfLine(OSD_File& aFile,
|
||||
aToken2.Clear();
|
||||
else {
|
||||
Line.Remove(1,Pos-1);
|
||||
const Standard_Integer aLineLength = Line.Length();
|
||||
if (aLineLength >= 2)
|
||||
{
|
||||
if (Line.Value(aLineLength - 1) == '\r')
|
||||
{
|
||||
Line.Remove(aLineLength - 1);
|
||||
}
|
||||
}
|
||||
Line.Remove(Line.Length());
|
||||
aToken2 = Line;
|
||||
}
|
||||
|
@@ -47,7 +47,9 @@ class TopoDS_Shape;
|
||||
//! Also supports multifile writing
|
||||
class STEPCAFControl_Writer
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
public:
|
||||
|
||||
//! Creates a writer with an empty
|
||||
|
@@ -1,6 +1,3 @@
|
||||
puts "TODO CR23671 Linux: Error"
|
||||
puts "TODO CR23671 Linux: Draw_Failure: Could not open"
|
||||
|
||||
puts "============"
|
||||
puts "CR23671"
|
||||
puts "============"
|
||||
|
16
tests/bugs/iges/bug33327
Normal file
16
tests/bugs/iges/bug33327
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "============"
|
||||
puts "0033327: Data Exchange, IGES Import - SubfigureDef can't read string"
|
||||
puts "============"
|
||||
|
||||
pload DCAF
|
||||
|
||||
Close D -silent
|
||||
|
||||
ReadIges D [locate_data_file "bug33327.igs"]
|
||||
vclear
|
||||
vinit View1
|
||||
XDisplay -dispMode 1 D
|
||||
vfit
|
||||
vdump "$imagedir/${casename}_src.png"
|
||||
|
||||
Close D
|
15
tests/bugs/modalg_7/bug33264
Normal file
15
tests/bugs/modalg_7/bug33264
Normal file
@@ -0,0 +1,15 @@
|
||||
puts "============"
|
||||
puts "0033264: Modeling Algorithms - Result of section operation is incomplete"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug33264_1.brep] srf1
|
||||
restore [locate_data_file bug33264_2.brep] srf2
|
||||
|
||||
bsection res srf1 srf2
|
||||
|
||||
checknbshapes res -vertex 44 -edge 43
|
||||
checkprops res -l 51.3377
|
||||
checksection res
|
||||
|
||||
checkview -display res -2d -path ${imagedir}/${test_image}.png
|
Reference in New Issue
Block a user