]> OCCT Git - occt-copy.git/commitdiff
0028256: Opening specific STEP file leads to application crash
authorika <ika@opencascade.com>
Wed, 1 Feb 2017 13:50:47 +0000 (16:50 +0300)
committerika <ika@opencascade.com>
Thu, 2 Feb 2017 11:52:53 +0000 (14:52 +0300)
add check for null.

18 files changed:
src/RWStepAP214/RWStepAP214_GeneralModule.cxx
src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
src/RWStepVisual/FILES
src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx [new file with mode: 0644]
src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.hxx [new file with mode: 0644]
src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx [new file with mode: 0644]
src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.hxx [new file with mode: 0644]
src/StepAP214/StepAP214_Protocol.cxx
src/StepToTopoDS/StepToTopoDS_TranslateVertex.cxx
src/StepVisual/FILES
src/StepVisual/StepVisual_AnnotationCurveOccurrence.cxx
src/StepVisual/StepVisual_AnnotationCurveOccurrence.hxx
src/StepVisual/StepVisual_AnnotationFillArea.cxx [new file with mode: 0644]
src/StepVisual/StepVisual_AnnotationFillArea.hxx [new file with mode: 0644]
src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.cxx [new file with mode: 0644]
src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.hxx [new file with mode: 0644]
tests/bugs/step/bug26451
tests/bugs/step/bug28256 [new file with mode: 0644]

index 7cdb5cdd9a6cc0bbe7f52ae56941bad1dbbd8f18..867251c4c505b02827c0f2efe49a6588b306bbdc 100644 (file)
@@ -1359,6 +1359,10 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule)
 #include <RWStepRepr_RWCharacterizedRepresentation.hxx>
 #include <StepVisual_CharacterizedObjectAndCharacterizedRepresentationAndDraughtingModelAndRepresentation.hxx>
 #include <RWStepVisual_RWCharacterizedObjectAndCharacterizedRepresentationAndDraughtingModelAndRepresentation.hxx>
+#include <StepVisual_AnnotationFillArea.hxx>
+#include <StepVisual_AnnotationFillAreaOccurrence.hxx>
+#include <RWStepVisual_RWAnnotationFillArea.hxx>
+#include <RWStepVisual_RWAnnotationFillAreaOccurrence.hxx>
 
 static Standard_Integer catsh,catdr,catstr,catdsc,cataux;
 
@@ -1442,6 +1446,20 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
        tool.Share(anent,iter);
       }
       break;
+    case 5:
+    {
+      DeclareAndCast(StepVisual_AnnotationFillArea, anent, ent);
+      RWStepVisual_RWAnnotationFillArea tool;
+      tool.Share(anent, iter);
+    }
+    break;
+    case 6:
+    {
+      DeclareAndCast(StepVisual_AnnotationFillAreaOccurrence, anent, ent);
+      RWStepVisual_RWAnnotationFillAreaOccurrence tool;
+      tool.Share(anent, iter);
+    }
+    break;
     case 7:
       {
        DeclareAndCast(StepVisual_AnnotationOccurrence,anent,ent);
@@ -5274,6 +5292,12 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
   case 4 : 
     ent = new StepVisual_AnnotationCurveOccurrence;
     break;
+  case 5:
+    ent = new StepVisual_AnnotationFillArea;
+    break;
+  case 6:
+    ent = new StepVisual_AnnotationFillAreaOccurrence;
+    break;
   case 7 : 
     ent = new StepVisual_AnnotationOccurrence;
     break;
index 7b8bde6d4a1bbf891c78e7c968695e61a6ff86c2..c8d5355abd63d0fa24417303c3b2ecb777549254 100644 (file)
@@ -1394,6 +1394,10 @@ Handle(atype) result = Handle(atype)::DownCast (start)
 #include <RWStepRepr_RWConstructiveGeometryRepresentationRelationship.hxx>
 #include <StepVisual_CharacterizedObjectAndCharacterizedRepresentationAndDraughtingModelAndRepresentation.hxx>
 #include <RWStepVisual_RWCharacterizedObjectAndCharacterizedRepresentationAndDraughtingModelAndRepresentation.hxx>
+#include <StepVisual_AnnotationFillArea.hxx>
+#include <StepVisual_AnnotationFillAreaOccurrence.hxx>
+#include <RWStepVisual_RWAnnotationFillArea.hxx>
+#include <RWStepVisual_RWAnnotationFillAreaOccurrence.hxx>
 
 
 // -- General Declarations (Recognize, StepType) ---
@@ -4880,6 +4884,20 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
       tool.ReadStep (data,num,ach,anent);
     }
     break;
