mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
0026174: Data Exchange, IGES - Loss of color after the second write of file
A copy of myface is made, where further on the copy the geometry changes. We connect the face, wire, edge of the original shape with the one whose geometry was changed. This is done in order to get the original shape in the TransferWire() and TransferEdge() methods.
This commit is contained in:
parent
e463b2f685
commit
6ba81a695f
@ -146,7 +146,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BREntity::TransferShape
|
|||||||
TopoDS_Edge E = TopoDS::Edge(start);
|
TopoDS_Edge E = TopoDS::Edge(start);
|
||||||
BRepToIGES_BRWire BW(*this);
|
BRepToIGES_BRWire BW(*this);
|
||||||
BW.SetModel(GetModel());
|
BW.SetModel(GetModel());
|
||||||
res = BW.TransferEdge(E, Standard_False);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
res = BW.TransferEdge(E, anEmptyMap, Standard_False);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_WIRE) {
|
else if (start.ShapeType() == TopAbs_WIRE) {
|
||||||
TopoDS_Wire W = TopoDS::Wire(start);
|
TopoDS_Wire W = TopoDS::Wire(start);
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRepBuilderAPI_Copy.hxx>
|
||||||
#include <BRepToIGES_BREntity.hxx>
|
#include <BRepToIGES_BREntity.hxx>
|
||||||
#include <BRepToIGES_BRShell.hxx>
|
#include <BRepToIGES_BRShell.hxx>
|
||||||
#include <BRepToIGES_BRWire.hxx>
|
#include <BRepToIGES_BRWire.hxx>
|
||||||
@ -123,8 +124,14 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
}
|
}
|
||||||
|
|
||||||
// pour explorer la face , il faut la mettre fORWARD.
|
// pour explorer la face , il faut la mettre fORWARD.
|
||||||
TopoDS_Face myface;
|
TopoDS_Face aFace = start;
|
||||||
|
// Associates the input face (start) and its sub-shapes with the reversed variant,
|
||||||
|
// if the input face has a Reversed orientation
|
||||||
|
TopTools_DataMapOfShapeShape aShapeShapeMap;
|
||||||
if (start.Orientation() == TopAbs_REVERSED) {
|
if (start.Orientation() == TopAbs_REVERSED) {
|
||||||
|
BRepBuilderAPI_Copy aCopy;
|
||||||
|
aCopy.Perform(aFace);
|
||||||
|
|
||||||
//create face with redirected surface
|
//create face with redirected surface
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
TopLoc_Location aLoc;
|
TopLoc_Location aLoc;
|
||||||
@ -133,29 +140,35 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
{
|
{
|
||||||
// take basis surface, because pcurves will be transformed, so trim will be shifted,
|
// take basis surface, because pcurves will be transformed, so trim will be shifted,
|
||||||
// accorded to new face bounds
|
// accorded to new face bounds
|
||||||
Handle(Geom_RectangularTrimmedSurface) aTrimmedSurf =
|
Handle(Geom_RectangularTrimmedSurface) aTrimmedSurf =
|
||||||
Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf);
|
Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf);
|
||||||
aSurf = aTrimmedSurf->BasisSurface();
|
aSurf = aTrimmedSurf->BasisSurface();
|
||||||
}
|
}
|
||||||
aSurf = aSurf->UReversed();
|
aSurf = aSurf->UReversed();
|
||||||
Standard_Real aTol = BRep_Tool::Tolerance(start);
|
Standard_Real aTol = BRep_Tool::Tolerance(start);
|
||||||
B.MakeFace(myface, aSurf, aLoc ,aTol);
|
B.MakeFace(aFace, aSurf, aLoc, aTol);
|
||||||
// set specifics flags of a Face
|
// set specifics flags of a Face
|
||||||
B.NaturalRestriction(myface, BRep_Tool::NaturalRestriction(start));
|
B.NaturalRestriction(aFace, BRep_Tool::NaturalRestriction(start));
|
||||||
//add wires
|
//add wires
|
||||||
TopoDS_Wire anOuter = TopoDS::Wire(ShapeAlgo::AlgoContainer()->OuterWire(start));
|
TopoDS_Wire anOuter = TopoDS::Wire(ShapeAlgo::AlgoContainer()->OuterWire(start));
|
||||||
TopExp_Explorer ex;
|
TopExp_Explorer ex;
|
||||||
for (ex.Init(start,TopAbs_WIRE); ex.More(); ex.Next()) {
|
for (ex.Init(start, TopAbs_WIRE); ex.More(); ex.Next()) {
|
||||||
TopoDS_Wire W = TopoDS::Wire(ex.Current());
|
TopoDS_Wire W = TopoDS::Wire(ex.Current());
|
||||||
|
TopoDS_Wire aCopyWire = TopoDS::Wire(aCopy.ModifiedShape(W));
|
||||||
|
aCopyWire = TopoDS::Wire(aCopyWire.Oriented(W.Orientation()));
|
||||||
if (!W.IsNull() && W.IsSame(anOuter)) {
|
if (!W.IsNull() && W.IsSame(anOuter)) {
|
||||||
B.Add(myface, W);
|
B.Add(aFace, aCopyWire);
|
||||||
|
aShapeShapeMap.Bind(aCopyWire, W); // Bind the reversed copy of Wire to the original
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ex.Init(start,TopAbs_WIRE); ex.More(); ex.Next()) {
|
for (ex.Init(start, TopAbs_WIRE); ex.More(); ex.Next()) {
|
||||||
TopoDS_Wire W = TopoDS::Wire(ex.Current());
|
TopoDS_Wire W = TopoDS::Wire(ex.Current());
|
||||||
|
TopoDS_Wire aCopyWire = TopoDS::Wire(aCopy.ModifiedShape(W));
|
||||||
|
aCopyWire = TopoDS::Wire(aCopyWire.Oriented(W.Orientation()));
|
||||||
if (!W.IsNull() && !W.IsSame(anOuter)) {
|
if (!W.IsNull() && !W.IsSame(anOuter)) {
|
||||||
B.Add(myface, W);
|
B.Add(aFace, aCopyWire);
|
||||||
|
aShapeShapeMap.Bind(aCopyWire, W); // Bind the reversed copy of Wire to the original
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,43 +180,48 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
gp_Ax2d axis(gp_Pnt2d(aCenter, V1), gp_Dir2d(0.,1.));
|
gp_Ax2d axis(gp_Pnt2d(aCenter, V1), gp_Dir2d(0.,1.));
|
||||||
T.SetMirror(axis);
|
T.SetMirror(axis);
|
||||||
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
|
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
|
||||||
for (ex.Init(myface,TopAbs_EDGE);ex.More(); ex.Next()) {
|
for (ex.Init(start, TopAbs_EDGE); ex.More(); ex.Next()) {
|
||||||
TopoDS_Edge anEdge = TopoDS::Edge(ex.Current());
|
TopoDS_Edge anOrigEdge = TopoDS::Edge(ex.Current());
|
||||||
if (!aMap.Add(anEdge))
|
TopoDS_Edge aCopyEdge = TopoDS::Edge(aCopy.ModifiedShape(anOrigEdge));
|
||||||
|
aCopyEdge = TopoDS::Edge(aCopyEdge.Oriented(anOrigEdge.Orientation()));
|
||||||
|
if (!aMap.Add(aCopyEdge))
|
||||||
// seam edge has been already updated
|
// seam edge has been already updated
|
||||||
continue;
|
continue;
|
||||||
Standard_Real f, l;
|
Standard_Real f, l;
|
||||||
Handle(Geom2d_Curve) aCurve1, aCurve2;
|
Handle(Geom2d_Curve) aCurve1, aCurve2;
|
||||||
aCurve1 = BRep_Tool::CurveOnSurface(anEdge, start, f, l);
|
aCurve1 = BRep_Tool::CurveOnSurface(aCopyEdge, TopoDS::Face(aCopy.ModifiedShape(start)), f, l);
|
||||||
aTol = BRep_Tool::Tolerance(anEdge);
|
aTol = BRep_Tool::Tolerance(aCopyEdge);
|
||||||
if (!aCurve1.IsNull()) {
|
if (!aCurve1.IsNull()) {
|
||||||
aCurve1 = Handle(Geom2d_Curve)::DownCast(aCurve1->Transformed(T));
|
aCurve1 = Handle(Geom2d_Curve)::DownCast(aCurve1->Transformed(T));
|
||||||
if (BRepTools::IsReallyClosed(anEdge, start)) {
|
if (BRepTools::IsReallyClosed(aCopyEdge, TopoDS::Face(aCopy.ModifiedShape(start)))) {
|
||||||
TopoDS_Edge revEdge = TopoDS::Edge(anEdge.Reversed());
|
TopoDS_Edge revEdge = TopoDS::Edge(aCopyEdge.Reversed());
|
||||||
aCurve2 = BRep_Tool::CurveOnSurface(revEdge, start, f, l);
|
aCurve2 = BRep_Tool::CurveOnSurface(revEdge, TopoDS::Face(aCopy.ModifiedShape(start)), f, l);
|
||||||
if (!aCurve2.IsNull()) {
|
if (!aCurve2.IsNull()) {
|
||||||
aCurve2 = Handle(Geom2d_Curve)::DownCast(aCurve2->Transformed(T));
|
aCurve2 = Handle(Geom2d_Curve)::DownCast(aCurve2->Transformed(T));
|
||||||
if (anEdge.Orientation() == TopAbs_FORWARD)
|
if (aCopyEdge.Orientation() == TopAbs_FORWARD)
|
||||||
B.UpdateEdge(anEdge, aCurve1, aCurve2, myface, aTol);
|
{
|
||||||
|
B.UpdateEdge(aCopyEdge, aCurve1, aCurve2, aFace, aTol);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
B.UpdateEdge(anEdge, aCurve2, aCurve1, myface, aTol);
|
{
|
||||||
|
B.UpdateEdge(aCopyEdge, aCurve2, aCurve1, aFace, aTol);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
B.UpdateEdge(anEdge, aCurve1, myface, aTol);
|
B.UpdateEdge(aCopyEdge, aCurve1, aFace, aTol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
B.UpdateEdge(anEdge, aCurve1, myface, aTol);
|
B.UpdateEdge(aCopyEdge, aCurve1, aFace, aTol);
|
||||||
}
|
}
|
||||||
// set range for degenerated edges
|
// set range for degenerated edges
|
||||||
if (BRep_Tool::Degenerated(anEdge)) {
|
if (BRep_Tool::Degenerated(aCopyEdge)) {
|
||||||
B.Range(anEdge, myface, f, l);
|
B.Range(aCopyEdge, aFace, f, l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
aShapeShapeMap.Bind(aCopyEdge, anOrigEdge); // Bind the reversed copy of Edge to the original
|
||||||
}
|
}
|
||||||
}
|
aShapeShapeMap.Bind(start, aFace); // Bind the original face to the reversed copy
|
||||||
else {
|
|
||||||
myface = start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Standard_Integer Nb = 0; //szv#4:S4163:12Mar99 unused
|
//Standard_Integer Nb = 0; //szv#4:S4163:12Mar99 unused
|
||||||
@ -213,13 +231,12 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
// returns the face surface
|
// returns the face surface
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
Handle(Geom_Surface) Surf = BRep_Tool::Surface(myface);
|
Handle(Geom_Surface) Surf = BRep_Tool::Surface(aFace);
|
||||||
Handle(Geom_Surface) Surf1;
|
|
||||||
|
|
||||||
if (!Surf.IsNull()) {
|
if (!Surf.IsNull()) {
|
||||||
Standard_Real U1, U2, V1, V2;
|
Standard_Real U1, U2, V1, V2;
|
||||||
// pour limiter les surfaces de base
|
// pour limiter les surfaces de base
|
||||||
BRepTools::UVBounds(myface, U1, U2, V1, V2);
|
BRepTools::UVBounds(aFace, U1, U2, V1, V2);
|
||||||
GeomToIGES_GeomSurface GS;
|
GeomToIGES_GeomSurface GS;
|
||||||
GS.SetModel(GetModel());
|
GS.SetModel(GetModel());
|
||||||
ISurf = GS.TransferSurface(Surf, U1, U2, V1, V2);
|
ISurf = GS.TransferSurface(Surf, U1, U2, V1, V2);
|
||||||
@ -228,14 +245,6 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
Length = GS.Length();
|
Length = GS.Length();
|
||||||
|
|
||||||
// modif mjm du 17/07/97
|
|
||||||
if (Surf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
|
|
||||||
DeclareAndCast(Geom_RectangularTrimmedSurface, rectang, Surf);
|
|
||||||
Surf1 = rectang->BasisSurface();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Surf1 = Surf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -249,11 +258,11 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
|
|
||||||
// outer wire
|
// outer wire
|
||||||
//:n3 TopoDS_Wire Outer = BRepTools::OuterWire(myface);
|
//:n3 TopoDS_Wire Outer = BRepTools::OuterWire(myface);
|
||||||
TopoDS_Wire Outer = ShapeAlgo::AlgoContainer()->OuterWire(myface); //:n3
|
TopoDS_Wire Outer = ShapeAlgo::AlgoContainer()->OuterWire(aFace); //:n3
|
||||||
Handle(IGESGeom_CurveOnSurface) IOuter = new IGESGeom_CurveOnSurface;
|
Handle(IGESGeom_CurveOnSurface) IOuter = new IGESGeom_CurveOnSurface;
|
||||||
if (!Outer.IsNull()) {
|
if (!Outer.IsNull()) {
|
||||||
Handle(IGESData_IGESEntity) ICurve3d =
|
Handle(IGESData_IGESEntity) ICurve3d =
|
||||||
BW.TransferWire(Outer, myface, ICurve2d, Length);
|
BW.TransferWire(Outer, aFace, aShapeShapeMap, ICurve2d, Length);
|
||||||
if ((!ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 3;
|
if ((!ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 3;
|
||||||
if ((!ICurve3d.IsNull()) && (ICurve2d.IsNull())) Iprefer = 2;
|
if ((!ICurve3d.IsNull()) && (ICurve2d.IsNull())) Iprefer = 2;
|
||||||
if ((ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 1;
|
if ((ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 1;
|
||||||
@ -264,7 +273,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
TopExp_Explorer Ex;
|
TopExp_Explorer Ex;
|
||||||
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
||||||
|
|
||||||
for (Ex.Init(myface,TopAbs_WIRE); Ex.More(); Ex.Next()) {
|
for (Ex.Init(aFace, TopAbs_WIRE); Ex.More(); Ex.Next()) {
|
||||||
TopoDS_Wire W = TopoDS::Wire(Ex.Current());
|
TopoDS_Wire W = TopoDS::Wire(Ex.Current());
|
||||||
Handle(IGESGeom_CurveOnSurface) Curve = new IGESGeom_CurveOnSurface;
|
Handle(IGESGeom_CurveOnSurface) Curve = new IGESGeom_CurveOnSurface;
|
||||||
if (W.IsNull()) {
|
if (W.IsNull()) {
|
||||||
@ -272,7 +281,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
}
|
}
|
||||||
else if (!W.IsSame(Outer)) {
|
else if (!W.IsSame(Outer)) {
|
||||||
Handle(IGESData_IGESEntity) ICurve3d =
|
Handle(IGESData_IGESEntity) ICurve3d =
|
||||||
BW.TransferWire(W, myface, ICurve2d, Length);
|
BW.TransferWire(W, aFace, aShapeShapeMap, ICurve2d, Length);
|
||||||
if ((!ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 3;
|
if ((!ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 3;
|
||||||
if ((!ICurve3d.IsNull()) && (ICurve2d.IsNull())) Iprefer = 2;
|
if ((!ICurve3d.IsNull()) && (ICurve2d.IsNull())) Iprefer = 2;
|
||||||
if ((ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 1;
|
if ((ICurve3d.IsNull()) && (!ICurve2d.IsNull())) Iprefer = 1;
|
||||||
@ -282,15 +291,15 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
}
|
}
|
||||||
|
|
||||||
// all inners edges not in a wire
|
// all inners edges not in a wire
|
||||||
for (Ex.Init(myface,TopAbs_EDGE,TopAbs_WIRE); Ex.More(); Ex.Next()) {
|
for (Ex.Init(aFace,TopAbs_EDGE,TopAbs_WIRE); Ex.More(); Ex.Next()) {
|
||||||
TopoDS_Edge E = TopoDS::Edge(Ex.Current());
|
TopoDS_Edge E = TopoDS::Edge(Ex.Current());
|
||||||
Handle(IGESGeom_CurveOnSurface) Curve = new IGESGeom_CurveOnSurface;
|
Handle(IGESGeom_CurveOnSurface) Curve = new IGESGeom_CurveOnSurface;
|
||||||
if (E.IsNull()) {
|
if (E.IsNull()) {
|
||||||
AddWarning(start," an Edge is a null entity");
|
AddWarning(start," an Edge is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Handle(IGESData_IGESEntity) ICurve3d = BW.TransferEdge(E, Standard_False);
|
Handle(IGESData_IGESEntity) ICurve3d = BW.TransferEdge(E, aShapeShapeMap, Standard_False);
|
||||||
Handle(IGESData_IGESEntity) newICurve2d = BW.TransferEdge(E, myface, Length, Standard_False);
|
Handle(IGESData_IGESEntity) newICurve2d = BW.TransferEdge(E, aFace, aShapeShapeMap, Length, Standard_False);
|
||||||
if ((!ICurve3d.IsNull()) && (!newICurve2d.IsNull())) Iprefer = 3;
|
if ((!ICurve3d.IsNull()) && (!newICurve2d.IsNull())) Iprefer = 3;
|
||||||
if ((!ICurve3d.IsNull()) && (newICurve2d.IsNull())) Iprefer = 2;
|
if ((!ICurve3d.IsNull()) && (newICurve2d.IsNull())) Iprefer = 2;
|
||||||
if ((ICurve3d.IsNull()) && (!newICurve2d.IsNull())) Iprefer = 1;
|
if ((ICurve3d.IsNull()) && (!newICurve2d.IsNull())) Iprefer = 1;
|
||||||
|
@ -306,7 +306,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_C
|
|||||||
AddWarning(start," an Edge is a null entity");
|
AddWarning(start," an Edge is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShape = BW.TransferEdge(S, Standard_False);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
IShape = BW.TransferEdge(S, anEmptyMap, Standard_False);
|
||||||
if (!IShape.IsNull()) Seq->Append(IShape);
|
if (!IShape.IsNull()) Seq->Append(IShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
|||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_EDGE) {
|
else if (start.ShapeType() == TopAbs_EDGE) {
|
||||||
TopoDS_Edge E = TopoDS::Edge(start);
|
TopoDS_Edge E = TopoDS::Edge(start);
|
||||||
res = TransferEdge(E, Standard_False);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
res = TransferEdge(E, anEmptyMap, Standard_False);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_WIRE) {
|
else if (start.ShapeType() == TopAbs_WIRE) {
|
||||||
TopoDS_Wire W = TopoDS::Wire(start);
|
TopoDS_Wire W = TopoDS::Wire(start);
|
||||||
@ -249,17 +250,18 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferVertex
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge
|
Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge
|
||||||
(const TopoDS_Edge& myedge,
|
(const TopoDS_Edge& theEdge,
|
||||||
const Standard_Boolean isBRepMode)
|
const TopTools_DataMapOfShapeShape& theOriginMap,
|
||||||
|
const Standard_Boolean theIsBRepMode)
|
||||||
{
|
{
|
||||||
Handle(IGESData_IGESEntity) res;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( myedge.IsNull()) return res;
|
if (theEdge.IsNull()) return res;
|
||||||
|
|
||||||
// returns the 3d curve of the edge and the parameter range
|
// returns the 3d curve of the edge and the parameter range
|
||||||
TopLoc_Location L;
|
TopLoc_Location L;
|
||||||
Standard_Real First, Last, U1, U2;
|
Standard_Real First, Last, U1, U2;
|
||||||
Handle(IGESData_IGESEntity) ICurve;
|
Handle(IGESData_IGESEntity) ICurve;
|
||||||
Handle(Geom_Curve) Curve3d = BRep_Tool::Curve(myedge, L, First, Last);
|
Handle(Geom_Curve) Curve3d = BRep_Tool::Curve(theEdge, L, First, Last);
|
||||||
|
|
||||||
//#28 rln 19.10.98 UKI60155, etc.
|
//#28 rln 19.10.98 UKI60155, etc.
|
||||||
//Only Bezier will be converted into B-Spline, not Conic. This conertation
|
//Only Bezier will be converted into B-Spline, not Conic. This conertation
|
||||||
@ -275,7 +277,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge
|
|||||||
else
|
else
|
||||||
Curve3d = Handle(Geom_Curve)::DownCast(Curve3d->Copy());
|
Curve3d = Handle(Geom_Curve)::DownCast(Curve3d->Copy());
|
||||||
|
|
||||||
if (myedge.Orientation() == TopAbs_REVERSED && !isBRepMode) {
|
if (theEdge.Orientation() == TopAbs_REVERSED && !theIsBRepMode) {
|
||||||
U1 = Curve3d->ReversedParameter(Last);
|
U1 = Curve3d->ReversedParameter(Last);
|
||||||
U2 = Curve3d->ReversedParameter(First);
|
U2 = Curve3d->ReversedParameter(First);
|
||||||
Curve3d->Reverse();
|
Curve3d->Reverse();
|
||||||
@ -296,7 +298,9 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge
|
|||||||
|
|
||||||
if (!ICurve.IsNull()) res = ICurve;
|
if (!ICurve.IsNull()) res = ICurve;
|
||||||
|
|
||||||
SetShapeResult ( myedge, res );
|
// In the reverted face's case find an origin by the reverted
|
||||||
|
TopoDS_Edge anEdge = !theOriginMap.IsEmpty() ? TopoDS::Edge(theOriginMap.Find(theEdge)) : theEdge;
|
||||||
|
SetShapeResult ( anEdge, res );
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -306,22 +310,23 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge
|
|||||||
// TransferEdge
|
// TransferEdge
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge& myedge,
|
Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge& theEdge,
|
||||||
const TopoDS_Face& myface,
|
const TopoDS_Face& theFace,
|
||||||
const Standard_Real length,
|
const TopTools_DataMapOfShapeShape& theOriginMap,
|
||||||
const Standard_Boolean isBRepMode)
|
const Standard_Real theLength,
|
||||||
|
const Standard_Boolean theIsBRepMode)
|
||||||
{
|
{
|
||||||
Handle(IGESData_IGESEntity) res;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( myedge.IsNull() || GetPCurveMode() ==0 ||
|
if (theEdge.IsNull() || GetPCurveMode() ==0 ||
|
||||||
( ! isBRepMode && BRep_Tool::Degenerated ( myedge ) ) ) return res;
|
( ! theIsBRepMode && BRep_Tool::Degenerated (theEdge) ) ) return res;
|
||||||
|
|
||||||
//S4181 pdn 23.04.99 adjusting length factor according to analytic mode.
|
//S4181 pdn 23.04.99 adjusting length factor according to analytic mode.
|
||||||
Standard_Real myLen = length;
|
Standard_Real myLen = theLength;
|
||||||
Standard_Boolean analyticMode = ( GetConvertSurfaceMode() ==0 && isBRepMode );
|
Standard_Boolean analyticMode = ( GetConvertSurfaceMode() ==0 && theIsBRepMode );
|
||||||
|
|
||||||
// returns the 2d curve associated to myedge in the parametric space of myface
|
// returns the 2d curve associated to theEdge in the parametric space of theFace
|
||||||
Standard_Real First, Last;
|
Standard_Real First, Last;
|
||||||
Handle(Geom2d_Curve) Curve2d = BRep_Tool::CurveOnSurface(myedge, myface, First, Last);
|
Handle(Geom2d_Curve) Curve2d = BRep_Tool::CurveOnSurface(theEdge, theFace, First, Last);
|
||||||
Handle(IGESData_IGESEntity) ICurve2d;
|
Handle(IGESData_IGESEntity) ICurve2d;
|
||||||
//#29 rln 19.10.98
|
//#29 rln 19.10.98
|
||||||
|
|
||||||
@ -333,12 +338,12 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
|
|||||||
// It is necessary to invert (u,v) surfaces of revolution.
|
// It is necessary to invert (u,v) surfaces of revolution.
|
||||||
|
|
||||||
TopLoc_Location L;
|
TopLoc_Location L;
|
||||||
Handle(Geom_Surface) st = BRep_Tool::Surface(myface, L);
|
Handle(Geom_Surface) st = BRep_Tool::Surface(theFace, L);
|
||||||
if (st->IsKind(STANDARD_TYPE(Geom_Plane))){
|
if (st->IsKind(STANDARD_TYPE(Geom_Plane))){
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
Standard_Real Ufirst, Ulast, Vfirst, Vlast;
|
Standard_Real Ufirst, Ulast, Vfirst, Vlast;
|
||||||
BRepTools::UVBounds(myface, Ufirst, Ulast, Vfirst, Vlast);
|
BRepTools::UVBounds(theFace, Ufirst, Ulast, Vfirst, Vlast);
|
||||||
Handle(Geom_Surface) Surf;
|
Handle(Geom_Surface) Surf;
|
||||||
|
|
||||||
if (st->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
|
if (st->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
|
||||||
@ -439,7 +444,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
|
|||||||
//S4181 transfer functionality
|
//S4181 transfer functionality
|
||||||
gp_Trsf2d trans;
|
gp_Trsf2d trans;
|
||||||
Standard_Real uFact = 1.;
|
Standard_Real uFact = 1.;
|
||||||
if(isBRepMode && Surf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
if(theIsBRepMode && Surf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||||
trans.SetScale(gp_Pnt2d(0,0),1./GetUnit());
|
trans.SetScale(gp_Pnt2d(0,0),1./GetUnit());
|
||||||
}
|
}
|
||||||
if(Surf->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) {
|
if(Surf->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) {
|
||||||
@ -485,7 +490,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
|
|||||||
Curve2d = sbe.TransformPCurve(Curve2d,trans1,1.,First,Last);
|
Curve2d = sbe.TransformPCurve(Curve2d,trans1,1.,First,Last);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myedge.Orientation() == TopAbs_REVERSED) {
|
if (theEdge.Orientation() == TopAbs_REVERSED) {
|
||||||
Standard_Real tmpFirst = Curve2d->ReversedParameter(Last),
|
Standard_Real tmpFirst = Curve2d->ReversedParameter(Last),
|
||||||
tmpLast = Curve2d->ReversedParameter(First);
|
tmpLast = Curve2d->ReversedParameter(First);
|
||||||
Curve2d->Reverse();
|
Curve2d->Reverse();
|
||||||
@ -503,7 +508,9 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
|
|||||||
|
|
||||||
if (!ICurve2d.IsNull()) res = ICurve2d;
|
if (!ICurve2d.IsNull()) res = ICurve2d;
|
||||||
|
|
||||||
SetShapeResult ( myedge, res );
|
// In the reverted face's case find an origin by the reverted
|
||||||
|
TopoDS_Edge anEdge = !theOriginMap.IsEmpty() ? TopoDS::Edge(theOriginMap.Find(theEdge)) : theEdge;
|
||||||
|
SetShapeResult ( anEdge, res );
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -535,7 +542,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
|||||||
AddWarning(mywire, "an Edge is a null entity");
|
AddWarning(mywire, "an Edge is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ent = TransferEdge(E, Standard_False);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
ent = TransferEdge(E, anEmptyMap, Standard_False);
|
||||||
if (!ent.IsNull()) Seq->Append(ent);
|
if (!ent.IsNull()) Seq->Append(ent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -571,13 +579,14 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
||||||
(const TopoDS_Wire & mywire,
|
(const TopoDS_Wire & theWire,
|
||||||
const TopoDS_Face & myface,
|
const TopoDS_Face& theFace,
|
||||||
Handle(IGESData_IGESEntity)& mycurve2d,
|
const TopTools_DataMapOfShapeShape& theOriginMap,
|
||||||
const Standard_Real length)
|
Handle(IGESData_IGESEntity)& theCurve2d,
|
||||||
|
const Standard_Real theLength)
|
||||||
{
|
{
|
||||||
Handle(IGESData_IGESEntity) res;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( mywire.IsNull()) return res;
|
if (theWire.IsNull()) return res;
|
||||||
|
|
||||||
Handle(IGESData_IGESEntity) ent3d ;
|
Handle(IGESData_IGESEntity) ent3d ;
|
||||||
Handle(IGESData_IGESEntity) ent2d ;
|
Handle(IGESData_IGESEntity) ent2d ;
|
||||||
@ -586,45 +595,45 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
|||||||
|
|
||||||
|
|
||||||
// create a 3d CompositeCurve and a 2d CompositeCurve
|
// create a 3d CompositeCurve and a 2d CompositeCurve
|
||||||
TopExp_Explorer TE(mywire, TopAbs_VERTEX);
|
TopExp_Explorer TE(theWire, TopAbs_VERTEX);
|
||||||
if ( TE.More()) {
|
if ( TE.More()) {
|
||||||
// PTV OCC908 workaround for KAS:dev version
|
// PTV OCC908 workaround for KAS:dev version
|
||||||
/*
|
/*
|
||||||
BRepTools_WireExplorer WE;
|
BRepTools_WireExplorer WE;
|
||||||
for ( WE.Init(mywire,myface); WE.More(); WE.Next()) {
|
for ( WE.Init(theWire,theFace); WE.More(); WE.Next()) {
|
||||||
TopoDS_Edge E = WE.Current();
|
TopoDS_Edge E = WE.Current();
|
||||||
if (E.IsNull()) {
|
if (E.IsNull()) {
|
||||||
AddWarning(mywire, "an Edge is a null entity");
|
AddWarning(theWire, "an Edge is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ent3d = TransferEdge(E, Standard_False);
|
ent3d = TransferEdge(E, Standard_False);
|
||||||
if (!ent3d.IsNull()) Seq3d->Append(ent3d);
|
if (!ent3d.IsNull()) Seq3d->Append(ent3d);
|
||||||
ent2d = TransferEdge(E, myface, length, Standard_False);
|
ent2d = TransferEdge(E, theFace, theLength, Standard_False);
|
||||||
if (!ent2d.IsNull()) Seq2d->Append(ent2d);
|
if (!ent2d.IsNull()) Seq2d->Append(ent2d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
Handle(ShapeFix_Wire) aSFW =
|
Handle(ShapeFix_Wire) aSFW =
|
||||||
new ShapeFix_Wire( mywire, myface, Precision::Confusion() );
|
new ShapeFix_Wire( theWire, theFace, Precision::Confusion() );
|
||||||
aSFW->FixReorder();
|
aSFW->FixReorder();
|
||||||
Handle(ShapeExtend_WireData) aSEWD = aSFW->WireData();
|
Handle(ShapeExtend_WireData) aSEWD = aSFW->WireData();
|
||||||
Standard_Integer nbE = aSEWD->NbEdges();
|
Standard_Integer nbE = aSEWD->NbEdges();
|
||||||
for (Standard_Integer windex = 1; windex <= nbE; windex++) {
|
for (Standard_Integer windex = 1; windex <= nbE; windex++) {
|
||||||
TopoDS_Edge E = aSEWD->Edge( windex );
|
TopoDS_Edge E = aSEWD->Edge( windex );
|
||||||
if (E.IsNull()) {
|
if (E.IsNull()) {
|
||||||
AddWarning(mywire, "an Edge is a null entity");
|
AddWarning(theWire, "an Edge is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ent3d = TransferEdge(E, Standard_False);
|
ent3d = TransferEdge(E, theOriginMap, Standard_False);
|
||||||
if (!ent3d.IsNull()) Seq3d->Append(ent3d);
|
if (!ent3d.IsNull()) Seq3d->Append(ent3d);
|
||||||
ent2d = TransferEdge(E, myface, length, Standard_False);
|
ent2d = TransferEdge(E, theFace, theOriginMap, theLength, Standard_False);
|
||||||
if (!ent2d.IsNull()) Seq2d->Append(ent2d);
|
if (!ent2d.IsNull()) Seq2d->Append(ent2d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// OCC908 end of workaround
|
// OCC908 end of workaround
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
AddWarning(mywire, " no Vertex associated to the Wire");
|
AddWarning(theWire, " no Vertex associated to the Wire");
|
||||||
|
|
||||||
// Composite Curve 3D
|
// Composite Curve 3D
|
||||||
Standard_Integer nb3d = Seq3d->Length();
|
Standard_Integer nb3d = Seq3d->Length();
|
||||||
@ -649,7 +658,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
|||||||
Standard_Integer nb2d = Seq2d->Length();
|
Standard_Integer nb2d = Seq2d->Length();
|
||||||
Handle(IGESData_HArray1OfIGESEntity) Tab2d;
|
Handle(IGESData_HArray1OfIGESEntity) Tab2d;
|
||||||
if ( nb2d == 1 ) {
|
if ( nb2d == 1 ) {
|
||||||
mycurve2d = ent2d;
|
theCurve2d = ent2d;
|
||||||
}
|
}
|
||||||
else if (nb2d >= 2) {
|
else if (nb2d >= 2) {
|
||||||
Tab2d = new IGESData_HArray1OfIGESEntity(1,nb2d);
|
Tab2d = new IGESData_HArray1OfIGESEntity(1,nb2d);
|
||||||
@ -661,10 +670,12 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
|||||||
}
|
}
|
||||||
Handle(IGESGeom_CompositeCurve) Comp = new IGESGeom_CompositeCurve;
|
Handle(IGESGeom_CompositeCurve) Comp = new IGESGeom_CompositeCurve;
|
||||||
Comp->Init(Tab2d);
|
Comp->Init(Tab2d);
|
||||||
mycurve2d = Comp;
|
theCurve2d = Comp;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetShapeResult ( mywire, res );
|
// In the reverted face's case find an origin by the reverted
|
||||||
|
TopoDS_Wire aWire = !theOriginMap.IsEmpty() ? TopoDS::Wire(theOriginMap.Find(theWire)) : theWire;
|
||||||
|
SetShapeResult ( aWire, res );
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include <BRepToIGES_BREntity.hxx>
|
#include <BRepToIGES_BREntity.hxx>
|
||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||||
|
|
||||||
class IGESData_IGESEntity;
|
class IGESData_IGESEntity;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class TopoDS_Vertex;
|
class TopoDS_Vertex;
|
||||||
@ -90,22 +92,22 @@ public:
|
|||||||
//! this member returns a NullEntity.
|
//! this member returns a NullEntity.
|
||||||
Standard_EXPORT Handle(IGESData_IGESEntity) TransferVertex (const TopoDS_Vertex& myvertex, const TopoDS_Face& myface, gp_Pnt2d& mypoint);
|
Standard_EXPORT Handle(IGESData_IGESEntity) TransferVertex (const TopoDS_Vertex& myvertex, const TopoDS_Face& myface, gp_Pnt2d& mypoint);
|
||||||
|
|
||||||
//! Transfert an Edge entity from TopoDS to IGES
|
//! Transfert an Edge 3d entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted,
|
//! If edge is REVERSED and isBRepMode is False 3D edge curve is reversed
|
||||||
//! this member returns a NullEntity.
|
//! @param[in] theEdge input edge to transfer
|
||||||
//! isBRepMode indicates if write mode is BRep
|
//! @param[in] theOriginMap shapemap contains the original shapes. Should be empty if face is not reversed
|
||||||
//! (True when called from BRepToIGESBRep and False when from BRepToIGES)
|
//! @param[in] theIsBRepMode indicates if write mode is BRep
|
||||||
//! If edge is REVERSED and isBRepMode is False 3D edge curve is reversed,
|
//! @return Iges entity or null if could not be converted
|
||||||
//! otherwise, not.
|
Standard_EXPORT Handle(IGESData_IGESEntity) TransferEdge (const TopoDS_Edge& theEdge, const TopTools_DataMapOfShapeShape& theOriginMap, const Standard_Boolean theIsBRepMode);
|
||||||
Standard_EXPORT Handle(IGESData_IGESEntity) TransferEdge (const TopoDS_Edge& myedge, const Standard_Boolean isBRepMode);
|
|
||||||
|
|
||||||
//! Transfert an Edge entity on a Face from TopoDS to IGES
|
//! Transfert an Edge 2d entity on a Face from TopoDS to IGES
|
||||||
//! If this Entity could not be converted,
|
//! @param[in] theEdge input edge to transfer
|
||||||
//! this member returns a NullEntity.
|
//! @param[in] theFace input face to get the surface and UV coordinates from it
|
||||||
//! isBRepMode indicates if write mode is BRep
|
//! @param[in] theOriginMap shapemap contains the original shapes. Should be empty if face is not reversed
|
||||||
//! (True when called from BRepToIGESBRep and False when from BRepToIGES)
|
//! @param[in] theLength input surface length
|
||||||
//! passing into Transform2dCurve()
|
//! @param[in] theIsBRepMode indicates if write mode is BRep
|
||||||
Standard_EXPORT Handle(IGESData_IGESEntity) TransferEdge (const TopoDS_Edge& myedge, const TopoDS_Face& myface, const Standard_Real length, const Standard_Boolean isBRepMode);
|
//! @return Iges entity or null if could not be converted
|
||||||
|
Standard_EXPORT Handle(IGESData_IGESEntity) TransferEdge (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace, const TopTools_DataMapOfShapeShape& theOriginMap, const Standard_Real theLength, const Standard_Boolean theIsBRepMode);
|
||||||
|
|
||||||
//! Transfert a Wire entity from TopoDS to IGES
|
//! Transfert a Wire entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted,
|
//! If this Entity could not be converted,
|
||||||
@ -113,12 +115,14 @@ public:
|
|||||||
Standard_EXPORT Handle(IGESData_IGESEntity) TransferWire (const TopoDS_Wire& mywire);
|
Standard_EXPORT Handle(IGESData_IGESEntity) TransferWire (const TopoDS_Wire& mywire);
|
||||||
|
|
||||||
//! Transfert a Wire entity from TopoDS to IGES.
|
//! Transfert a Wire entity from TopoDS to IGES.
|
||||||
//! Returns the curve associated to mywire in
|
//! @param[in] theWire input wire
|
||||||
//! the parametric space of myface.
|
//! @param[in] theFace input face
|
||||||
//! If this Entity could not be converted,
|
//! @param[in] theOriginMap shapemap contains the original shapes. Should be empty if face is not reversed
|
||||||
//! this member returns a NullEntity.
|
//! @param[in] theCurve2d input curve 2d
|
||||||
//! Parameter IsRevol is not used anymore
|
//! @param[in] theLength input surface length
|
||||||
Standard_EXPORT Handle(IGESData_IGESEntity) TransferWire (const TopoDS_Wire& mywire, const TopoDS_Face& myface, Handle(IGESData_IGESEntity)& mycurve2d, const Standard_Real length);
|
//! @return Iges entity (the curve associated to mywire in the parametric space of myface)
|
||||||
|
//! or null if could not be converted
|
||||||
|
Standard_EXPORT Handle(IGESData_IGESEntity) TransferWire (const TopoDS_Wire& theWire, const TopoDS_Face& theFace, const TopTools_DataMapOfShapeShape& theOriginMap, Handle(IGESData_IGESEntity)& theCurve2d, const Standard_Real theLength);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -303,7 +303,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferShape
|
|||||||
TopoDS_Edge E = TopoDS::Edge(start);
|
TopoDS_Edge E = TopoDS::Edge(start);
|
||||||
BRepToIGES_BRWire BW(*this);
|
BRepToIGES_BRWire BW(*this);
|
||||||
BW.SetModel(GetModel());
|
BW.SetModel(GetModel());
|
||||||
res = BW.TransferEdge(E, Standard_False);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
res = BW.TransferEdge(E, anEmptyMap, Standard_False);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_WIRE) {
|
else if (start.ShapeType() == TopAbs_WIRE) {
|
||||||
@ -357,7 +358,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferEdge (const TopoDS_E
|
|||||||
{
|
{
|
||||||
BRepToIGES_BRWire BR(*this);
|
BRepToIGES_BRWire BR(*this);
|
||||||
BR.SetModel(GetModel());
|
BR.SetModel(GetModel());
|
||||||
return BR.TransferEdge (myedge, Standard_True);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
return BR.TransferEdge (myedge, anEmptyMap, Standard_True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -375,7 +377,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferEdge (const TopoDS_Ed
|
|||||||
|
|
||||||
BRepToIGES_BRWire BR(*this);
|
BRepToIGES_BRWire BR(*this);
|
||||||
BR.SetModel(GetModel());
|
BR.SetModel(GetModel());
|
||||||
ICurve2d = BR.TransferEdge (myedge, myface, Length, Standard_True);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
ICurve2d = BR.TransferEdge (myedge, myface, anEmptyMap, Length, Standard_True);
|
||||||
|
|
||||||
// curve 3d is obligatory. If it does not exist it is created and stored in "myCurves".
|
// curve 3d is obligatory. If it does not exist it is created and stored in "myCurves".
|
||||||
// If the edge is degenerated, there is no associated 3d. So "edge-tuple"
|
// If the edge is degenerated, there is no associated 3d. So "edge-tuple"
|
||||||
@ -897,7 +900,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
|
|||||||
|
|
||||||
BRepToIGES_BRWire BW(*this);
|
BRepToIGES_BRWire BW(*this);
|
||||||
BW.SetModel(GetModel());
|
BW.SetModel(GetModel());
|
||||||
IShape = BW.TransferEdge(S, Standard_False);
|
TopTools_DataMapOfShapeShape anEmptyMap;
|
||||||
|
IShape = BW.TransferEdge(S, anEmptyMap, Standard_False);
|
||||||
if (!IShape.IsNull()) Seq->Append(IShape);
|
if (!IShape.IsNull()) Seq->Append(IShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
45
tests/bugs/iges/bug26174
Normal file
45
tests/bugs/iges/bug26174
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0026174: Data Exchange, IGES - Loss of color after the second write of file"
|
||||||
|
puts "============"
|
||||||
|
|
||||||
|
pload XDE
|
||||||
|
catch { Close D }
|
||||||
|
catch { Close D1 }
|
||||||
|
|
||||||
|
box b 0 0 0 10 10 10
|
||||||
|
compound b c
|
||||||
|
XNewDoc D
|
||||||
|
XAddShape D c 1
|
||||||
|
XSetColor D 0:1:1:1:1 1 0 0
|
||||||
|
|
||||||
|
WriteIges D $imagedir/${casename}_orig.igs
|
||||||
|
XGetOneShape res D
|
||||||
|
set dump [dump res]
|
||||||
|
if { [regexp "Dump of 24 Curve2ds" $dump] != 1 } {
|
||||||
|
puts "Error: incorrect Curve transfer"
|
||||||
|
}
|
||||||
|
WriteIges D $imagedir/${casename}_comp.igs
|
||||||
|
ReadIges D1 $imagedir/${casename}_comp.igs
|
||||||
|
XGetOneShape res1 D1
|
||||||
|
|
||||||
|
vinit view1
|
||||||
|
vclear
|
||||||
|
XDisplay D1 0:1:1:1
|
||||||
|
vfit
|
||||||
|
set ColorD1 [string trim [vreadpixel 204 204 name]]
|
||||||
|
if {$ColorD1 != "RED 1"} {
|
||||||
|
puts "Error: expected color of shape from Document1 is RED."
|
||||||
|
}
|
||||||
|
|
||||||
|
catch {[file delete $imagedir/${casename}_orig.igs]}
|
||||||
|
catch {[file delete $imagedir/${casename}_comp.igs]}
|
||||||
|
|
||||||
|
checkprops res -equal res1
|
||||||
|
set color_orig [XGetAllColors D]
|
||||||
|
set color_comp [XGetAllColors D1]
|
||||||
|
if { $color_orig != $color_comp } {
|
||||||
|
puts "Error: incorrect color transfer"
|
||||||
|
}
|
||||||
|
|
||||||
|
checknbshapes res -vertex 8 -edge 12 -wire 6 -face 6
|
||||||
|
checkview -screenshot -3d -path $imagedir/${test_image}.png
|
@ -1,53 +0,0 @@
|
|||||||
puts "TODO OCC26174 ALL: ERROR: OCC26174 is reproduced."
|
|
||||||
|
|
||||||
puts "========"
|
|
||||||
puts "OCC26174"
|
|
||||||
puts "========"
|
|
||||||
puts ""
|
|
||||||
#######################################################
|
|
||||||
# Loss of color after the second write of file (iges)
|
|
||||||
#######################################################
|
|
||||||
|
|
||||||
pload DCAF
|
|
||||||
|
|
||||||
set aFileD1 ${imagedir}/${casename}_D1.igs
|
|
||||||
set aFileD2 ${imagedir}/${casename}_D2.igs
|
|
||||||
|
|
||||||
set anImageD $imagedir/${casename}_D.png
|
|
||||||
set anImageD1 $imagedir/${casename}_D1.png
|
|
||||||
set anImageD2 $imagedir/${casename}_D2.png
|
|
||||||
|
|
||||||
box b 0 0 0 10 10 10
|
|
||||||
compound b c
|
|
||||||
NewDocument D
|
|
||||||
XAddShape D c 1
|
|
||||||
XSetColor D 0:1:1:1 1 0 0
|
|
||||||
|
|
||||||
XShow D
|
|
||||||
vfit
|
|
||||||
set ColorD [string trim [vreadpixel 204 204 name]]
|
|
||||||
vdump $anImageD
|
|
||||||
|
|
||||||
WriteIges D ${aFileD1}
|
|
||||||
WriteIges D ${aFileD2}
|
|
||||||
|
|
||||||
ReadIges D1 ${aFileD1}
|
|
||||||
ReadIges D2 ${aFileD2}
|
|
||||||
file delete -force ${aFileD1}
|
|
||||||
file delete -force ${aFileD2}
|
|
||||||
|
|
||||||
XShow D1
|
|
||||||
vfit
|
|
||||||
set ColorD1 [string trim [vreadpixel 204 204 name]]
|
|
||||||
vdump $anImageD1
|
|
||||||
if {$ColorD != $ColorD1} {
|
|
||||||
puts "ERROR: OCC26174 is reproduced. Expected color of shape from Document1 is ${ColorD}, not ${ColorD1}."
|
|
||||||
}
|
|
||||||
|
|
||||||
XShow D2
|
|
||||||
vfit
|
|
||||||
set ColorD2 [string trim [vreadpixel 204 204 name]]
|
|
||||||
vdump $anImageD2
|
|
||||||
if {$ColorD != $ColorD2} {
|
|
||||||
puts "ERROR: OCC26174 is reproduced. Expected color of shape from Document2 is ${ColorD}, not ${ColorD2}."
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user