]> OCCT Git - occt.git/commitdiff
0032731: Data Exchange, Step Import - Incorrect PMI text location
authordpasukhi <dpasukhi@opencascade.com>
Mon, 31 Jan 2022 08:09:20 +0000 (11:09 +0300)
committerdpasukhi <dpasukhi@opencascade.com>
Tue, 1 Feb 2022 10:38:08 +0000 (13:38 +0300)
Added new complex Entity for representation of PMI
Added moving the presentation with new entity

15 files changed:
src/RWStepAP214/RWStepAP214_GeneralModule.cxx
src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
src/RWStepVisual/FILES
src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx [new file with mode: 0644]
src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx [new file with mode: 0644]
src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.cxx [new file with mode: 0644]
src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.hxx [new file with mode: 0644]
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/StepAP214/StepAP214_Protocol.cxx
src/StepVisual/FILES
src/StepVisual/StepVisual_RepositionedTessellatedGeometricSet.cxx [new file with mode: 0644]
src/StepVisual/StepVisual_RepositionedTessellatedGeometricSet.hxx [new file with mode: 0644]
src/StepVisual/StepVisual_RepositionedTessellatedItem.cxx [new file with mode: 0644]
src/StepVisual/StepVisual_RepositionedTessellatedItem.hxx [new file with mode: 0644]
tests/bugs/step/bug32731 [new file with mode: 0644]

index 55ea79fee67c4b43e04ffa0e590c634854f10c3c..1a411dce2671e81edeb535cae5d4f38900b6aeac 100644 (file)
 #include <RWStepVisual_RWPresentationStyleByContext.hxx>
 #include <RWStepVisual_RWPresentationView.hxx>
 #include <RWStepVisual_RWPresentedItemRepresentation.hxx>
+#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
+#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
 #include <RWStepVisual_RWStyledItem.hxx>
 #include <RWStepVisual_RWSurfaceSideStyle.hxx>
 #include <RWStepVisual_RWSurfaceStyleBoundary.hxx>
 #include <StepVisual_PresentationStyleByContext.hxx>
 #include <StepVisual_PresentationView.hxx>
 #include <StepVisual_PresentedItemRepresentation.hxx>
+#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
+#include <StepVisual_RepositionedTessellatedItem.hxx>
 #include <StepVisual_StyledItem.hxx>
 #include <StepVisual_SurfaceSideStyle.hxx>
 #include <StepVisual_SurfaceStyleBoundary.hxx>
@@ -5193,6 +5197,13 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
     tool.Share(anent, iter);
   }
   break;
+  case 802:
+  {
+    DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
+    RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
+    aTool.Share(anEnt, iter);
+    break;
+  }
     default : break;
     }
 }
@@ -7217,6 +7228,12 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
    case 723:
      ent = new StepVisual_SurfaceStyleRenderingWithProperties;
    break;
+   case 802:
+     ent = new StepVisual_RepositionedTessellatedGeometricSet;
+     break;
+   case 803:
+     ent = new StepVisual_RepositionedTessellatedItem;
+     break;
   default: 
     return Standard_False;
   }
@@ -7819,7 +7836,8 @@ Standard_Integer  RWStepAP214_GeneralModule::CategoryNumber
   case 721:
   case 722:
   case 723: return catdr;
-
+  case 802: return cataux;
+  case 803: return cataux;
   default : break;
   }
   return 0;
index 2e7bcb36d838d6f6919e9a0b4815e7d9fee6ee47..eab7aab7fd00872f46371c73b014ae711d3f422d 100644 (file)
@@ -258,6 +258,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
 #include <StepVisual_PresentationStyleAssignment.hxx>
 #include <StepVisual_PresentationStyleByContext.hxx>
 #include <StepVisual_PresentationView.hxx>
+#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
+#include <StepVisual_RepositionedTessellatedItem.hxx>
 #include <StepBasic_Product.hxx>
 #include <StepBasic_ProductCategory.hxx>
 #include <StepBasic_ProductContext.hxx>
