mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-21 19:00:33 +05:00
Fix for the "0020750: EDF 1296 GEOM: Naming during STEP import" issue.
This commit is contained in:
parent
311af584c2
commit
9b14149777
@ -53,6 +53,8 @@
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_ChildIDIterator.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
|
||||
@ -232,14 +234,29 @@ extern "C"
|
||||
{
|
||||
TopoDS_Shape aSub = anIndices.FindKey(isub);
|
||||
if (aSub.IsPartner(S)) {
|
||||
// create label and set shape
|
||||
TDF_Label L;
|
||||
if (enti->IsKind(tGeom)) {
|
||||
// check all named shapes using iterator
|
||||
TDF_ChildIDIterator anIt (theShapeLabel, TDataStd_Name::GetID(), Standard_True);
|
||||
for (; anIt.More(); anIt.Next()) {
|
||||
Handle(TDataStd_Name) nameAttr =
|
||||
Handle(TDataStd_Name)::DownCast(anIt.Value());
|
||||
if (nameAttr.IsNull()) continue;
|
||||
TDF_Label Lab = nameAttr->Label();
|
||||
Handle(TNaming_NamedShape) shAttr;
|
||||
if (Lab.FindAttribute(TNaming_NamedShape::GetID(), shAttr) && shAttr->Get().IsEqual(aSub))
|
||||
L = Lab;
|
||||
}
|
||||
}
|
||||
// create label and set shape
|
||||
if (L.IsNull())
|
||||
{
|
||||
TDF_TagSource aTag;
|
||||
L = aTag.NewChild(theShapeLabel);
|
||||
TNaming_Builder tnBuild (L);
|
||||
//tnBuild.Generated(S);
|
||||
tnBuild.Generated(aSub);
|
||||
|
||||
}
|
||||
// set a name
|
||||
TDataStd_Name::Set(L, aNameExt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user