]> OCCT Git - occt.git/commitdiff
Data Exchange, Step Import - Adding product attributes to metadata #315
authorDmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com>
Sat, 1 Feb 2025 17:16:21 +0000 (17:16 +0000)
committerGitHub <noreply@github.com>
Sat, 1 Feb 2025 17:16:21 +0000 (17:16 +0000)
Product attributes metadata for step files is now handled during import.
Attribute ReadProductMetadata is added to DESTEP_Parameters.
Method STEPCAFControl_Reader::ReadMetadata() is partially refactored.
Metadata tests for STEP are updated with new data.
Metadata tests for GLTF are updated with new data (since original
metadata in those tests is acquired from STEP files).

28 files changed:
src/DESTEP/DESTEP_ConfigurationNode.cxx
src/DESTEP/DESTEP_Parameters.cxx
src/DESTEP/DESTEP_Parameters.hxx
src/DESTEP/DESTEP_Provider.cxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/STEPCAFControl/STEPCAFControl_Reader.hxx
tests/de_wrapper/configuration/A3
tests/de_wrapper/configuration/A4
tests/metadata/gltf/A1
tests/metadata/gltf/A2
tests/metadata/gltf/A3
tests/metadata/gltf/A4
tests/metadata/gltf/A5
tests/metadata/gltf/A6
tests/metadata/gltf/A7
tests/metadata/gltf/A8
tests/metadata/gltf/A9
tests/metadata/gltf/end
tests/metadata/step/A1
tests/metadata/step/A2
tests/metadata/step/A3
tests/metadata/step/A4
tests/metadata/step/A5
tests/metadata/step/A6
tests/metadata/step/A7
tests/metadata/step/A8
tests/metadata/step/A9
tests/metadata/step/end

index e9e00add302d499565f74e9aed9ee88a1a484055..2a7eba8166b4e3798a42a73e0e9f9778e3e974c7 100644 (file)
@@ -142,6 +142,8 @@ bool DESTEP_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theRe
     theResource->BooleanVal("read.props", InternalParameters.ReadProps, aScope);
   InternalParameters.ReadMetadata =
     theResource->BooleanVal("read.metadata", InternalParameters.ReadMetadata, aScope);