@@ -654,6 +656,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
 #include <RWStepVisual_RWPresentationStyleAssignment.hxx>
 #include <RWStepVisual_RWPresentationStyleByContext.hxx>
 #include <RWStepVisual_RWPresentationView.hxx>
+#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
+#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
 #include <RWStepBasic_RWProduct.hxx>
 #include <RWStepBasic_RWProductCategory.hxx>
 #include <RWStepBasic_RWProductContext.hxx>
@@ -2047,6 +2051,8 @@ static TCollection_AsciiString Reco_AnnotationPlane("ANNOTATION_PLANE");
 static TCollection_AsciiString Reco_TessellatedAnnotationOccurrence("TESSELLATED_ANNOTATION_OCCURRENCE");
 static TCollection_AsciiString Reco_TessellatedGeometricSet("TESSELLATED_GEOMETRIC_SET");
 static TCollection_AsciiString Reco_TessellatedCurveSet("TESSELLATED_CURVE_SET");
+static TCollection_AsciiString Reco_TessellatedItem("TESSELLATED_ITEM");
+static TCollection_AsciiString Reco_RepositionedTessellatedItem("REPOSITIONED_TESSELLATED_ITEM");
 static TCollection_AsciiString Reco_CoordinatesList("COORDINATES_LIST");
 static TCollection_AsciiString Reco_ConstructiveGeometryRepresentation("CONSTRUCTIVE_GEOMETRY_REPRESENTATION");
 static TCollection_AsciiString Reco_ConstructiveGeometryRepresentationRelationship("CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP");
@@ -2721,6 +2727,7 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
   typenums.Bind (Reco_SurfaceStyleReflectanceAmbient, 721);
   typenums.Bind (Reco_SurfaceStyleRendering, 722);
   typenums.Bind (Reco_SurfaceStyleRenderingWithProperties, 723);
+  typenums.Bind (Reco_RepositionedTessellatedItem, 803);
 
 //    SHORT NAMES
 //    NB : la liste est celle de AP203
@@ -3489,13 +3496,22 @@ Standard_Integer RWStepAP214_ReadWriteModule::CaseStep
                  types(5).IsEqual(StepType(624))))) {
         return 705;
       }
-      if ((types(1).IsEqual(StepType(4))) &&
+      else if ((types(1).IsEqual(StepType(4))) &&
           (types(2).IsEqual(StepType(7))) &&
           (types(3).IsEqual(StepType(144))) &&
           (types(4).IsEqual(StepType(247))) &&
-          (types(5).IsEqual(StepType(270)))) {
+          (types(5).IsEqual(StepType(270))))
+      {
         return 719;
       }
+      else if ((types(1).IsEqual(StepType(144))) &&
+        (types(2).IsEqual(StepType(803))) &&
+        (types(3).IsEqual(StepType(247))) &&
+        (types(4).IsEqual(StepType(709))) &&
+        (types(5).IsEqual(StepType(708))))
+      {
+        return 802;
+      }
     }
     else if (NbComp == 4) {
       if ((types(1).IsEqual(StepType(161))) &&
@@ -4565,6 +4581,7 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
   case 704: return Reco_AnnotationPlane;
 
   case 707 : return Reco_TessellatedAnnotationOccurrence;
+  case 708 : return Reco_TessellatedItem;
   case 709 : return Reco_TessellatedGeometricSet;
 
   case 710 : return Reco_TessellatedCurveSet;
@@ -4581,6 +4598,7 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
   case 722 : return Reco_SurfaceStyleRendering;
   case 723 : return Reco_SurfaceStyleRenderingWithProperties;
 
+  case 803: return Reco_RepositionedTessellatedItem;
   default : return PasReco;
   }
 }
