Archived issue #0033660
Data Exchange, Step Import - Adding product attributes to metadata
Description
Needs to update ReadMetadata method.
Steps to reproduce
Not required
Public activity
9 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: ichesnok
Date: Mon Apr 1 12:13:15 2024 +0100
0033660: Data Exchange, Step Import - Adding product attributes to metadata
Attributes of product was added to metadata.
[revision removed]
Detailed log of new commits:
Author: ichesnok
Date: Mon Apr 1 12:13:15 2024 +0100
0033660: Data Exchange, Step Import - Adding product attributes to metadata
Attributes of product was added to metadata.
Dear Commenter 3,
please review branch CR33660.
please review branch CR33660.
There are new bug into Hoops are detected.
No remarks about result of importing.
But there are some remarks about code.
Continue should be?
Better to rework
There always Add can be perform.
The same remarks about Add
// fill user defined attribute map
Can be optimize to use instead of isBound Seek operation and working with pointer.
Nor Bind all the time, we can work with map element directly all the time to avoid copying :)
Anything else about IsBoind then Find can be replaces just with Find :)
There more samples, please check your fix with that kind of remarks
No remarks about result of importing.
But there are some remarks about code.
Continue should be?
+ TopoDS_Shape aShape = TransferBRep::ShapeResult(aTP, aBinder); + if (aShape.IsNull()) + continue; +
Better to rework
from:
+ TDF_Label aShapeLabel;
+ if (myMap.IsBound(aShape))
+ {
+ aShapeLabel = myMap.Find(aShape);
+ }
+ if (!aShapeLabel.IsNull())
+ {
to:
+ TDF_Label aShapeLabel;
+ if (myMap.Find(aShape, aShapeLabel))
+ {
There always Add can be perform.
+ if (!aGeneralLabelMap.Contains(aShapeLabel))
+ {
+ aGeneralLabelMap.Add(aShapeLabel);
+ }
to
aGeneralLabelMap.Add(aShapeLabel);
Just bacause the code of Add already have checking for existing :)
The same remarks about Add
@@ -5134,28 +5172,78 @@ Standard_Boolean STEPCAFControl_Reader::ReadMetadata(const Handle(XSControl_Work
if (!aShapeLabel.IsNull())
{
aLabelSeq.Append(aShapeLabel);
+ if (!aGeneralLabelMap.Contains(aShapeLabel))
+ {
+ aGeneralLabelMap.Add(aShapeLabel);
+ }
// fill user defined attribute map
Can be optimize to use instead of isBound Seek operation and working with pointer.
Nor Bind all the time, we can work with map element directly all the time to avoid copying :)
Anything else about IsBoind then Find can be replaces just with Find :)
There more samples, please check your fix with that kind of remarks
+ if (anAttrMap.IsBound(aLabelIt.Value()))
+ {
+ NCollection_Sequence<Handle(StepRepr_PropertyDefinition)> anAttrib = anAttrMap.Find(aLabelIt.Value());
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: ichesnok
Date: Mon Apr 1 12:13:15 2024 +0100
0033660: Data Exchange, Step Import - Adding product attributes to metadata
Attributes of product was added to metadata.
[revision removed]
Detailed log of new commits:
Author: ichesnok
Date: Mon Apr 1 12:13:15 2024 +0100
0033660: Data Exchange, Step Import - Adding product attributes to metadata
Attributes of product was added to metadata.
Dear Commenter 3, remarks were fixed.
Please review branch CR33660_1.
Please review branch CR33660_1.
Needs to use "const auto& aPair" I mean needs to use reference.
No more remarks
+ std::pair<TCollection_AsciiString, Handle(TCollection_HAsciiString)> aPair = aSeqIt.Value();
+ if (aPair.second.IsNull() || aPair.second->String().IsEmpty())
+ {
No more remarks
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Need to think about integrate this solution into OCCT.
But in that case need to think about special flag or enum for metadata
But in that case need to think about special flag or enum for metadata
Need to verify and integrate to the master if no conflicts.