+  InternalParameters.ReadProductMetadata =
+    theResource->BooleanVal("read.productmetadata", InternalParameters.ReadProductMetadata, aScope);
 
   InternalParameters.WritePrecisionMode =
     (DESTEP_Parameters::WriteMode_PrecisionMode)theResource->IntegerVal(
@@ -435,6 +437,13 @@ TCollection_AsciiString DESTEP_ConfigurationNode::Save() const
   aResult += aScope + "read.metadata :\t " + InternalParameters.ReadMetadata + "\n";
   aResult += "!\n";
 
+  aResult += "!\n";
+  aResult += "!Setting up the read.productmetadata parameter which is used to indicate whether to "
+             "read Product Metadata or not\n";
+  aResult += "!Default value: 0(\"OFF\"). Available values: 0(\"OFF\"), 1(\"ON\")\n";
+  aResult += aScope + "read.productmetadata :\t " + InternalParameters.ReadProductMetadata + "\n";
+  aResult += "!\n";
+
   aResult += "!\n";
   aResult += "!Write Parameters:\n";
   aResult += "!\n";
index 0dfe0bc7bd6d519d32e4516a37ae6fdb865af29c..7dceb541263f76fc01776ccd06869909966c8962 100644 (file)
@@ -55,11 +55,6 @@ void DESTEP_Parameters::InitFromStatic()
   ReadIdeas              = Interface_Static::IVal("read.step.ideas") == 1;
   ReadAllShapes          = Interface_Static::IVal("read.step.all.shapes") == 1;
   ReadRootTransformation = Interface_Static::IVal("read.step.root.transformation") == 1;
-  ReadColor              = Interface_Static::IVal("read.color") == 1;
-  ReadName               = Interface_Static::IVal("read.name") == 1;
-  ReadLayer              = Interface_Static::IVal("read.layer") == 1;
-  ReadProps              = Interface_Static::IVal("read.props") == 1;
-  ReadMetadata           = Interface_Static::IVal("read.metadata") == 1;
 
   WritePrecisionMode =
     (DESTEP_Parameters::WriteMode_PrecisionMode)Interface_Static::IVal("write.precision.mode");
index a02b35b2b85df5a536a21263eca0ee57d010bc53..58ad9ee04d3216140e182950e91db7228051e0e0 100644 (file)
@@ -181,6 +181,7 @@ public:
   bool ReadLayer = true; //<! LayerMode is used to indicate read Layers or not
   bool ReadProps = true; //<! PropsMode is used to indicate read Validation properties or not
   bool ReadMetadata = true; //! Parameter for metadata reading
+  bool ReadProductMetadata = false; //! Parameter for product metadata reading
   
   // Write
   WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //<! Specifies the mode of writing the resolution value into the STEP file
index 48bb95936d6240910742cae1628302edd08354e4..1e0bd64e6c4921b1d3cdb54ff818ff00501cc3b6 100644 (file)
@@ -69,6 +69,7 @@ bool DESTEP_Provider::Read(const TCollection_AsciiString&  thePath,
   aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
   aReader.SetPropsMode(aNode->InternalParameters.ReadProps);
   aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata);
+  aReader.SetProductMetaMode(aNode->InternalParameters.ReadProductMetadata);
   aReader.SetShapeFixParameters(aNode->ShapeFixParameters);
   IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
   DESTEP_Parameters     aParams   = aNode->InternalParameters;
index 91dc2e3915498b64fa8b947e4661fd64df0a198f..a8857e726e0cace55db2f9cb4e71523f4eed12ab 100644 (file)
@@ -761,7 +761,15 @@ Standard_Boolean STEPCAFControl_Reader::Transfer(STEPControl_Reader&
 
   // read metadata
   if (GetMetaMode())
+  {
     ReadMetadata(reader.WS(), doc, aLocalFactors);
+  }
+
+  // read product metadata
+  if (GetProductMetaMode())
+  {
+    ReadProductMetadata(reader.WS(), doc);
+  }
 
   // Expand resulting CAF structure for sub-shapes (optionally with their
   // names) if requested
@@ -5731,6 +5739,20 @@ Standard_Boolean STEPCAFControl_Reader::GetMetaMode() const
 
 //=================================================================================================
 
+void STEPCAFControl_Reader::SetProductMetaMode(const Standard_Boolean theProductMetaMode)
+{
+  myProductMetaMode = theProductMetaMode;
+}
+
+//=================================================================================================
+
+Standard_Boolean STEPCAFControl_Reader::GetProductMetaMode() const
+{
+  return myProductMetaMode;
+}
+
+//=================================================================================================
+
 void STEPCAFControl_Reader::SetSHUOMode(const Standard_Boolean mode)
 {
   mySHUOMode = mode;
@@ -5830,229 +5852,305 @@ const STEPCAFControl_Reader::ProcessingFlags& STEPCAFControl_Reader::GetShapePro
 
 //=================================================================================================
 
-Standard_Boolean STEPCAFControl_Reader::ReadMetadata(const Handle(XSControl_WorkSession)& theWS,
-                                                     const Handle(TDocStd_Document)&      theDoc,
-                                                     const StepData_Factors& theLocalFactors) const
+TDF_Label STEPCAFControl_Reader::getShapeLabelFromProductDefinition(
+  const Handle(Transfer_TransientProcess)&   theTransferProcess,
+  const Handle(StepBasic_ProductDefinition)& theProductDefinition) const
 {
-  const Handle(Interface_InterfaceModel)&  aModel = theWS->Model();
-  const Handle(XSControl_TransferReader)&  aTR    = theWS->TransferReader();
-  const Handle(Transfer_TransientProcess)& aTP    = aTR->TransientProcess();
-  Handle(XCAFDoc_ShapeTool)                aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
-  if (aSTool.IsNull())
+  TDF_Label aShapeLabel;
+
+  Handle(Transfer_Binder) aBinder = theTransferProcess->Find(theProductDefinition);
+  if (aBinder.IsNull())
   {
-    return Standard_False;
+    return aShapeLabel;
   }
 
-  Standard_Integer   aNb = aModel->NbEntities();
-  STEPConstruct_Tool aTool(theWS);
+  const TopoDS_Shape aShape = TransferBRep::ShapeResult(theTransferProcess, aBinder);
+  if (aShape.IsNull())
+  {
+    return aShapeLabel;
+  }
 
-  for (Standard_Integer anEntityInd = 1; anEntityInd <= aNb; ++anEntityInd)
+  myMap.Find(aShape, aShapeLabel);
+  return aShapeLabel;
+}
+
+//=================================================================================================
+
+Handle(StepBasic_Product) STEPCAFControl_Reader::getProductFromProductDefinition(
+  const Handle(StepBasic_ProductDefinition)& theProductDefinition) const
+{
+  Handle(StepBasic_ProductDefinitionFormation) aFormation = theProductDefinition->Formation();
+  if (aFormation.IsNull())
+  {
+    return nullptr;
+  }
+
+  return aFormation->OfProduct();
+}
+
+//=================================================================================================
+
+std::vector<Handle(StepRepr_PropertyDefinition)> STEPCAFControl_Reader::collectPropertyDefinitions(
+  const Handle(XSControl_WorkSession)& theWorkSession,
+  const Handle(Standard_Transient)&    theGeneralProperty) const
+{
+  std::vector<Handle(StepRepr_PropertyDefinition)> aResult;
+
+  Handle(StepBasic_GeneralProperty) aGeneralProp =
+    Handle(StepBasic_GeneralProperty)::DownCast(theGeneralProperty);
+  if (aGeneralProp.IsNull())
   {
-    Handle(Standard_Transient)        anEntity = aModel->Value(anEntityInd);
-    Handle(StepBasic_GeneralProperty) aGeneralProp =
-      Handle(StepBasic_GeneralProperty)::DownCast(anEntity);
-    if (aGeneralProp.IsNull())
+    return aResult;
+  }
+
+  Interface_EntityIterator aSharingListOfGP = theWorkSession->Graph().Sharings(aGeneralProp);
+  for (aSharingListOfGP.Start(); aSharingListOfGP.More(); aSharingListOfGP.Next())
+  {
+    Handle(StepBasic_GeneralPropertyAssociation) aPropAssociation =
+      Handle(StepBasic_GeneralPropertyAssociation)::DownCast(aSharingListOfGP.Value());
+    if (aPropAssociation.IsNull())
+    {
       continue;
+    }
+
+    aResult.emplace_back(aPropAssociation->PropertyDefinition());
+  }
 
-    Handle(StepBasic_GeneralPropertyAssociation)          aPropAssociation;
-    NCollection_List<Handle(StepRepr_PropertyDefinition)> aPropDefinitionList;
-    Interface_EntityIterator aSharingListOfGP = theWS->Graph().Sharings(aGeneralProp);
-    for (aSharingListOfGP.Start(); aSharingListOfGP.More(); aSharingListOfGP.Next())
+  return aResult;
+}
+
+//=================================================================================================
+
+std::vector<TDF_Label> STEPCAFControl_Reader::collectShapeLabels(
+  const Handle(XSControl_WorkSession)&       theWorkSession,
+  const Handle(Transfer_TransientProcess)&   theTransferProcess,
+  const Handle(StepRepr_PropertyDefinition)& theSource) const
+{
+  std::vector<TDF_Label> aResult;
+
+  NCollection_List<Handle(Transfer_Binder)> aBinders;
+  collectBinders(theWorkSession, theTransferProcess, theSource, aBinders);
+  if (aBinders.IsEmpty())
+  {
+    return aResult;
+  }
+
+  NCollection_List<Handle(Transfer_Binder)>::Iterator aBindIt(aBinders);
+  for (; aBindIt.More(); aBindIt.Next())
+  {
+    const TopoDS_Shape aShape = TransferBRep::ShapeResult(theTransferProcess, aBindIt.Value());
+    if (aShape.IsNull())
     {
-      aPropAssociation =
-        Handle(StepBasic_GeneralPropertyAssociation)::DownCast(aSharingListOfGP.Value());
-      if (aPropAssociation.IsNull())
-        continue;
+      continue;
+    }
 
-      aPropDefinitionList.Append(aPropAssociation->PropertyDefinition());
+    TDF_Label aShapeResultLabel;
+    if (myMap.Find(aShape, aShapeResultLabel))
+    {
+      aResult.emplace_back(aShapeResultLabel);
     }
+  }
+
+  return aResult;
+}
 
-    if (aPropDefinitionList.IsEmpty())
+//=================================================================================================
+
+std::vector<Handle(StepRepr_PropertyDefinition)> STEPCAFControl_Reader::
+  collectRelatedPropertyDefinitions(const Handle(XSControl_WorkSession)&       theWorkSession,
+                                    const Handle(StepRepr_PropertyDefinition)& theProperty) const
+{
+  std::vector<Handle(StepRepr_PropertyDefinition)> aGroupedProperties;
+  aGroupedProperties.emplace_back(theProperty);
+
+  Interface_EntityIterator aSharingsListOfPD = theWorkSession->Graph().Sharings(theProperty);
+  for (aSharingsListOfPD.Start(); aSharingsListOfPD.More(); aSharingsListOfPD.Next())
+  {
+    Handle(StepRepr_PropertyDefinitionRelationship) aRel =
+      Handle(StepRepr_PropertyDefinitionRelationship)::DownCast(aSharingsListOfPD.Value());
+    if (aRel.IsNull())
+    {
       continue;
+    }
 
-    NCollection_List<Handle(StepRepr_PropertyDefinition)>::Iterator aPropDefIter(
-      aPropDefinitionList);
-    for (; aPropDefIter.More(); aPropDefIter.Next())
+    Handle(StepRepr_PropertyDefinition) aGroupedProp = aRel->RelatedPropertyDefinition();
+    if (!aGroupedProp.IsNull())
     {
-      Handle(StepRepr_PropertyDefinition) aPropDefinition = aPropDefIter.Value();
+      aGroupedProperties.emplace_back(aGroupedProp);
+    }
+  }
 
-      // check group of PropertyDefinition
-      NCollection_List<Handle(StepRepr_PropertyDefinition)> aGroupedProperties;
-      Interface_EntityIterator aSharingsListOfPD = theWS->Graph().Sharings(aPropDefinition);
-      for (aSharingsListOfPD.Start(); aSharingsListOfPD.More(); aSharingsListOfPD.Next())
-      {
-        Handle(StepRepr_PropertyDefinitionRelationship) aRel =
-          Handle(StepRepr_PropertyDefinitionRelationship)::DownCast(aSharingsListOfPD.Value());
-        if (aRel.IsNull())
-        {
-          continue;
-        }
+  return aGroupedProperties;
+}
 
-        Handle(StepRepr_PropertyDefinition) aGroupedProp = aRel->RelatedPropertyDefinition();
-        if (!aGroupedProp.IsNull())
-        {
-          aGroupedProperties.Append(aGroupedProp);
-        }
+//=================================================================================================
+
+Handle(TDataStd_NamedData) STEPCAFControl_Reader::getNamedData(const TDF_Label& theLabel) const
+{
+  Handle(TDataStd_NamedData) anAttribute;
+  if (!theLabel.FindAttribute(TDataStd_NamedData::GetID(), anAttribute))
+  {
+    anAttribute = new TDataStd_NamedData;
+    theLabel.AddAttribute(anAttribute);
+  }
+  return anAttribute;
+}
+
+//=================================================================================================
+
+void STEPCAFControl_Reader::collectBinders(
+  const Handle(XSControl_WorkSession)&       theWorkSession,
+  const Handle(Transfer_TransientProcess)&   theTransientProcess,
+  const Handle(StepRepr_PropertyDefinition)& theSource,
+  NCollection_List<Handle(Transfer_Binder)>& theBinders) const
+{
+  Interface_EntityIterator aSharedListOfPD = theWorkSession->Graph().Shareds(theSource);
+  for (aSharedListOfPD.Start(); aSharedListOfPD.More(); aSharedListOfPD.Next())
+  {
+    // Acquire binder from StepBasic_ProductDefinition.
+    Handle(StepBasic_ProductDefinition) aProductDefinition =
+      Handle(StepBasic_ProductDefinition)::DownCast(aSharedListOfPD.Value());
+    if (!aProductDefinition.IsNull())
+    {
+      const Handle(Transfer_Binder) aBinder = theTransientProcess->Find(aProductDefinition);
+      if (!aBinder.IsNull())
+      {
+        theBinders.Append(aBinder);
       }
+      continue;
+    }
 
-      NCollection_List<Handle(Transfer_Binder)> aBinders;
-      Interface_EntityIterator aSharedListOfPD = theWS->Graph().Shareds(aPropDefinition);
-      for (aSharedListOfPD.Start(); aSharedListOfPD.More(); aSharedListOfPD.Next())
+    // Acquire binder from StepRepr_ProductDefinitionShape.
+    Handle(StepRepr_ProductDefinitionShape) aProductDefinitionShape =
+      Handle(StepRepr_ProductDefinitionShape)::DownCast(aSharedListOfPD.Value());
+    if (!aProductDefinitionShape.IsNull())
+    {
+      Handle(StepBasic_ProductDefinition) aProductDef =
+        aProductDefinitionShape->Definition().ProductDefinition();
+      const Handle(Transfer_Binder) aBinder = theTransientProcess->Find(aProductDef);
+      if (!aBinder.IsNull())
       {
-        Handle(Transfer_Binder)             aBinder;
-        Handle(StepBasic_ProductDefinition) aProductDefinition =
-          Handle(StepBasic_ProductDefinition)::DownCast(aSharedListOfPD.Value());
-        if (!aProductDefinition.IsNull())
-        {
-          aBinder = aTP->Find(aProductDefinition);
-          if (!aBinder.IsNull())
-          {
-            aBinders.Append(aBinder);
-          }
-          continue;
-        }
+        theBinders.Append(aBinder);
+      }
+      continue;
+    }
 
-        Handle(StepRepr_ProductDefinitionShape) aProductDefinitionShape =
-          Handle(StepRepr_ProductDefinitionShape)::DownCast(aSharedListOfPD.Value());
-        if (!aProductDefinitionShape.IsNull())
-        {
-          Handle(StepBasic_ProductDefinition) aProductDef =
-            aProductDefinitionShape->Definition().ProductDefinition();
-          aBinder = aTP->Find(aProductDef);
-          if (!aBinder.IsNull())
-          {
-            aBinders.Append(aBinder);
-          }
-          continue;
-        }
+    // Acquire binder from StepRepr_NextAssemblyUsageOccurrence.
+    Handle(StepRepr_NextAssemblyUsageOccurrence) aNextAssembUsOcc =
+      Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(aSharedListOfPD.Value());
+    if (!aNextAssembUsOcc.IsNull())
+    {
+      const Handle(Transfer_Binder) aBinder = theTransientProcess->Find(aNextAssembUsOcc);
+      if (!aBinder.IsNull())
+      {
+        theBinders.Append(aBinder);
+      }
+      continue;
+    }
 
-        Handle(StepRepr_NextAssemblyUsageOccurrence) aNextAssembUsOcc =
-          Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(aSharedListOfPD.Value());
-        if (!aNextAssembUsOcc.IsNull())
+    Handle(StepRepr_ShapeAspect) aShapeAspect =
+      Handle(StepRepr_ShapeAspect)::DownCast(aSharedListOfPD.Value());
+    if (!aShapeAspect.IsNull())
+    {
+      Interface_EntityIterator aSharedListOfSA = theWorkSession->Graph().Sharings(aShapeAspect);
+      for (aSharedListOfSA.Start(); aSharedListOfSA.More(); aSharedListOfSA.Next())
+      {
+        Handle(StepAP242_DraughtingModelItemAssociation) aDMIA =
+          Handle(StepAP242_DraughtingModelItemAssociation)::DownCast(aSharedListOfSA.Value());
+        if (!aDMIA.IsNull())
         {
-          aBinder = aTP->Find(aNextAssembUsOcc);
-          if (!aBinder.IsNull())
-          {
-            aBinders.Append(aBinder);
-          }
-          continue;
+          break;
         }
 
-        Handle(StepRepr_ShapeAspect) aShapeAspect =
-          Handle(StepRepr_ShapeAspect)::DownCast(aSharedListOfPD.Value());
-        if (!aShapeAspect.IsNull())
+        Handle(StepAP242_ItemIdentifiedRepresentationUsage) anItemIdentUsage =
+          Handle(StepAP242_ItemIdentifiedRepresentationUsage)::DownCast(aSharedListOfSA.Value());
+        if (!anItemIdentUsage.IsNull())
         {
-          TDF_Label aLabel;
-          if (!aBinder.IsNull())
+          for (Standard_Integer anIndex = 1; anIndex <= anItemIdentUsage->NbIdentifiedItem();
+               ++anIndex)
           {
-            TopoDS_Shape aShape = TransferBRep::ShapeResult(aTP, aBinder);
-            if (aShape.IsNull())
+            Handle(StepRepr_RepresentationItem) aReprItem =
+              anItemIdentUsage->IdentifiedItemValue(anIndex);
+            if (aReprItem.IsNull())
+            {
               continue;
+            }
 
-            if (myMap.IsBound(aShape))
+            const Handle(Transfer_Binder) aBinder = theTransientProcess->Find(aReprItem);
+            if (!aBinder.IsNull())
             {
-              aLabel = myMap.Find(aShape);
+              theBinders.Append(aBinder);
             }
           }
-          Interface_EntityIterator aSharedListOfSA = theWS->Graph().Sharings(aShapeAspect);
-          for (aSharedListOfSA.Start(); aSharedListOfSA.More(); aSharedListOfSA.Next())
-          {
-            Handle(StepAP242_DraughtingModelItemAssociation) aDMIA =
-              Handle(StepAP242_DraughtingModelItemAssociation)::DownCast(aSharedListOfSA.Value());
-            if (!aDMIA.IsNull())
-              break;
-
-            Handle(StepAP242_ItemIdentifiedRepresentationUsage) anItemIdentUsage =
-              Handle(StepAP242_ItemIdentifiedRepresentationUsage)::DownCast(
-                aSharedListOfSA.Value());
-            if (!anItemIdentUsage.IsNull())
-            {
-              for (Standard_Integer anIndex = 1; anIndex <= anItemIdentUsage->NbIdentifiedItem();
-                   ++anIndex)
-              {
-                Handle(StepRepr_RepresentationItem) aReprItem =
-                  anItemIdentUsage->IdentifiedItemValue(anIndex);
-                if (aReprItem.IsNull())
-                  continue;
-                aBinder = aTP->Find(aReprItem);
-                if (!aBinder.IsNull())
-                {
-                  aBinders.Append(aBinder);
-                }
-              }
-              continue;
-            }
+          continue;
+        }
 
-            Handle(StepRepr_PropertyDefinition) aPropDef =
-              Handle(StepRepr_PropertyDefinition)::DownCast(aSharedListOfSA.Value());
-            if (!aPropDef.IsNull() && aPropDef != aPropDefinition)
+        Handle(StepRepr_PropertyDefinition) aPropDef =
+          Handle(StepRepr_PropertyDefinition)::DownCast(aSharedListOfSA.Value());
+        if (!aPropDef.IsNull() && aPropDef != theSource)
+        {
+          Interface_EntityIterator aSharingListOfPD = theWorkSession->Graph().Sharings(aPropDef);
+          for (aSharingListOfPD.Start(); aSharingListOfPD.More(); aSharingListOfPD.Next())
+          {
+            Handle(StepShape_ShapeDefinitionRepresentation) aShDef =
+              Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(aSharingListOfPD.Value());
+            if (aShDef.IsNull())
             {
-              Interface_EntityIterator aSharingListOfPD = theWS->Graph().Sharings(aPropDef);
-              for (aSharingListOfPD.Start(); aSharingListOfPD.More(); aSharingListOfPD.Next())
-              {
-                Handle(StepShape_ShapeDefinitionRepresentation) aShDef =
-                  Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(
-                    aSharingListOfPD.Value());
-                if (aShDef.IsNull())
-                  continue;
-
-                findReprItems(theWS, aShDef, aBinders);
-              }
               continue;
             }
 
-            Handle(StepShape_ShapeDefinitionRepresentation) aShapeDefRepr =
-              Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(aSharedListOfSA.Value());
-            if (!aShapeDefRepr.IsNull())
-            {
-              findReprItems(theWS, aShapeDefRepr, aBinders);
-            }
+            findReprItems(theWorkSession, aShDef, theBinders);
           }
-        }
-      }
-
-      if (aBinders.IsEmpty())
-        continue;
-
-      TDF_LabelSequence                                   aLabelSeq;
-      NCollection_List<Handle(Transfer_Binder)>::Iterator aBindIt(aBinders);
-      for (; aBindIt.More(); aBindIt.Next())
-      {
-        TopoDS_Shape aShape = TransferBRep::ShapeResult(aTP, aBindIt.Value());
-        if (aShape.IsNull())
           continue;
-
-        TDF_Label aShapeLabel;
-        if (myMap.IsBound(aShape))
-        {
-          aShapeLabel = myMap.Find(aShape);
         }
-        if (!aShapeLabel.IsNull())
+
+        Handle(StepShape_ShapeDefinitionRepresentation) aShapeDefRepr =
+          Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(aSharedListOfSA.Value());
+        if (!aShapeDefRepr.IsNull())
         {
-          aLabelSeq.Append(aShapeLabel);
+          findReprItems(theWorkSession, aShapeDefRepr, theBinders);
         }
       }
+    }
+  }
+}
+
+//=================================================================================================
+
+Standard_Boolean STEPCAFControl_Reader::ReadMetadata(const Handle(XSControl_WorkSession)& theWS,
+                                                     const Handle(TDocStd_Document)&      theDoc,
+                                                     const StepData_Factors& theLocalFactors) const
+{
+  if (XCAFDoc_DocumentTool::ShapeTool(theDoc->Main()).IsNull())
+  {
+    return Standard_False;
+  }
 
-      // create metadata
-      for (TDF_LabelSequence::Iterator aLabelIt(aLabelSeq); aLabelIt.More(); aLabelIt.Next())
+  const Handle(Interface_InterfaceModel)&  aModel = theWS->Model();
+  const Handle(Transfer_TransientProcess)& aTransientProcess =
+    theWS->TransferReader()->TransientProcess();
+
+  for (Standard_Integer anEntityInd = 1; anEntityInd <= aModel->NbEntities(); ++anEntityInd)
+  {
+    for (const auto& aPropertyDefinition :
+         collectPropertyDefinitions(theWS, aModel->Value(anEntityInd)))
+    {
+      // Collect all the related PropertyDefinitions.
+      const std::vector<Handle(StepRepr_PropertyDefinition)> aGroupedProperties =
+        collectRelatedPropertyDefinitions(theWS, aPropertyDefinition);
+
+      // Collect all the shapes labels.
+      const std::vector<TDF_Label> aLabels =
+        collectShapeLabels(theWS, aTransientProcess, aPropertyDefinition);
+
+      // Fill all atributes for each shape label.
+      for (const auto& aLabel : aLabels)
       {
-        TDF_Label                  aLabel = aLabelIt.Value();
-        Handle(TDataStd_NamedData) anAttr;
-        if (!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAttr))
-        {
-          anAttr = new TDataStd_NamedData;
-          aLabel.AddAttribute(anAttr);
-        }
+        Handle(TDataStd_NamedData) anAttribute = getNamedData(aLabel);
 
-        fillAttributes(theWS, aPropDefinition, theLocalFactors, anAttr);
-        if (!aGroupedProperties.IsEmpty())
+        for (const auto& aPropDefinition : aGroupedProperties)
         {
-          NCollection_List<Handle(StepRepr_PropertyDefinition)>::Iterator aPropIt(
-            aGroupedProperties);
-          for (; aPropIt.More(); aPropIt.Next())
-          {
-            fillAttributes(theWS, aPropIt.Value(), theLocalFactors, anAttr);
-          }
+          fillAttributes(theWS, aPropDefinition, theLocalFactors, anAttribute);
         }
       }
     }
@@ -6063,6 +6161,68 @@ Standard_Boolean STEPCAFControl_Reader::ReadMetadata(const Handle(XSControl_Work
 
 //=================================================================================================
 
+Standard_Boolean STEPCAFControl_Reader::ReadProductMetadata(
+  const Handle(XSControl_WorkSession)& theWS,
+  const Handle(TDocStd_Document)&      theDoc) const
+{
+  if (XCAFDoc_DocumentTool::ShapeTool(theDoc->Main()).IsNull())
+  {
+    return Standard_False;
+  }
+
+  const Handle(Interface_InterfaceModel)&  aModel = theWS->Model();
+  const Handle(Transfer_TransientProcess)& aTransientProcess =
+    theWS->TransferReader()->TransientProcess();
+
+  for (Standard_Integer anEntityInd = 1; anEntityInd <= aModel->NbEntities(); ++anEntityInd)
+  {
+    // Processing only StepBasic_ProductDefinition entities.
+    const Handle(StepBasic_ProductDefinition) aProdDefinition =
+      Handle(StepBasic_ProductDefinition)::DownCast(aModel->Value(anEntityInd));
+    if (aProdDefinition.IsNull())
+    {
+      continue;
+    }
+
+    // Prepare required data for processing: ShapeLabel and Product entity.
+    const TDF_Label aShapeLabel =
+      getShapeLabelFromProductDefinition(aTransientProcess, aProdDefinition);
+    if (aShapeLabel.IsNull())
+    {
+      continue;
+    }
+    const Handle(StepBasic_Product) aProduct = getProductFromProductDefinition(aProdDefinition);
+    if (aProduct.IsNull())
+    {
+      continue;
+    }
+
+    // Find or create NamedData attribute for ShapeLabel.
+    Handle(TDataStd_NamedData) anAttribute = getNamedData(aShapeLabel);
+    // Fill NamedData attribute with product metadata.
+    if (aProduct->Id() && !aProduct->Id()->String().IsEmpty())
+    {
+      anAttribute->SetString("ProductID", aProduct->Id()->String());
+    }
+    if (aProduct->Name() && !aProduct->Name()->String().IsEmpty())
+    {
+      anAttribute->SetString("ProductName", aProduct->Name()->String());
+    }
+    if (aProduct->Description() && !aProduct->Description()->String().IsEmpty())
+    {
+      anAttribute->SetString("Description", aProduct->Description()->String());
+    }
+    if (aProdDefinition->Description() && !aProdDefinition->Description()->String().IsEmpty())
+    {
+      anAttribute->SetString("ProductDefinition", aProdDefinition->Description()->String());
+    }
+  }
+
+  return true;
+}
+
+//=================================================================================================
+
 Standard_Boolean STEPCAFControl_Reader::findReprItems(
   const Handle(XSControl_WorkSession)&                   theWS,
   const Handle(StepShape_ShapeDefinitionRepresentation)& theShDefRepr,
index 2eec37ec93359e349b0cf539759f31460b70c84a..b1a6562cc55fc75cc5443c5347f2dde5651c70ac 100644 (file)
@@ -37,6 +37,7 @@ class XCAFDoc_ShapeTool;
 class StepRepr_RepresentationItem;
 class Transfer_TransientProcess;
 class StepBasic_NamedUnit;
+class StepBasic_Product;
 class StepShape_ConnectedFaceSet;
 class StepShape_ShapeDefinitionRepresentation;
 class StepRepr_NextAssemblyUsageOccurrence;
@@ -199,6 +200,11 @@ public:
 
   Standard_EXPORT Standard_Boolean GetMetaMode() const;
 
+  //! MetaMode for indicate whether to read Product Metadata or not.
+  Standard_EXPORT void SetProductMetaMode(const Standard_Boolean theProductMetaMode);
+
+  Standard_EXPORT Standard_Boolean GetProductMetaMode() const;
+
   //! Set SHUO mode for indicate write SHUO or not.
   Standard_EXPORT void SetSHUOMode(const Standard_Boolean shuomode);
 
@@ -316,6 +322,10 @@ protected:
                  const Handle(TDocStd_Document)&      theDoc,
                  const StepData_Factors&              theLocalFactors = StepData_Factors()) const;
 
+  Standard_EXPORT Standard_Boolean
+    ReadProductMetadata(const Handle(XSControl_WorkSession)& theWS,
+                        const Handle(TDocStd_Document)&      theDoc) const;
+
   //! Reads layers of parts defined in the STEP model and
   //! set reference between shape and layers in the DECAF document
   Standard_EXPORT Standard_Boolean ReadLayers(const Handle(XSControl_WorkSession)& WS,
@@ -435,6 +445,62 @@ private:
                                   const StepData_Factors&                    theLocalFactors,
                                   Handle(TDataStd_NamedData)&                theAttr) const;
 
+  //! Returns the label of the shape associated with the given product definition.
+  //! @param theTransferProcess The transfer process to use for finding the label.
+  //! @param theProductDefinition The product definition for which to find the label.
+  //! @return The label of the shape associated with the given product definition.
+  TDF_Label getShapeLabelFromProductDefinition(
+    const Handle(Transfer_TransientProcess)&   theTransferProcess,
+    const Handle(StepBasic_ProductDefinition)& theProductDefinition) const;
+
+  //! Returns the product associated with the given product definition.
+  //! @param theProductDefinition The product definition for which to get the product.
+  //! @return The product associated with the given product definition.
+  Handle(StepBasic_Product) getProductFromProductDefinition(
+    const Handle(StepBasic_ProductDefinition)& theProductDefinition) const;
+
+  //! Collects property definitions from the given general property and stores them in a vector.
+  //! @param theWorkSession The work session to use for collecting property definitions.
+  //! @param theGeneralProperty The general property from which to collect property definitions.
+  //! @return A vector of collected property definitions.
+  std::vector<Handle(StepRepr_PropertyDefinition)> collectPropertyDefinitions(
+    const Handle(XSControl_WorkSession)& theWorkSession,
+    const Handle(Standard_Transient)&    theGeneralProperty) const;
+
+  //! Collects shape labels from the given property definition.
+  //! @param theWorkSession The work session to use for collecting shape labels.
+  //! @param theTransferProcess The transfer process to use for collecting shape labels.
+  //! @param theSource The property definition from which to collect shape labels.
+  //! @return A vector of collected shape labels.
+  std::vector<TDF_Label> collectShapeLabels(
+    const Handle(XSControl_WorkSession)&       theWorkSession,
+    const Handle(Transfer_TransientProcess)&   theTransferProcess,
+    const Handle(StepRepr_PropertyDefinition)& theSource) const;
+
+  //! Collects a group of related property definitions from the given property definition.
+  //! @p theProperty itself will be added to the result as well.
+  //! @param theWorkSession The work session to use for collecting related property definitions.
+  //! @param theProperty The property definition from which to collect related property definitions.
+  //! @return A vector of collected related property definitions.
+  std::vector<Handle(StepRepr_PropertyDefinition)> collectRelatedPropertyDefinitions(
+    const Handle(XSControl_WorkSession)&       theWorkSession,
+    const Handle(StepRepr_PropertyDefinition)& theProperty) const;
+
+  //! Helper method to get NamedData attribute assigned to the given label.
+  //! @param theLabel The label to get NamedData attribute from.
+  //! @return Handle to the NamedData attribute. Guarantees that the attribute is never null.
+  Handle(TDataStd_NamedData) getNamedData(const TDF_Label& theLabel) const;
+
+  //! Collects binders from the given property definition and stores them in the binder list.
+  //! @param theWorkSession The work session to use for collecting binders.
+  //! @param theTransientProcess The transient process to use for collecting binders.
+  //! @param theSource The property definition from which to collect binders.
+  //! @param theBinders The list to store the collected binders.
+  void collectBinders(const Handle(XSControl_WorkSession)&       theWorkSession,
+                      const Handle(Transfer_TransientProcess)&   theTransientProcess,
+                      const Handle(StepRepr_PropertyDefinition)& theSource,
+                      NCollection_List<Handle(Transfer_Binder)>& theBinders) const;
+
 private:
   STEPControl_Reader                                                              myReader;
   NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
@@ -444,6 +510,7 @@ private:
   Standard_Boolean                                                                myLayerMode;
   Standard_Boolean                                                                myPropsMode;
   Standard_Boolean                                                                myMetaMode;
+  Standard_Boolean                                                                myProductMetaMode;
   Standard_Boolean                                                                mySHUOMode;
   Standard_Boolean                                                                myGDTMode;
   Standard_Boolean                                                                myMatMode;
index e026ca550be25678db29d50cbc2d5027aba522fb..32f76755f83c1b8f72bd9f067ed3fb0609bf66fb 100644 (file)
@@ -178,6 +178,7 @@ provider.STEP.OCC.read.name :        1
 provider.STEP.OCC.read.layer :  1
 provider.STEP.OCC.read.props :  1
 provider.STEP.OCC.read.metadata :       1
+provider.STEP.OCC.read.productmetadata :        0
 provider.STEP.OCC.write.precision.mode :        0
 provider.STEP.OCC.write.precision.val :         0.0001
 provider.STEP.OCC.write.assembly :      2
index ef54dc7034971b4802e153756ad0ea1960dd4112..08fe236b290cc4546f920a8e282b9e52a7ed8b5c 100644 (file)
@@ -123,6 +123,7 @@ provider.STEP.OCC.read.name :        1
 provider.STEP.OCC.read.layer :  1
 provider.STEP.OCC.read.props :  1
 provider.STEP.OCC.read.metadata :       1
+provider.STEP.OCC.read.productmetadata :        0
 provider.STEP.OCC.write.precision.mode :        0
 provider.STEP.OCC.write.precision.val :         0.0001
 provider.STEP.OCC.write.assembly :      2
index efd60d443ee0a25999a6eaec570a2f01eb58884d..0f3c3619989167f35de679b5421328d4d7f606f5 100644 (file)
@@ -1,9 +1,12 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename bug28345_30338.stp
-set ref_size 5896
+set ref_size 6292
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
 H_CIP : 55.545955351400004
+ProductID : MVE0300X02S030_ASM
+ProductName : MVE0300X02S030_ASM
+Description : NOT SPECIFIED
 Property for [0:1:1:1:1]:
 H : 45
 E : 55
@@ -15,6 +18,9 @@ C : 140
 F : 0.29999999999999999
 DESCRIPTION : 
 MODELED_BY : 
+ProductID : CUT_MVE0300X02S030
+ProductName : CUT_MVE0300X02S030
+Description : NOT SPECIFIED
 Property for [0:1:1:1:2]:
 H : 45
 E : 55
@@ -26,4 +32,7 @@ C : 140
 F : 0.29999999999999999
 DESCRIPTION : 
 MODELED_BY : 
+ProductID : NOCUT_MVE0300X02S030
+ProductName : NOCUT_MVE0300X02S030
+Description : NOT SPECIFIED
 }
index e07d96524924c14eac09b75dc13972d77d46dce9..732c1f077120786d0a4b5b6317ee1e69d77f54f5 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename bug28389_CONFIDENTIAL_SHEET_METAL_F3D.stp
-set ref_size 86278
+set ref_size 86338
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
 yCenterOfGravity : 0.1148447698
@@ -23,4 +23,5 @@ Iyx : 2.044e-07
 OriginX : 0
 OriginZ : 0
 JoggleFormula : 
+ProductID : SHEET METAL F3D
 }
index d805b6e69d6bd212df31e87ef07c22e97c808550..8db299a681e86a2cb2b341db7d68e26cfaa794c5 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename bug28444_nist_ftc_06_asme1_ct5240_rd.stp
-set ref_size 85383
+set ref_size 85605
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
 yCenterOfGravity : 0.0289950044
@@ -20,4 +20,6 @@ Ixx : 2.16819e-05
 Izy : -1.3068999999999999e-06
 Mass : 3.3238733752999998
 Iyx : 0
+ProductID : NIST PMI FTC 06 ASME1
+Description : NIST PMI test model downloaded from http://go.usa.gov/mGVm
 }
index a7f84629fba7cf1f2dbca83e8e4b2196843b181b..3a89e74c07f27cc90ee675019f7cb10e4dc6f0c5 100644 (file)
@@ -1,4 +1,4 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename bug29525_rev_part_neu_01.prt_converted_from_datakit.stp
-set ref_size 80996
+set ref_size 81056
 set check_metadata 0
index cb88744ec0f4196036f4407ab47a60564d02c6a9..0702b8591378fa1a71af24be00aabfedb55066fb 100644 (file)
@@ -1,10 +1,11 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename bug29633_nist_ctc_05_asme1_ap242-1.stp
-set ref_size 69902
+set ref_size 70034
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
 FILESIZE : 1495040
 GDT_STANDARD : 5302
+ProductID : nist_ctc_05_asme1
 MaterialMultipleAssigned : FALSE
 ATTR_VERSION : 18.3.001
 FILESAVETIME : Tue Dec 09 03:47:24 2014
@@ -12,6 +13,7 @@ Part Number : NIST PMI CTC 05 ASME1
 Revision : D
 CAD_SOURCE : ug
 MTIME : 1418096844
+ProductName : nist_ctc_05_asme1
 MaterialMissingAssignments : TRUE
 FILENAME : nist_ctc_05_asme1.prt
 Description : NIST PMI test model downloaded from http://go.usa.gov/mGVm
index fafd4bd210ad468c560a3d363c947bc35c20ee99..62fbe8e9c42cbb4ed1b99c627e73bc8971d9eb26 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename bug29803.stp
-set ref_size 17032
+set ref_size 17176
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
 OUT_MASS : 50.813477444850157
@@ -28,6 +28,7 @@ SS_FLANGE : NO
 MODELED_BY : LSD
 STANDARD_BODY_DIA : Y
 DEEP_HOLE_WEBSITE : 
+ProductID : Tool1
 ITEM_NUM : HOLDER
 LENGTH : STUB
 FINISH : BLACK OXIDE
@@ -36,6 +37,8 @@ SHANK_IM : M
 FLUTE : STRAIGHT
 SHANK : ER
 MATERIAL : STEEL
+ProductName : Tool1
+Description : NOT SPECIFIED
 SERIES : Y
 DEEP_HOLE_NOTES : 
 }
index e45618c83ecec0de514510bd68dfce330cfd981b..163cf41daa9557f6968ce43a876849b477af139d 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename sp7_04-do-242.stp
-set ref_size 224779
+set ref_size 224869
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
 PRO_MP_ALT_COGX : - >
@@ -224,6 +224,7 @@ PRO_MP_VOLUME : - >
 PRO_MP_ALT_IXX DESIGNATED : NO
 MP_DENSITY ACCESS : Full
 PRO_MP_TRF_21 ACCESS : Locked
+ProductID : NIST_CTC_04_ASME1_RD_CR4050_RA
 PRO_MP_ALT_IYY : - >
 PRO_MP_TRF_41 DESCRIPTION : NULL
 PRO_MP_ALT_MASS DESCRIPTION : NULL
index cdb51b5f41a9a39e8d934093a71bfba9468de1d6..662b840029d9e8f516122fa6ab69253e7cc8bf45 100644 (file)
@@ -1,6 +1,6 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename bug32087_part.stp
-set ref_size 15789
+set ref_size 15921
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
 SETUP_PART : 0
@@ -17,6 +17,7 @@ MODEL_3D_APPROVED_BY :
 MODEL_3D_CAD_SYSTEM : 
 PART_NAME : 
 MODEL_3D_CHECKED_BY : 
+ProductID : Block
 OWNER : 
 COPYRIGHT : 
 WORK_ORDER_NUMBER : 
@@ -28,6 +29,7 @@ TREATMENT :
 MODEL_3D_CREATED_BY : 
 UNIT_SYSTEM : 
 MODEL_3D_DATE_OF_ISSUE : 
+ProductDefinition :  
 WELD_TOLERANCES : 
 PROJECT : 
 LANGUAGE : 
@@ -61,6 +63,7 @@ REFERENCE_DESIGNATION+ :
 MODEL_3D_ID_NUMBER : 
 PART_NOTE : 
 WELD_PREPARATION : 
+Description : Block
 MODEL_3D_RELEASED_DATE : 
 MODEL_3D_REPLACES : 
 PAINT_SURFACE : 
index b99ad90904bac86acc1b027cf44b9153983c89fc..601fb383df08f28f8e4d4bc3413e0d03fba7317a 100644 (file)
@@ -1,9 +1,12 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 set filename nist_ftc_08_asme1_ap242-2.stp
-set ref_size 118200
+set ref_size 118396
 set check_metadata 1
 set ref_metadata {Property for [0:1:1:1]:
+ProductID : NIST PMI FTC 08 ASME1
+ProductDefinition :  
 Revision : C
 PartNumber : NIST PMI FTC 08 ASME1
 DescriptionRef : NIST PMI test model downloaded from http://go.usa.gov/mGVm
+ProductName : NIST PMI FTC 08 ASME1
 }
index 0e571bcd5fc9694c45e9691a92c6a02d8414c35b..ff03351666a6fa3ae7d13f0d2abff0af0bfe8572 100644 (file)
@@ -2,10 +2,12 @@
 # used as reference. In this mode all tests intentionally report failure. 
 set dump_file 0
 
+set conf "provider.STEP.OCC.read.productmetadata : 1"
+
 # Read original file
 if { [string length $filename] > 1} {
   set path_file [locate_data_file $filename]
-  if { [catch { ReadFile aDocExport $path_file } catch_result] } {
+  if { [catch { ReadFile aDocExport $path_file -conf $conf } catch_result] } {
     set err_msg "Error: file was not read - exception "
     puts $err_msg
   }
index 5f59f47d5608b756409d9e6f8cd6e801865827f9..8521d66daf0ec2c7e09f08eff8db114634866b8f 100644 (file)
@@ -4,6 +4,9 @@ set filename bug28345_30338.stp
 set ref_data {
 Property for [0:1:1:1]:
 H_CIP : 55.545955351400004
+ProductID : MVE0300X02S030_ASM
+ProductName : MVE0300X02S030_ASM
+Description : NOT SPECIFIED
 Property for [0:1:1:2]:
 H : 45
 E : 55
@@ -15,6 +18,9 @@ C : 140
 F : 0.29999999999999999
 DESCRIPTION : 
 MODELED_BY : 
+ProductID : CUT_MVE0300X02S030
+ProductName : CUT_MVE0300X02S030
+Description : NOT SPECIFIED
 Property for [0:1:1:3]:
 H : 45
 E : 55
@@ -26,5 +32,8 @@ C : 140
 F : 0.29999999999999999
 DESCRIPTION : 
 MODELED_BY : 
+ProductID : NOCUT_MVE0300X02S030
+ProductName : NOCUT_MVE0300X02S030
+Description : NOT SPECIFIED
 
 }
index c790ff46ff8e725b101ebfda5c060af2f998a9e8..d4f0cf9c370a044de772a4f122246442f4e1640e 100644 (file)
@@ -23,5 +23,6 @@ Iyx : 2.044e-07
 OriginX : 0
 OriginZ : 0
 JoggleFormula : 
+ProductID : SHEET METAL F3D
 
 }
index 46f6de2315fc0eeebf9231944f38926f87119607..18baf5030fb5d9e5aa9374994502715b642c575d 100644 (file)
@@ -20,5 +20,7 @@ Ixx : 2.16819e-05
 Izy : -1.3068999999999999e-06
 Mass : 3.3238733752999998
 Iyx : 0
+ProductID : NIST PMI FTC 06 ASME1
+Description : NIST PMI test model downloaded from http://go.usa.gov/mGVm
 
 }
index 3b4e1d1dc5cb4407ae544804cc6719f289ce62bf..9b55f2f3013cc36abf1e96b8f594d3d23da03653 100644 (file)
@@ -594,6 +594,7 @@ D_DOCNR DESCRIPTION : NULL
 D_MATERIAL : -
 PROI_CREATED_BY : 
 PRO_MP_TRF_21 ACCESS : Locked
+ProductID : REV_PART_NEU_01
 PRO_MP_ALT_IYY : ->
 PRO_MP_TRF_41 DESCRIPTION : NULL
 PTC_WM_REVISION DESIGNATED : NO
index e06628ac5e4af023960a49359a554e611361e637..68c6f2531124d603ec10c816ee71ef936733b9f3 100644 (file)
@@ -5,6 +5,7 @@ set ref_data {
 Property for [0:1:1:1]:
 FILESIZE : 1495040
 GDT_STANDARD : 5302
+ProductID : nist_ctc_05_asme1
 MaterialMultipleAssigned : FALSE
 ATTR_VERSION : 18.3.001
 Part Number : NIST PMI CTC 05 ASME1
@@ -12,6 +13,7 @@ FILESAVETIME : Tue Dec 09 03:47:24 2014
 Revision : D
 CAD_SOURCE : ug
 MTIME : 1418096844
+ProductName : nist_ctc_05_asme1
 MaterialMissingAssignments : TRUE
 FILENAME : nist_ctc_05_asme1.prt
 Description : NIST PMI test model downloaded from http://go.usa.gov/mGVm
index 5aece011e211bea2b3b8051bd178fe1509eb7d6b..e23a88960cd71fe9c79f25a008b92533b674acdb 100644 (file)
@@ -28,6 +28,7 @@ DESCRIPTION : T-A HOLDER
 MODELED_BY : LSD
 STANDARD_BODY_DIA : Y
 DEEP_HOLE_WEBSITE : 
+ProductID : Tool1
 ITEM_NUM : HOLDER
 LENGTH : STUB
 FINISH : BLACK OXIDE
@@ -36,6 +37,8 @@ SHANK_IM : M
 FLUTE : STRAIGHT
 SHANK : ER
 MATERIAL : STEEL
+ProductName : Tool1
+Description : NOT SPECIFIED
 SERIES : Y
 DEEP_HOLE_NOTES : 
 
index de84141dfdfa26e6b37d053ee5c7bbd576b8ce26..aa4292b59367e29ad8599c57e65fff6f9824496d 100644 (file)
@@ -224,6 +224,7 @@ PRO_MP_VOLUME : - >
 PRO_MP_ALT_IXX DESIGNATED : NO
 MP_DENSITY ACCESS : Full
 PRO_MP_TRF_21 ACCESS : Locked
+ProductID : NIST_CTC_04_ASME1_RD_CR4050_RA
 PRO_MP_ALT_IYY : - >
 PRO_MP_TRF_41 DESCRIPTION : NULL
 PRO_MP_ALT_MASS DESCRIPTION : NULL
index 09a3369d68a7b9d202dde0c5e0f6b6c3a50f1b81..cfa9ac30ce9d15865a944f403321c397bb64470f 100644 (file)
@@ -16,6 +16,7 @@ MODEL_3D_CAD_SYSTEM :
 MODEL_3D_APPROVED_BY : 
 REFERENCE_DESIGNATION++ : 
 PART_NAME : 
+ProductID : Block
 MODEL_3D_CHECKED_BY : 
 OWNER : 
 COPYRIGHT : 
@@ -28,6 +29,7 @@ GENERAL_TOLERANCES_DRILL_HOLE :
 MODEL_3D_CREATED_BY : 
 UNIT_SYSTEM : 
 MODEL_3D_DATE_OF_ISSUE : 
+ProductDefinition :  
 WELD_TOLERANCES : 
 PROJECT : 
 MODEL_3D_RELEASED_STATUS : 
@@ -61,6 +63,7 @@ MODEL_3D_ID_NUMBER :
 REFERENCE_DESIGNATION+ : 
 PART_NOTE : 
 WELD_PREPARATION : 
+Description : Block
 MODEL_3D_RELEASED_DATE : 
 MODEL_3D_REPLACES : 
 PAINT_SURFACE : 
index 1eead28ed922b7ac7715b560e5542a988c40f0d1..e5cae202447e253f67bda29b60728a564d5b471b 100644 (file)
@@ -3,8 +3,11 @@ set filename nist_ftc_08_asme1_ap242-2.stp
 
 set ref_data {
 Property for [0:1:1:1]:
+ProductID : NIST PMI FTC 08 ASME1
+ProductDefinition :  
 Revision : C
 PartNumber : NIST PMI FTC 08 ASME1
 DescriptionRef : NIST PMI test model downloaded from http://go.usa.gov/mGVm
+ProductName : NIST PMI FTC 08 ASME1
 
 }
index fc54e89d6c85d2660ee5022ee90d6f62aad33c33..4bb4e53c335481f120849e6e74305d946e352232 100644 (file)
@@ -8,10 +8,12 @@ set todo_mask "puts \"TODO CR00000 ALL: "
 set end_line "\" \n"
 ##################################################################
 
+set conf "provider.STEP.OCC.read.productmetadata : 1"
+
 # Read original file
 if { [string length $filename] > 1} {
   set path_file [locate_data_file $filename]
-  if { [catch { ReadFile D $path_file } catch_result] } {
+  if { [catch { ReadFile D $path_file -conf $conf } catch_result] } {
     set err_msg "Error: file was not read - exception "
     puts $err_msg
     append todo_msg $todo_mask $err_msg $end_line