@@ -4864,7 +4882,6 @@ Standard_Boolean RWStepAP214_ReadWriteModule::ComplexType(const Standard_Integer
       types.Append (StepType(625));
       types.Append (StepType(677));
       break;
-      default : return Standard_False;
     case 698:
       types.Append (StepType(671));
       types.Append (StepType(470));
@@ -4902,6 +4919,14 @@ Standard_Boolean RWStepAP214_ReadWriteModule::ComplexType(const Standard_Integer
       types.Append(StepType(247));
       types.Append(StepType(270));
       break;
+    case 802:
+      types.Append(StepType(144));
+      types.Append(StepType(803));
+      types.Append(StepType(247));
+      types.Append(StepType(709));
+      types.Append(StepType(708));
+      break;
+    default: return Standard_False;
     }
   return Standard_True;
 }
@@ -9508,6 +9533,20 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
     tool.ReadStep(data, num, ach, anent);
   }
   break;
+  case 802:
+  {
+    DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
+    RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
+    aTool.ReadStep(data, num, ach, anEnt);
+    break;
+  }
+  case 803:
+  {
+    DeclareAndCast(StepVisual_RepositionedTessellatedItem, anEnt, ent);
+    RWStepVisual_RWRepositionedTessellatedItem aTool;
+    aTool.ReadStep(data, num, ach, anEnt);
+    break;
+  }
 
   default: 
     ach->AddFail("Type Mismatch when reading - Entity");
@@ -14392,6 +14431,21 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
       tool.WriteStep(SW, anent);
     }
     break;
+  break;
+  case 802:
+  {
+    DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
+    RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
+    aTool.WriteStep(SW, anEnt);
+    break;
+  }
+  case 803:
+  {
+    DeclareAndCast(StepVisual_RepositionedTessellatedItem, anEnt, ent);
+    RWStepVisual_RWRepositionedTessellatedItem aTool;
+    aTool.WriteStep(SW, anEnt);
+    break;
+  }
   default: 
     return;
   }
index 739e8d7c9e3fdd348efebc37d397d6fa0aefc41d..5c396ba9ae4ab11d275d42e95c2fa5a52cc39492 100644 (file)
@@ -106,6 +106,10 @@ RWStepVisual_RWPresentationView.cxx
 RWStepVisual_RWPresentationView.hxx
 RWStepVisual_RWPresentedItemRepresentation.cxx
 RWStepVisual_RWPresentedItemRepresentation.hxx
+RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx
+RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx
+RWStepVisual_RWRepositionedTessellatedItem.cxx
+RWStepVisual_RWRepositionedTessellatedItem.hxx
 RWStepVisual_RWStyledItem.cxx
 RWStepVisual_RWStyledItem.hxx
 RWStepVisual_RWSurfaceSideStyle.cxx
