1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0025166: STEP Reader - allow GEOMETRIC_SET entity to accept non-geometric children

Allow GEOMETRIC_SET entity to accept GeometricRepresentationItem children

Modification to avoid cyclic dependency between STEPControl and StepToTopoDS packages

Test cases for issue CR25166
This commit is contained in:
drazmyslovich 2014-08-21 12:41:24 +04:00 committed by bugmaster
parent d91b3986ed
commit 38deba5d7f
6 changed files with 58 additions and 7 deletions

View File

@ -1231,7 +1231,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
found = Standard_True;
}
else if (start->IsKind(STANDARD_TYPE(StepShape_GeometricSet))) {
myShapeBuilder.Init(GetCasted(StepShape_GeometricSet, start), TP);
myShapeBuilder.Init(GetCasted(StepShape_GeometricSet, start), TP, this, isManifold);
found = Standard_True;
}
else if (start->IsKind(STANDARD_TYPE(StepShape_EdgeBasedWireframeModel))) {

View File

@ -22,6 +22,7 @@ Standard_Integer StepShape_GeometricSetSelect::CaseNum(const Handle(Standard_Tra
if (ent->IsKind(STANDARD_TYPE(StepGeom_Point))) return 1;
if (ent->IsKind(STANDARD_TYPE(StepGeom_Curve))) return 2;
if (ent->IsKind(STANDARD_TYPE(StepGeom_Surface))) return 3;
if (ent->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) return 4;
return 0;
}

View File

@ -22,7 +22,7 @@ package StepToTopoDS
uses TopoDS, StdFail, TCollection, TColStd, BRep, Geom, Geom2d,
GeomAdaptor, Extrema, gp, Transfer, Geom2dAPI,
StepRepr, StepGeom, StepShape, TopTools
StepRepr, StepGeom, StepShape, TopTools, STEPControl
is

View File

@ -34,7 +34,9 @@ uses
Shape from TopoDS,
BuilderError from StepToTopoDS,
TransientProcess from Transfer,
NMTool from StepToTopoDS
NMTool from StepToTopoDS,
ActorRead from STEPControl,
ActorOfTransientProcess from Transfer
raises NotDone from StdFail
@ -98,7 +100,9 @@ is
Init (me : in out;
S : GeometricSet from StepShape;
TP : TransientProcess from Transfer );
TP : TransientProcess from Transfer;
RA : ActorOfTransientProcess from Transfer = NULL;
isManifold : Boolean = Standard_False );
Value (me) returns Shape from TopoDS
raises NotDone

View File

@ -79,8 +79,12 @@
#include <StepToTopoDS_TranslateFace.hxx>
#include <StepShape_HArray1OfFace.hxx>
#include <STEPControl_ActorRead.hxx>
#include <Message_ProgressSentry.hxx>
#include <Message_Messenger.hxx>
#include <Transfer_ActorOfTransientProcess.hxx>
#include <STEPControl_ActorRead.hxx>
static void ResetPreci (const TopoDS_Shape& S, Standard_Real maxtol)
{
@ -720,7 +724,9 @@ static TopoDS_Face TranslateBoundedSurf (const Handle(StepGeom_Surface) &surf,
void StepToTopoDS_Builder::Init
(const Handle(StepShape_GeometricSet)& GCS,
const Handle(Transfer_TransientProcess)& TP)
const Handle(Transfer_TransientProcess)& TP,
const Handle(Transfer_ActorOfTransientProcess)& RA,
const Standard_Boolean isManifold)
{
// Initialisation of the Tool
@ -842,7 +848,23 @@ void StepToTopoDS_Builder::Init
// try other surfs
else res = TranslateBoundedSurf (aSurf, preci);
}
else TP->AddWarning (ent," Entity is not a Curve, Point or Surface");
else if ( ent->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem)) )
{
Handle(StepGeom_GeometricRepresentationItem) GRI =
Handle(StepGeom_GeometricRepresentationItem)::DownCast(ent);
if (!RA.IsNull())
{
Handle(STEPControl_ActorRead) anActor = Handle(STEPControl_ActorRead)::DownCast(RA);
Handle(Transfer_Binder) binder;
if( !anActor.IsNull())
binder = anActor->TransferShape(GRI, TP, isManifold);
if (!binder.IsNull())
{
res = TransferBRep::ShapeResult(binder);
}
}
}
else TP->AddWarning (ent," Entity is not a Curve, Point, Surface or GeometricRepresentationItem");
if ( ! res.IsNull() ) {
B.Add(S, res);
TransferBRep::SetShapeResult ( TP, ent, res );

24
tests/bugs/step/bug25166 Normal file
View File

@ -0,0 +1,24 @@
puts "============"
puts "OCC25166"
puts "============"
puts ""
#####################################################
# STEP Reader - allow GEOMETRIC_SET entity to accept non-geometric children
#####################################################
stepread [locate_data_file bug25166_piston.stp] a *
tpcompound result
set square 46280.7
set nb_v_good 176
set nb_e_good 176
set nb_w_good 176
set nb_f_good 168
set nb_sh_good 168
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 2
set nb_shape_good 866
set 3dviewer 1