From 3506e665858658dffb707a1eb8ac16ee6c2c7c41 Mon Sep 17 00:00:00 2001 From: ika Date: Wed, 1 Feb 2017 16:50:47 +0300 Subject: [PATCH] 0028256: Opening specific STEP file leads to application crash add check for null. --- src/RWStepAP214/RWStepAP214_GeneralModule.cxx | 24 ++++ .../RWStepAP214_ReadWriteModule.cxx | 32 +++++ src/RWStepVisual/FILES | 4 + .../RWStepVisual_RWAnnotationFillArea.cxx | 98 +++++++++++++++ .../RWStepVisual_RWAnnotationFillArea.hxx | 49 ++++++++ ...pVisual_RWAnnotationFillAreaOccurrence.cxx | 113 ++++++++++++++++++ ...pVisual_RWAnnotationFillAreaOccurrence.hxx | 45 +++++++ src/StepAP214/StepAP214_Protocol.cxx | 6 +- .../StepToTopoDS_TranslateVertex.cxx | 5 + src/StepVisual/FILES | 4 + .../StepVisual_AnnotationCurveOccurrence.cxx | 2 +- .../StepVisual_AnnotationCurveOccurrence.hxx | 8 +- .../StepVisual_AnnotationFillArea.cxx | 26 ++++ .../StepVisual_AnnotationFillArea.hxx | 40 +++++++ ...tepVisual_AnnotationFillAreaOccurrence.cxx | 38 ++++++ ...tepVisual_AnnotationFillAreaOccurrence.hxx | 57 +++++++++ tests/bugs/step/bug26451 | 14 +-- tests/bugs/step/bug28256 | 27 +++++ 18 files changed, 578 insertions(+), 14 deletions(-) create mode 100644 src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx create mode 100644 src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.hxx create mode 100644 src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx create mode 100644 src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.hxx create mode 100644 src/StepVisual/StepVisual_AnnotationFillArea.cxx create mode 100644 src/StepVisual/StepVisual_AnnotationFillArea.hxx create mode 100644 src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.cxx create mode 100644 src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.hxx create mode 100644 tests/bugs/step/bug28256 diff --git a/src/RWStepAP214/RWStepAP214_GeneralModule.cxx b/src/RWStepAP214/RWStepAP214_GeneralModule.cxx index 7cdb5cdd9a..867251c4c5 100644 --- a/src/RWStepAP214/RWStepAP214_GeneralModule.cxx +++ b/src/RWStepAP214/RWStepAP214_GeneralModule.cxx @@ -1359,6 +1359,10 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule) #include #include #include +#include +#include +#include +#include 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; diff --git a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx index 7b8bde6d4a..c8d5355abd 100644 --- a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx +++ b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx @@ -1394,6 +1394,10 @@ Handle(atype) result = Handle(atype)::DownCast (start) #include #include #include +#include +#include +#include +#include // -- 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); diff --git a/src/RWStepVisual/FILES b/src/RWStepVisual/FILES index 059401d1a1..f6f964ded4 100644 --- a/src/RWStepVisual/FILES +++ b/src/RWStepVisual/FILES @@ -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 index 0000000000..fb85f8cf5a --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx @@ -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 +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +//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 index 0000000000..d360bea4a4 --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.hxx @@ -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 +#include +#include + +#include +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 index 0000000000..a2c0ba77bd --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +//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 index 0000000000..50c20df195 --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.hxx @@ -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 +#include +#include + +#include +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 diff --git a/src/StepAP214/StepAP214_Protocol.cxx b/src/StepAP214/StepAP214_Protocol.cxx index da1074cac4..df010c12e3 100644 --- a/src/StepAP214/StepAP214_Protocol.cxx +++ b/src/StepAP214/StepAP214_Protocol.cxx @@ -743,6 +743,8 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI #include #include #include +#include +#include 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); diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateVertex.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateVertex.cxx index a6086563bd..9d7cf98c61 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateVertex.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateVertex.cxx @@ -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) diff --git a/src/StepVisual/FILES b/src/StepVisual/FILES index 9de42462ec..641d3fcbfe 100644 --- a/src/StepVisual/FILES +++ b/src/StepVisual/FILES @@ -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 diff --git a/src/StepVisual/StepVisual_AnnotationCurveOccurrence.cxx b/src/StepVisual/StepVisual_AnnotationCurveOccurrence.cxx index 79428a82ad..b4a61da531 100644 --- a/src/StepVisual/StepVisual_AnnotationCurveOccurrence.cxx +++ b/src/StepVisual/StepVisual_AnnotationCurveOccurrence.cxx @@ -16,6 +16,6 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(StepVisual_AnnotationCurveOccurrence,StepVisual_StyledItem) +IMPLEMENT_STANDARD_RTTIEXT(StepVisual_AnnotationCurveOccurrence,StepVisual_AnnotationOccurrence) StepVisual_AnnotationCurveOccurrence::StepVisual_AnnotationCurveOccurrence () {} diff --git a/src/StepVisual/StepVisual_AnnotationCurveOccurrence.hxx b/src/StepVisual/StepVisual_AnnotationCurveOccurrence.hxx index 3223156076..2cf5f86d78 100644 --- a/src/StepVisual/StepVisual_AnnotationCurveOccurrence.hxx +++ b/src/StepVisual/StepVisual_AnnotationCurveOccurrence.hxx @@ -19,18 +19,18 @@ #include #include -#include +#include 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 index 0000000000..c325d3a469 --- /dev/null +++ b/src/StepVisual/StepVisual_AnnotationFillArea.cxx @@ -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 +#include + +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 index 0000000000..2b770da19f --- /dev/null +++ b/src/StepVisual/StepVisual_AnnotationFillArea.hxx @@ -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 +#include + +#include +#include +#include +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 index 0000000000..7703719a99 --- /dev/null +++ b/src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.cxx @@ -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 +#include + +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 index 0000000000..46bed0d946 --- /dev/null +++ b/src/StepVisual/StepVisual_AnnotationFillAreaOccurrence.hxx @@ -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 +#include + +#include + +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 diff --git a/tests/bugs/step/bug26451 b/tests/bugs/step/bug26451 index 1abbed6d9e..3d33b9649d 100644 --- a/tests/bugs/step/bug26451 +++ b/tests/bugs/step/bug26451 @@ -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 index 0000000000..16cd68bc26 --- /dev/null +++ b/tests/bugs/step/bug28256 @@ -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 -- 2.39.5