diff --git a/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx b/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx
new file mode 100644 (file)
index 0000000..6f173e8
--- /dev/null
@@ -0,0 +1,99 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
+
+#include <Interface_Check.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <StepData_StepReaderData.hxx>
+#include <StepData_StepWriter.hxx>
+#include <StepRepr_RepresentationItem.hxx>
+#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
+#include <StepVisual_PresentationStyleAssignment.hxx>
+#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
+#include <StepGeom_Axis2Placement3d.hxx>
+
+//=======================================================================
+//function : ReadStep
+//purpose  :
+//=======================================================================
+void RWStepVisual_RWRepositionedTessellatedGeometricSet::ReadStep
+  (const Handle(StepData_StepReaderData)& theData,
+   const Standard_Integer theNum,
+   Handle(Interface_Check)& theAch,
+   const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const
+{
+  Standard_Integer aNum = 0;
+  theData->NamedForComplex("REPOSITIONED_TESSELLATED_ITEM", theNum, aNum, theAch);
+  if (!theData->CheckNbParams(aNum, 1, theAch, "location"))
+    return;
+  Handle(StepGeom_Axis2Placement3d) aLocation;
+  theData->ReadEntity(aNum,1,"location",theAch,STANDARD_TYPE(StepGeom_Axis2Placement3d), aLocation);
+
+  theData->NamedForComplex("REPRESENTATION_ITEM", theNum, aNum, theAch);
+  if (!theData->CheckNbParams(aNum, 1, theAch, "name"))
+    return;
+  Handle(TCollection_HAsciiString) aName;
+  theData->ReadString (aNum, 1, "name", theAch, aName);
+  
+  theData->NamedForComplex("TESSELLATED_GEOMETRIC_SET", theNum, aNum, theAch);
+  NCollection_Handle<StepVisual_Array1OfTessellatedItem> anItems;
+  Standard_Integer aNSub2;
+  if (theData->ReadSubList (aNum,1,"items",theAch,aNSub2)) {
+    Standard_Integer aNb2 = theData->NbParams(aNSub2);
+    anItems = new StepVisual_Array1OfTessellatedItem(1, aNb2);
+    for (Standard_Integer i2 = 1; i2 <= aNb2; i2 ++) {
+      Handle(StepVisual_TessellatedItem) anItem;
+      if (theData->ReadEntity (aNSub2,i2,"item",theAch,STANDARD_TYPE(StepVisual_TessellatedItem), anItem))
+        anItems->SetValue(i2,anItem);
+    }
+  }
+  theEnt->Init(aName, anItems, aLocation);
+}
+
+//=======================================================================
+//function : WriteStep
+//purpose  :
+//=======================================================================
+void RWStepVisual_RWRepositionedTessellatedGeometricSet::WriteStep
+  (StepData_StepWriter& theSW,
+   const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const
+{
+  theSW.StartEntity("GEOMETRIC_REPRESENTATION_ITEM");
+  theSW.StartEntity("REPOSITIONED_TESSELLATED_ITEM");
+  theSW.Send(theEnt->Location());
+  theSW.StartEntity("REPRESENTATION_ITEM");
+  theSW.Send(theEnt->Name());
+  theSW.StartEntity("TESSELLATED_GEOMETRIC_SET");
+  theSW.OpenSub();
+  for(StepVisual_Array1OfTessellatedItem::Iterator anIter(*theEnt->Items());
+    anIter.More(); anIter.Next())
+  {
+    theSW.Send(anIter.Value());
+  }
+  theSW.CloseSub();
+  theSW.StartEntity("TESSELLATED_ITEM");
+}
+
+//=======================================================================
+//function : Share
+//purpose  :
+//=======================================================================
+void RWStepVisual_RWRepositionedTessellatedGeometricSet::Share(const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt,
+                                                               Interface_EntityIterator& theIter) const
+{
+  // Own field : children
+  for (Standard_Integer i = 1; i <= theEnt->Items()->Length(); i++)
+      theIter.AddItem(theEnt->Items()->Value(i));
+  theIter.AddItem(theEnt->Location());
+}
diff --git a/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx b/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx
new file mode 100644 (file)
index 0000000..80b8ba0
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile
+#define _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile
+
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Handle.hxx>
+
+class StepData_StepReaderData;
+class Interface_Check;
+class StepVisual_RepositionedTessellatedGeometricSet;
+class StepData_StepWriter;
+class Interface_EntityIterator;
+
+//! Read & Write tool for complex RepositionedTessellatedGeometricSet
+class RWStepVisual_RWRepositionedTessellatedGeometricSet
+{
+public:
+
+  DEFINE_STANDARD_ALLOC
+
+  //! Empty constructor
+  RWStepVisual_RWRepositionedTessellatedGeometricSet() {};
+
+  //! Reads RepositionedTessellatedGeometricSet
+  Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
+                                 const Standard_Integer theNum,
+                                 Handle(Interface_Check)& theAch,
+                                 const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const;
+
+  //! Writes RepositionedTessellatedGeometricSet
+  Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
+                                  const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const;
+
+  //! Fills data for graph (shared items)
+  Standard_EXPORT void Share (const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt,
+                              Interface_EntityIterator& theIter) const;
+};
+#endif // _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile
diff --git a/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.cxx b/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.cxx
new file mode 100644 (file)
index 0000000..f1e33eb
--- /dev/null
@@ -0,0 +1,58 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
+
+#include <Interface_Check.hxx>
+#include <StepData_StepReaderData.hxx>
+#include <StepData_StepWriter.hxx>
+#include <StepVisual_RepositionedTessellatedItem.hxx>
+#include <StepGeom_Axis2Placement3d.hxx>
+
+//=======================================================================
+//function : ReadStep
+//purpose  :
+//=======================================================================
+void RWStepVisual_RWRepositionedTessellatedItem::ReadStep
+  (const Handle(StepData_StepReaderData)& theData,
+   const Standard_Integer theNum,
+   Handle(Interface_Check)& theAch,
+   const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const
+{
+  // --- Number of Parameter Control ---
+  if (!theData->CheckNbParams(theNum,2,theAch,"tessellated_item"))
+    return;
+
+  // --- inherited field : name ---
+  Handle(TCollection_HAsciiString) aName;
+  theData->ReadString (theNum,1,"name",theAch,aName);
+  // --- inherited field : location ---
+  Handle(StepGeom_Axis2Placement3d) aLocation;
+  theData->ReadEntity(theNum,2,"location", theAch, STANDARD_TYPE(StepGeom_Axis2Placement3d),aLocation);
+
+  //--- Initialisation of the read entity ---
+  theEnt->Init(aName, aLocation);
+}
+
+//=======================================================================
+//function : WriteStep
+//purpose  :
+//=======================================================================
+void RWStepVisual_RWRepositionedTessellatedItem::WriteStep
+  (StepData_StepWriter& theSW,
+   const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const
+{
+  // --- inherited field name ---
+  theSW.Send(theEnt->Name());
+  theSW.Send(theEnt->Location());
+}
diff --git a/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.hxx b/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.hxx
new file mode 100644 (file)
index 0000000..719db35
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile
+#define _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Handle.hxx>
+
+class StepData_StepReaderData;
+class Interface_Check;
+class StepVisual_RepositionedTessellatedItem;
+class StepData_StepWriter;
+
+//! Read & Write tool for RepositionedTessellatedItem
+class RWStepVisual_RWRepositionedTessellatedItem
+{
+public:
+
+  DEFINE_STANDARD_ALLOC
+
+  //! Empty constructor
+  RWStepVisual_RWRepositionedTessellatedItem() {};
+
+  //! Reads RepositionedTessellatedItem
+  Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
+   const Standard_Integer theNum,
+   Handle(Interface_Check)& theAch,
+   const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const;
+
+  //! Writes RepositionedTessellatedItem
+  Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
+    const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const;
+};
+#endif // _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile
index 2772edc2d6ef91ebff737ba066f32eb0b679244e..5222f3a91222836d5b25f4360ac5dcc7bf2ad4f2 100644 (file)
 #include <StepVisual_PlanarBox.hxx>
 #include <StepVisual_PresentationLayerAssignment.hxx>
 #include <StepVisual_PresentationStyleByContext.hxx>
+#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
 #include <StepVisual_StyleContextSelect.hxx>
 #include <StepVisual_StyledItem.hxx>
 #include <StepVisual_ViewVolume.hxx>
@@ -1850,6 +1851,25 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
       Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem);
       if (aTessSet.IsNull())
         continue;
+      gp_Trsf aTransf;
+      if (aTessSet->IsKind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet)))
+      {
+        Handle(StepVisual_RepositionedTessellatedGeometricSet) aRTGS =
+          Handle(StepVisual_RepositionedTessellatedGeometricSet)::DownCast(aTessSet);
+        Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location());
+        if (!aLocation.IsNull())
+        {
+          const gp_Ax3 anAx3Orig = gp::XOY();
+          const gp_Ax3 anAx3Targ(aLocation->Ax2());
+          if (anAx3Targ.Location().SquareDistance(anAx3Orig.Location()) >= Precision::SquareConfusion() ||
+            !anAx3Targ.Direction().IsEqual(anAx3Orig.Direction(), Precision::Angular()) ||
+            !anAx3Targ.XDirection().IsEqual(anAx3Orig.XDirection(), Precision::Angular()) ||
+            !anAx3Targ.YDirection().IsEqual(anAx3Orig.YDirection(), Precision::Angular()))
+          {
+            aTransf.SetTransformation(anAx3Targ, anAx3Orig);
+          }
+        }
+      }
       NCollection_Handle<StepVisual_Array1OfTessellatedItem> aListItems = aTessSet->Items();
       Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length();
       Handle(StepVisual_TessellatedCurveSet) aTessCurve;
