#include <UnitsMethods.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <XSAlgo_ToolContainer.hxx>
+#include <TopExp_Explorer.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient)
//=======================================================================
//function : XSAlgo_AlgoContainer
const Standard_CString prscfile,
const Standard_CString pseq,
Handle(Standard_Transient)& info,
- const Handle(Message_ProgressIndicator)& progress) const
+ const Handle(Message_ProgressIndicator)& progress,
+ const Standard_Boolean NonManifold) const
{
if ( shape.IsNull() ) return shape;
if ( !progress.IsNull() )
context->SetProgress(progress);
}
+ context->SetNonManifold(NonManifold);
info = context;
Standard_CString seq = Interface_Static::CVal ( pseq );
{
static Standard_Integer time = 0;
if ( ! time )
- cout << "Warning: XSAlgo_AlgoContainer::ProcessShape(): Sequence " << str.ToCString() <<
- " is not defined in " << prscfile << " resource; do default processing" << endl;
+ std::cout << "Warning: XSAlgo_AlgoContainer::ProcessShape(): Sequence " << str.ToCString() <<
+ " is not defined in " << prscfile << " resource; do default processing" << std::endl;
time++;
}
#endif
context->SetResult ( S );
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- cout << "Error: XSAlgo_AlgoContainer::ProcessShape(): Exception in ShapeFix::Shape" << endl;
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ std::cout << "Error: XSAlgo_AlgoContainer::ProcessShape(): Exception in ShapeFix::Shape" << std::endl;
+ anException.Print(std::cout); std::cout << std::endl;
#endif
- }
+ (void)anException;
+ }
return context->Result();
}
// for writing, define default sequence of DirectFaces
}
catch (Standard_Failure) {
#ifdef OCCT_DEBUG
- cout << "Error: XSAlgo_AlgoContainer::PerformFixShape(): Exception in ShapeFix::Shape" << endl;
+ std::cout << "Error: XSAlgo_AlgoContainer::PerformFixShape(): Exception in ShapeFix::Shape" << std::endl;
#endif
}
return shape;
if ( DU/8. > (UL/6. - UF/6.) || DV/8. > (VL/6. - VF/6.) ) {
ShapeBuild_Edge().RemovePCurve(E,face);
#ifdef OCCT_DEBUG
- cout<<"Removing pcuve periodic"<<endl;
+ std::cout<<"Removing pcuve periodic"<<std::endl;
#endif
return Standard_False;
}
if (!((Dist11 <= preci) && (Dist22 <= preci))) {
ShapeBuild_Edge().RemovePCurve(E,face);
#ifdef OCCT_DEBUG
- cout<<"Removing pcurve points"<<endl;
+ std::cout<<"Removing pcurve points"<<std::endl;
#endif
return Standard_False;
}
return;
Standard_Integer i = ( startTPitem >0 ? startTPitem : 1 );
- for ( ; i <= TP->NbMapped(); i++ ) {
+ for ( ; i <= TP->NbMapped(); i++ )
+ {
Handle(Transfer_Binder) bnd = TP->MapItem ( i );
Handle(TransferBRep_ShapeBinder) sb = Handle(TransferBRep_ShapeBinder)::DownCast ( bnd );
if ( sb.IsNull() || sb->Result().IsNull() ) continue;
-
+
TopoDS_Shape orig = sb->Result();
- if ( map.IsBound ( orig ) ) sb->SetResult ( map.Find ( orig ) );
+
+ if ( map.IsBound ( orig ) )
+ {
+ sb->SetResult ( map.Find ( orig ) );
+ }
else if ( !orig.Location().IsIdentity() )
{
TopLoc_Location aNullLoc;
TopoDS_Shape atmpSh = orig.Located(aNullLoc);
if ( map.IsBound ( atmpSh ) ) sb->SetResult ( map.Find ( atmpSh ) );
}
+ else
+ {
+ // Some of edges may be modified.
+ BRepTools_ReShape aReShape;
+ Standard_Boolean hasModifiedEdges = Standard_False;
+ TopExp_Explorer anExpSE(orig, TopAbs_EDGE);
+
+ // Remember modifications.
+ for( ; anExpSE.More() ; anExpSE.Next() )
+ {
+ if ( map.IsBound ( anExpSE.Current() ) )
+ {
+ hasModifiedEdges = Standard_True;
+ TopoDS_Shape aModifiedShape = map.Find( anExpSE.Current() );
+ aReShape.Replace(anExpSE.Current(), aModifiedShape);
+ }
+ }
+
+ // Apply modifications and store result in binder.
+ if (hasModifiedEdges)
+ {
+ TopoDS_Shape aRes = aReShape.Apply(orig);
+ sb->SetResult ( aRes );
+ }
+ }
+
// update messages
if ( ! msg.IsNull() ) {
resBinder->AddResult(TransientListBinder);
// resBinder->SetNext(TransientListBinder, Standard_True);
#ifdef OCCT_DEBUG
- cout<<"Info: TransientListBinder created for splitted shape"<<endl;
+ std::cout<<"Info: TransientListBinder created for splitted shape"<<std::endl;
}
else {
- cout<<"Warning: XSAlgo_AlgoContainer::MergeTransferInfo() "
- <<"No results were found for splitted shape. "<<endl;
- //<<"Transfer_FinderProcess->NbMapped() = "<<FP->NbMapped()<<endl;
+ std::cout<<"Warning: XSAlgo_AlgoContainer::MergeTransferInfo() "
+ <<"No results were found for splitted shape. "<<std::endl;
+ //<<"Transfer_FinderProcess->NbMapped() = "<<FP->NbMapped()<<std::endl;
#endif
}
}