*/
bool HYDROData_LandCoverMap::Merge( const TopTools_ListOfShape& theFaces, const QString& theType )
{
- // 1. to remove the merged faces from the current map
- Remove( theFaces );
-
- // 2. to fuse the faces into the new face
- /*BOPAlgo_PaveFiller aPF;
- aPF.SetArguments( theFaces );
- aPF.SetFuzzyValue( 1E-5 );
- aPF.SetRunParallel( Standard_False );
- aPF.Perform();
- int iErr = aPF.ErrorStatus();
- if( iErr )
- return false;
-
- BOPAlgo_BOP aBOP;
- aBOP.SetArguments( theFaces );
- aBOP.SetOperation( BOPAlgo_FUSE );
- aBOP.SetRunParallel( Standard_False );
- aBOP.PerformWithFiller(aPF);
- iErr = aBOP.ErrorStatus();
- if( iErr )
- return false;
-
- TopoDS_Shape aMergedShape = aBOP.Shape();
- if( aMergedShape.ShapeType()!=TopAbs_FACE )
- return false;*/
-
-
- ////
- TopoDS_Shape MergedFace;
- MergeFaces(theFaces, true, MergedFace);
- //BRepTools::Write(aMergedShape, "c:/sh_.brep");
+ // 1. to fuse the faces into the new face
+ TopoDS_Shape aMergedFace;
+ if( MergeFaces( theFaces, true, aMergedFace ) )
+ {
+ if( aMergedFace.ShapeType()==TopAbs_FACE )
+ {
+ // 2. to remove the merged faces from the current map
+ Remove( theFaces );
- // 3. to add the face into the map
- return LocalPartition( TopoDS_Face( /*aMergedShape*/ ), theType );
+ // 3. to add the face into the map
+ return LocalPartition( TopoDS::Face( aMergedFace ), theType );
+ }
+ }
+ return false;
}
bool HYDROData_LandCoverMap::MergeFaces(const TopTools_ListOfShape& theFaces, bool IsToUnify, TopoDS_Shape& outSh)