View Issue Details

IDProjectCategoryView StatusLast Update
0033660Open CASCADEOCCT:Data Exchangepublic2024-09-16 23:49
Reporterichesnokova Assigned Todkulikov  
PrioritynormalSeverityminor 
Status assignedResolutionopen 
Target Version7.8.1 
Summary0033660: Data Exchange, Step Import - Adding product attributes to metadata
DescriptionNeeds to update ReadMetadata method.
Steps To ReproduceNot required
TagsNo tags attached.
Test case number

Attached Files

  • A9_Dtk.txt (440 bytes)
  • A9_Hoops.txt (247 bytes)
  • A1_Dtk.txt (1,300 bytes)
  • A1_Hoops.txt (491 bytes)
  • A3_Dtk.txt (1,043 bytes)
  • A3_Hoops.txt (439 bytes)
  • A4_Dtk.txt (19,675 bytes)
  • A4_Hoops.txt (19,051 bytes)
  • A6_Dtk.txt (1,214 bytes)
  • A6_Hoops.txt (451 bytes)

Activities

git

2024-04-01 18:23

administrator   ~0115531

Branch CR33660 has been created by ichesnokova.

SHA-1: b936aa6ed1a1ca2a34e07c6563091757104ee9fb


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.

ichesnokova

2024-04-01 18:31

developer   ~0115533

Dear dpasukhi,
please review branch CR33660.

dpasukhi

2024-04-03 19:29

administrator   ~0115565

There are new bug into Hoops are detected.
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());

git

2024-04-04 17:44

administrator   ~0115585

Branch CR33660_1 has been created by ichesnokova.

SHA-1: fdd94ff6c6d36c3c66d682448e17f4e8256b2342


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.

ichesnokova

2024-04-04 17:47

developer   ~0115587

Dear dpasukhi, remarks were fixed.
Please review branch CR33660_1.

dpasukhi

2024-04-04 19:07

administrator   ~0115592

Needs to use "const auto& aPair" I mean needs to use reference.
+        std::pair<TCollection_AsciiString, Handle(TCollection_HAsciiString)> aPair = aSeqIt.Value();
+        if (aPair.second.IsNull() || aPair.second->String().IsEmpty())
+        {

No more remarks

git

2024-04-04 20:39

administrator   ~0115593

Branch CR33660_1 has been updated forcibly by ichesnokova.

SHA-1: ade87423fedf4002b235eeadebae5b418e5463f1

dpasukhi

2024-04-10 18:20

administrator   ~0115679

Need to think about integrate this solution into OCCT.
But in that case need to think about special flag or enum for metadata

dpasukhi

2024-08-26 19:41

administrator   ~0116558

Need to verify and integrate to the master if no conflicts.

Issue History

Date Modified Username Field Change
2024-04-01 17:50 ichesnokova New Issue
2024-04-01 17:50 ichesnokova Assigned To => ichesnokova
2024-04-01 17:53 ichesnokova Summary Data Exchange - Adding product attributes to metadata => Data Exchange, Step Import - Adding product attributes to metadata
2024-04-01 18:23 git Note Added: 0115531
2024-04-01 18:31 ichesnokova Assigned To ichesnokova => dpasukhi
2024-04-01 18:31 ichesnokova Status new => resolved
2024-04-01 18:31 ichesnokova Note Added: 0115533
2024-04-03 19:29 dpasukhi Assigned To dpasukhi => ichesnokova
2024-04-03 19:29 dpasukhi Status resolved => assigned
2024-04-03 19:29 dpasukhi Note Added: 0115565
2024-04-04 17:44 git Note Added: 0115585
2024-04-04 17:47 ichesnokova Assigned To ichesnokova => dpasukhi
2024-04-04 17:47 ichesnokova Status assigned => resolved
2024-04-04 17:47 ichesnokova Note Added: 0115587
2024-04-04 19:07 dpasukhi Note Added: 0115592
2024-04-04 19:08 dpasukhi Assigned To dpasukhi => ichesnokova
2024-04-04 19:08 dpasukhi Status resolved => feedback
2024-04-04 20:39 git Note Added: 0115593
2024-04-10 18:20 dpasukhi Note Added: 0115679
2024-08-26 19:41 dpasukhi Assigned To ichesnokova => dpasukhi
2024-08-26 19:41 dpasukhi Status feedback => resolved
2024-08-26 19:41 dpasukhi Steps to Reproduce Updated
2024-08-26 19:41 dpasukhi Note Added: 0116558
2024-09-16 23:48 dpasukhi Assigned To dpasukhi => dkulikov
2024-09-16 23:48 dpasukhi Status resolved => assigned
2024-09-16 23:49 dpasukhi Project Internal => Open CASCADE