#include <BRepCheck_Shell.hxx>
#include <BRepCheck_ListOfStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
-#include <Handle_Geom_Curve.hxx>
-#include <Handle_Geom_Line.hxx>
-#include <Handle_Geom_TrimmedCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <NCollection_DoubleMap.hxx>
+#include <stdexcept>
#include <QFile>
#include <QString>
const int TELEMAC_PRECISION = 3;
-IMPLEMENT_STANDARD_HANDLE(HYDROData_LandCoverMap, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_LandCoverMap, HYDROData_Entity)
/**
// c. add the new shape if it is face with its type
if( theNewShape.ShapeType()==TopAbs_FACE )
aNewFaces.Add( TopoDS::Face( theNewShape ), theNewType );
+ //DEBTRACE(theNewShape << " " << theNewType);
// convert map of shape to type to compound and list of types
StoreLandCovers( aNewFaces );
}
TopTools_IndexedDataMapOfShapeListOfShape ShHistory;
+ ShHistory.Clear();
TopoDS_Shape aResult;
if( aListOfFaces.Extent() == 1 )
//DEBTRACE(" --- " << aFF);
if( aFF.IsNull() )
continue;
- TopTools_ListOfShape aLS = ShHistory.FindFromKey(aFF);
+ //DEBTRACE(ShHistory.IsEmpty());
+ //DEBTRACE(aFF.Checked());
+ TopTools_ListOfShape aLS;
+ try
+ {
+ aLS = ShHistory.FindFromKey(aFF); //TODO: bug to fix. Observed on an incomplete split of a face
+ }
+ catch (...)
+ {
+ DEBTRACE("TODO: bug to fix. Observed on an incomplete split of a face");
+ //continue; // No, keep aLS empty and propagate the type of the original face
+ }
if (aLS.IsEmpty())
{
+ //DEBTRACE("--- aLS.IsEmpty()");
QString aSType = theMap.FindFromKey(aFF);
//DEBTRACE(" --- " << aSType.toStdString());
if (ShF2FHistory.Contains(aFF))
}
else
{
+ //DEBTRACE("--- !aLS.IsEmpty()");
TopTools_ListIteratorOfListOfShape anIt(aLS);
for (; anIt.More(); anIt.Next())
{
//if (ShF2FHistory.Contains(aFF))
if (ShF2FHistory.Contains(aMF))
{
- aChF2ST.Add(ShF2FHistory.FindFromKey(aMF), aSType);
//DEBTRACE("ShF2FHistory.FindFromKey(aMF) " << ShF2FHistory.FindFromKey(aFF));
+ aChF2ST.Add(ShF2FHistory.FindFromKey(aMF), aSType);
}
else
{
- aChF2ST.Add(aMF, aSType);
//DEBTRACE("aMF " << aMF);
+ aChF2ST.Add(aMF, aSType);
}
}
}
//
if (!anEdgesToRemove.IsEmpty())
{
- Handle_ShapeBuild_ReShape aReshape = new ShapeBuild_ReShape();
+ Handle(ShapeBuild_ReShape) aReshape = new ShapeBuild_ReShape();
TopoDS_Shape OutF = aReshape->Apply(CurFace);
TopTools_ListIteratorOfListOfShape aIt(anEdgesToRemove);
for (; aIt.More(); aIt.Next())
}
}
//
- Handle_ShapeBuild_ReShape anExtReshape = new ShapeBuild_ReShape();
+ Handle(ShapeBuild_ReShape) anExtReshape = new ShapeBuild_ReShape();
for (int i = 1; i <= aF2FReplace->Extent(); i++)
{
TopoDS_Face aFK = aF2FReplace->FindKey(i);
{
HYDROData_ShapeFile anExporter;
QStringList aList;
- anExporter.Export(theSHPFileName, this, aList, bUseDiscr, theDefl );
+ anExporter.Export(HYDROData_Document::Document(1), theSHPFileName, this, aList, bUseDiscr, theDefl );
if (aList.empty())
return true;
else
{
TopoDS_Edge E = TopoDS::Edge(anEdgeEx.Current());
double aFP, aLP;
- Handle_Geom_Curve aCur = BRep_Tool::Curve(E, aFP, aLP);
+ Handle(Geom_Curve) aCur = BRep_Tool::Curve(E, aFP, aLP);
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(aCur);
if (aLine.IsNull())
{