mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6231958ddc | ||
|
359edc7d8a | ||
|
f9998f03ad | ||
|
c479c4f6d8 | ||
|
c51df6bfd2 | ||
|
5e43274280 | ||
|
efe960751c | ||
|
6b9e0dc3f8 | ||
|
2ef94c994e | ||
|
1dd4b902c0 | ||
|
a846d36326 | ||
|
86e352849d | ||
|
6d140acb14 | ||
|
44be123039 |
@@ -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"
|
||||
|
@@ -3228,6 +3228,30 @@ void AIS_InteractiveContext::ClearSelected (const Standard_Boolean theToUpdateVi
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : isDetected
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveContext::isDetected (const Handle(AIS_InteractiveObject)& theObject)
|
||||
{
|
||||
for (Standard_Integer aDetIter = myDetectedSeq.Lower(); aDetIter <= myDetectedSeq.Upper(); aDetIter++)
|
||||
{
|
||||
Handle(SelectMgr_EntityOwner) aPicked = MainSelector()->Picked(myDetectedSeq(aDetIter));
|
||||
Handle(AIS_InteractiveObject) anObj;
|
||||
if (!aPicked.IsNull())
|
||||
{
|
||||
anObj = Handle(AIS_InteractiveObject)::DownCast(aPicked->Selectable());
|
||||
}
|
||||
|
||||
if (!anObj.IsNull()
|
||||
&& anObj == theObject)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSelected
|
||||
//purpose : Sets the whole object as selected and highlights it with selection color
|
||||
@@ -3288,7 +3312,8 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
|
||||
}
|
||||
|
||||
// added to avoid untimely viewer update...
|
||||
mySelection->ClearAndSelect (anOwner);
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
mySelection->ClearAndSelect (anOwner, myFilters, isDetected (anObj));
|
||||
|
||||
if (myAutoHilight)
|
||||
{
|
||||
@@ -3350,7 +3375,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
|
||||
unhighlightSelected();
|
||||
}
|
||||
|
||||
mySelection->ClearAndSelect (theOwner);
|
||||
mySelection->ClearAndSelect (theOwner, myFilters, isDetected (anObject));
|
||||
if (myAutoHilight)
|
||||
{
|
||||
Handle(Prs3d_Drawer) aCustomStyle;
|
||||
@@ -3401,16 +3426,17 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
|
||||
return;
|
||||
}
|
||||
|
||||
if (!myFilters->IsOk(theOwner) && !theOwner->IsSelected())
|
||||
if (!myFilters->IsOk (theOwner) && !theOwner->IsSelected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mySelection->Select (theOwner);
|
||||
AIS_SelectionScheme aSelScheme = theOwner->IsSelected() ? AIS_SelectionScheme_Remove : AIS_SelectionScheme_Add;
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
mySelection->Select (theOwner, myFilters, aSelScheme, isDetected (anObj));
|
||||
|
||||
if (myAutoHilight)
|
||||
{
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
|
||||
if (!aStatusPtr)
|
||||
{
|
||||
@@ -3469,7 +3495,8 @@ Standard_Boolean AIS_InteractiveContext::SetSelectedState (const Handle(SelectMg
|
||||
}
|
||||
else
|
||||
{
|
||||
const AIS_SelectStatus aSelStatus = mySelection->Select (theEntity);
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast(theEntity->Selectable());
|
||||
const AIS_SelectStatus aSelStatus = mySelection->Select (theEntity, myFilters, AIS_SelectionScheme_Remove, isDetected (anObj));
|
||||
theEntity->SetSelected (false);
|
||||
return aSelStatus == AIS_SS_Removed;
|
||||
}
|
||||
|
@@ -1302,6 +1302,9 @@ protected: //! @name internal methods
|
||||
Standard_EXPORT AIS_StatusOfDetection moveTo (const Handle(V3d_View)& theView,
|
||||
const Standard_Boolean theToRedrawOnUpdate);
|
||||
|
||||
//! Returns True if the object is detected.
|
||||
Standard_EXPORT Standard_Boolean isDetected (const Handle(AIS_InteractiveObject)& theObject);
|
||||
|
||||
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
|
||||
Standard_EXPORT void unselectOwners (const Handle(AIS_InteractiveObject)& theObject);
|
||||
|
||||
|
@@ -55,24 +55,38 @@ void AIS_Selection::Clear()
|
||||
//function : Select
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& theObject)
|
||||
AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Handle(SelectMgr_Filter)& theFilter,
|
||||
const AIS_SelectionScheme theSelScheme,
|
||||
const Standard_Boolean theIsDetected)
|
||||
{
|
||||
if (theObject.IsNull()
|
||||
|| !theObject->HasSelectable())
|
||||
if (theOwner.IsNull()
|
||||
|| !theOwner->HasSelectable())
|
||||
{
|
||||
return AIS_SS_NotDone;
|
||||
}
|
||||
|
||||
if (!myResultMap.IsBound (theObject))
|
||||
const Standard_Boolean isDetected = theIsDetected
|
||||
&& (theFilter.IsNull() || theFilter->IsOk (theOwner));
|
||||
|
||||
const Standard_Boolean wasSelected = theOwner->IsSelected();
|
||||
const Standard_Boolean toSelect = theOwner->Select (theSelScheme, isDetected);
|
||||
|
||||
if (toSelect && !wasSelected)
|
||||
{
|
||||
AIS_NListOfEntityOwner::Iterator aListIter;
|
||||
myresult.Append (theObject, aListIter);
|
||||
myResultMap.Bind (theObject, aListIter);
|
||||
theObject->SetSelected (Standard_True);
|
||||
myresult.Append (theOwner, aListIter);
|
||||
myResultMap.Bind (theOwner, aListIter);
|
||||
theOwner->SetSelected (Standard_True);
|
||||
return AIS_SS_Added;
|
||||
}
|
||||
|
||||
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theObject);
|
||||
if (!toSelect && !wasSelected)
|
||||
{
|
||||
return AIS_SS_NotDone;
|
||||
}
|
||||
|
||||
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theOwner);
|
||||
if (myIterator == aListIter)
|
||||
{
|
||||
if (myIterator.More())
|
||||
@@ -88,14 +102,14 @@ AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& the
|
||||
// In the mode of advanced mesh selection only one owner is created for all selection modes.
|
||||
// It is necessary to check the current detected entity
|
||||
// and remove the owner from map only if the detected entity is the same as previous selected (IsForcedHilight call)
|
||||
if (theObject->IsForcedHilight())
|
||||
if (theOwner->IsForcedHilight())
|
||||
{
|
||||
return AIS_SS_Added;
|
||||
}
|
||||
|
||||
myresult.Remove (aListIter);
|
||||
myResultMap.UnBind (theObject);
|
||||
theObject->SetSelected (Standard_False);
|
||||
myResultMap.UnBind (theOwner);
|
||||
theOwner->SetSelected (Standard_False);
|
||||
|
||||
// update list iterator for next object in <myresult> list if any
|
||||
if (aListIter.More())
|
||||
@@ -142,86 +156,39 @@ void AIS_Selection::SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwner
|
||||
const Standard_Boolean theToAllowSelOverlap,
|
||||
const Handle(SelectMgr_Filter)& theFilter)
|
||||
{
|
||||
(void )theToAllowSelOverlap;
|
||||
switch (theSelScheme)
|
||||
(void)theToAllowSelOverlap;
|
||||
|
||||
if (theSelScheme == AIS_SelectionScheme_ReplaceExtra
|
||||
&& thePickedOwners.Size() == myresult.Size())
|
||||
{
|
||||
case AIS_SelectionScheme_UNKNOWN:
|
||||
// If picked owners is equivalent to the selected then just clear selected.
|
||||
Standard_Boolean isTheSame = Standard_True;
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aPickedIter (thePickedOwners); aPickedIter.More(); aPickedIter.Next())
|
||||
{
|
||||
return;
|
||||
}
|
||||
case AIS_SelectionScheme_ReplaceExtra:
|
||||
{
|
||||
// If picked owners is equivalent to the selected then just clear selected
|
||||
// Else go to AIS_SelectionScheme_Replace
|
||||
if (thePickedOwners.Size() == myresult.Size())
|
||||
if (!myResultMap.IsBound (aPickedIter.Value()))
|
||||
{
|
||||
Standard_Boolean isTheSame = Standard_True;
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
if (!myResultMap.IsBound (aSelIter.Value()))
|
||||
{
|
||||
isTheSame = Standard_False;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isTheSame)
|
||||
{
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
isTheSame = Standard_False;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case AIS_SelectionScheme_Replace:
|
||||
if (isTheSame)
|
||||
{
|
||||
Clear();
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
appendOwner (aSelIter.Value(), theFilter);
|
||||
}
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
case AIS_SelectionScheme_Add:
|
||||
{
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
appendOwner (aSelIter.Value(), theFilter);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case AIS_SelectionScheme_Remove:
|
||||
{
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
if (myResultMap.IsBound (aSelIter.Value()))
|
||||
{
|
||||
Select (aSelIter.Value());
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
case AIS_SelectionScheme_XOR:
|
||||
{
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
|
||||
if (anOwner.IsNull()
|
||||
|| !anOwner->HasSelectable()
|
||||
|| !theFilter->IsOk (anOwner))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (theSelScheme == AIS_SelectionScheme_Replace
|
||||
|| theSelScheme == AIS_SelectionScheme_ReplaceExtra
|
||||
|| theSelScheme == AIS_SelectionScheme_Clear)
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
Select (anOwner);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case AIS_SelectionScheme_Clear:
|
||||
{
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aPickedIter (thePickedOwners); aPickedIter.More(); aPickedIter.Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner)& anOwner = aPickedIter.Value();
|
||||
Select (anOwner, theFilter, theSelScheme, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -34,23 +34,36 @@ public:
|
||||
|
||||
//! creates a new selection.
|
||||
Standard_EXPORT AIS_Selection();
|
||||
|
||||
|
||||
//! removes all the object of the selection.
|
||||
Standard_EXPORT virtual void Clear();
|
||||
|
||||
|
||||
//! if the object is not yet in the selection, it will be added.
|
||||
//! if the object is already in the selection, it will be removed.
|
||||
Standard_EXPORT virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theObject);
|
||||
|
||||
//! @param[in] theOwner element to change selection state
|
||||
//! @param[in] theFilter context filter
|
||||
//! @param[in] theSelScheme selection scheme
|
||||
//! @param[in] theIsDetected flag of object detection
|
||||
//! @return result of selection
|
||||
Standard_EXPORT virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Handle(SelectMgr_Filter)& theFilter,
|
||||
const AIS_SelectionScheme theSelScheme,
|
||||
const Standard_Boolean theIsDetected);
|
||||
|
||||
//! the object is always add int the selection.
|
||||
//! faster when the number of objects selected is great.
|
||||
Standard_EXPORT virtual AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
|
||||
|
||||
//! clears the selection and adds the object in the selection.
|
||||
virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject)
|
||||
//! @param[in] theObject element to change selection state
|
||||
//! @param[in] theFilter context filter
|
||||
//! @param[in] theIsDetected flag of object detection
|
||||
virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject,
|
||||
const Handle(SelectMgr_Filter)& theFilter,
|
||||
const Standard_Boolean theIsDetected)
|
||||
{
|
||||
Clear();
|
||||
Select (theObject);
|
||||
Select (theObject, theFilter, AIS_SelectionScheme_Add, theIsDetected);
|
||||
}
|
||||
|
||||
//! checks if the object is in the selection.
|
||||
|
@@ -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),
|
||||
|
@@ -34,6 +34,8 @@ public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Returns a shape built by the shape construction algorithm.
|
||||
//! Does not check if the shape is built.
|
||||
Standard_EXPORT virtual const TopoDS_Shape& Shape() Standard_OVERRIDE;
|
||||
|
||||
// Provide access to methods of protected base class BOPAlgo_Options
|
||||
|
@@ -127,6 +127,14 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
|
||||
for (ex.Init(S,TopAbs_EDGE,TopAbs_FACE); ex.More(); ex.Next())
|
||||
{
|
||||
const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
|
||||
|
||||
if (!useTriangulation && BRep_Tool::IsGeometric(E))
|
||||
{
|
||||
BC.Initialize(E);
|
||||
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Poly_Polygon3D) P3d = BRep_Tool::Polygon3D(E, l);
|
||||
if (!P3d.IsNull() && P3d->NbNodes() > 0)
|
||||
{
|
||||
@@ -143,7 +151,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
|
||||
else
|
||||
{
|
||||
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l);
|
||||
if (useTriangulation && !Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
|
||||
if (!Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
|
||||
{
|
||||
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
|
||||
nbNodes = Indices.Length();
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <ChFi3d.hxx>
|
||||
#include <LocalAnalysis_SurfaceContinuity.hxx>
|
||||
|
||||
static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
||||
const TopoDS_Vertex& aVertex,
|
||||
@@ -50,6 +51,12 @@ static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
||||
if (aVertex.IsSame(Vlast))
|
||||
TangVec.Reverse();
|
||||
}
|
||||
|
||||
static Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngTol);
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepOffset_Analyse
|
||||
//purpose :
|
||||
@@ -105,15 +112,168 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
|
||||
ConnectType = ChFiDS_Tangential;
|
||||
Standard_Boolean isTwoSplines = (aSurfType1 == GeomAbs_BSplineSurface || aSurfType1 == GeomAbs_BezierSurface) &&
|
||||
(aSurfType2 == GeomAbs_BSplineSurface || aSurfType2 == GeomAbs_BezierSurface);
|
||||
Standard_Boolean isMixedConcavity = Standard_False;
|
||||
if (isTwoSplines)
|
||||
{
|
||||
Standard_Real anAngTol = 0.1;
|
||||
isMixedConcavity = CheckMixedContinuity(E, F1, F2, anAngTol);
|
||||
}
|
||||
|
||||
if (!isMixedConcavity)
|
||||
{
|
||||
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
|
||||
{
|
||||
ConnectType = ChFiDS_Tangential;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
||||
}
|
||||
}
|
||||
else
|
||||
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
||||
{
|
||||
ConnectType = ChFiDS_Mixed;
|
||||
}
|
||||
}
|
||||
|
||||
I.Type(ConnectType);
|
||||
LI.Append(I);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : CheckMixedConcavity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngTol)
|
||||
{
|
||||
Standard_Boolean aMixedCont = Standard_False;
|
||||
GeomAbs_Shape aCurrOrder = BRep_Tool::Continuity(theEdge, theFace1, theFace2);
|
||||
if (aCurrOrder > GeomAbs_C0)
|
||||
{
|
||||
//Method BRep_Tool::Continuity(...) always returns minimal continuity between faces
|
||||
//so, if aCurrOrder > C0 it means that faces are tangent along whole edge.
|
||||
return aMixedCont;
|
||||
}
|
||||
//But we caqnnot trust result, if it is C0. because this value set by default.
|
||||
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||
|
||||
Standard_Real aFirst;
|
||||
Standard_Real aLast;
|
||||
|
||||
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||
|
||||
if (!theFace1.IsSame(theFace2) &&
|
||||
BRep_Tool::IsClosed(theEdge, theFace1) &&
|
||||
BRep_Tool::IsClosed(theEdge, theFace2))
|
||||
{
|
||||
//Find the edge in the face 1: this edge will have correct orientation
|
||||
TopoDS_Edge anEdgeInFace1;
|
||||
TopoDS_Face aFace1 = theFace1;
|
||||
aFace1.Orientation(TopAbs_FORWARD);
|
||||
TopExp_Explorer anExplo(aFace1, TopAbs_EDGE);
|
||||
for (; anExplo.More(); anExplo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(anExplo.Current());
|
||||
if (anEdge.IsSame(theEdge))
|
||||
{
|
||||
anEdgeInFace1 = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (anEdgeInFace1.IsNull())
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
aC2d1 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace1, aFirst, aLast);
|
||||
TopoDS_Face aFace2 = theFace2;
|
||||
aFace2.Orientation(TopAbs_FORWARD);
|
||||
anEdgeInFace1.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace2, aFirst, aLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
aC2d1 = BRep_Tool::CurveOnSurface(theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
{
|
||||
EE.Reverse();
|
||||
}
|
||||
aC2d2 = BRep_Tool::CurveOnSurface(EE, theFace2, aFirst, aLast);
|
||||
}
|
||||
|
||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
// Obtaining of two surfaces from adjacent faces.
|
||||
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1);
|
||||
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2);
|
||||
|
||||
if (aSurf1.IsNull() || aSurf2.IsNull())
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
Standard_Integer aNbSamples = 23;
|
||||
|
||||
// Computation of the continuity.
|
||||
Standard_Real aPar;
|
||||
Standard_Real aDelta = (aLast - aFirst) / (aNbSamples - 1);
|
||||
Standard_Integer i, istart = 1;
|
||||
Standard_Boolean isG1 = Standard_False;
|
||||
|
||||
for (i = 1, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
|
||||
{
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
|
||||
if (aCont.IsDone())
|
||||
{
|
||||
istart = i + 1;
|
||||
isG1 = aCont.IsG1();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (istart > aNbSamples / 2)
|
||||
{
|
||||
return aMixedCont;
|
||||
}
|
||||
|
||||
for (i = istart, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
|
||||
{
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
|
||||
if (!aCont.IsDone())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aCont.IsG1() == isG1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
aMixedCont = Standard_True;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return aMixedCont;
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BuildAncestors
|
||||
|
@@ -29,7 +29,8 @@ enum BRepOffset_Error
|
||||
BRepOffset_CannotTrimEdges, //!< exception while trim edges
|
||||
BRepOffset_CannotFuseVertices, //!< exception while fuse vertices
|
||||
BRepOffset_CannotExtentEdge, //!< exception while extent edges
|
||||
BRepOffset_UserBreak //!< user break
|
||||
BRepOffset_UserBreak, //!< user break
|
||||
BRepOffset_MixedConnectivity //!< Different connectivity of faces along edge: partially C0 and tangent
|
||||
};
|
||||
|
||||
#endif // _BRepOffset_Error_HeaderFile
|
||||
|
@@ -910,6 +910,19 @@ void BRepOffset_MakeOffset::MakeOffsetShape(const Message_ProgressRange& theRang
|
||||
myAnalyse.SetFaceOffsetMap (myFaceOffset);
|
||||
}
|
||||
myAnalyse.Perform(myFaceComp,TolAngle, aPS.Next(aSteps(PIOperation_Analyse)));
|
||||
TopExp_Explorer anEExp(myFaceComp, TopAbs_EDGE);
|
||||
for (; anEExp.More(); anEExp.Next())
|
||||
{
|
||||
const TopoDS_Edge& anE = TopoDS::Edge(anEExp.Current());
|
||||
const BRepOffset_ListOfInterval& aLI = myAnalyse.Type(anE);
|
||||
if (aLI.IsEmpty())
|
||||
continue;
|
||||
if (aLI.Last().Type() == ChFiDS_Mixed)
|
||||
{
|
||||
myError = BRepOffset_MixedConnectivity;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!aPS.More())
|
||||
{
|
||||
myError = BRepOffset_UserBreak;
|
||||
@@ -2960,6 +2973,36 @@ void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRa
|
||||
TopExp::Vertices(anEdge, V1, V2);
|
||||
Standard_Real aF, aL;
|
||||
const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL);
|
||||
if (V3.IsNull() && V4.IsNull())
|
||||
{
|
||||
// Initially offset edge is created without vertices.
|
||||
// Then edge is trimmed by intersection line between
|
||||
// two adjacent extended offset faces and get vertices.
|
||||
// When intersection lines are invalid for any reason,
|
||||
// (one of reson is mixed connectivity of faces)
|
||||
// algoritm of cutting offset edge by intersection line
|
||||
// can fail and offset edge cannot get vertices.
|
||||
// Follwing workaround is only to avoid exeption if V3 and V4 are Null
|
||||
// Vertex points are invalid.
|
||||
Standard_Real anOEF, anOEL;
|
||||
TopAbs_Orientation anOEOri = OE.Orientation();
|
||||
OE.Orientation(TopAbs_FORWARD);
|
||||
Handle(Geom_Curve) anOEC = BRep_Tool::Curve(OE, anOEF, anOEL);
|
||||
BRep_Builder aBB;
|
||||
gp_Pnt aP1 = anOEC->Value(aF);
|
||||
gp_Pnt aP2 = anOEC->Value(aL);
|
||||
TopoDS_Vertex anOEV1, anOEV2;
|
||||
Standard_Real aTol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2));
|
||||
aBB.MakeVertex(anOEV1, aP1, aTol);
|
||||
anOEV1.Orientation(TopAbs_FORWARD);
|
||||
aBB.MakeVertex(anOEV2, aP2, aTol);
|
||||
anOEV2.Orientation(TopAbs_REVERSED);
|
||||
aBB.Add(OE, anOEV1);
|
||||
aBB.Add(OE, anOEV2);
|
||||
aBB.Range(OE, aF, aL);
|
||||
OE.Orientation(anOEOri);
|
||||
TopExp::Vertices(OE, V4, V3);
|
||||
}
|
||||
if (!aC.IsNull() &&
|
||||
(!aC->IsClosed() && !aC->IsPeriodic()))
|
||||
{
|
||||
|
@@ -281,9 +281,11 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
|
||||
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
|
||||
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
|
||||
if (C.IsNull() && C2d.IsNull()) {
|
||||
Handle(Poly_Polygon3D) P3d = DrawTrSurf::GetPolygon3D(a[2]);
|
||||
|
||||
if (C.IsNull() && C2d.IsNull() && P3d.IsNull()) {
|
||||
//std::cout << a[2] << " is not a curve" << std::endl;
|
||||
di << a[2] << " is not a curve\n";
|
||||
di << a[2] << " is not a curve or polygon 3d\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -291,7 +293,12 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
|
||||
if (n == 3) {
|
||||
if (!C.IsNull()) edge = BRepBuilderAPI_MakeEdge(C);
|
||||
else edge = BRepBuilderAPI_MakeEdge2d(C2d);
|
||||
else if (!C2d.IsNull()) edge = BRepBuilderAPI_MakeEdge2d(C2d);
|
||||
else
|
||||
{
|
||||
BRep_Builder aBB;
|
||||
aBB.MakeEdge(edge, P3d);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Handle(Geom_Surface) S;
|
||||
|
@@ -415,6 +415,11 @@ static void reportOffsetState(Draw_Interpretor& theCommands,
|
||||
theCommands << "ERROR. Can not extent edge.";
|
||||
break;
|
||||
}
|
||||
case BRepOffset_MixedConnectivity:
|
||||
{
|
||||
theCommands << "ERROR. Mixed connectivity of faces.";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
theCommands << "ERROR. offsetperform operation not done.";
|
||||
@@ -974,7 +979,10 @@ Standard_Integer thickshell(Draw_Interpretor& theCommands,
|
||||
const BRepOffset_Error aRetCode = B.Error();
|
||||
reportOffsetState(theCommands, aRetCode);
|
||||
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
if (!B.Shape().IsNull())
|
||||
{
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1109,7 +1117,10 @@ Standard_Integer offsetshape(Draw_Interpretor& theCommands,
|
||||
const BRepOffset_Error aRetCode = B.Error();
|
||||
reportOffsetState(theCommands, aRetCode);
|
||||
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
if (!B.Shape().IsNull())
|
||||
{
|
||||
DBRep::Set(a[1], B.Shape());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -692,7 +692,6 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
else{
|
||||
sst = Spine->LastStatus();
|
||||
iedge = Spine->NbEdges();
|
||||
E[0] = Spine->Edges(iedge);
|
||||
V = Spine->LastVertex();
|
||||
}
|
||||
//Before all it is checked if the tangency is not dead.
|
||||
@@ -703,6 +702,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
}
|
||||
|
||||
if(sst == ChFiDS_BreakPoint){
|
||||
Standard_Integer aLocNbG1Connections = 0;
|
||||
TopTools_ListIteratorOfListOfShape It;//,Jt;
|
||||
Standard_Boolean sommetpourri = Standard_False;
|
||||
TopTools_IndexedMapOfOrientedShape EdgesOfV;
|
||||
@@ -720,7 +720,10 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
if (!F2.IsNull() && ChFi3d::IsTangentFaces(anEdge, F1, F2, GeomAbs_G2)) //smooth edge
|
||||
{
|
||||
if (!F1.IsSame(F2))
|
||||
{
|
||||
NbG1Connections++;
|
||||
aLocNbG1Connections++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -759,7 +762,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
||||
if (EdgesOfV.Extent() != 3)
|
||||
sommetpourri = Standard_True;
|
||||
|
||||
if(!sommetpourri){
|
||||
if(!sommetpourri && aLocNbG1Connections < 4){
|
||||
sst = ChFi3d_EdgeState(E,myEFMap);
|
||||
}
|
||||
if(ii==1)Spine->SetFirstStatus(sst);
|
||||
|
@@ -24,7 +24,8 @@ ChFiDS_Concave,
|
||||
ChFiDS_Convex,
|
||||
ChFiDS_Tangential,
|
||||
ChFiDS_FreeBound,
|
||||
ChFiDS_Other
|
||||
ChFiDS_Other,
|
||||
ChFiDS_Mixed
|
||||
};
|
||||
|
||||
#endif // _ChFiDS_TypeOfConcavity_HeaderFile
|
||||
|
@@ -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();
|
||||
|
@@ -150,7 +150,6 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
|
||||
const Standard_Integer number,
|
||||
Handle(ShapeExtend_WireData)& Gsewd)
|
||||
{
|
||||
(void)number;
|
||||
Gsewd = new ShapeExtend_WireData;//local translation (for mysewd)
|
||||
Handle(ShapeExtend_WireData) Gsewd3d = new ShapeExtend_WireData;//local translation (for mysewd3d)
|
||||
Handle(ShapeExtend_WireData) Gsewd2d = new ShapeExtend_WireData;//local translation (for mysewd2d)
|
||||
@@ -385,31 +384,17 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
|
||||
}
|
||||
}
|
||||
|
||||
if (!mysewd.IsNull())
|
||||
{
|
||||
okCurve = okCurve && Connect(saw, mysewd, Gsewd, (len3d > 1) || (len2d > 1), maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
mysewd = Gsewd;
|
||||
}
|
||||
if (!mysewd3d.IsNull())
|
||||
{
|
||||
if (number > 1) {
|
||||
okCurve = okCurve && Connect (saw, mysewd, Gsewd, (len3d > 1) || (len2d > 1), maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
okCurve3d = okCurve3d && Connect (saw3d, mysewd3d, Gsewd3d, len3d > 1, maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
mysewd3d = Gsewd3d;
|
||||
}
|
||||
if (!mysewd2d.IsNull())
|
||||
{
|
||||
okCurve2d = okCurve2d && Connect (saw2d, mysewd2d, Gsewd2d, len2d > 1, maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
mysewd = Gsewd;
|
||||
mysewd3d = Gsewd3d;
|
||||
mysewd2d = Gsewd2d;
|
||||
}
|
||||
return okCurve;
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <ShapeBuild_ReShape.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
@@ -47,6 +48,7 @@ void IGESData_VerifyDate
|
||||
IGESData_IGESModel::IGESData_IGESModel ()
|
||||
{
|
||||
thestart = new TColStd_HSequenceOfHAsciiString();
|
||||
myReShape = new ShapeBuild_ReShape();
|
||||
// thecheckstx = new Interface_Check;
|
||||
// thechecksem = new Interface_Check;
|
||||
}
|
||||
@@ -62,6 +64,7 @@ void IGESData_IGESModel::ClearHeader ()
|
||||
IGESData_GlobalSection newheader; // Un peu brutal, certes
|
||||
theheader = newheader;
|
||||
thestart = new TColStd_HSequenceOfHAsciiString();
|
||||
myReShape = new ShapeBuild_ReShape();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,10 +22,10 @@
|
||||
|
||||
class IGESData_IGESEntity;
|
||||
class Interface_Check;
|
||||
class ShapeBuild_ReShape;
|
||||
class Standard_Transient;
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
|
||||
class IGESData_IGESModel;
|
||||
DEFINE_STANDARD_HANDLE(IGESData_IGESModel, Interface_InterfaceModel)
|
||||
|
||||
@@ -151,8 +151,11 @@ public:
|
||||
//! i.e. a string "Dnn" with nn = directory entry number (2*N-1)
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
|
||||
|
||||
//! Gets ReShape used to store a model's shapes changes
|
||||
const Handle(ShapeBuild_ReShape)& ReShape() const { return myReShape; }
|
||||
|
||||
|
||||
//! Sets ReShape used to store a history of changes of the model's shapes
|
||||
void SetReShape(const Handle(ShapeBuild_ReShape)& theReShape) { myReShape = theReShape; }
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IGESData_IGESModel,Interface_InterfaceModel)
|
||||
|
||||
@@ -166,7 +169,7 @@ private:
|
||||
|
||||
Handle(TColStd_HSequenceOfHAsciiString) thestart;
|
||||
IGESData_GlobalSection theheader;
|
||||
|
||||
Handle(ShapeBuild_ReShape) myReShape;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -131,8 +131,6 @@ static void TrimTolerances (const TopoDS_Shape& shape,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Transfer
|
||||
//purpose :
|
||||
@@ -196,10 +194,11 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
|
||||
|
||||
// fixing shape
|
||||
Handle(Standard_Transient) info;
|
||||
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, theeps, CAS.GetMaxTol(),
|
||||
"read.iges.resource.name",
|
||||
"read.iges.sequence", info,
|
||||
aPS.Next());
|
||||
shape = XSAlgo::AlgoContainer()->ProcessShape(shape, theeps, CAS.GetMaxTol(),
|
||||
"read.iges.resource.name",
|
||||
"read.iges.sequence",
|
||||
info, mymodel->ReShape(),
|
||||
aPS.Next());
|
||||
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
|
||||
}
|
||||
|
||||
|
@@ -395,7 +395,7 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferLoop(const Handle(IGESSolid_Loop)& s
|
||||
Curves2d->SetValue (i, start->ParametricCurve(iedge,i));
|
||||
}
|
||||
Handle(ShapeExtend_WireData) lsewd;//result of translation of current edge
|
||||
Result = Result && IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
Result = Result & IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
curve3d, Curves2d, !orientation,
|
||||
iedge, lsewd);
|
||||
if (iedge == 1) sewd = IB->WireData();//initialization
|
||||
|
@@ -343,7 +343,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc
|
||||
//The dimensions should be also obliged:
|
||||
//[a]=[b]=[c]=L^-2
|
||||
//if ( (Abs(a-c) <= GetEpsGeom()) && (Abs(b) < GetEpsCoeff()))
|
||||
Standard_Real eps2 = (Precision::PConfusion() * Precision::PConfusion()) / GetUnitFactor();
|
||||
Standard_Real eps2 = Precision::PConfusion() * Precision::PConfusion();
|
||||
if ( (Abs(a-c) <= eps2) && (Abs(b) < eps2)) {
|
||||
|
||||
// =================
|
||||
@@ -358,8 +358,8 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc
|
||||
|
||||
t1 = ElCLib::Parameter(circ, startPoint);
|
||||
t2 = ElCLib::Parameter(circ, endPoint);
|
||||
if (t1 > t2 && (t1 - t2) > Precision::Confusion() / GetUnitFactor()) t2 += 2.*M_PI;
|
||||
if (Abs(t1 - t2) <= Precision::Confusion() / GetUnitFactor()) { // t1 = t2
|
||||
if (t1 > t2 && (t1 - t2) > Precision::Confusion()) t2 += 2.*M_PI;
|
||||
if (Abs(t1 - t2) <= Precision::Confusion()) { // t1 = t2
|
||||
Message_Msg msg1160("IGES_1160");
|
||||
SendWarning(st, msg1160);
|
||||
}
|
||||
@@ -1249,7 +1249,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferLine
|
||||
|
||||
// modif du 15/10/97 : test moins severe
|
||||
// beaucoup de points confondus a GetEpsGeom()*GetUnitFactor()
|
||||
if (!Ps.IsEqual(Pe,Precision::Confusion() / GetUnitFactor())) { //:l3 abv 11 Jan 99: GetEpsGeom()*GetUnitFactor()/10.)) {
|
||||
if (!Ps.IsEqual(Pe,Precision::Confusion())) { //:l3 abv 11 Jan 99: GetEpsGeom()*GetUnitFactor()/10.)) {
|
||||
gp_Lin line(Ps, gp_Dir(gp_Vec(Ps,Pe)));
|
||||
Standard_Real t1 = ElCLib::Parameter(line, Ps);
|
||||
Standard_Real t2 = ElCLib::Parameter(line, Pe);
|
||||
@@ -1299,7 +1299,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dLine
|
||||
start->EndPoint().Y());
|
||||
}
|
||||
|
||||
if (!beg.IsEqual(end,Precision::PConfusion() / GetUnitFactor())) { //:l3 abv 11 Jan 99: GetEpsCoeff())) {
|
||||
if (!beg.IsEqual(end,Precision::PConfusion())) { //:l3 abv 11 Jan 99: GetEpsCoeff())) {
|
||||
gp_Lin2d line2d(beg, gp_Dir2d(gp_Vec2d(beg,end)));
|
||||
Standard_Real t1 = ElCLib::Parameter(line2d, beg);
|
||||
Standard_Real t2 = ElCLib::Parameter(line2d, end);
|
||||
|
@@ -312,7 +312,7 @@ Handle(Geom_CylindricalSurface) IGESToBRep_BasicSurface::TransferRigthCylindrica
|
||||
// Direction Reading Error : Null IGESEntity
|
||||
return res;
|
||||
}
|
||||
if (radius < Precision::Confusion() / GetUnitFactor()) {
|
||||
if (radius < Precision::Confusion()) {
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ Handle(Geom_ConicalSurface) IGESToBRep_BasicSurface::TransferRigthConicalSurface
|
||||
if (radius < 0) {
|
||||
return res;
|
||||
}
|
||||
if (radius < Precision::Confusion() / GetUnitFactor())
|
||||
if (radius < Precision::Confusion())
|
||||
radius = 0.;
|
||||
|
||||
gp_Pnt Pt = Point->Value();
|
||||
@@ -427,7 +427,7 @@ Handle(Geom_SphericalSurface) IGESToBRep_BasicSurface::TransferSphericalSurface
|
||||
// Direction Reading Error : Null IGESEntity
|
||||
return res;
|
||||
}
|
||||
if (radius < Precision::Confusion() / GetUnitFactor()){
|
||||
if (radius < Precision::Confusion()){
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -483,7 +483,7 @@ Handle(Geom_ToroidalSurface) IGESToBRep_BasicSurface::TransferToroidalSurface
|
||||
// Direction Reading Error : Null IGESEntity
|
||||
return res;
|
||||
}
|
||||
if (major < Precision::Confusion() / GetUnitFactor() || minor < Precision::Confusion() / GetUnitFactor()){
|
||||
if (major < Precision::Confusion()||minor < Precision::Confusion()){
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@@ -1330,7 +1330,7 @@ TopoDS_Shape IGESToBRep_TopoCurve::TransferBoundaryOnFace(TopoDS_Face& face,
|
||||
}
|
||||
else
|
||||
Curves2d = start->ParameterCurves(i);
|
||||
Result = Result && IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
Result = Result & IB->Transfer (okCurve, okCurve3d, okCurve2d,
|
||||
start->ModelSpaceCurve(i), start->Sense(i) == 2,
|
||||
Curves2d, i);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -4692,9 +4692,16 @@ void collectRepresentationItems(const Interface_Graph& theGraph,
|
||||
const Handle(StepShape_ShapeRepresentation)& theRepresentation,
|
||||
NCollection_Sequence<Handle(StepRepr_RepresentationItem)>& theItems)
|
||||
{
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = theRepresentation->Items();
|
||||
for (Standard_Integer itemIt = aReprItems->Lower(); itemIt <= aReprItems->Upper(); itemIt++)
|
||||
theItems.Append(aReprItems->Value(itemIt));
|
||||
for (StepRepr_HArray1OfRepresentationItem::Iterator anIter(theRepresentation->Items()->Array1());
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(StepRepr_RepresentationItem)& anReprItem = anIter.Value();
|
||||
if (anReprItem.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
theItems.Append(anReprItem);
|
||||
}
|
||||
|
||||
Interface_EntityIterator entIt = theGraph.TypedSharings(theRepresentation, STANDARD_TYPE(StepRepr_RepresentationRelationship));
|
||||
for (entIt.Start(); entIt.More(); entIt.Next())
|
||||
|
@@ -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
|
||||
|
@@ -83,6 +83,51 @@ void SelectMgr_EntityOwner::HilightWithColor (const Handle(PrsMgr_PresentationMa
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Select
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean SelectMgr_EntityOwner::Select (const AIS_SelectionScheme theSelScheme,
|
||||
const Standard_Boolean theIsDetected) const
|
||||
{
|
||||
switch (theSelScheme)
|
||||
{
|
||||
case AIS_SelectionScheme_UNKNOWN:
|
||||
{
|
||||
return myIsSelected;
|
||||
}
|
||||
case AIS_SelectionScheme_Replace:
|
||||
{
|
||||
return theIsDetected;
|
||||
}
|
||||
case AIS_SelectionScheme_Add:
|
||||
{
|
||||
return !myIsSelected || theIsDetected || IsForcedHilight();
|
||||
}
|
||||
case AIS_SelectionScheme_Remove:
|
||||
{
|
||||
return myIsSelected && !theIsDetected;
|
||||
}
|
||||
case AIS_SelectionScheme_XOR:
|
||||
{
|
||||
if (theIsDetected)
|
||||
{
|
||||
return !myIsSelected && !IsForcedHilight();
|
||||
}
|
||||
return myIsSelected;
|
||||
}
|
||||
case AIS_SelectionScheme_Clear:
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
case AIS_SelectionScheme_ReplaceExtra:
|
||||
{
|
||||
return theIsDetected;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DumpJson
|
||||
// purpose :
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#ifndef _SelectMgr_EntityOwner_HeaderFile
|
||||
#define _SelectMgr_EntityOwner_HeaderFile
|
||||
|
||||
#include <AIS_SelectionScheme.hxx>
|
||||
#include <Aspect_VKey.hxx>
|
||||
#include <PrsMgr_PresentationManager.hxx>
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
@@ -139,6 +140,12 @@ public:
|
||||
//! @param theIsSelected [in] shows if owner is selected.
|
||||
void SetSelected (const Standard_Boolean theIsSelected) { myIsSelected = theIsSelected; }
|
||||
|
||||
//! If the object needs to be selected, it returns true.
|
||||
//! @param[in] theSelScheme selection scheme
|
||||
//! @param[in] theIsDetected flag of object detection
|
||||
Standard_EXPORT Standard_Boolean Select (const AIS_SelectionScheme theSelScheme,
|
||||
const Standard_Boolean theIsDetected) const;
|
||||
|
||||
//! Returns selection state.
|
||||
Standard_DEPRECATED ("Deprecated method - IsSelected() should be used instead")
|
||||
Standard_Integer State() const { return myIsSelected ? 1 : 0; }
|
||||
|
@@ -112,18 +112,20 @@ Standard_Boolean ShapeFix_Shape::Perform(const Message_ProgressRange& theProgres
|
||||
TopLoc_Location nullLoc,L;
|
||||
L = myShape.Location();
|
||||
TopoDS_Shape aShapeNullLoc = myShape;
|
||||
const Standard_Boolean aIsRecorded = Context()->IsNewShape(myShape);
|
||||
aShapeNullLoc.Location(nullLoc);
|
||||
if(myMapFixingShape.Contains(aShapeNullLoc)) {
|
||||
if(aIsRecorded || myMapFixingShape.Contains(aShapeNullLoc))
|
||||
{
|
||||
myShape.Location(L, Standard_False);
|
||||
myResult = Context()->Apply(myShape);
|
||||
status = Standard_True;
|
||||
return status;
|
||||
}
|
||||
else myMapFixingShape.Add(aShapeNullLoc);
|
||||
myMapFixingShape.Add(aShapeNullLoc);
|
||||
//---------------------------------------
|
||||
myShape.Location(L, Standard_False);
|
||||
TopoDS_Shape S = Context()->Apply(myShape);
|
||||
if ( NeedFix ( myFixVertexPositionMode ) )
|
||||
if (NeedFix(myFixVertexPositionMode))
|
||||
ShapeFix::FixVertexPosition(S,Precision(),Context());
|
||||
|
||||
st = S.ShapeType();
|
||||
|
@@ -267,7 +267,7 @@ public:
|
||||
|
||||
//! Performs an analysis and reorders edges in the wire using class WireOrder.
|
||||
//! Flag <theModeBoth> determines the use of miscible mode if necessary.
|
||||
Standard_EXPORT Standard_Boolean FixReorder(Standard_Boolean theModeBoth = Standard_False);
|
||||
Standard_EXPORT Standard_Boolean FixReorder(Standard_Boolean theModeBoth = Standard_True);
|
||||
|
||||
//! Applies FixSmall(num) to all edges in the wire
|
||||
Standard_EXPORT Standard_Integer FixSmall (const Standard_Boolean lockvtx, const Standard_Real precsmall = 0.0);
|
||||
|
@@ -174,7 +174,7 @@ void TopoDSToStep_MakeStepWire::Init (const TopoDS_Wire& aWire,
|
||||
const TopoDS_Wire ForwardWire = TopoDS::Wire (aWire.Oriented (TopAbs_FORWARD));
|
||||
Handle(ShapeFix_Wire) STW = new ShapeFix_Wire (ForwardWire, aTool.CurrentFace(), Precision::Confusion());
|
||||
// for toroidal like surfaces we need to use both (3d and 2d) mode to correctly reorder the edges
|
||||
STW->FixReorder (Standard_True);
|
||||
STW->FixReorder ();
|
||||
Handle(ShapeExtend_WireData) anExtWire = STW->WireData();
|
||||
|
||||
//:abv 04.05.00: CAX-IF TRJ4: writing complete sphere with single vertex_loop
|
||||
|
@@ -82,103 +82,131 @@ void XSAlgo_AlgoContainer::PrepareForTransfer() const
|
||||
|
||||
//=======================================================================
|
||||
//function : ProcessShape
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
|
||||
const Standard_Real Prec,
|
||||
const Standard_Real maxTol,
|
||||
const Standard_CString prscfile,
|
||||
const Standard_CString pseq,
|
||||
Handle(Standard_Transient)& info,
|
||||
const Message_ProgressRange& theProgress,
|
||||
const Standard_Boolean NonManifold) const
|
||||
TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape(const TopoDS_Shape& theShape,
|
||||
const Standard_Real thePrec,
|
||||
const Standard_Real theMaxTol,
|
||||
const Standard_CString thePrscfile,
|
||||
const Standard_CString thePseq,
|
||||
Handle(Standard_Transient)& theInfo,
|
||||
const Handle(ShapeBuild_ReShape)& theReShape,
|
||||
const Message_ProgressRange& theProgress,
|
||||
const Standard_Boolean theNonManifold) const
|
||||
{
|
||||
if ( shape.IsNull() ) return shape;
|
||||
|
||||
Handle(ShapeProcess_ShapeContext) context = Handle(ShapeProcess_ShapeContext)::DownCast(info);
|
||||
if ( context.IsNull() )
|
||||
if (theShape.IsNull())
|
||||
{
|
||||
Standard_CString rscfile = Interface_Static::CVal(prscfile);
|
||||
if (rscfile != nullptr && strlen (rscfile) == 0)
|
||||
return theShape;
|
||||
}
|
||||
|
||||
Handle(ShapeProcess_ShapeContext) aContext = Handle(ShapeProcess_ShapeContext)::DownCast(theInfo);
|
||||
if (aContext.IsNull())
|
||||
{
|
||||
Standard_CString aRscfile = Interface_Static::CVal(thePrscfile);
|
||||
if (aRscfile != nullptr && strlen(aRscfile) == 0)
|
||||
{
|
||||
context = new ShapeProcess_ShapeContext(shape, nullptr);
|
||||
Interface_Static::FillMap(context->ResourceManager()->GetMap());
|
||||
aContext = new ShapeProcess_ShapeContext(theShape, nullptr);
|
||||
Interface_Static::FillMap(aContext->ResourceManager()->GetMap());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!rscfile)
|
||||
rscfile = prscfile;
|
||||
context = new ShapeProcess_ShapeContext(shape, rscfile);
|
||||
if (!aRscfile)
|
||||
aRscfile = thePrscfile;
|
||||
aContext = new ShapeProcess_ShapeContext(theShape, aRscfile);
|
||||
}
|
||||
context->SetDetalisation(TopAbs_EDGE);
|
||||
aContext->SetDetalisation(TopAbs_EDGE);
|
||||
}
|
||||
context->SetNonManifold(NonManifold);
|
||||
info = context;
|
||||
|
||||
Standard_CString seq = Interface_Static::CVal ( pseq );
|
||||
if ( ! seq ) seq = pseq;
|
||||
|
||||
aContext->SetNonManifold(theNonManifold);
|
||||
theInfo = aContext;
|
||||
|
||||
Standard_CString aSeq = Interface_Static::CVal(thePseq);
|
||||
if (!aSeq) aSeq = thePseq;
|
||||
|
||||
// if resource file is not loaded or does not define <seq>.exec.op,
|
||||
// do default fixes
|
||||
Handle(Resource_Manager) rsc = context->ResourceManager();
|
||||
TCollection_AsciiString str ( seq );
|
||||
str += ".exec.op";
|
||||
if ( ! rsc->Find ( str.ToCString() ) ) {
|
||||
Handle(Resource_Manager) aRsc = aContext->ResourceManager();
|
||||
TCollection_AsciiString aStr(aSeq);
|
||||
aStr += ".exec.op";
|
||||
if (!aRsc->Find(aStr.ToCString()))
|
||||
{
|
||||
#ifdef OCCT_DEBUG
|
||||
{
|
||||
static Standard_Integer time = 0;
|
||||
if ( ! time )
|
||||
std::cout << "Warning: XSAlgo_AlgoContainer::ProcessShape(): Sequence " << str.ToCString() <<
|
||||
" is not defined in " << prscfile << " resource; do default processing" << std::endl;
|
||||
time++;
|
||||
static Standard_Integer aTime = 0;
|
||||
if (!aTime)
|
||||
std::cout << "Warning: XSAlgo_AlgoContainer::ProcessShape(): Sequence " << aStr.ToCString() <<
|
||||
" is not defined in " << thePrscfile << " resource; do default processing" << std::endl;
|
||||
aTime++;
|
||||
}
|
||||
#endif
|
||||
// if reading, do default ShapeFix
|
||||
if ( ! strncmp ( pseq, "read.", 5 ) ) {
|
||||
if (!strncmp(thePseq, "read.", 5))
|
||||
{
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
Handle(ShapeExtend_MsgRegistrator) msg = new ShapeExtend_MsgRegistrator;
|
||||
Handle(ShapeFix_Shape) sfs = ShapeAlgo::AlgoContainer()->ToolContainer()->FixShape();
|
||||
sfs->Init ( shape );
|
||||
sfs->SetMsgRegistrator ( msg );
|
||||
sfs->SetPrecision ( Prec );
|
||||
sfs->SetMaxTolerance ( maxTol );
|
||||
sfs->FixFaceTool()->FixWireTool()->FixSameParameterMode() = Standard_False;
|
||||
sfs->FixSolidTool()->CreateOpenSolidMode() = Standard_False;
|
||||
sfs->Perform(theProgress);
|
||||
Handle(ShapeExtend_MsgRegistrator) aMsg = new ShapeExtend_MsgRegistrator;
|
||||
Handle(ShapeFix_Shape) aSfs = ShapeAlgo::AlgoContainer()->ToolContainer()->FixShape();
|
||||
aSfs->Init(theShape);
|
||||
aSfs->SetMsgRegistrator(aMsg);
|
||||
aSfs->SetPrecision(thePrec);
|
||||
aSfs->SetMaxTolerance(theMaxTol);
|
||||
aSfs->FixFaceTool()->FixWireTool()->FixSameParameterMode() = Standard_False;
|
||||
aSfs->FixSolidTool()->CreateOpenSolidMode() = Standard_False;
|
||||
aSfs->SetContext(theReShape);
|
||||
aSfs->Perform(theProgress);
|
||||
|
||||
TopoDS_Shape S = sfs->Shape();
|
||||
if ( ! S.IsNull() && S != shape ) {
|
||||
context->RecordModification ( sfs->Context(), msg );
|
||||
context->SetResult ( S );
|
||||
}
|
||||
TopoDS_Shape aShape = aSfs->Shape();
|
||||
if (!aShape.IsNull() && aShape != theShape)
|
||||
{
|
||||
aContext->RecordModification(aSfs->Context(), aMsg);
|
||||
aContext->SetResult(aShape);
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure const& anException) {
|
||||
catch (Standard_Failure const& anException)
|
||||
{
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "Error: XSAlgo_AlgoContainer::ProcessShape(): Exception in ShapeFix::Shape" << std::endl;
|
||||
std::cout << "Error: XSAlgo_AlgoContainer::ProcessShape(): Exception in ShapeFix::Shape" << std::endl;
|
||||
anException.Print(std::cout); std::cout << std::endl;
|
||||
#endif
|
||||
(void)anException;
|
||||
(void)anException;
|
||||
}
|
||||
return context->Result();
|
||||
return aContext->Result();
|
||||
}
|
||||
// for writing, define default sequence of DirectFaces
|
||||
else if ( ! strncmp ( pseq, "write.", 6 ) ) {
|
||||
rsc->SetResource ( str.ToCString(), "DirectFaces" );
|
||||
else if (!strncmp(thePseq, "write.", 6))
|
||||
{
|
||||
aRsc->SetResource(aStr.ToCString(), "DirectFaces");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Define runtime tolerances and do Shape Processing
|
||||
rsc->SetResource ( "Runtime.Tolerance", Prec );
|
||||
rsc->SetResource ( "Runtime.MaxTolerance", maxTol );
|
||||
aRsc->SetResource("Runtime.Tolerance", thePrec);
|
||||
aRsc->SetResource("Runtime.MaxTolerance", theMaxTol);
|
||||
|
||||
if ( !ShapeProcess::Perform(context, seq, theProgress) )
|
||||
return shape; // return original shape
|
||||
if (!ShapeProcess::Perform(aContext, aSeq, theProgress))
|
||||
return theShape; // return original shape
|
||||
|
||||
return context->Result();
|
||||
return aContext->Result();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ProcessShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape(const TopoDS_Shape& theShape,
|
||||
const Standard_Real thePrec,
|
||||
const Standard_Real theMaxTol,
|
||||
const Standard_CString thePrscfile,
|
||||
const Standard_CString thePseq,
|
||||
Handle(Standard_Transient)& theInfo,
|
||||
const Message_ProgressRange& theProgress,
|
||||
const Standard_Boolean theNonManifold) const
|
||||
{
|
||||
Handle(ShapeBuild_ReShape) aReShape = new ShapeBuild_ReShape();
|
||||
return ProcessShape(theShape, thePrec, theMaxTol, thePrscfile,
|
||||
thePseq, theInfo, aReShape, theProgress,
|
||||
theNonManifold);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformFixShape
|
||||
//purpose :
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Message_ProgressRange.hxx>
|
||||
|
||||
class ShapeBuild_ReShape;
|
||||
class XSAlgo_ToolContainer;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Edge;
|
||||
@@ -30,7 +31,6 @@ class TopoDS_Face;
|
||||
class Transfer_TransientProcess;
|
||||
class Transfer_FinderProcess;
|
||||
|
||||
|
||||
class XSAlgo_AlgoContainer;
|
||||
DEFINE_STANDARD_HANDLE(XSAlgo_AlgoContainer, Standard_Transient)
|
||||
|
||||
@@ -55,16 +55,44 @@ public:
|
||||
Standard_EXPORT virtual void PrepareForTransfer() const;
|
||||
|
||||
//! Does shape processing with specified tolerances
|
||||
//! and returns resulting shape and associated information
|
||||
//! in the form of Transient.
|
||||
//! This information should be later transmitted to
|
||||
//! MergeTransferInfo in order to be recorded in the
|
||||
//! translation map
|
||||
Standard_EXPORT virtual TopoDS_Shape ProcessShape (
|
||||
const TopoDS_Shape& shape, const Standard_Real Prec, const Standard_Real MaxTol,
|
||||
const Standard_CString rscfile, const Standard_CString seq, Handle(Standard_Transient)& info,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange(),
|
||||
const Standard_Boolean NonManifold = Standard_False) const;
|
||||
//! @param[in] theShape shape to process
|
||||
//! @param[in] thePrec basic precision and tolerance
|
||||
//! @param[in] theMaxTol maximum allowed tolerance
|
||||
//! @param[in] thePrscfile name of the resource file
|
||||
//! @param[in] thePseq name of the sequence of operators defined in the resource file for Shape Processing
|
||||
//! @param[out] theInfo information to be recorded in the translation map
|
||||
//! @param[in] theProgress progress indicator
|
||||
//! @param[in] theNonManifold flag to proceed with non-manifold topology
|
||||
//! @return the processed shape
|
||||
Standard_EXPORT virtual TopoDS_Shape ProcessShape (const TopoDS_Shape& theShape,
|
||||
const Standard_Real thePrec,
|
||||
const Standard_Real theMaxTol,
|
||||
const Standard_CString thePrscfile,
|
||||
const Standard_CString thePseq,
|
||||
Handle(Standard_Transient)& theInfo,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange(),
|
||||
const Standard_Boolean theNonManifold = Standard_False) const;
|
||||
|
||||
//! Does shape processing with specified tolerances
|
||||
//! @param[in] theShape shape to process
|
||||
//! @param[in] thePrec basic precision and tolerance
|
||||
//! @param[in] theMaxTol maximum allowed tolerance
|
||||
//! @param[in] thePrscfile name of the resource file
|
||||
//! @param[in] thePseq name of the sequence of operators defined in the resource file for Shape Processing
|
||||
//! @param[out] theInfo information to be recorded in the translation map
|
||||
//! @param[in] theReShape tool to record the modifications of input shape
|
||||
//! @param[in] theProgress progress indicator
|
||||
//! @param[in] theNonManifold flag to proceed with non-manifold topology
|
||||
//! @return the processed shape
|
||||
Standard_EXPORT virtual TopoDS_Shape ProcessShape(const TopoDS_Shape& theShape,
|
||||
const Standard_Real thePrec,
|
||||
const Standard_Real theMaxTol,
|
||||
const Standard_CString thePrscfile,
|
||||
const Standard_CString thePseq,
|
||||
Handle(Standard_Transient)& theInfo,
|
||||
const Handle(ShapeBuild_ReShape)& theReShape,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange(),
|
||||
const Standard_Boolean theNonManifold = Standard_False) const;
|
||||
|
||||
//! Checks quality of pcurve of the edge on the given face,
|
||||
//! and corrects it if necessary.
|
||||
|
@@ -1,6 +1,3 @@
|
||||
puts "TODO CR23671 Linux: Error"
|
||||
puts "TODO CR23671 Linux: Draw_Failure: Could not open"
|
||||
|
||||
puts "============"
|
||||
puts "CR23671"
|
||||
puts "============"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO OCC23638 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
puts "TODO OCC23638 ALL: Faulty shapes in variables faulty_1 to faulty_1"
|
||||
|
||||
puts "============"
|
||||
puts "CR23638"
|
||||
@@ -8,8 +8,6 @@ puts ""
|
||||
# Reading IGES file produced invalid shape
|
||||
#######################################################################
|
||||
|
||||
param read.surfacecurve.mode -3
|
||||
|
||||
igesread [locate_data_file bug23638_cadbad.igs] result *
|
||||
|
||||
checkshape result
|
||||
|
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
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO OCC26556 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC26556 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
@@ -20,6 +20,7 @@ if { [catch { offsetshape result a -1 a_6 } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 1185.03
|
||||
@@ -27,3 +28,4 @@ checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,6 +1,4 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Tcl Exception:"
|
||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
@@ -25,6 +23,7 @@ if { [catch { offsetperform result } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 1185.03
|
||||
@@ -32,3 +31,4 @@ checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
puts "============"
|
||||
@@ -21,6 +23,7 @@ if { [catch { offsetperform result } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 876.584
|
||||
@@ -28,3 +31,5 @@ checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
puts "============"
|
||||
@@ -16,9 +18,12 @@ if { [catch { offsetshape result a -1 } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkprops result -s 876.584
|
||||
checkshape result
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
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
|
18
tests/bugs/modalg_8/bug33113
Normal file
18
tests/bugs/modalg_8/bug33113
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "================================"
|
||||
puts "OCC33113: Modeling Algorithms - BRepFilletAPI_MakeFillet::Build SIGSEGV"
|
||||
puts "================================"
|
||||
|
||||
restore [locate_data_file bug33113.brep] sh
|
||||
|
||||
explode sh e
|
||||
copy sh_4 e
|
||||
|
||||
explode sh So
|
||||
copy sh_1 s
|
||||
|
||||
fillet res s 0.1 e
|
||||
|
||||
checkshape res
|
||||
|
||||
checkview -display res -3d -path ${imagedir}/${test_image}.png
|
||||
|
14
tests/bugs/step/bug33331
Normal file
14
tests/bugs/step/bug33331
Normal file
@@ -0,0 +1,14 @@
|
||||
puts "===================================="
|
||||
puts "0033331: Data Exchange, Step Import - Unsupported Representation Items"
|
||||
puts "===================================="
|
||||
puts ""
|
||||
|
||||
pload DCAF
|
||||
catch {Close D}
|
||||
|
||||
param "read.stepcaf.subshapes.name" 1
|
||||
|
||||
ReadStep D [locate_data_file bug33331.stp]
|
||||
|
||||
param "read.stepcaf.subshapes.name" 0
|
||||
Close D
|
68
tests/lowalgos/bnd/bug30292
Normal file
68
tests/lowalgos/bnd/bug30292
Normal file
@@ -0,0 +1,68 @@
|
||||
puts "========"
|
||||
puts "0030292: Modeling Algorithms - BRepBndLib should avoid using Poly_Polygon3D when called with useTriangulation set to false"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
## geometric edge without any discrete representations
|
||||
|
||||
circle c 0 0 0 1
|
||||
mkedge e c
|
||||
set res1 [bounding e]
|
||||
set res2 [bounding e -noTriangulation]
|
||||
if {$res1 != $res2} {
|
||||
puts "Error: bounding boxes are different for geometric edge"
|
||||
}
|
||||
|
||||
## geometric edge with polygon 3d
|
||||
|
||||
incmesh e 0.1
|
||||
set res1_ref "-1.1000000999999999 -1.0927089740980542 -0.10000010000000001 1.1000000999999999 1.092708974098054 0.10000010000000001"
|
||||
set res2_ref "-1.0000001000000001 -1.0000001000000001 -9.9999999999999995e-08 1.0000001000000001 1.0000001000000001 9.9999999999999995e-08"
|
||||
unset res1
|
||||
set res1 [bounding e]
|
||||
foreach dd $res1 {
|
||||
if ![regexp $dd $res1_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
unset res2
|
||||
set res2 [bounding e -noTriangulation]
|
||||
foreach dd $res2 {
|
||||
if ![regexp $dd $res2_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
|
||||
## geometric edge with polygon on triangulation
|
||||
|
||||
pcylinder cyl 1 1
|
||||
incmesh cyl 0.1
|
||||
explode cyl e
|
||||
renamevar cyl_3 e
|
||||
unset res1
|
||||
set res1 [bounding e]
|
||||
foreach dd $res1 {
|
||||
if ![regexp $dd $res1_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
unset res2
|
||||
set res2 [bounding e -noTriangulation]
|
||||
foreach dd $res2 {
|
||||
if ![regexp $dd $res2_ref] {
|
||||
puts "Error: bounding box is wrong"
|
||||
}
|
||||
}
|
||||
|
||||
## not geometric edge with polygon 3d
|
||||
|
||||
polygon3d pol3d 5 1 0 0 0 1 0 -1 0 0 0 -1 0 1 0 0
|
||||
mkedge e pol3d
|
||||
unset res1
|
||||
set res1 [bounding e]
|
||||
unset res2
|
||||
set res2 [bounding e -noTriangulation]
|
||||
if {$res1 != $res2} {
|
||||
puts "Error: bounding boxes are different for not geometric edge"
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
puts "TODO OCC26030 ALL: Error : The offset cannot be built"
|
||||
puts "TODO OCC26030 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "========"
|
||||
puts "OCC26288"
|
||||
|
@@ -1,6 +1,5 @@
|
||||
puts "TODO OCC26577 All: Error : is WRONG because number of EDGE entities in shape"
|
||||
puts "TODO OCC26577 All: Error : is WRONG because number of SHELL entities in shape"
|
||||
|
||||
puts "TODO OCC26577 All: ERROR. Mixed connectivity of faces."
|
||||
puts "TODO OCC26577 All: Error : The offset cannot be built."
|
||||
|
||||
puts "=============================================================="
|
||||
puts "0027913: Sharing between edges was lost after offset operation"
|
||||
@@ -12,9 +11,11 @@ offsetparameter 1e-7 p i
|
||||
offsetload s 10
|
||||
offsetperform result
|
||||
|
||||
unifysamedom result_unif result
|
||||
if { [isdraw result] } {
|
||||
unifysamedom result_unif result
|
||||
|
||||
checkshape result
|
||||
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
|
||||
checkshape result
|
||||
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
|
||||
|
||||
checknbshapes result -ref [lrange [nbshapes s] 8 19]
|
||||
checknbshapes result -ref [lrange [nbshapes s] 8 19]
|
||||
}
|
||||
|
13
tests/offset/bugs/bug30055
Normal file
13
tests/offset/bugs/bug30055
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "REQUIRED All: ERROR. Mixed connectivity of faces."
|
||||
puts "REQUIRED All: Error : The offset cannot be built."
|
||||
puts "============"
|
||||
puts "0030055: BRepOffset_MakeOffset throws TopoDS_Vertex hasn't gp_Pnt in intersection mode"
|
||||
puts "============"
|
||||
|
||||
restore [locate_data_file bug30055.brep] a
|
||||
|
||||
thickshell result a 1 i
|
||||
|
||||
if { [isdraw result] } {
|
||||
puts "ERROR - result must not be buit"
|
||||
}
|
@@ -1,4 +1,6 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
puts "TODO OCC25925 ALL: Error : The offset cannot be built."
|
||||
|
||||
puts "============"
|
||||
puts "OCC5806"
|
||||
puts "============"
|
||||
@@ -28,11 +30,12 @@ explode resthru f
|
||||
if { [catch { offsetshape result resthru -0.5 resthru_6 resthru_7 } catch_result] } {
|
||||
puts "Faulty ${BugNumber} : offsetshape is wrong"
|
||||
}
|
||||
if { [isdraw result] } {
|
||||
checkmaxtol result -min_tol 1.
|
||||
|
||||
checkmaxtol result -min_tol 1.
|
||||
checkprops result -s 1116.06
|
||||
checkshape result
|
||||
|
||||
checkprops result -s 1116.06
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
checknbshapes result -vertex 10 -edge 15 -wire 7 -face 7 -shell 1 -solid 1 -compsolid 0 - compound 0 -shape 41
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
puts "TODO OCC23190 ALL: ERROR. C0 continuity of input data."
|
||||
puts "TODO OCC23190 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC23190 ALL: result is not a topological shape!!!"
|
||||
puts "TODO OCC23068 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC23068 ALL: Error : The offset cannot be built."
|
||||
|
||||
# Original bug : hkg60144/pro15325
|
||||
# Date : 17Juillet98
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
puts "TODO OCC23190 ALL: ERROR. C0 continuity of input data."
|
||||
puts "TODO OCC23190 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC23190 ALL: result is not a topological shape!!!"
|
||||
puts "TODO OCC23068 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC23068 ALL: Error : The offset cannot be built."
|
||||
|
||||
# Original bug : cts21271
|
||||
# Date : 11Sept98
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. Mixed connectivity of faces."
|
||||
|
||||
puts "========"
|
||||
puts "OCC26443"
|
||||
puts "========"
|
||||
@@ -15,6 +17,8 @@ offsetshape r a -2
|
||||
dchrono h stop counter offsetshape
|
||||
fit
|
||||
|
||||
if { [isdraw r] } {
|
||||
checkshape r
|
||||
checknbshapes r -ref [lrange [nbshapes a] 8 19]
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
||||
}
|
||||
|
Reference in New Issue
Block a user