{
}
-void HYDROData_SinusX::CollectExistingNames(Handle_HYDROData_Document theDocument)
+void HYDROData_SinusX::CollectExistingNames(Handle(HYDROData_Document) theDocument)
{
HYDROData_Iterator anIter( theDocument );
int anInd = 0;
}
-bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument,
+ NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
if ( theFilePath.isEmpty() )
{
}
-void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
for ( size_t i = 0; i < myCurveBlocks.size(); i++ )
{
{
Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( theDocument->CreateObject( KIND_BATHYMETRY ) );
HYDROData_Bathymetry::AltitudePoints aAPoints;
- for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+ size_t n = myCurveBlocks[i].myXYZPoints.size();
+ aAPoints.reserve( n );
+ for (size_t j = 0; j < n; j++)
{
gp_XYZ aLocalPoint = gp_XYZ (myCurveBlocks[i].myXYZPoints[j]);
theDocument->Transform(aLocalPoint, true);
- aAPoints.Append(aLocalPoint);
+ HYDROData_Bathymetry::AltitudePoint p;
+ p.X = aLocalPoint.X();
+ p.Y = aLocalPoint.Y();
+ p.Z = aLocalPoint.Z();
+ aAPoints.push_back(p);
}
aBath->SetAltitudePoints(aAPoints);
}
-bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
if ( theFilePath.isEmpty() )
{
}
-void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
QTextStream aTextStream(&theFile);
aTextStream << "C Generated by HYDRO Module\n";
for (int i = 1; i <= theEntities.Size(); i++)
{
- Handle_HYDROData_Entity anEnt = theEntities.Value(i);
+ Handle(HYDROData_Entity) anEnt = theEntities.Value(i);
if (anEnt->IsKind( STANDARD_TYPE(HYDROData_Bathymetry) ))
{
Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt );
aTextStream << "CN " << aBathy->GetName() << "\n";
aTextStream << "CP 0 0\n";
aTextStream << "CP 0\n";
- for (int j = anXYZPoints.Lower(); j <= anXYZPoints.Upper(); j++)
- aTextStream << " " << QString::number(anXYZPoints(j).X(), 'f', 3)
- << " " << QString::number(anXYZPoints(j).Y(), 'f', 3)
- << " " << QString::number(anXYZPoints(j).Z(), 'f', 3) << "\n";
+ for (size_t j = 0, m = anXYZPoints.size(); j < m; j++)
+ aTextStream << " " << QString::number(anXYZPoints[j].X, 'f', 3)
+ << " " << QString::number(anXYZPoints[j].Y, 'f', 3)
+ << " " << QString::number(anXYZPoints[j].Z, 'f', 3) << "\n";
}
else if (anEnt->IsKind( STANDARD_TYPE(HYDROData_PolylineXY) ))
{