@@ -1895,7 +1915,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
         }
         aB.Add(aComp, aCurW);
       }
-      anAnnotationShape = aComp;
+      anAnnotationShape = aComp.Moved(aTransf);
     }
     if (!anAnnotationShape.IsNull())
     {
index 00da5908ca10dec8b5f0ead409873780c7a0758d..89f3a08c0649ede3514e78cabc1c52531c024cc6 100644 (file)
@@ -738,6 +738,8 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
 #include <StepVisual_TessellatedItem.hxx>
 #include <StepVisual_TessellatedGeometricSet.hxx>
 #include <StepVisual_TessellatedCurveSet.hxx>
+#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
+#include <StepVisual_RepositionedTessellatedItem.hxx>
 #include <StepVisual_CoordinatesList.hxx>
 #include <StepRepr_CharacterizedRepresentation.hxx>
 #include <StepRepr_ConstructiveGeometryRepresentation.hxx>
@@ -756,7 +758,7 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
 #include <StepVisual_SurfaceStyleRenderingWithProperties.hxx>
 
 static int THE_StepAP214_Protocol_init = 0;
-static Interface_DataMapOfTransientInteger types(800);
+static Interface_DataMapOfTransientInteger types(803);
 
 //=======================================================================
 //function : StepAP214_Protocol
@@ -1468,6 +1470,8 @@ StepAP214_Protocol::StepAP214_Protocol ()
   types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleReflectanceAmbient), 721);
   types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleRendering), 722);
   types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleRenderingWithProperties), 723);
