1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025816: IGES export - edges within compound are lost if BREP mode (IGES 5.1) is used

Enable writing wires, edges, and vertices inside compound in IGES in BREP mode.
Create IGES group for compound even if it contains single shape.
This commit is contained in:
abv
2015-02-10 22:50:51 +03:00
committed by bugmaster
parent 859a47c3d1
commit 19589673b3
3 changed files with 40 additions and 12 deletions

View File

@@ -869,6 +869,11 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More(); Ex.Next()) {
TopoDS_Wire S = TopoDS::Wire(Ex.Current());
AddWarning(S," a Wire alone is not an IGESBRep entity : no Transfer");
BRepToIGES_BRWire BW(*this);
BW.SetModel(GetModel());
IShape = BW.TransferWire(S);
if (!IShape.IsNull()) Seq->Append(IShape);
}
@@ -876,6 +881,11 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More(); Ex.Next()) {
TopoDS_Edge S = TopoDS::Edge(Ex.Current());
AddWarning(S," a Edge alone is not an IGESBRep entity : no Transfer");
BRepToIGES_BRWire BW(*this);
BW.SetModel(GetModel());
IShape = BW.TransferEdge(S, Standard_False);
if (!IShape.IsNull()) Seq->Append(IShape);
}
@@ -883,27 +893,27 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More(); Ex.Next()) {
TopoDS_Vertex S = TopoDS::Vertex(Ex.Current());
AddWarning(S," a Vertex alone is not an IGESBRep entity : no Transfer");
BRepToIGES_BRWire BW(*this);
BW.SetModel(GetModel());
IShape = BW.TransferVertex(S);
if (!IShape.IsNull()) Seq->Append(IShape);
}
// construct the group
Standard_Integer nbshapes = Seq->Length();
Handle(IGESData_HArray1OfIGESEntity) Tab;
if (nbshapes > 1) {
Tab = new IGESData_HArray1OfIGESEntity(1,nbshapes);
if (nbshapes > 0) {
Handle(IGESData_HArray1OfIGESEntity) Tab =
new IGESData_HArray1OfIGESEntity(1,nbshapes);
for (Standard_Integer itab = 1; itab <= nbshapes; itab++) {
Handle(IGESData_IGESEntity) item = GetCasted(IGESData_IGESEntity, Seq->Value(itab));
Tab->SetValue(itab,item);
}
}
if (nbshapes == 1) {
res = IShape;
}
else if(nbshapes > 1) {
Handle(IGESBasic_Group) IGroup = new IGESBasic_Group;
IGroup->Init(Tab);
res = IGroup;
}
}
SetShapeResult ( start, res );