#include <TCollection_AsciiString.hxx>
#endif
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
#include <assert.h>
typedef NCollection_DataMap<Standard_Real, Handle(HYDROData_Profile)> HYDROData_DataMapOfRealOfHDProfile;
TopoDS_Wire aHydraulicWire = TopoDS::Wire( theHydAxis->GetShape() ); //guide line
TopoDS_Wire aProfileWire = TopoDS::Wire( theProfile->GetTopShape() );
if ( aProfileWire.IsNull() )
- return false;
+ {
+ DEBTRACE("aProfileWire.IsNull");
+ return false;
+ }
//BRepProj_Projection aProjector (aProfileWire, thePlane, gp::OZ().Direction());
BRepAlgo_NormalProjection nproj(thePlane);
nproj.SetDefaultParams();
nproj.Build();
if(!nproj.IsDone())
- return false;
+ {
+ DEBTRACE("!nproj.IsDone");
+ return false;
+ }
TopoDS_Shape aPrjProfile = nproj.Projection();
if(aPrjProfile.IsNull())
- return false;
+ {
+ DEBTRACE("aPrjProfile.IsNull");
+ return false;
+ }
TopoDS_Vertex aV1, aV2;
if(aPrjProfile.ShapeType() == TopAbs_EDGE)
TopExp::Vertices(TopoDS::Edge(aPrjProfile), aV1, aV2);
}
}
if(aV1.IsNull() || aV2.IsNull())
- return false;
+ {
+ DEBTRACE("aV1.IsNull() || aV2.IsNull()");
+ return false;
+ }
gp_Pnt aPnt1 = BRep_Tool::Pnt(aV1);
gp_Pnt aPnt2 = BRep_Tool::Pnt(aV2);
aPnt1.SetZ(0.0);
aPnt2.SetZ(0.0);
BRepBuilderAPI_MakeEdge aMk(aPnt1, aPnt2);
if(!aMk.IsDone())
- return false;
+ {
+ DEBTRACE("!aMk.IsDone()");
+ return false;
+ }
const TopoDS_Edge& anEdg2 = aMk.Edge();//Section edge
Standard_Integer aNum(0);
}
if(hasInt)
return true;
+ DEBTRACE("!hasInt " << aPnt1.X() << " " << aPnt1.Y() << " " << aPnt2.X() << " " << aPnt2.Y() << " --- " << aSqDist);
return false;
}
Standard_Real aPar(.0);
if ( HasReference( theProfile, DataTag_Profile ) || !HasIntersection( theProfile, aPlane, aPar ) )
return false; // Object is already in reference list or it has no intersection
-
+ //DEBTRACE("AddProfile - insertParameter " << aPar);
int aProfileIndex = insertParameter( aPar );
insertProfileInToOrder( theProfile, aProfileIndex );
bool HYDROData_Stream::SetProfiles( const HYDROData_SequenceOfObjects& theProfiles,
const bool& theIsToOrder )
{
+ DEBTRACE(" --- SetProfiles " <<theIsToOrder );
if ( theIsToOrder )
{
for ( int i = 1; i <= theProfiles.Length(); ++i )
{
aResIndex = 0;
- QVector<double> aNewArr( anArr->Upper() );
-
+ QVector<double> aNewArr( anArr->Upper() +1 );
bool isInserted = false;
for ( int i = anArr->Lower(), j = i, n = anArr->Upper(); i <= n; ++i, ++j )
{
}
else
{
- aNewArr[j-1] = theParam;
+ if (j<=n+1)
+ aNewArr[j-1] = theParam;
isInserted = true;
++j;
}
}
-
- aNewArr[j-1] = aStoredParam;
+ if (j<=n+1)
+ aNewArr[j-1] = aStoredParam;
}
if ( !isInserted )