+  case 5:
+  {
+    DeclareAndCast(StepVisual_AnnotationFillArea, anent, ent);
+    RWStepVisual_RWAnnotationFillArea tool;
+    tool.ReadStep(data, num, ach, anent);
+  }
+  break;
+  case 6:
+  {
+    DeclareAndCast(StepVisual_AnnotationFillAreaOccurrence, anent, ent);
+    RWStepVisual_RWAnnotationFillAreaOccurrence tool;
+    tool.ReadStep(data, num, ach, anent);
+  }
+  break;
   case 7 : 
     {
       DeclareAndCast(StepVisual_AnnotationOccurrence, anent, ent);
@@ -9418,6 +9436,20 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
       tool.WriteStep (SW,anent);
     }
     break;
+  case 5:
+  {
+    DeclareAndCast(StepVisual_AnnotationFillArea, anent, ent);
+    RWStepVisual_RWAnnotationFillArea tool;
+    tool.WriteStep(SW, anent);
+  }
+  break;
+  case 6:
+  {
+    DeclareAndCast(StepVisual_AnnotationFillAreaOccurrence, anent, ent);
+    RWStepVisual_RWAnnotationFillAreaOccurrence tool;
+    tool.WriteStep(SW, anent);
+  }
+  break;
   case 7 : 
     {
       DeclareAndCast(StepVisual_AnnotationOccurrence, anent, ent);
index 059401d1a1d5a474c5561ecaec7d9841057ee986..f6f964ded403559eabcd08b7b460f0fd2bb6971e 100644 (file)
@@ -1,5 +1,9 @@
 RWStepVisual_RWAnnotationCurveOccurrence.cxx
 RWStepVisual_RWAnnotationCurveOccurrence.hxx
+RWStepVisual_RWAnnotationFillArea.cxx
+RWStepVisual_RWAnnotationFillArea.hxx
+RWStepVisual_RWAnnotationFillAreaOccurrence.cxx
+RWStepVisual_RWAnnotationFillAreaOccurrence.hxx
 RWStepVisual_RWAnnotationOccurrence.cxx
 RWStepVisual_RWAnnotationOccurrence.hxx
 RWStepVisual_RWAnnotationPlane.cxx
diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx
new file mode 100644 (file)
index 0000000..fb85f8c
--- /dev/null
@@ -0,0 +1,98 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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 <Interface_Check.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <RWStepVisual_RWAnnotationFillArea.hxx>
+#include <StepData_StepReaderData.hxx>
+#include <StepData_StepWriter.hxx>
+#include <StepVisual_AnnotationFillArea.hxx>
+#include <StepShape_GeometricSetSelect.hxx>
+#include <StepShape_HArray1OfGeometricSetSelect.hxx>
+
+//=======================================================================
+//function : RWStepVisual_RWAnnotationFillArea
+//purpose  : 
+//=======================================================================
+RWStepVisual_RWAnnotationFillArea::RWStepVisual_RWAnnotationFillArea () {}
+
+//=======================================================================
+//function : ReadStep
+//purpose  : 
+//=======================================================================
+void RWStepVisual_RWAnnotationFillArea::ReadStep
+(const Handle(StepData_StepReaderData)& data,
+const Standard_Integer num,
+Handle(Interface_Check)& ach,
+const Handle(StepVisual_AnnotationFillArea)& ent) const
+{
+  // Number of Parameter Control
+  if (!data->CheckNbParams(num, 2, ach, "annotation_fill_area"))
+    return;
+
+  // Inherited field : name
+
+  Handle(TCollection_HAsciiString) aName;
+  data->ReadString(num, 1, "name", ach, aName);
+
+  // Own field : boundaries
+  Handle(StepShape_HArray1OfGeometricSetSelect) aElements;
+  StepShape_GeometricSetSelect aElementsItem;
+  Standard_Integer nsub;
+  if (data->ReadSubList(num, 2, "boundaries", ach, nsub)) {
+    Standard_Integer nb = data->NbParams(nsub);
+    aElements = new StepShape_HArray1OfGeometricSetSelect(1, nb);
+    for (Standard_Integer i = 1; i <= nb; i++) {
+      if (data->ReadEntity(nsub, i, "boundaries", ach, aElementsItem))
+        aElements->SetValue(i, aElementsItem);
+    }
+  }
+
+  //Initialization of the read entity
+  ent->Init(aName, aElements);
+}
+
+//=======================================================================
+//function : WriteStep
+//purpose  : 
+//=======================================================================
+void RWStepVisual_RWAnnotationFillArea::WriteStep
+(StepData_StepWriter& SW,
+const Handle(StepVisual_AnnotationFillArea)& ent) const
+{
+  // Inherited field : name
+  SW.Send(ent->Name());
+
+  // Own field : elements
+  SW.OpenSub();
+  for (Standard_Integer i = 1; i <= ent->NbElements(); i++) {
+    SW.Send(ent->ElementsValue(i).Value());
+  }
+  SW.CloseSub();
+}
+
+//=======================================================================
+//function : Share
+//purpose  : 
+//=======================================================================
+void RWStepVisual_RWAnnotationFillArea::Share(const Handle(StepVisual_AnnotationFillArea)& ent, Interface_EntityIterator& iter) const
+{
+  Standard_Integer nbBound = ent->NbElements();
+  for (Standard_Integer i = 1; i <= nbBound; i++) {
+    iter.GetOneItem(ent->ElementsValue(i).Value());
+  }
+}
+
diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.hxx b/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.hxx
new file mode 100644 (file)
index 0000000..d360bea
--- /dev/null
@@ -0,0 +1,49 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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_RWAnnotationFillArea_HeaderFile
+#define _RWStepVisual_RWAnnotationFillArea_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Handle.hxx>
+
+#include <Standard_Integer.hxx>
+class StepData_StepReaderData;
+class Interface_Check;
+class StepVisual_AnnotationFillArea;
+class StepData_StepWriter;
+class Interface_EntityIterator;
+
+
+//! Read & Write Module for AnnotationFillArea
+class RWStepVisual_RWAnnotationFillArea 
+{
+public:
+
+  DEFINE_STANDARD_ALLOC
+
+  
+  Standard_EXPORT RWStepVisual_RWAnnotationFillArea();
+  
+  Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationFillArea)& ent) const;
+  
+  Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationFillArea)& ent) const;
+  
+  Standard_EXPORT void Share (const Handle(StepVisual_AnnotationFillArea)& ent, Interface_EntityIterator& iter) const;
+
+};
+
+#endif // _RWStepVisual_RWAnnotationFillArea_HeaderFile
diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx
new file mode 100644 (file)
index 0000000..a2c0ba7
--- /dev/null
@@ -0,0 +1,113 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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 <Interface_Check.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <RWStepVisual_RWAnnotationFillAreaOccurrence.hxx>
+#include <StepData_StepReaderData.hxx>
+#include <StepData_StepWriter.hxx>
+#include <StepGeom_GeometricRepresentationItem.hxx>
+#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
+#include <StepVisual_PresentationStyleAssignment.hxx>
+#include <StepVisual_AnnotationFillAreaOccurrence.hxx>
+
+//=======================================================================
+//function : RWStepVisual_RWAnnotationFillAreaOccurrence
+//purpose  : 
+//=======================================================================
+RWStepVisual_RWAnnotationFillAreaOccurrence::RWStepVisual_RWAnnotationFillAreaOccurrence () {}
+
+//=======================================================================
+//function : ReadStep
+//purpose  : 
+//=======================================================================
+void RWStepVisual_RWAnnotationFillAreaOccurrence::ReadStep
+(const Handle(StepData_StepReaderData)& data,
+const Standard_Integer num,
+Handle(Interface_Check)& ach,
+const Handle(StepVisual_AnnotationFillAreaOccurrence)& ent) const
+{
+  // Number of Parameter Control
+  if (!data->CheckNbParams(num, 4, ach, "annotation_fill_area_occurrence")) return;
+
+  // Inherited field : name
+  Handle(TCollection_HAsciiString) aName;
+  data->ReadString(num, 1, "name", ach, aName);
+
+  // Inherited field : styles
+  Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
+  Handle(StepVisual_PresentationStyleAssignment) anent;
+  Standard_Integer nsub;
+  if (data->ReadSubList(num, 2, "styles", ach, nsub)) {
+    Standard_Integer nb = data->NbParams(nsub);
+    aStyles = new StepVisual_HArray1OfPresentationStyleAssignment(1, nb);
+    for (Standard_Integer i = 1; i <= nb; i++) {
+      if (data->ReadEntity(nsub, i, "presentation_style_assignment", ach,
+        STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent))
+        aStyles->SetValue(i, anent);
+    }
+  }
+
+  // Inherited field : item
+  Handle(MMgt_TShared) aItem;
+  data->ReadEntity(num, 3, "item", ach, STANDARD_TYPE(MMgt_TShared), aItem);
+
+  // Own field : fill_style_target
+  Handle(StepGeom_GeometricRepresentationItem) aFillStyleTarget;
+  data->ReadEntity(num, 4, "item", ach, STANDARD_TYPE(StepGeom_GeometricRepresentationItem), aFillStyleTarget);
+
+  // Initialisation of the read entity
+  ent->Init(aName, aStyles, aItem, aFillStyleTarget);
+}
+
+//=======================================================================
+//function : WriteStep
+//purpose  : 
+//=======================================================================
+void RWStepVisual_RWAnnotationFillAreaOccurrence::WriteStep
+(StepData_StepWriter& SW,
+const Handle(StepVisual_AnnotationFillAreaOccurrence)& ent) const
+{
+  // Inherited field : name
+  SW.Send(ent->Name());
+
+  // Inherited field : styles
+  SW.OpenSub();
+  for (Standard_Integer i = 1; i <= ent->NbStyles(); i++) {
+    SW.Send(ent->StylesValue(i));
+  }
+  SW.CloseSub();
+
+  // Inherited field : item
+  SW.Send(ent->Item());
+
+  // Own field: fill_area_target
+  SW.Send(ent->FillStyleTarget());
+}
+
+//=======================================================================
+//function : Share
+//purpose  : 
+//=======================================================================
+void RWStepVisual_RWAnnotationFillAreaOccurrence::Share(const Handle(StepVisual_AnnotationFillAreaOccurrence)& ent, Interface_EntityIterator& iter) const
+{
+  Standard_Integer nbElem1 = ent->NbStyles();
+  for (Standard_Integer i = 1; i <= nbElem1; i++) {
+    iter.GetOneItem(ent->StylesValue(i));
+  }
+  iter.GetOneItem(ent->Item());
+  iter.GetOneItem(ent->FillStyleTarget());
+}
diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.hxx b/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.hxx
new file mode 100644 (file)
index 0000000..50c20df
--- /dev/null
@@ -0,0 +1,45 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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_RWAnnotationFillAreaOccurrence_HeaderFile
+#define _RWStepVisual_RWAnnotationFillAreaOccurrence_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Handle.hxx>
+
+#include <Standard_Integer.hxx>
+class StepData_StepReaderData;
+class Interface_Check;
+class StepVisual_AnnotationFillAreaOccurrence;
+class StepData_StepWriter;
+class Interface_EntityIterator;
+
+//! Read & Write Module for AnnotationFillAreaOccurrence
+class RWStepVisual_RWAnnotationFillAreaOccurrence 
+{
+public:
+
+  DEFINE_STANDARD_ALLOC
+  
+  Standard_EXPORT RWStepVisual_RWAnnotationFillAreaOccurrence();
+  
+  Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationFillAreaOccurrence)& ent) const;
+  
+  Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationFillAreaOccurrence)& ent) const;
+  
+  Standard_EXPORT void Share (const Handle(StepVisual_AnnotationFillAreaOccurrence)& ent, Interface_EntityIterator& iter) const;
+};
+#endif // _RWStepVisual_RWAnnotationFillAreaOccurrence_HeaderFile
index da1074cac42a68861ee8310bda5d7b3040cb475d..df010c12e34da39831f74756efe474ca1b17cc55 100644 (file)
@@ -743,6 +743,8 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
 #include <StepRepr_ConstructiveGeometryRepresentation.hxx>
 #include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
 #include <StepVisual_CharacterizedObjectAndCharacterizedRepresentationAndDraughtingModelAndRepresentation.hxx>
