Interface_Static::Init ("XSTEP","write.step.sequence",'t',"ToSTEP");
Interface_Static::Init ("XSTEP","read.step.sequence",'t',"FromSTEP");
+ // ika 28.07.16: Paremeter to read all top level solids and shells,
+ // should be used only in case of invalid shape_representation without links to shapes.
+ Interface_Static::Init("step", "read.step.all.shapes", 'e', "");
+ Interface_Static::Init("step", "read.step.all.shapes", '&', "enum 0");
+ Interface_Static::Init("step", "read.step.all.shapes", '&', "eval Off");
+ Interface_Static::Init("step", "read.step.all.shapes", '&', "eval On");
+ Interface_Static::SetIVal("read.step.all.shapes", 0);
+
init = Standard_True;
}
#include <StepRepr_RepresentationMap.hxx>
#include <StepRepr_RepresentationRelationship.hxx>
#include <StepRepr_ShapeAspect.hxx>
+#include <StepShape_ManifoldSolidBrep.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
+#include <StepShape_ShellBasedSurfaceModel.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_Array1OfAsciiString.hxx>
#include <TColStd_Array1OfReal.hxx>
Standard_Integer nb = Model()->NbEntities();
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(Standard_Transient) ent = Model()->Value(i);
+ if (Interface_Static::IVal("read.step.all.shapes") == 1) {
+ // Special case to read invalid shape_representation without links to shapes.
+ if (ent->IsKind(STANDARD_TYPE(StepShape_ManifoldSolidBrep))) {
+ Interface_EntityIterator aShareds = WS()->Graph().Sharings(ent);
+ if (!aShareds.More()) {
+ theroots.Append(ent);
+ WS()->TransferReader()->TransientProcess()->RootsForTransfer()->Append(ent);
+ }
+ }
+ if (ent->IsKind(STANDARD_TYPE(StepShape_ShellBasedSurfaceModel))) {
+ Interface_EntityIterator aShareds = WS()->Graph().Sharings(ent);
+ if (!aShareds.More()) {
+ theroots.Append(ent);
+ WS()->TransferReader()->TransientProcess()->RootsForTransfer()->Append(ent);
+ }
+ }
+ }
if(ent->IsKind(STANDARD_TYPE(StepBasic_ProductDefinition))) {
// PTV 31.01.2003 TRJ11 exclude Product Definition With Associated Document from roots
if (ent->IsKind(STANDARD_TYPE(StepBasic_ProductDefinitionWithAssociatedDocuments))) {
--- /dev/null
+puts "========"
+puts "OCC27721"
+puts "========"
+puts ""
+##############################################################################
+# Add possibility to read STEP file with invalid shape_representation entity.
+##############################################################################
+
+param read.step.all.shapes 1
+newmodel
+
+ReadStep D [locate_data_file bug27721.stp]
+
+XGetOneShape result D
+
+checknbshapes result -solid 1 -shell 2 -shape 43
+
+param read.step.all.shapes 0
+newmodel