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

0022767: Extension of DRAW command fixshape

This commit is contained in:
DBV
2011-12-16 11:18:18 +00:00
committed by bugmaster
parent f793011ee6
commit 999d2599ea
6 changed files with 102 additions and 101 deletions

View File

@@ -517,7 +517,8 @@ Standard_Boolean ShapeFix_Face::Perform()
//fix for loop of wire
TopTools_SequenceOfShape aLoopWires;
if(NeedFix ( myFixLoopWiresMode) && FixLoopWire(aLoopWires)) {
if (aLoopWires.Length() > 1)
SendWarning ( wire, Message_Msg ( "FixAdvFace.FixLoopWire.MSG0" ) );// Wire was splitted on several wires
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE7 );
fixed = Standard_True;
Standard_Integer k=1;
@@ -776,7 +777,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
}
// B.UpdateFace (myFace,myPrecision);
SendWarning (Message_Msg ("FixAdvFace.FixOrientation.MSG0"));//Face created with natural bounds
SendWarning ( myFace, Message_Msg ( "FixAdvFace.FixOrientation.MSG0" ) );// Face created with natural bounds
BRepTools::Update(myFace);
return Standard_True;
}
@@ -926,7 +927,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
#ifdef DEBUG
cout<<"Natural bound on sphere or torus with holes added"<<endl; // mise au point !
#endif
SendWarning (Message_Msg ("FixAdvFace.FixOrientation.MSG0"));//Face created with natural bounds
SendWarning ( myFace, Message_Msg ( "FixAdvFace.FixOrientation.MSG0" ) );// Face created with natural bounds
return Standard_True;
}
@@ -1033,7 +1034,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
new ShapeExtend_WireData (TopoDS::Wire(ws.Value(1)));
sbdw->Reverse ( myFace );
ws.SetValue ( 1, sbdw->Wire() );
SendWarning (Message_Msg ("FixAdvFace.FixOrientation.MSG5"));//Wire on face was reversed
SendWarning ( sbdw->Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
done = Standard_True;
#ifdef DEBUG
cout<<"Wire reversed"<<endl; // mise au point !
@@ -1179,10 +1180,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
}
if (sta == TopAbs_UNKNOWN) { // ERREUR
Message_Msg MSG ("FixAdvFace.FixOrientation.MSG11"); //Cannot orient wire %d of %d
MSG.Arg (i);
MSG.Arg (nb);
SendWarning (MSG);
SendWarning ( aw, Message_Msg ( "FixAdvFace.FixOrientation.MSG11" ) );// Cannot orient wire
}
else {
MW.Bind(aw,IntWires);
@@ -1193,6 +1191,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
ShapeExtend_WireData sewd (aw);
sewd.Reverse(myFace);
ws.SetValue (i,sewd.Wire());
SendWarning ( sewd.Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
aSeqReversed.Append(i);
done = Standard_True;
SI.Bind(ws.Value(i),1);
@@ -1223,6 +1222,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
ShapeExtend_WireData sewd (aw);
sewd.Reverse(myFace);
ws.SetValue (i,sewd.Wire());
SendWarning ( sewd.Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
aSeqReversed.Append(i);
done = Standard_True;
MapWires.Bind(ws.Value(i),IW);
@@ -1235,6 +1235,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
ShapeExtend_WireData sewd (aw);
sewd.Reverse(myFace);
ws.SetValue (i,sewd.Wire());
SendWarning ( sewd.Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
aSeqReversed.Append(i);
done = Standard_True;
}
@@ -1271,13 +1272,10 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
myFace = TopoDS::Face ( S );
BRepTools::Update(myFace);
Standard_Integer k =1;
for( ; k <= aSeqReversed.Length();k++) {
Message_Msg MSG ("FixAdvFace.FixOrientation.MSG10"); //Wire %d of %d on face was reversed
MSG.Arg (aSeqReversed.Value(k));
MSG.Arg (nb);
SendWarning (MSG);
for( ; k <= aSeqReversed.Length(); k++ )
{
#ifdef DEBUG
cout<<"Wire no "<<aSeqReversed.Value(k)<<" of "<<nb<<" reversed"<<endl; // mise au point !
cout<<"Wire no "<<aSeqReversed.Value(k)<<" of "<<nb<<" reversed"<<endl; // mise au point !
#endif
}
@@ -1650,7 +1648,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
BRepTools::Update(myFace); //:p4
}
SendWarning (Message_Msg ("FixAdvFace.FixMissingSeam.MSG0"));//Missing seam-edge added
SendWarning ( Message_Msg ( "FixAdvFace.FixMissingSeam.MSG0" ) );// Missing seam-edge added
return Standard_True;
}
@@ -1679,8 +1677,13 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire()
continue;
TopoDS_Wire wire = TopoDS::Wire ( wi.Value() );
Handle(ShapeAnalysis_Wire) saw = new ShapeAnalysis_Wire(wire,myFace,prec);
if ( saw->CheckSmallArea(prec) ) nbRemoved++;
else {
if ( saw->CheckSmallArea(prec) )
{
SendWarning ( wire, Message_Msg ("FixAdvFace.FixSmallAreaWire.MSG0") );// Null area wire detected, wire skipped
nbRemoved++;
}
else
{
B.Add(face,wire);
nbWires++;
}
@@ -1698,7 +1701,6 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire()
#endif
if ( ! Context().IsNull() ) Context()->Replace ( myFace, face );
myFace = face;
SendWarning (Message_Msg ("FixAdvFace.FixSmallAreaWire.MSG0"));//Null area wire detected, wire skipped
return Standard_True;
}
//=======================================================================
@@ -1907,12 +1909,10 @@ Standard_Boolean ShapeFix_Face::FixLoopWire(TopTools_SequenceOfShape& aResWires)
}
Standard_Boolean isDone =(aResWires.Length() && isClosed);
if(isDone && aResWires.Length() >1) {
Message_Msg MSG ("FixAdvFace.FixLoopWire.MSG0"); //Wire was splitted on %d wires
MSG.Arg (aResWires.Length());
if(isDone && aResWires.Length() >1)
{
#ifdef DEBUG
cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
#endif
}

View File

@@ -903,7 +903,7 @@ Standard_Boolean ShapeFix_Shell::FixFaceOrientation(const TopoDS_Shell& shell,co
done = Standard_True;
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL);
SendWarning (Message_Msg ("FixAdvShell.FixOrientation.MSG20"));//Faces were incorrectly oriented in the shell, a few shells were created;
SendWarning ( Message_Msg ( "FixAdvShell.FixOrientation.MSG20" ) );// Impossible to orient faces in shell, several shells created
return Standard_True;
}
if(aNumMultShell >1) {
@@ -958,10 +958,10 @@ Standard_Boolean ShapeFix_Shell::FixFaceOrientation(const TopoDS_Shell& shell,co
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE2);
if(!Context().IsNull())
Context()->Replace(shell, myShape);
if( myNbShells == 1)
SendWarning (Message_Msg ("FixAdvShell.FixOrientation.MSG0"));//Faces were incorrectly oriented in the shell, corrected
if ( myNbShells == 1 )
SendWarning ( Message_Msg ( "FixAdvShell.FixOrientation.MSG0" ) );// Faces were incorrectly oriented in the shell, corrected
else
SendWarning (Message_Msg ("FixAdvShell.FixOrientation.MSG30"));//Bad connected shell ,a few shells were created.
SendWarning ( Message_Msg ( "FixAdvShell.FixOrientation.MSG30" ) );// Improperly connected shell split into parts
return Standard_True;
}
else return Standard_False;

View File

@@ -442,10 +442,7 @@ Standard_Integer ShapeFix_Wire::FixSmall (const Standard_Boolean lockvtx,
FixSmall ( i, lockvtx, precsmall );
myStatusSmall |= myLastFixStatus;
}
if ( StatusSmall ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
SendWarning (Message_Msg ("FixAdvWire.FixSmall.MSG0"));//Small edge(s) removed
}
return StatusSmall ( ShapeExtend_DONE );
}
@@ -673,12 +670,12 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves()
TopLoc_Location L;
Standard_Real first, last;
BRep_Tool::CurveOnSurface ( sbwd->Edge(i), C, S, L, first, last );
if ( C.IsNull() ) {
if ( C.IsNull() )
{
SendWarning ( sbwd->Edge ( i ), Message_Msg ( "FixWire.FixCurve3d.Removed" ) );// Incomplete edge (with no pcurves or 3d curve) removed
sbwd->Remove ( i-- );
nb--;
myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
if ( ! myShape.IsNull() )
SendWarning (Message_Msg ("FixWire.FixCurve3d.Removed")); // Incomplete edge (with no pcurves or 3d curve) removed
}
myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL5 );
}
@@ -776,10 +773,6 @@ Standard_Boolean ShapeFix_Wire::FixDegenerated()
}
else prevcoded = coded;
}
if ( StatusDegenerated ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
SendWarning (Message_Msg ("FixWire.FixDegenerated.MSG0")); //Degenerated edge(s) detected
}
return StatusDegenerated ( ShapeExtend_DONE );
}
@@ -935,9 +928,6 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersection()
*/
}
if ( StatusSelfIntersection ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
SendWarning (Message_Msg ("FixAdvWire.FixIntersection.MSG0")); // Self-intersection corrected
}
return StatusSelfIntersection ( ShapeExtend_DONE );
}
@@ -1077,7 +1067,9 @@ Standard_Boolean ShapeFix_Wire::FixSmall (const Standard_Integer num,
else myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
// action: remove edge
if ( ! Context().IsNull() ) Context()->Remove(WireData()->Edge(n));
if ( ! Context().IsNull() )
Context()->Remove(WireData()->Edge(n));
SendWarning ( WireData()->Edge ( n ), Message_Msg ( "FixAdvWire.FixSmall.MSG0" ) ); //Small edge(s) removed
WireData()->Remove ( n );
// call FixConnected in the case if vertices of the small edge were not the same
@@ -1089,12 +1081,7 @@ Standard_Boolean ShapeFix_Wire::FixSmall (const Standard_Integer num,
savLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL3 );
myLastFixStatus = savLastFixStatus;
}
if ( ! myShape.IsNull() ) {
Message_Msg MSG ("FixAdvWire.FixSmall.MSG0"); //Small edge %d removed
MSG.Arg (n);
SendWarning (MSG);
}
return Standard_True;
}
@@ -1633,10 +1620,10 @@ Standard_Boolean ShapeFix_Wire::FixDegenerated (const Standard_Integer num)
sbwd->Set ( degEdge, n2 );
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
}
//: abv 28.08.01 - commented to avoid extra messages
// Message_Msg MSG ("FixWire.FixDegenerated.MSG5"); //Degenerated edge %d detected
// MSG.Arg (n2);
// SendWarning (MSG);
// commented to avoid extra messages
// SendWarning ( degEdge, Message_Msg ( "FixWire.FixDegenerated.MSG0" ) );// Degenerated edge(s) detected
return Standard_True;
}
@@ -2214,9 +2201,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersectingEdge (const Standard_Integer
}
if ( LastFixStatus ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
Message_Msg MSG ("FixAdvWire.FixIntersection.MSG5"); //Edge %d was self-intersecting, corrected
MSG.Arg (num);
SendWarning (MSG);
SendWarning ( E, Message_Msg ( "FixAdvWire.FixIntersection.MSG5" ) );// Edge was self-intersecting, corrected
}
return LastFixStatus ( ShapeExtend_DONE );
@@ -2418,10 +2403,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE7 );
}
if ( ! myShape.IsNull() ) {
Message_Msg MSG ("FixAdvWire.FixIntersection.MSG10"); //Edges %d and %d were intersecting, corrected
MSG.Arg (n1);
MSG.Arg (n2);
SendWarning (MSG);
SendWarning ( Message_Msg ( "FixAdvWire.FixIntersection.MSG10" ) );// Edges were intersecting, corrected
}
return Standard_True;
}
@@ -2600,10 +2582,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num
if(newTolers(i)>0) B.UpdateVertex(TopoDS::Vertex(vertices(i)),newTolers(i));
if ( ! myShape.IsNull() ) {
Message_Msg MSG ("FixAdvWire.FixIntersection.MSG10"); //Edges %d and %d were intersecting, corrected
MSG.Arg (n1);
MSG.Arg (n2);
SendWarning (MSG);
SendWarning ( Message_Msg ( "FixAdvWire.FixIntersection.MSG10" ) );// Edges were intersecting, corrected
}
return Standard_True;
}