}
}
-//bool HYDROData_PolylineOperator::CreatePolylinesSplit(const Handle( HYDROData_Document )& theDoc,
-// const Handle( HYDROData_PolylineXY )& thePolyline,
-// const std::vector<TopoDS_Shape>& theShapes, bool isUseIndices)
-//{
-//
-// if (theDoc.IsNull())
-// return false;
-//
-// int nbSections = thePolyline->NbSections();
-// const QString& theNamePrefix = thePolyline->GetName();
-// const QColor& theColor = thePolyline->GetWireColor();
-//
-// int n = theShapes.size();
-// DEBTRACE("theShapes.size() "<< n);
-// int anIndex = 1;
-// for (int i = 0; i < n; i++)
-// {
-// Handle( HYDROData_PolylineXY ) aPolyline =
-// Handle( HYDROData_PolylineXY )::DownCast(theDoc->CreateObject(KIND_POLYLINEXY));
-// if (aPolyline.IsNull())
-// return false;
-//
-// for (int isec = 0; isec < nbSections; isec++)
-// {
-// gp_XY p = gp_XY(0, 0);
-// //double d = thePolyline->GetMinDistance(isec, p);
-// }
-//
-// if (isUseIndices)
-// {
-// QString aNewName = theNamePrefix + "_" + QString::number(anIndex);
-// while (!theDoc->FindObjectByName(aNewName).IsNull()) // the object with such a name is not found
-// {
-// anIndex++;
-// aNewName = theNamePrefix + "_" + QString::number(anIndex);
-// }
-// aPolyline->SetName(aNewName);
-// }
-// else
-// {
-// aPolyline->SetName(theNamePrefix);
-// }
-//
-// if (theColor.isValid())
-// aPolyline->SetWireColor(theColor);
-// }
-// return true;
-//
-//}
-
bool HYDROData_PolylineOperator::CreatePolylines( const Handle( HYDROData_Document )& theDoc,
const Handle( HYDROData_PolylineXY )& theOldPolyline,
const std::vector<TopoDS_Shape>& theShapes,
double theTolerance,
std::vector<TopoDS_Shape>& theWires);
-// static bool CreatePolylinesSplit( const Handle( HYDROData_Document )& theDoc,
-// const Handle( HYDROData_PolylineXY )& thePolyline,
-// const std::vector<TopoDS_Shape>& theShapes,
-// bool isUseIndices);
-
static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc,
const Handle( HYDROData_PolylineXY )& theOldPolyline,
const std::vector<TopoDS_Shape>& theShape,
return aResDistance;
}
-//double HYDROData_PolylineXY::GetMinDistance( const int theSectionIndex,
-// const Point& thePoint ) const
-//{
-// double aResDistance = -1;
-// if ( theSectionIndex < 0 || theSectionIndex >= NbSections() )
-// return aResDistance;
-//
-// std::vector<TopoDS_Wire> aCurves;
-// HYDROData_PolylineOperator::GetWires(this, aCurves);
-// if (aCurves.size() != NbSections())
-// {
-// DEBTRACE("nbCurves != nbSections " << aCurves.size() << " " << NbSections());
-// return aResDistance;
-// }
-// TopoDS_Wire aWire = aCurves[theSectionIndex];
-// TopTools_SequenceOfShape anEdges;
-// HYDROData_ShapesTool::ExploreShapeToShapes( aWire, TopAbs_EDGE, anEdges );
-// for ( int i = 1, n = anEdges.Length(); i <= n; ++i )
-// {
-// DEBTRACE("i: "<< i);
-// TopoDS_Edge aWireEdge = TopoDS::Edge( anEdges.Value( i ) );
-// gp_XYZ aPointz = gp_XYZ(thePoint.X(), thePoint.Y(), 0);
-// Adaptor3d_Curve theCurve = BRepAdaptor_Curve(aWireEdge);
-// double theParameter = -1;
-// double d = ProjectPointToCurve(aPointz, theCurve, theParameter);
-// if (d<aResDistance) aResDistance = d;
-// DEBTRACE("d[" << i <<"]=" << d);
-// }
-// DEBTRACE("distance section "<<theSectionIndex<<" point="<<aResDistance<<" ("<<thePoint.X()<<", "<< thePoint.Y()<<")");
-// return aResDistance;
-//}
-
int HYDROData_PolylineXY::NbSections() const
{
Handle(TDataStd_ExtStringList) aNamesList;
HYDRODATA_EXPORT bool IsClosed( const bool theIsSimpleCheck = true ) const;
/**
- * Returns the distance beetwen first and point with index thePointIndex
+ * Returns the distance between first and point with index thePointIndex
* at the section with index theSectionIndex. -1 is returned if error is occurred.
*/
HYDRODATA_EXPORT double GetDistance( const int theSectionIndex,
const int thePointIndex ) const;
- /**
- * Returns the distance between a section and a point
- */
-// HYDRODATA_EXPORT double GetMinDistance( const int theSectionIndex,
-// const Point& thePoint ) const;
-
-
/**
* Returns number of sections.
*/
class TopoDS_Wire;
+//! Get the parameter of the projected point on the curve, and return the distance of the original point
double ProjectPointToCurve(const gp_XYZ& thePoint,
const Adaptor3d_Curve& theCurve,
double& theParameter);
const double theDeflection, HYDROData_TopoCurve& theCurve) const;
//! Calculates the values of the curve in its knots.
- //! Returns 'false' if a curve edge has a nonidentity location or a nonforward
+ //! Returns 'false' if a curve edge has a non-identity location or a non-forward
//! orientation or has no a B-spline representation.
HYDRODATA_EXPORT bool ValuesInKnots(std::list<gp_XYZ>& theValues) const;