litMajeur.SetFillingColor( QColor( 0, 170, 127, 255 ) )
-litMajeur.SetAltitudeObject( Cloud_02 )
+litMajeur.SetAltitudeObject( garonne_point_L93 )
litMajeur.SetPolyline( lit_majeur )
litMajeur.Update()
#include <OSD_Timer.hxx>
#endif
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
const int BLOCK_SIZE = 1000;
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
//HYDROData_QuadtreeNode* HYDROData_Bathymetry::myQuadtree = 0;
-
+int HYDROData_Bathymetry::myQuadTreeNumber = 0;
std::map<int, HYDROData_QuadtreeNode*> HYDROData_Bathymetry::myQuadtrees;
#ifndef LIGHT_MODE
+int HYDROData_Bathymetry::myDelaunayNumber = 0;
std::map<int, vtkPolyData*> HYDROData_Bathymetry::myDelaunay2D;
#endif
HYDROData_QuadtreeNode* HYDROData_Bathymetry::GetQuadtreeNodes() const
{
- TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
- if (aLabel.IsNull())
- return 0;
- int labkey = myLab.Tag();
- //int altkey = aLabel.Tag();
- //DEBTRACE("GetQuadtreeNodes this labkey altkey "<<this<<" "<<labkey<<" "<<altkey);
- // if (myQuadtree->isEmpty() )
- if (myQuadtrees.find(labkey) == myQuadtrees.end())
+ TDF_Label aLabel2 = myLab.FindChild(DataTag_Quadtree, false);
+ if (aLabel2.IsNull())
{
- //DEBTRACE("GetQuadtreeNodes init " << this << " " << labkey);
- HYDROData_QuadtreeNode* aQuadtree = new HYDROData_QuadtreeNode(0, 30, 5, 0.);
- myQuadtrees[labkey] = aQuadtree;
TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
if (aLabel.IsNull())
return 0;
if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray))
return 0;
+ myQuadTreeNumber++;
+ TDataStd_Integer::Set( myLab.FindChild( DataTag_Quadtree ), myQuadTreeNumber );
+ DEBTRACE("GetQuadtreeNodes init " << this << " " << myQuadTreeNumber);
+ HYDROData_QuadtreeNode* aQuadtree = new HYDROData_QuadtreeNode(0, 30, 5, 0.);
+ myQuadtrees[myQuadTreeNumber] = aQuadtree;
+
Nodes_3D* aListOfNodes = new Nodes_3D();
int index =0;
index++;
aListOfNodes->push_back(aPoint);
}
- //DEBTRACE(" GetQuadtreeNodes call setNodesAndCompute");
+ DEBTRACE(" GetQuadtreeNodes call setNodesAndCompute");
aQuadtree->setNodesAndCompute(aListOfNodes);
return aQuadtree;
}
else
- return myQuadtrees[labkey];
+ {
+ Handle(TDataStd_Integer) aQuadtreeNum;
+ if ( aLabel2.FindAttribute( TDataStd_Integer::GetID(), aQuadtreeNum ) )
+ {
+ if (myQuadtrees.find(aQuadtreeNum->Get()) != myQuadtrees.end())
+ return myQuadtrees[aQuadtreeNum->Get()];
+ else DEBTRACE("myQuadtrees["<<aQuadtreeNum->Get()<<"] does not exists!");
+ }
+ else DEBTRACE("no attribute TDataStd_Integer");
+ }
+ return 0;
}
#ifndef LIGHT_MODE
vtkPolyData* HYDROData_Bathymetry::GetVtkDelaunay2D() const
{
- TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
- if (aLabel.IsNull())
- return 0;
- int labkey = myLab.Tag();
- //int altkey = aLabel.Tag();
- //DEBTRACE("GetVtkDelaunay2D this labkey altkey "<<this<<" "<<labkey<<" "<<altkey);
- if (myDelaunay2D.find(labkey) == myDelaunay2D.end())
+ TDF_Label aLabel2 = myLab.FindChild(DataTag_Delaunay, false);
+ if (aLabel2.IsNull())
{
- //DEBTRACE("GetVtkDelaunay2D init " << this << " " << labkey);
-
TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
if (aLabel.IsNull())
return 0;
+
Handle(TDataStd_RealArray) aCoordsArray;
if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray))
return 0;
+ myDelaunayNumber++;
+ TDataStd_Integer::Set( myLab.FindChild( DataTag_Delaunay ), myDelaunayNumber );
+ DEBTRACE("GetVtkDelaunay2D init " << this << " " << myDelaunayNumber);
vtkPoints *points = vtkPoints::New();
points->Allocate(aCoordsArray->Upper() +1);
for (int i = aCoordsArray->Lower(), n = aCoordsArray->Upper(); i <= n;)
}
vtkPolyData* profile = vtkPolyData::New();
profile->SetPoints(points);
- //DEBTRACE("Number of Points: "<< points->GetNumberOfPoints());
+ DEBTRACE("Number of Points: "<< points->GetNumberOfPoints());
vtkDelaunay2D* delaunay2D = vtkDelaunay2D::New();
delaunay2D->SetInputData(profile);
delaunay2D->Update();
vtkPolyData* data = delaunay2D->GetOutput();
data->BuildLinks();
- myDelaunay2D[labkey] = data;
+ myDelaunay2D[myDelaunayNumber] = data;
return data;
}
else
- return myDelaunay2D[labkey];
-
+ {
+ Handle(TDataStd_Integer) aDelaunayNum;
+ if ( aLabel2.FindAttribute( TDataStd_Integer::GetID(), aDelaunayNum ) )
+ {
+ if (myDelaunay2D.find(aDelaunayNum->Get()) != myDelaunay2D.end())
+ return myDelaunay2D[aDelaunayNum->Get()];
+ else DEBTRACE("myDelaunay2D["<<aDelaunayNum->Get()<<"] does not exists!");
+ }
+ else DEBTRACE("no attribute TDataStd_Integer");
+ }
+ return 0;
}
#endif
void HYDROData_Bathymetry::RemoveAltitudePoints()
double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theMethod) const
{
- //DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << "), interpolation method: " << theMethod);
+ DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << "), interpolation method: " << theMethod);
double anInvalidAltitude = GetInvalidAltitude();
double aResAltitude = anInvalidAltitude;
HYDROData_QuadtreeNode* aQuadtree = GetQuadtreeNodes();
if (!aQuadtree)
{
- //DEBTRACE(" no Quadtree");
+ DEBTRACE(" no Quadtree");
return aResAltitude;
}
while (dist2nodes.size() == 0)
{
aQuadtree->setPrecision(aQuadtree->getPrecision() *2);
- //DEBTRACE("adjust precision to: " << aQuadtree->getPrecision());
+ DEBTRACE("adjust precision to: " << aQuadtree->getPrecision());
aQuadtree->NodesAround(thePoint, dist2nodes, aQuadtree->getPrecision());
}
std::map<double, const gpi_XYZ*>::const_iterator it = dist2nodes.begin();
aResAltitude = it->second->Z();
int nodeIndex = it->second->getIndex();
- //DEBTRACE(" number of points found: " << dist2nodes.size() << " nearest z: " << aResAltitude << " point index: " << nodeIndex);
+ DEBTRACE(" number of points found: " << dist2nodes.size() << " nearest z: " << aResAltitude << " point index: " << nodeIndex);
// --- for coarse bathymetry clouds (when the TELEMAC mesh is more refined than the bathymetry cloud)
// interpolation is required.
points->Allocate(64);
aDelaunay2D->GetPointCells(nodeIndex, cells);
vtkIdType nbCells = cells->GetNumberOfIds();
- //DEBTRACE(" triangles on nearest point: " << nbCells);
+ DEBTRACE(" triangles on nearest point: " << nbCells);
bool isInside = false;
for (int i=0; i<nbCells; i++)
{
if (isInside)
{
aResAltitude = z;
- //DEBTRACE(" interpolated z: " << z);
+ DEBTRACE(" interpolated z: " << z);
break;
}
}
if (!isInside)
{
- // DEBTRACE(" point outside triangles, nearest z kept");
+ DEBTRACE(" point outside triangles, nearest z kept");
}
}
#endif
DataTag_FilePath, ///< bathymetry imported file path
DataTag_FilePaths, ///< bathymetry imported file paths
DataTag_AltitudesInverted, ///< flag to invert z values
+ DataTag_Quadtree, ///< quadtree associated to the zone
+ DataTag_Delaunay, ///< Delaunay 2D associated to the zone
};
public:
*/
bool importFromXYZFile( QFile& theFile,
AltitudePoints& thePoints ) const;
+ static int myQuadTreeNumber;
static std::map<int, HYDROData_QuadtreeNode*> myQuadtrees;
#ifndef LIGHT_MODE
+ static int myDelaunayNumber;
static std::map<int, vtkPolyData*> myDelaunay2D;
#endif
bool importFromASCFile( QFile& theFile,
#include <SALOME_LifeCycleCORBA.hxx>
#endif
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
if ( !aZone.IsNull() )
{
- //DEBTRACE("GetAltitudeForPoint Region " << theRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString());
+ DEBTRACE("GetAltitudeForPoint Region " << theRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString());
Handle(HYDROData_Region) aRefRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() );
if ( IsEqual( aRefRegion, theRegion ) )
aResAltitude = GetAltitudeForPoint( thePoint, aZone, theMethod );
else
{
- //DEBTRACE("GetAltitudeForPoint Region " << aRefRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString() << " ---------------------------");
+ DEBTRACE("GetAltitudeForPoint Region " << aRefRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString() << " ---------------------------");
aResAltitude = GetAltitudeForPoint( thePoint, aZone, theMethod );
}
}
else
{
- //DEBTRACE(" --- GetAltitudeForPoint No Zone ---");
+ DEBTRACE(" --- GetAltitudeForPoint No Zone ---");
}
return aResAltitude;
const Handle(HYDROData_Zone)& theZone,
int theMethod) const
{
- //DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString());
+ DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString());
double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
if ( theZone.IsNull() )
{
}
HYDROData_Zone::MergeType aZoneMergeType = theZone->GetMergeType();
- //DEBTRACE("aZoneMergeType " << aZoneMergeType);
+ DEBTRACE("aZoneMergeType " << aZoneMergeType);
if ( !theZone->IsMergingNeed() )
{
aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
- //DEBTRACE("---");
+ DEBTRACE("---");
}
else if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
{
- //DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString() << " Merge_UNKNOWN");
+ DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString() << " Merge_UNKNOWN");
return aResAltitude;
}
}
else
{
- //DEBTRACE("aZoneInterpolator == NULL");
+ DEBTRACE("aZoneInterpolator == NULL");
aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
}
}
}
else
{
- //DEBTRACE("aZoneMergeType != HYDROData_Zone::Merge_Object");
+ DEBTRACE("aZoneMergeType != HYDROData_Zone::Merge_Object");
HYDROData_SequenceOfObjects aZoneObjects = theZone->GetObjects();
HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
for ( ; anIter.More(); anIter.Next() )
}
else
{
- //DEBTRACE("aZoneInterpolator == NULL");
+ DEBTRACE("aZoneInterpolator == NULL");
aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint, theMethod );
}
#include "HYDROData_ProfileUZ.h"
#include "HYDROData_Profile.h"
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
#include <QString>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepLib_MakeWire.hxx>
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
#include <BRepTools.hxx>
#include <sstream>
for (int aPSI = 0; aPSI < aPSCount; ++aPSI)
{
HYDROData_TopoCurve aCurve;
- //DEBTRACE("Initialize curve " << aPSI);
+ DEBTRACE("Initialize curve " << aPSI);
if (!aCurve.Initialize(aCurves[aPSI]))
{
continue;
aSplitCurves.end();
for (int iw=0; aCIt != aLastCIt; ++aCIt, iw++)
{
- /*std::stringstream brepName;
+ std::stringstream brepName;
brepName << "theSplitWire_";
brepName << iw;
brepName << ".brep";
- BRepTools::Write(aCIt->Wire() , brepName.str().c_str() );*/
+ BRepTools::Write(aCIt->Wire() , brepName.str().c_str() );
aResult.push_back(aCIt->Wire());
}
}
const QColor& theColor = theOldPolyline->GetWireColor();
int n = theShapes.size();
- //DEBTRACE("theShapes.size() "<< n);
+ DEBTRACE("theShapes.size() "<< n);
int anIndex = 1;
for( int i=0; i<n; i++ )
{
#include <QPainterPath>
#include <QVariant>
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
#include <BRepTools.hxx>
#include <sstream>
double theDeflection,
const Handle( HYDROData_PolylineXY )& theOldPolyline )
{
- //DEBTRACE("convertEdgesToSections")
+ DEBTRACE("convertEdgesToSections")
Standard_Real aFirst = 0.0, aLast = 0.0;
Handle(Geom_Curve) anEdgeGeomCurve = BRep_Tool::Curve( theEdge, aFirst, aLast );
if ( anEdgeGeomCurve.IsNull() )
return false;
bool isPrevious = (theSectTypes.Size() > 0);
- //DEBTRACE("nb sections: " << theSectTypes.Size());
+ DEBTRACE("nb sections: " << theSectTypes.Size());
HYDROData_PolylineXY::SectionType prevSectType = HYDROData_PolylineXY::SECTION_SPLINE;;
HYDROData_PolylineXY::PointsList prevPointList;
bool isPrevClosed = true;
}
bool isNewSection = !isPrevious || isPrevClosed || anIsEdgeClosed || prevSectType != aSectionType;
- //DEBTRACE(isNewSection <<": " << !isPrevious << " " << isPrevClosed << " " << anIsEdgeClosed << " " << (prevSectType != aSectionType));
+ DEBTRACE(isNewSection <<": " << !isPrevious << " " << isPrevClosed << " " << anIsEdgeClosed << " " << (prevSectType != aSectionType));
HYDROData_PolylineXY::PointsList aPointsList;
if (!isNewSection)
if( aSectionType == HYDROData_PolylineXY::SECTION_POLYLINE )
{
- //DEBTRACE("SECTION_POLYLINE");
+ DEBTRACE("SECTION_POLYLINE");
Handle(Geom_Line) aGeomLine = Handle(Geom_Line)::DownCast( anEdgeGeomCurve );
gp_Pnt aFirstPoint, aLastPoint;
{
if (aSectFirstPoint == prevPointList.Last())
{
- //DEBTRACE("points shared: a");//aPointsList.Append( aSectFirstPoint );
+ DEBTRACE("points shared: a");//aPointsList.Append( aSectFirstPoint );
aPointsList.Append( aSectLastPoint );
}
else if (aSectLastPoint == prevPointList.Last())
{
- //DEBTRACE("points shared: b");//aPointsList.Append( aSectLastPoint );
+ DEBTRACE("points shared: b");//aPointsList.Append( aSectLastPoint );
aPointsList.Append( aSectFirstPoint );
}
else if (aSectFirstPoint == prevPointList.First())
{
- //DEBTRACE("points shared: c");//aPointsList.Prepend( aSectFirstPoint );
+ DEBTRACE("points shared: c");//aPointsList.Prepend( aSectFirstPoint );
aPointsList.Prepend( aSectLastPoint );
}
else if (aSectLastPoint == prevPointList.First())
{
- //DEBTRACE("points shared: d");//aPointsList.Prepend( aSectLastPoint );
+ DEBTRACE("points shared: d");//aPointsList.Prepend( aSectLastPoint );
aPointsList.Prepend( aSectFirstPoint );
}
else
{
- //DEBTRACE("no point shared")
+ DEBTRACE("no point shared")
isNewSection = true; // no point shared, new section
aPointsList.Clear();
aPointsList.Append( aSectFirstPoint );
}
else
{
- //DEBTRACE("new section");
+ DEBTRACE("new section");
aPointsList.Append( aSectFirstPoint );
aPointsList.Append( aSectLastPoint );
}
}
else // aSectionType == HYDROData_PolylineXY::SECTION_SPLINE
{
- //DEBTRACE("SECTION_SPLINE");
+ DEBTRACE("SECTION_SPLINE");
isNewSection = true;
aPointsList.Clear();
gp_Pnt endPts[] = {gp_Pnt(aPointsList.First().X(),aPointsList.First().Y(), 0),
gp_Pnt(aPointsList.Last().X(),aPointsList.Last().Y(), 0) };
- //DEBTRACE("curve start: "<< endPts[0].X() << " " << endPts[0].Y());
- //DEBTRACE("curve end: "<< endPts[1].X() << " " << endPts[1].Y());
+ DEBTRACE("curve start: "<< endPts[0].X() << " " << endPts[0].Y());
+ DEBTRACE("curve end: "<< endPts[1].X() << " " << endPts[1].Y());
}
else // --- split of a previous polyline: try to retrieve old sets of points and add intersection points
{
double midPar = (anAdaptorCurve.LastParameter() + anAdaptorCurve.FirstParameter())/2;
gp_Pnt midPnt;
anAdaptorCurve.D0(midPar, midPnt);
- //DEBTRACE("curve first point: " << aEndPs[0].X() << " " << aEndPs[0].Y() << " " << aEndPs[0].Z());
- //DEBTRACE("curve last point: " << aEndPs[1].X() << " " << aEndPs[1].Y() << " " << aEndPs[1].Z());
- //DEBTRACE("curve mid point: " << midPnt.X() << " " << midPnt.Y() << " " << midPnt.Z());
+ DEBTRACE("curve first point: " << aEndPs[0].X() << " " << aEndPs[0].Y() << " " << aEndPs[0].Z());
+ DEBTRACE("curve last point: " << aEndPs[1].X() << " " << aEndPs[1].Y() << " " << aEndPs[1].Z());
+ DEBTRACE("curve mid point: " << midPnt.X() << " " << midPnt.Y() << " " << midPnt.Z());
std::vector<TopoDS_Wire> aCurves;
HYDROData_PolylineOperator::GetWires(theOldPolyline, aCurves);
int nbSections = theOldPolyline->NbSections();
- //DEBTRACE("nbSections: "<< nbSections << ", nbCurves: " << aCurves.size() );
+ DEBTRACE("nbSections: "<< nbSections << ", nbCurves: " << aCurves.size() );
for (int isec = 0; isec < nbSections; isec++)
{
- //DEBTRACE("section: "<< isec);
+ DEBTRACE("section: "<< isec);
bool isOldSectionclosed = theOldPolyline->IsClosedSection(isec);
TopoDS_Wire aWire = aCurves[isec]; // we suppose sections and wires are in the same order
TopExp_Explorer anExp(aWire, TopAbs_EDGE);
BRepAdaptor_Curve adaptorOldCurve(anEdge);
double pfirst = adaptorOldCurve.FirstParameter();
double plast = adaptorOldCurve.LastParameter();
- //DEBTRACE("previous curve first last : "<< pfirst << " " << plast);
+ DEBTRACE("previous curve first last : "<< pfirst << " " << plast);
double p[3] = {-1, -1};
double d0= ProjectPointToCurve(aEndPs[0].XYZ(), adaptorOldCurve,p[0]);
double d1= ProjectPointToCurve(aEndPs[1].XYZ(), adaptorOldCurve,p[1]);
double d2= ProjectPointToCurve(midPnt.XYZ(), adaptorOldCurve, p[2]);
- //DEBTRACE("d0: "<<d0<<" d1: "<<d1<<" d2: "<<d2<<" p0: "<<p[0]<<" p1: "<<p[1]<<" p2: "<<p[2]);
+ DEBTRACE("d0: "<<d0<<" d1: "<<d1<<" d2: "<<d2<<" p0: "<<p[0]<<" p1: "<<p[1]<<" p2: "<<p[2]);
if ((d0 < 1.e-3) && (d1 < 1.e-3) && (d2 < 1.e-3)) // we got the good old curve (and the good section)
{
double pmin = p[0];
double pmax = p[1];
bool forward = true;
- //DEBTRACE("isOldSectionclosed: " << isOldSectionclosed);
+ DEBTRACE("isOldSectionclosed: " << isOldSectionclosed);
if (!isOldSectionclosed) // no need to check first and last points on an open curve
{
if (pmin > pmax)
else if ((abs(pmax - pfirst) <1.e-3) && (p[2] > pmin)) // forward, replace pmax par plast
pmax = plast;
}
- //DEBTRACE("forward: "<< forward << " pmin " << pmin << " pmax " << pmax);
+ DEBTRACE("forward: "<< forward << " pmin " << pmin << " pmax " << pmax);
HYDROData_PolylineXY::Point aFirstPoint, aLastPoint;
if (forward)
{
HYDROData_PolylineXY::PointsList aSectPoints = theOldPolyline->GetPoints(isec, false);
int nbPoints = aSectPoints.Length();
- //DEBTRACE("nbPoints " << nbPoints);
+ DEBTRACE("nbPoints " << nbPoints);
if (forward)
for (int i=1; i<=nbPoints; i++)
{
double d = ProjectPointToCurve(p, adaptorOldCurve, param);
if ((param > pmin) && (param < pmax))
{
- //DEBTRACE("param: " << param);
+ DEBTRACE("param: " << param);
aPointsList.Append(aPoint);
}
}
double d = ProjectPointToCurve(p, adaptorOldCurve, param);
if ((param > pmin) && (param < pmax))
{
- //DEBTRACE("param: " << param);
+ DEBTRACE("param: " << param);
aPointsList.Append(aPoint);
}
}
TCollection_AsciiString aSectName = getUniqueSectionName( theSectNames );
if (isNewSection)
{
- //DEBTRACE("isNewSection");
+ DEBTRACE("isNewSection");
theSectNames.Append( aSectName );
theSectTypes.Append( aSectionType );
theSectClosures.Append( anIsEdgeClosed );
}
else
{
- //DEBTRACE("sameSection");
+ DEBTRACE("sameSection");
theSectPoints.SetValue(theSectPoints.Length(), aPointsList);
}
bool IsClosureAllowed,
double theDeviation )
{
- //DEBTRACE("ImportShape");
+ DEBTRACE("ImportShape");
if ( theShape.IsNull() )
return false;
if ( theShape.ShapeType() == TopAbs_EDGE )
{
- //DEBTRACE("TopAbs_EDGE");
+ DEBTRACE("TopAbs_EDGE");
TopoDS_Edge anEdge = TopoDS::Edge( theShape );
// anIsCanBeImported = convertEdgeToSection( anEdge, aSectNames, aSectTypes,
// aSectClosures, aSectPoints, true, IsInterpolationAllowed, theDeviation );
}
else if ( theShape.ShapeType() == TopAbs_WIRE )
{
- //DEBTRACE("TopAbs_WIRE");
+ DEBTRACE("TopAbs_WIRE");
TopTools_SequenceOfShape anEdges;
HYDROData_ShapesTool::ExploreShapeToShapes( theShape, TopAbs_EDGE, anEdges );
*/
bool HYDROData_PolylineXY::IsClosed(const bool theIsSimpleCheck) const
{
- //DEBTRACE("IsClosed " << theIsSimpleCheck << " " << GetName());
+ DEBTRACE("IsClosed " << theIsSimpleCheck << " " << GetName());
bool anIsClosed = false;
TopoDS_Shape aShape = GetShape();
anIsClosed = BRep_Tool::IsClosed(aWires.First());
else
{
- //DEBTRACE("aNbWires " << aNbWires);
+ DEBTRACE("aNbWires " << aNbWires);
Handle(TopTools_HSequenceOfShape) aSeqWires = new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) aSeqEdges = new TopTools_HSequenceOfShape;
for (int i = 1; i <= aNbWires; ++i)
}
if (aSeqEdges->Length() > 1)
{
- //DEBTRACE(aSeqEdges->Length());
+ DEBTRACE(aSeqEdges->Length());
ShapeAnalysis_FreeBounds::ConnectEdgesToWires(aSeqEdges, 1E-5, Standard_False, aSeqWires);
if (aSeqWires->Length() == 1)
{
- //DEBTRACE(aSeqWires->Length());
+ DEBTRACE(aSeqWires->Length());
const TopoDS_Wire& aPolylineWire = TopoDS::Wire(aSeqWires->Value(1));
anIsClosed = BRep_Tool::IsClosed(aPolylineWire);
}
}
else
{
- //DEBTRACE("aNbWires " << aNbWires);
+ DEBTRACE("aNbWires " << aNbWires);
Handle(TopTools_HSequenceOfShape) aSeqWires = new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) aSeqEdges = new TopTools_HSequenceOfShape;
for (int i = 1; i <= aNbWires; ++i)
}
if (aSeqEdges->Length() > 1)
{
- //DEBTRACE(aSeqEdges->Length());
+ DEBTRACE(aSeqEdges->Length());
ShapeAnalysis_FreeBounds::ConnectEdgesToWires(aSeqEdges, 1E-5, Standard_False, aSeqWires);
}
aConnectedWires = aSeqWires;
#include <gp_Pnt.hxx>
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
using namespace std;
myNodes = theNodes;
if (myNodes)
{
- //DEBTRACE(" --- start compute");
+ DEBTRACE(" --- start compute");
compute();
- //DEBTRACE(" --- end compute : children & height " << this->nbChildren() << " " << this->getHeight());
- //DEBTRACE("Bounding box min: " << this->myBox->CornerMin().X() << " " << this->myBox->CornerMin().Y());
- //DEBTRACE("Bounding box max: " << this->myBox->CornerMax().X() << " " << this->myBox->CornerMax().Y());
+ DEBTRACE(" --- end compute : children & height " << this->nbChildren() << " " << this->getHeight());
+ DEBTRACE("Bounding box min: " << this->myBox->CornerMin().X() << " " << this->myBox->CornerMin().Y());
+ DEBTRACE("Bounding box max: " << this->myBox->CornerMax().X() << " " << this->myBox->CornerMax().Y());
}
}
static TCollection_AsciiString fileNameBefore("BeforeTranslation");
#endif
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
TopoDS_Face HYDROData_SplitToZonesTool::SplitData::Face() const
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
#include <BRepTools.hxx>
if (ProjectPointToCurve(aEndPs[aPI], theCurve1, aParameter) <=
Precision::SquareConfusion())
{
+ DEBTRACE("aParameter " << aParameter);
aIntCount += AddParameter(theCurve1, aParameter, theParameters);
}
}
// Process the internal extremums.
- Extrema_ExtCC aAlgo(theCurve1, theCurve2);
+ Extrema_ExtCC aAlgo(theCurve1, theCurve2); //, 1.e-6, 1.e-6);
if (aAlgo.IsDone())
{
const int aECount = aAlgo.NbExt();
{
Extrema_POnCurv aP1, aP2;
aAlgo.Points(aEN, aP1, aP2);
+ DEBTRACE("SquareDistance " << aP1.Value().SquareDistance(aP2.Value()));
if (aP1.Value().SquareDistance(aP2.Value()) <=
Precision::SquareConfusion())
{
+ DEBTRACE("aP1.Parameter() " << aP1.Parameter());
aIntCount += AddParameter(theCurve1, aP1.Parameter(), theParameters);
}
}
TopExp::MapShapesAndAncestors(theWire,
TopAbs_VERTEX, TopAbs_EDGE, aVertexToEdges);
const int aVCount = aVertexToEdges.Extent();
- //DEBTRACE("initialize VCount= "<< aVCount);
+ DEBTRACE("initialize VCount= "<< aVCount);
if (aVCount == 0)
{
return false;
aParamI ^= 1;
}
const bool isClosed = IsClosed();
- //DEBTRACE("aParamI: " << aParamI << " isClosed: "<< isClosed);
+ DEBTRACE("aParamI: " << aParamI << " isClosed: "<< isClosed);
if (aParamI < 0)
{
aEdge.Orientation(TopAbs_FORWARD);
const TopoDS_Wire& theWire,
std::deque<std::list<double> >& theParameters) const
{
- //std::string brepName = "theWireToIntersect";
- //brepName += ".brep";
- //BRepTools::Write( theWire, brepName.c_str() );
+ std::string brepName = "theWireToIntersect";
+ brepName += ".brep";
+ BRepTools::Write( theWire, brepName.c_str() );
int aIntCount = 0;
theParameters.resize(myEdges.size());
+ DEBTRACE("myEdges.size() " << myEdges.size());
std::list<TopoDS_Edge>::const_iterator aEIt = myEdges.begin();
std::list<TopoDS_Edge>::const_iterator aLastEIt = myEdges.end();
std::deque<std::list<double> >::iterator aPIt = theParameters.begin();
for (; aEIt != aLastEIt; ++aPIt, ++aEIt)
{
+ DEBTRACE("---");
const TopoDS_Edge& aEdge = *aEIt;
std::list<double>& aParams = *aPIt;
TopExp_Explorer aEIt2(theWire, TopAbs_EDGE);
for (; aEIt2.More(); aEIt2.Next())
{
aIntCount += IntersectEdge(aEdge,TopoDS::Edge(aEIt2.Current()), aParams);
+ DEBTRACE("aParams.size() " << aParams.size());
}
}
- //DEBTRACE("aIntCount " << aIntCount);
+ DEBTRACE("aIntCount " << aIntCount);
return aIntCount;
}