+  types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet), 802);
+  types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedItem), 803);
 }
 
 
index b86995588f523e6dcce0ebe098bc777a36974894..83e199d91d40528534db13427c6070a4bf2ce606 100644 (file)
@@ -197,6 +197,10 @@ StepVisual_PresentedItemRepresentation.cxx
 StepVisual_PresentedItemRepresentation.hxx
 StepVisual_RenderingPropertiesSelect.cxx
 StepVisual_RenderingPropertiesSelect.hxx
+StepVisual_RepositionedTessellatedGeometricSet.hxx
+StepVisual_RepositionedTessellatedGeometricSet.cxx
+StepVisual_RepositionedTessellatedItem.hxx
+StepVisual_RepositionedTessellatedItem.cxx
 StepVisual_ShadingSurfaceMethod.hxx
 StepVisual_StyleContextSelect.cxx
 StepVisual_StyleContextSelect.hxx
diff --git a/src/StepVisual/StepVisual_RepositionedTessellatedGeometricSet.cxx b/src/StepVisual/StepVisual_RepositionedTessellatedGeometricSet.cxx
new file mode 100644 (file)
index 0000000..20ac1d2
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
+
+#include <StepGeom_Axis2Placement3d.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
+
+//=======================================================================
+//function : Init
+//purpose  :
+//=======================================================================
+void StepVisual_RepositionedTessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName,
+                                                          const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems,
+                                                          const Handle(StepGeom_Axis2Placement3d)& theLocation)
+{
+  StepVisual_TessellatedGeometricSet::Init(theName, theItems);
+  myLocation = theLocation;
+}
diff --git a/src/StepVisual/StepVisual_RepositionedTessellatedGeometricSet.hxx b/src/StepVisual/StepVisual_RepositionedTessellatedGeometricSet.hxx
new file mode 100644 (file)
index 0000000..c037b01
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _StepVisual_RepositionedTessellatedGeometricSet_HeaderFile
+#define _StepVisual_RepositionedTessellatedGeometricSet_HeaderFile
+
+#include <StepVisual_TessellatedGeometricSet.hxx>
+
+class StepGeom_Axis2Placement3d;
+
+DEFINE_STANDARD_HANDLE(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
+
+//! Representation of complex STEP entity RepositionedTessellatedGeometricSet
+class StepVisual_RepositionedTessellatedGeometricSet : public StepVisual_TessellatedGeometricSet
+{
+public:
+
+  DEFINE_STANDARD_ALLOC
+
+  DEFINE_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
+
+  //! Default constructor
+  StepVisual_RepositionedTessellatedGeometricSet() {};
+
+  //! Initialize all fields (own and inherited)
+  Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName,
+                            const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems,
+                            const Handle(StepGeom_Axis2Placement3d)& theLocation);
+
+  //! Returns location
+  Handle(StepGeom_Axis2Placement3d) Location() const { return myLocation; }
+
+  //! Sets location
+  void SetLocation(const Handle(StepGeom_Axis2Placement3d)& theLocation) { myLocation = theLocation; }
+
+private:
+
+  Handle(StepGeom_Axis2Placement3d) myLocation;
+};
+#endif // StepVisual_RepositionedTessellatedGeometricSet_HeaderFile
diff --git a/src/StepVisual/StepVisual_RepositionedTessellatedItem.cxx b/src/StepVisual/StepVisual_RepositionedTessellatedItem.cxx
new file mode 100644 (file)
index 0000000..ef05a4e
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <StepVisual_RepositionedTessellatedItem.hxx>
+
+#include <StepGeom_Axis2Placement3d.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
+
+//=======================================================================
+//function : Init
+//purpose  :
+//=======================================================================
+void StepVisual_RepositionedTessellatedItem::Init(const Handle(TCollection_HAsciiString)& theName,
+                                                  const Handle(StepGeom_Axis2Placement3d)& theLocation)
+{
+  StepVisual_TessellatedItem::Init(theName);
+  myLocation = theLocation;
+}
diff --git a/src/StepVisual/StepVisual_RepositionedTessellatedItem.hxx b/src/StepVisual/StepVisual_RepositionedTessellatedItem.hxx
new file mode 100644 (file)
index 0000000..b9b4dec
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright (c) 2022 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _StepVisual_RepositionedTessellatedItem_HeaderFile
+#define _StepVisual_RepositionedTessellatedItem_HeaderFile
+
+#include <StepVisual_TessellatedItem.hxx>
+
+class StepGeom_Axis2Placement3d;
+
+DEFINE_STANDARD_HANDLE(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
+
+//! Representation of STEP entity RepositionedTessellatedItem
+class StepVisual_RepositionedTessellatedItem : public StepVisual_TessellatedItem
+{
+public:
+
+  DEFINE_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
+
+  DEFINE_STANDARD_ALLOC
+
+  //! Default constructor
+  StepVisual_RepositionedTessellatedItem() {};
+
+  //! Initialize all fields (own and inherited)
+  Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName,
+                            const Handle(StepGeom_Axis2Placement3d)& theLocation);
+
+  //! Returns location
+  Handle(StepGeom_Axis2Placement3d) Location() const { return myLocation; }
+
+  //! Sets location
+  void SetLocation(const Handle(StepGeom_Axis2Placement3d)& theLocation) { myLocation = theLocation; }
+
+private:
+
+  Handle(StepGeom_Axis2Placement3d) myLocation;
+};
+#endif // StepVisual_RepositionedTessellatedItem_HeaderFile
diff --git a/tests/bugs/step/bug32731 b/tests/bugs/step/bug32731
new file mode 100644 (file)
index 0000000..73d0fe4
--- /dev/null
@@ -0,0 +1,17 @@
+puts "======="
+puts "0032731: Data Exchange, Step Import - Incorrect PMI text location"
+puts "======="
+
+pload OCAF
+
+catch {Close D}
+
+# Read file
+ReadStep D [locate_data_file bug32731_A5E46910589A.stp]
+
+#Checking
+XGetShape repr0 D 0:1:4:106:15
+checkgravitycenter repr0 -l -109.847 153.679 0 1e-7
+
+XGetShape repr1 D 0:1:4:56:15
+checkgravitycenter repr1 -l -68.7 123.272 -18.5624 1e-7