+#include <StepVisual_AnnotationFillArea.hxx>
+#include <StepVisual_AnnotationFillAreaOccurrence.hxx>
 
 static int init = 0;
 static Interface_DataMapOfTransientInteger types(800);
@@ -761,8 +763,8 @@ StepAP214_Protocol::StepAP214_Protocol ()
   types.Bind (STANDARD_TYPE(StepShape_AdvancedBrepShapeRepresentation), 2);
   types.Bind (STANDARD_TYPE(StepShape_AdvancedFace), 3);
   types.Bind (STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence), 4);
-//  types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillArea), 5);
-//  types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillAreaOccurrence), 6);
+  types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillArea), 5);
+  types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillAreaOccurrence), 6);
   types.Bind (STANDARD_TYPE(StepVisual_AnnotationOccurrence), 7);
 //  types.Bind (STANDARD_TYPE(StepVisual_AnnotationSubfigureOccurrence), 8);
 //  types.Bind (STANDARD_TYPE(StepVisual_AnnotationSymbol), 9);
index a6086563bd08755b766a9b1c7a02171133f23e0c..9d7cf98c61098fd5652324c2cf691529e82f5d36 100644 (file)
@@ -65,6 +65,11 @@ void StepToTopoDS_TranslateVertex::Init(const Handle(StepShape_Vertex)& aVertex,
                                                                StepToTopoDS_Tool& aTool,
                                         StepToTopoDS_NMTool& NMTool)
 {
+  if (aVertex.IsNull()) {
+    myError = StepToTopoDS_TranslateVertexOther;
+    done = Standard_False;
+    return;
+  }
   if (!aTool.IsBound(aVertex)) {
 
     // [BEGIN] Proceed with non-manifold topology (ssv; 14.11.2010)
index 9de42462ec41e23af84c3cbcc1812ee2301d5ffb..641d3fcbfeb03574792febc9e848bd990c0dc44b 100644 (file)
@@ -1,5 +1,9 @@
 StepVisual_AnnotationCurveOccurrence.cxx
 StepVisual_AnnotationCurveOccurrence.hxx
+StepVisual_AnnotationFillArea.cxx
+StepVisual_AnnotationFillArea.hxx
+StepVisual_AnnotationFillAreaOccurrence.cxx
+StepVisual_AnnotationFillAreaOccurrence.hxx
 StepVisual_AnnotationOccurrence.cxx
 StepVisual_AnnotationOccurrence.hxx
 StepVisual_AnnotationPlane.cxx
index 79428a82ad660e74bd18f567a167af36a7a144d2..b4a61da53121c6d1e821bbf3f7dad23515694012 100644 (file)
@@ -16,6 +16,6 @@
 #include <Standard_Type.hxx>
 #include <StepVisual_AnnotationCurveOccurrence.hxx>
 
-IMPLEMENT_STANDARD_RTTIEXT(StepVisual_AnnotationCurveOccurrence,StepVisual_StyledItem)
+IMPLEMENT_STANDARD_RTTIEXT(StepVisual_AnnotationCurveOccurrence,StepVisual_AnnotationOccurrence)
 
 StepVisual_AnnotationCurveOccurrence::StepVisual_AnnotationCurveOccurrence ()  {}
index 3223156076ae46bbbcf29893e3c74a4761afca51..2cf5f86d78248adb8afdffb0e40b0b241a74d972 100644 (file)
 #include <Standard.hxx>
 #include <Standard_Type.hxx>
 
-#include <StepVisual_StyledItem.hxx>
+#include <StepVisual_AnnotationOccurrence.hxx>
 
 class StepVisual_AnnotationCurveOccurrence;
-DEFINE_STANDARD_HANDLE(StepVisual_AnnotationCurveOccurrence, StepVisual_StyledItem)
+DEFINE_STANDARD_HANDLE(StepVisual_AnnotationCurveOccurrence, StepVisual_AnnotationOccurrence)
 
-class StepVisual_AnnotationCurveOccurrence : public StepVisual_StyledItem
+class StepVisual_AnnotationCurveOccurrence : public StepVisual_AnnotationOccurrence
 {
 public:
 
   //! Returns a AnnotationCurveOccurrence
   Standard_EXPORT StepVisual_AnnotationCurveOccurrence();
 
-  DEFINE_STANDARD_RTTIEXT(StepVisual_AnnotationCurveOccurrence,StepVisual_StyledItem)
+  DEFINE_STANDARD_RTTIEXT(StepVisual_AnnotationCurveOccurrence,StepVisual_AnnotationOccurrence)
 };
 #endif // _StepVisual_AnnotationCurveOccurrence_HeaderFile
diff --git a/src/StepVisual/StepVisual_AnnotationFillArea.cxx b/src/StepVisual/StepVisual_AnnotationFillArea.cxx
new file mode 100644 (file)
index 0000000..c325d3a
--- /dev/null
@@ -0,0 +1,26 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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 <Standard_Type.hxx>
+#include <StepVisual_AnnotationFillArea.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(StepVisual_AnnotationFillArea, StepShape_GeometricCurveSet)
+
+//=======================================================================
+//function : StepVisual_AnnotationFillArea
+//purpose  : 
+//=======================================================================
+StepVisual_AnnotationFillArea::StepVisual_AnnotationFillArea ()  {}
diff --git a/src/StepVisual/StepVisual_AnnotationFillArea.hxx b/src/StepVisual/StepVisual_AnnotationFillArea.hxx
new file mode 100644 (file)
index 0000000..2b770da
--- /dev/null
@@ -0,0 +1,40 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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_AnnotationFillArea_HeaderFile
+#define _StepVisual_AnnotationFillArea_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Type.hxx>
+
+#include <StepRepr_HArray1OfRepresentationItem.hxx>
+#include <StepShape_GeometricCurveSet.hxx>
+#include <Standard_Integer.hxx>
+class TCollection_HAsciiString;
+
+class StepVisual_AnnotationFillArea;
+DEFINE_STANDARD_HANDLE(StepVisual_AnnotationFillArea, StepShape_GeometricCurveSet)
+
+
+class StepVisual_AnnotationFillArea : public StepShape_GeometricCurveSet
+{
+
+public:  
+  //! Returns a AnnotationFillArea
+  Standard_EXPORT StepVisual_AnnotationFillArea();
+
+  DEFINE_STANDARD_RTTIEXT(StepVisual_AnnotationFillArea, StepShape_GeometricCurveSet)
+};
+#endif // _StepVisual_AnnotationFillArea_HeaderFile
diff --git a/src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.cxx b/src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.cxx
new file mode 100644 (file)
index 0000000..7703719
--- /dev/null
@@ -0,0 +1,38 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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 <Standard_Type.hxx>
+#include <StepVisual_AnnotationFillAreaOccurrence.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(StepVisual_AnnotationFillAreaOccurrence, StepVisual_AnnotationOccurrence)
+
+//=======================================================================
+//function : StepVisual_AnnotationFillAreaOccurrence
+//purpose  : 
+//=======================================================================
+StepVisual_AnnotationFillAreaOccurrence::StepVisual_AnnotationFillAreaOccurrence ()  {}
+
+//=======================================================================
+//function : Init
+//purpose  : 
+//=======================================================================
+void StepVisual_AnnotationFillAreaOccurrence::Init(const Handle(TCollection_HAsciiString)& theName,
+  const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& theStyles,
+  const Handle(MMgt_TShared)& theItem,
+  const Handle(StepGeom_GeometricRepresentationItem)& theFillStyleTarget)
+{
+  StepVisual_AnnotationOccurrence::Init(theName, theStyles, theItem);
+  myFillStyleTarget = theFillStyleTarget;
+}
diff --git a/src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.hxx b/src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.hxx
new file mode 100644 (file)
index 0000000..46bed0d
--- /dev/null
@@ -0,0 +1,57 @@
+// Created on: 2016-12-28
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 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_AnnotationFillAreaOccurrence_HeaderFile
+#define _StepVisual_AnnotationFillAreaOccurrence_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Type.hxx>
+
+#include <StepVisual_AnnotationOccurrence.hxx>
+
+class StepVisual_AnnotationFillAreaOccurrence;
+DEFINE_STANDARD_HANDLE(StepVisual_AnnotationFillAreaOccurrence, StepVisual_AnnotationOccurrence)
+
+class StepVisual_AnnotationFillAreaOccurrence : public StepVisual_AnnotationOccurrence
+{
+public:
+
+  //! Returns a AnnotationFillAreaOccurrence
+  Standard_EXPORT StepVisual_AnnotationFillAreaOccurrence();
+  
+  //! Initialize all fields (own and inherited)
+  Standard_EXPORT void Init (const Handle(TCollection_HAsciiString)& theName,
+                             const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& theStyles,
+                             const Handle(MMgt_TShared)& theItem,
+                             const Handle(StepGeom_GeometricRepresentationItem)& theFillStyleTarget);
+  
+  //! Returns field fill_style_target
+  Standard_EXPORT Handle(StepGeom_GeometricRepresentationItem) FillStyleTarget() const
+  {
+    return myFillStyleTarget;
+  }
+  
+  //! Set field fill_style_target
+  Standard_EXPORT void SetFillStyleTarget (const Handle(StepGeom_GeometricRepresentationItem)& theTarget)
+  {
+    myFillStyleTarget = theTarget;
+  }
+
+  DEFINE_STANDARD_RTTIEXT(StepVisual_AnnotationFillAreaOccurrence, StepVisual_AnnotationOccurrence)
+  
+private:
+  Handle(StepGeom_GeometricRepresentationItem) myFillStyleTarget;
+};
+#endif // _StepVisual_AnnotationFillAreaOccurrence_HeaderFile
index 1abbed6d9efba7d998c1addf4a2aadcbbc91c3a7..3d33b9649dec53e2f6fe51a88a32aee22baba200 100644 (file)
@@ -9,20 +9,20 @@ puts ""
 stepread [locate_data_file bug26451_Test_STEP.stp] a *
 tpcompound result
 
-checkprops result -s 550061 
+checkprops result -s 551394 
 checkshape result
 
 set nbshapes_expected "
 Number of shapes in shape
- VERTEX    : 7973
- EDGE      : 8250
- WIRE      : 1950
- FACE      : 1716
- SHELL     : 1716
+ VERTEX    : 8057
+ EDGE      : 8372
+ WIRE      : 1988
+ FACE      : 1754
+ SHELL     : 1754
  SOLID     : 0
  COMPSOLID : 0
  COMPOUND  : 1
- SHAPE     : 21606
+ SHAPE     : 21926
 "
 checknbshapes result -ref ${nbshapes_expected} -t -m "importing file"
 checkview -display result -3d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/step/bug28256 b/tests/bugs/step/bug28256
new file mode 100644 (file)
index 0000000..16cd68b
--- /dev/null
@@ -0,0 +1,27 @@
+puts "========"
+puts "OCC28256"
+puts "========"
+puts ""
+##########################################################################
+# Opening specific STEP file leads to application crash
+##########################################################################
+
+stepread [locate_data_file bug28256_test.stp] a *
+tpcompound result
+
+checkprops result -s 1.8e+101 
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX    : 56881
+ EDGE      : 85310
+ WIRE      : 37795
+ FACE      : 32992
+ SHELL     : 1318
+ SOLID     : 1308
+ COMPSOLID : 0
+ COMPOUND  : 1
+ SHAPE     : 215605
+"
+checknbshapes result -ref ${nbshapes_expected} -t -m "importing file"
+checkview -display result -3d -path ${imagedir}/${test_image}.png