0025169: STEP Reader - allow opened shells to be an outer for ManifoldSolidBrep
authordrazmyslovich <razmyslovich@volumegraphics.com>
Tue, 19 Aug 2014 13:31:06 +0000 (15:31 +0200)
committerbugmaster <bugmaster@opencascade.com>
Thu, 21 Aug 2014 11:51:19 +0000 (15:51 +0400)
Allow opened shells to be an outer for ManifoldSolidBrep

src/RWStepShape/RWStepShape_RWManifoldSolidBrep.cxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/StepShape/StepShape_ManifoldSolidBrep.cdl
src/StepShape/StepShape_ManifoldSolidBrep.cxx
src/StepToTopoDS/StepToTopoDS_Builder.cxx

index 91313b9..6f6eaf0 100644 (file)
@@ -43,9 +43,9 @@ void RWStepShape_RWManifoldSolidBrep::ReadStep
 
        // --- own field : outer ---
 
-       Handle(StepShape_ClosedShell) aOuter;
+       Handle(StepShape_ConnectedFaceSet) aOuter;
        //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
-       data->ReadEntity(num, 2,"outer", ach, STANDARD_TYPE(StepShape_ClosedShell), aOuter);
+       data->ReadEntity(num, 2,"outer", ach, STANDARD_TYPE(StepShape_ConnectedFaceSet), aOuter);
 
        //--- Initialisation of the read entity ---
 
index 73f8577..57202a0 100644 (file)
@@ -2184,7 +2184,7 @@ void STEPCAFControl_Reader::ExpandManifoldSolidBrep(TDF_Label& ShapeLab,
 {
   // Access outer shell
   Handle(StepShape_ManifoldSolidBrep) aMSB = Handle(StepShape_ManifoldSolidBrep)::DownCast(Repr);
-  Handle(StepShape_ClosedShell) aShell = aMSB->Outer();
+  Handle(StepShape_ConnectedFaceSet) aShell = aMSB->Outer();
 
   // Expand shell contents to CAF tree
   ExpandShell(aShell, ShapeLab, TP, ShapeTool);
index ef0186e..71e524f 100644 (file)
@@ -20,6 +20,7 @@ inherits SolidModel from StepShape
 
 uses
 
+       ConnectedFaceSet from StepShape, 
        ClosedShell from StepShape, 
        HAsciiString from TCollection
 is
@@ -35,13 +36,17 @@ is
              aName : HAsciiString from TCollection;
              aOuter : ClosedShell from StepShape) is virtual;
 
+       Init (me : mutable;
+             aName : HAsciiString from TCollection;
+             aOuter : ConnectedFaceSet from StepShape) is virtual;
+
        -- Specific Methods for Field Data Access --
 
-       SetOuter(me : mutable; aOuter : ClosedShell);
-       Outer (me) returns ClosedShell;
+       SetOuter(me : mutable; aOuter : ConnectedFaceSet);
+       Outer (me) returns ConnectedFaceSet;
 
 fields
 
-       outer : ClosedShell from StepShape;
+       outer : ConnectedFaceSet from StepShape;
 
 end ManifoldSolidBrep;
index ab6e04d..46f491f 100644 (file)
@@ -24,8 +24,18 @@ void StepShape_ManifoldSolidBrep::Init(
 }
 
 void StepShape_ManifoldSolidBrep::Init(
+  const Handle(TCollection_HAsciiString)& aName,
+  const Handle(StepShape_ClosedShell)& aOuter)
+{
+  // --- classe own fields ---
+  outer = aOuter;
+  // --- classe inherited fields ---
+  StepRepr_RepresentationItem::Init(aName);
+}
+
+void StepShape_ManifoldSolidBrep::Init(
        const Handle(TCollection_HAsciiString)& aName,
-       const Handle(StepShape_ClosedShell)& aOuter)
+       const Handle(StepShape_ConnectedFaceSet)& aOuter)
 {
        // --- classe own fields ---
        outer = aOuter;
@@ -33,13 +43,12 @@ void StepShape_ManifoldSolidBrep::Init(
        StepRepr_RepresentationItem::Init(aName);
 }
 
-
-void StepShape_ManifoldSolidBrep::SetOuter(const Handle(StepShape_ClosedShell)& aOuter)
+void StepShape_ManifoldSolidBrep::SetOuter(const Handle(StepShape_ConnectedFaceSet)& aOuter)
 {
        outer = aOuter;
 }
 
-Handle(StepShape_ClosedShell) StepShape_ManifoldSolidBrep::Outer() const
+Handle(StepShape_ConnectedFaceSet) StepShape_ManifoldSolidBrep::Outer() const
 {
        return outer;
 }
index e2a27ea..60a57d9 100644 (file)
@@ -192,15 +192,15 @@ void StepToTopoDS_Builder::Init
 
   // Start Mapping
 
-  Handle(StepShape_ClosedShell) aCShell;
-  aCShell = aManifoldSolid->Outer();
+  Handle(StepShape_ConnectedFaceSet) aShell;
+  aShell = aManifoldSolid->Outer();
 
   StepToTopoDS_TranslateShell myTranShell;
   myTranShell.SetPrecision(Precision());
   myTranShell.SetMaxTol(MaxTol());
   // Non-manifold topology is not referenced by ManifoldSolidBrep (ssv; 14.11.2010)
   StepToTopoDS_NMTool dummyNMTool;
-  myTranShell.Init(aCShell, myTool, dummyNMTool);
+  myTranShell.Init(aShell, myTool, dummyNMTool);
 
   if (myTranShell.IsDone()) {
     TopoDS_Shape Sh = myTranShell.Value();
@@ -234,7 +234,7 @@ void StepToTopoDS_Builder::Init
     ResetPreci (S, MaxTol());
   }
   else {
-    TP->AddWarning(aCShell," OuterShell from ManifoldSolidBrep not mapped to TopoDS");
+    TP->AddWarning(aShell," OuterShell from ManifoldSolidBrep not mapped to TopoDS");
     myError  = StepToTopoDS_BuilderOther;
     done     = Standard_False;
   }
@@ -273,7 +273,7 @@ void StepToTopoDS_Builder::Init
   myTranShell.SetMaxTol(MaxTol());
   // OuterBound
 
-  aCShell = aBRepWithVoids->Outer();
+  aCShell = Handle(StepShape_ClosedShell)::DownCast(aBRepWithVoids->Outer());
   // Non-manifold topology is not referenced by BrepWithVoids (ssv; 14.11.2010)
   StepToTopoDS_NMTool dummyNMTool;
   myTranShell.Init(aCShell, myTool, dummyNMTool);
@@ -360,7 +360,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepShape_FacetedBrep)& aFB,
   // Start Mapping
 
   Handle(StepShape_ClosedShell) aCShell;
-  aCShell = aFB->Outer();
+  aCShell = Handle(StepShape_ClosedShell)::DownCast(aFB->Outer());
   TopoDS_Shape Sh;
 
   StepToTopoDS_TranslateShell myTranShell; 
@@ -411,7 +411,7 @@ void StepToTopoDS_Builder::Init
   // Start Mapping
 
   Handle(StepShape_ClosedShell) aCShell;
-  aCShell = aFBABWV->Outer();
+  aCShell = Handle(StepShape_ClosedShell)::DownCast(aFBABWV->Outer());
   TopoDS_Shape Sh;
 
   StepToTopoDS_TranslateShell myTranShell;