]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Lots 4 & 5
authorisn <isn@opencascade.com>
Tue, 12 Feb 2019 17:59:53 +0000 (20:59 +0300)
committerisn <isn@opencascade.com>
Mon, 18 Feb 2019 15:27:41 +0000 (18:27 +0300)
17 files changed:
src/HYDROData/HYDROData_Polyline3D.cxx
src/HYDROData/HYDROData_Polyline3D.h
src/HYDROData/HYDROData_ProfileUZ.cxx
src/HYDROData/HYDROData_ProfileUZ.h
src/HYDROData/HYDROData_ShapeFile.cxx
src/HYDROData/HYDROData_ShapeFile.h
src/HYDROData/HYDROData_SinusX.cxx
src/HYDROData/HYDROData_SinusX.h
src/HYDROData/HYDROData_Stream.cxx
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_ImportPolylineDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportPolylineDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx
src/HYDROGUI/HYDROGUI_ImportSinusXDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportSinusXDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 858a0a6c7b73641ecef7d6b5231707b8c1488308..ce4bb667dac514a4833fed2b76e306544cfebd7b 100644 (file)
@@ -153,14 +153,14 @@ void HYDROData_Polyline3D::Update()
 
   bool anIsSectionClosed = aPolylineXY->IsClosedSection( 0 );
   HYDROData_IPolyline::SectionType aSectionType = aPolylineXY->GetSectionType( 0 );
-  NCollection_Sequence<Polyline3DPoint> aResPoints = GetProfilePoints3D();
+  NCollection_Sequence<Polyline3DPoint> aResPoints = GetProfilePoints3D(false);
 
   TopoDS_Wire aResWire = HYDROData_PolylineXY::BuildWire( aSectionType, anIsSectionClosed, aResPoints );
   SetTopShape( aResWire );
   SetShape3D( aResWire );
 } 
 
-HYDROData_Polyline3D::Polyline3DPoints HYDROData_Polyline3D::GetProfilePoints3D()
+HYDROData_Polyline3D::Polyline3DPoints HYDROData_Polyline3D::GetProfilePoints3D(bool IsConvertToGlobal)
 {
   Handle(HYDROData_PolylineXY) aPolylineXY = GetPolylineXY();
   if ( aPolylineXY.IsNull() )
@@ -213,6 +213,15 @@ HYDROData_Polyline3D::Polyline3DPoints HYDROData_Polyline3D::GetProfilePoints3D(
   // Add last point as is
   aResPoints.Append( Polyline3DPoint( aLastPoint.X(), aLastPoint.Y(), aLastParPoint.Y() ) );
 
+  if (IsConvertToGlobal)
+  {
+    Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myLab );
+    for (int i=1;i<=aResPoints.Size();i++)
+    {
+      gp_XYZ& point = aResPoints.ChangeValue(i);
+      aDoc->Transform( point, false );
+    }
+  }
   return aResPoints;
 }
 
index 1666a459bc48c99551b7a927be765e1d1b2b56e6..3f0c75172216179dbb8cd19c60832001c2188767 100644 (file)
@@ -132,7 +132,7 @@ public:
    */
   HYDRODATA_EXPORT virtual void RemoveAltitudeObject();
 
-  HYDRODATA_EXPORT Polyline3DPoints GetProfilePoints3D();
+  HYDRODATA_EXPORT Polyline3DPoints GetProfilePoints3D(bool IsConvertToGlobal);
 
   /**
    * Returns the child u,z profile which has been generated from bathymetry.
index 5dccf20cc35c1d2178b1ec76f9b6cbb6124806e8..8ef3dfb6972011570c490e01489bba237c49a107 100644 (file)
@@ -278,14 +278,19 @@ HYDROData_ProfileUZ::PointsList HYDROData_ProfileUZ::GetPoints( const int /*theS
   return aResList;
 }
 
-void HYDROData_ProfileUZ::CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle(HYDROData_PolylineXY)& thePolylineXY)
+void HYDROData_ProfileUZ::CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, 
+  Handle(HYDROData_PolylineXY)& thePolylineXY,
+  bool fillPolyXY)
 {
    // Fill 2D polyline
-  for ( int i = 1; i <= theXYZPoints.Size(); i++ ) {
-    const HYDROData_Profile::ProfilePoint& aBottomPoint = theXYZPoints.Value( i );
-    thePolylineXY->AddPoint( 0, HYDROData_PolylineXY::Point( aBottomPoint.X(), aBottomPoint.Y() ) );
+  if (fillPolyXY)
+  {
+    for ( int i = 1; i <= theXYZPoints.Size(); i++ ) {
+      const HYDROData_Profile::ProfilePoint& aBottomPoint = theXYZPoints.Value( i );
+      thePolylineXY->AddPoint( 0, HYDROData_PolylineXY::Point( aBottomPoint.X(), aBottomPoint.Y() ) );
+    }
   }
-  
+
   // Calculate profile UZ points
 
   // First point
index 2fcb3899a9d1595eeac31b94abe5c4a967360077..7e889c6b6978af19896fc62015683d941a8d43ce 100644 (file)
@@ -169,7 +169,7 @@ public:
   HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const;
 
   HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints,
-     Handle(HYDROData_PolylineXY)& thePolylineXY);
+     Handle(HYDROData_PolylineXY)& thePolylineXY, bool fillPolyXY);
 
 protected:
 
index fdcb4a592fb70be201b72ad7a03a9bcdc57dbcae..4d7519ac0cf16a6c1edbfb8b37abb094f1689861 100644 (file)
@@ -193,7 +193,7 @@ int HYDROData_ShapeFile::WriteObjectPoly3D(Handle(HYDROData_Document) theDocumen
   if (thePoly->GetPolylineXY()->GetSectionType(0) == HYDROData_IPolyline::SECTION_SPLINE)
     return -1;  
 
-  HYDROData_Polyline3D::Polyline3DPoints aPointList3D = thePoly->GetProfilePoints3D();
+  HYDROData_Polyline3D::Polyline3DPoints aPointList3D = thePoly->GetProfilePoints3D(true);
   for (int j = 1; j <= aPointList3D.Size(); j++)
   {
     const gp_XYZ& P = aPointList3D(j);
@@ -368,12 +368,12 @@ void HYDROData_ShapeFile::ProcessFace(Handle(HYDROData_Document) theDocument,
 
 }
 
-bool HYDROData_ShapeFile::Parse(SHPHandle theHandle, ShapeType theType, int& theShapeTypeOfFile)
+bool HYDROData_ShapeFile::Parse(SHPHandle theHandle, ShapeType theType)
 {
   int aShapeType;
   mySHPObjects.clear();
   SHPGetInfo( theHandle, NULL, &aShapeType, NULL, NULL );
-  theShapeTypeOfFile = aShapeType;
+  //theShapeTypeOfFile = aShapeType;
   bool ToRead = (theType == ShapeType_Polyline && 
     (aShapeType == 3 || aShapeType == 13 || aShapeType == 23 || aShapeType == 5)) ||
    (theType == ShapeType_Polygon && aShapeType == 5);
@@ -516,7 +516,7 @@ int HYDROData_ShapeFile::ImportPolygons(Handle(HYDROData_Document) theDocument,
   if (Stat != 0)
     return Stat;
   myHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" );
-  if (!Parse(myHSHP, HYDROData_ShapeFile::ShapeType_Polygon, theShapeTypeOfFile))
+  if (!Parse(myHSHP, HYDROData_ShapeFile::ShapeType_Polygon))
     return 0;
   for (size_t i = 0; i < mySHPObjects.size(); i++)
     thePolygonsList.append("polygon_" + QString::number(i + 1));
@@ -560,7 +560,6 @@ void HYDROData_ShapeFile::Free()
 void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, 
   int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, bool bReadAsPolyline)
 {
-
   Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
   
   int nParts = anObj->nParts;
@@ -609,17 +608,79 @@ void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument,
   
   aPolylineXY->Update();
   theEntities.Append(aPolylineXY);
+}
+
+
+void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, 
+  const Handle(HYDROData_PolylineXY)& aPolylineXY, 
+  NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
+{
+  Handle(HYDROData_Polyline3D) aPolylineObj = Handle(HYDROData_Polyline3D)::DownCast( theDocument->CreateObject( KIND_POLYLINE ) );
+  Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( theDocument->CreateObject( KIND_BATHYMETRY ) );
+
+  HYDROData_Bathymetry::AltitudePoints aAPoints;
+
+  int nParts = anObj->nParts;
+  for ( int i = 0 ; i < nParts ; i++ )
+  {
+    //bool aSectClosure = true;
+    int StartIndex = anObj->panPartStart[i];
+    int EndIndex;
+    if (i != nParts - 1)
+      EndIndex = anObj->panPartStart[i + 1];
+    else
+      EndIndex = anObj->nVertices;
+
+    HYDROData_PolylineXY::SectionType aSectType = HYDROData_PolylineXY::SECTION_POLYLINE; 
+    if (anObj->padfX[StartIndex] == anObj->padfX[EndIndex - 1] &&
+      anObj->padfY[StartIndex] == anObj->padfY[EndIndex - 1] &&
+      anObj->padfZ[StartIndex] == anObj->padfZ[EndIndex - 1])    
+      EndIndex--;
+    for ( int k = StartIndex ; k < EndIndex ; k++ )
+    {
+      gp_XYZ xyz(anObj->padfX[k], anObj->padfY[k], anObj->padfZ[k]);
+      theDocument->Transform(xyz, true);
+      HYDROData_Bathymetry::AltitudePoint p;
+      p.X = xyz.X();
+      p.Y = xyz.Y();
+      p.Z = xyz.Z();
+      aAPoints.push_back(p);      
+    }
+  }
+
+  QString PolyXYName = aPolylineXY->GetName();
+  QString aPoly3DName = PolyXYName, aBathyName = PolyXYName;
+  aPoly3DName.replace(PolyXYName.lastIndexOf("_PolyXY_"), 8, "_Poly3D_");
+  aBathyName.replace(PolyXYName.lastIndexOf("_Bath_"), 6, "_Poly3D_");
+  
+  aBath->SetAltitudePoints(aAPoints);
+  aBath->SetName( aBathyName );
+
+  aPolylineObj->SetPolylineXY (aPolylineXY, false);
+  aPolylineObj->SetAltitudeObject(aBath);
+
+  aPolylineObj->SetBorderColor( aPolylineObj->DefaultBorderColor() );
+  aPolylineObj->SetName( aPoly3DName );
+
+  aPolylineObj->Update();
 
+  theEntities.Append(aPolylineObj);
 }
 
+/*
 void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, 
-  int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
+  int theInd, bool XYOnly, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
 {
   Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
 
-  Handle(HYDROData_Polyline3D) aPolylineObj = Handle(HYDROData_Polyline3D)::DownCast( theDocument->CreateObject( KIND_POLYLINE ) );
+  Handle(HYDROData_Polyline3D) aPolylineObj;
+  Handle(HYDROData_Bathymetry) aBath;
+  if (!XYOnly)
+  {
+    Handle(HYDROData_Polyline3D) aPolylineObj = Handle(HYDROData_Polyline3D)::DownCast( theDocument->CreateObject( KIND_POLYLINE ) );
+    Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( theDocument->CreateObject( KIND_BATHYMETRY ) );
+  }
 
-  Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( theDocument->CreateObject( KIND_BATHYMETRY ) );
   HYDROData_Bathymetry::AltitudePoints aAPoints;
 
   int nParts = anObj->nParts;
@@ -652,11 +713,14 @@ void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument,
       HYDROData_PolylineXY::Point aSectPoint = gp_XY(anObj->padfX[k], anObj->padfY[k]);
       theDocument->Transform(aSectPoint, true);
       aPolylineXY->AddPoint( i, aSectPoint );
-      HYDROData_Bathymetry::AltitudePoint p;
-      p.X = aSectPoint.X();
-      p.Y = aSectPoint.Y();
-      p.Z = anObj->padfZ[k];
-      aAPoints.push_back(p);
+      if (!XYOnly)
+      {
+        HYDROData_Bathymetry::AltitudePoint p;
+        p.X = aSectPoint.X();
+        p.Y = aSectPoint.Y();
+        p.Z = anObj->padfZ[k];
+        aAPoints.push_back(p);
+      }
     }
   }
 
@@ -668,21 +732,27 @@ void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument,
   aPolylineXY->SetName( aPolyXYName );
   aPolylineXY->SetWireColor(HYDROData_PolylineXY::DefaultWireColor());
   aPolylineXY->Update();
-  
-  aBath->SetAltitudePoints(aAPoints);
-  aBath->SetName( aBathName );
 
-  aPolylineObj->SetPolylineXY (aPolylineXY, false);
-  aPolylineObj->SetAltitudeObject(aBath);
+  if (!XYOnly)
+  {
+    aBath->SetAltitudePoints(aAPoints);
+    aBath->SetName( aBathName );
+
+    aPolylineObj->SetPolylineXY (aPolylineXY, false);
+    aPolylineObj->SetAltitudeObject(aBath);
+
+    aPolylineObj->SetBorderColor( aPolylineObj->DefaultBorderColor() );
+    aPolylineObj->SetName( aPoly3DName );
+
+    aPolylineObj->Update();
+  }
 
-  aPolylineObj->SetBorderColor( aPolylineObj->DefaultBorderColor() );
-  aPolylineObj->SetName( aPoly3DName );
-  
-  aPolylineObj->Update();
   theEntities.Append(aPolylineXY);
-  theEntities.Append(aPolylineObj);
 
-}
+  if (!XYOnly)
+    theEntities.Append(aPolylineObj);
+
+}*/
 
 void HYDROData_ShapeFile::GetFreeIndices(std::vector<int>& theAllowedIndexes, QString strName, size_t theObjsSize,
                                          QStringList theExistingNames, QString theBaseFileName)
@@ -700,14 +770,34 @@ void HYDROData_ShapeFile::GetFreeIndices(std::vector<int>& theAllowedIndexes, QS
   }
 }
 
-int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, 
-  NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, int& theShapeTypeOfFile, ImportShapeType theShapeTypesToImport)
+int HYDROData_ShapeFile::OpenAndParse(const QString& theFileName)
 {
   //Free();
   int aStat = TryOpenShapeFile(theFileName);
   if (aStat != 0)
     return aStat;
 
+  //SHPHandle aHSHP;
+  myHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" );
+  if (myHSHP == NULL)
+    return -1;
+
+  if (!Parse(myHSHP, HYDROData_ShapeFile::ShapeType_Polyline))
+    return -1;
+  
+  return 1;
+  //sh_type = aHSHP->nShapeType;
+}
+
+int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, 
+  const QString& theFileName, 
+  NCollection_IndexedDataMap<Handle(HYDROData_Entity), SHPObject*>& theEntitiesToSHPObj, 
+  ImportShapeType theShapeTypesToImport)
+{
+  int aStat = -1;
+  int sh_type = myHSHP->nShapeType;
+  QFileInfo aFileInfo(theFileName);
+  QString aBaseFileName = aFileInfo.baseName();
   HYDROData_Iterator anIter( theDocument );
   int anInd = 0;
   QStringList anExistingNames;
@@ -715,17 +805,7 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument,
   for( ; anIter.More(); anIter.Next() )
     anExistingNames.push_back(anIter.Current()->GetName());
 
-  SHPHandle aHSHP;
-  aHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" );
-  
-  QFileInfo aFileInfo(theFileName);
-  QString aBaseFileName = aFileInfo.baseName();
-
-  if (!Parse(aHSHP, HYDROData_ShapeFile::ShapeType_Polyline, theShapeTypeOfFile))
-    return 0;
-
-  int sh_type = aHSHP->nShapeType;
-
+  NCollection_Sequence<Handle(HYDROData_Entity)> Ents;
   if ((theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_All || 
     theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_Polyline) 
     && (sh_type == 3 || sh_type == 23))
@@ -735,7 +815,9 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument,
  
     for (size_t i = 0; i < mySHPObjects.size(); i++ )
     {
-      ReadSHPPolyXY(theDocument, mySHPObjects[i], aBaseFileName, anAllowedIndexes[i], theEntities, false);
+      ReadSHPPolyXY(theDocument, mySHPObjects[i], aBaseFileName, anAllowedIndexes[i], Ents, false);
+      for (int k=1;k<=Ents.Size();k++)
+        theEntitiesToSHPObj.Add(Ents(k), mySHPObjects[i]);
     }
     aStat = 1;
   }
@@ -757,7 +839,10 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument,
     }
     for (size_t i = 0; i < mySHPObjects.size(); i++ )
     {
-      ReadSHPPoly3D(theDocument, mySHPObjects[i], aBaseFileName, anAllowedIndexes[i], theEntities);
+      //ReadSHPPoly3D(theDocument, mySHPObjects[i], aBaseFileName, anAllowedIndexes[i], false, theEntities); 
+      ReadSHPPolyXY(theDocument, mySHPObjects[i], aBaseFileName, anAllowedIndexes[i], Ents, false); //TODO check Z coord on closeness 
+      for (int k=1;k<=Ents.Size();k++)
+        theEntitiesToSHPObj.Add(Ents(k), mySHPObjects[i]);
     }
     aStat = 1;
   }
@@ -770,7 +855,9 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument,
  
     for (size_t i = 0; i < mySHPObjects.size(); i++ )
     {
-      ReadSHPPolyXY(theDocument, mySHPObjects[i], aBaseFileName, anAllowedIndexes[i], theEntities, true);
+      ReadSHPPolyXY(theDocument, mySHPObjects[i], aBaseFileName, anAllowedIndexes[i], Ents, true);
+      for (int k=1;k<=Ents.Size();k++)
+        theEntitiesToSHPObj.Add(Ents(k), mySHPObjects[i]);
     }
     aStat = 2;
   }
@@ -779,14 +866,42 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument,
     aStat = 0;
   }
   
-  for (size_t i = 0; i < mySHPObjects.size(); i++ )
-    free (mySHPObjects[i]);
+  return aStat;
+}
 
-  mySHPObjects.clear();
-  SHPClose(aHSHP);
+int HYDROData_ShapeFile::GetShapeType() const
+{
+  if (myHSHP != NULL)
+    return myHSHP->nShapeType;
+  else 
+    return -1;
+}
+
+int HYDROData_ShapeFile::ImportPolylines3D(Handle(HYDROData_Document) theDocument, 
+                                           NCollection_IndexedDataMap<Handle(HYDROData_Entity), SHPObject*> thePolyXYToObj, 
+                                           NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities,
+                                           ImportShapeType theShapeTypesToImport)
+{
+  int aStat = -1;
+  int sh_type = myHSHP->nShapeType;
+  if ((theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_All || 
+    theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_Polyline3D) && sh_type == 13)
+  {
+    //for (size_t i = 0; i < mySHPObjects.size(); i++ )
+    for (int i = 1; i <= thePolyXYToObj.Extent(); i++ )
+    {
+      Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( thePolyXYToObj.FindKey(i) );
+      ReadSHPPoly3D(theDocument, thePolyXYToObj(i), aPolylineXY, theEntities); 
+    }
+    aStat = 1;
+  }
+  else  
+    aStat = 0;
+  
   return aStat;
 }
 
+
 QString HYDROData_ShapeFile::GetShapeTypeName(int theType)
 {
   switch (theType)
@@ -910,7 +1025,7 @@ QStringList HYDROData_ShapeFile::DBF_GetFieldList()
 
 void HYDROData_ShapeFile::DBF_GetFieldTypeList(std::vector<DBF_FieldType>& FTVect)
 {
-  int  nWidth, nDecimals;
+  int nWidth, nDecimals;
   char chField[12];
   DBF_FieldType FT;
   for( int i = 0; i < DBFGetFieldCount(myHDBF); i++ )
index b546bd235a5123a713ea2826bd283d930db6d19a..586c5c20ef9755093e72fad770b2bae6974cb0e0 100644 (file)
 #include <NCollection_Sequence.hxx>
 
 #include <TopTools_SequenceOfShape.hxx>
-
+#include <NCollection_IndexedDataMap.hxx>
 #include <QStringList>
 
 #include <vector>
 
-
 //extern "C" {
 #include <shapefil.h> 
 //};
@@ -116,7 +115,7 @@ public:
   int WriteObjectPolygon(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle,
                          const TopoDS_Shape& theInputShape, bool bUseDiscr, double theDefl );
   //Import
-  bool Parse(SHPHandle theHandle, ShapeType theType, int& theShapeTypeOfFile);
+  bool Parse(SHPHandle theHandle, ShapeType theType);
   //Import Landcover
   void ReadSHPPolygon(Handle(HYDROData_Document) theDocument, SHPObject* anObj, int i, TopoDS_Face& F);
 
@@ -133,15 +132,27 @@ public:
                      int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities,
                      bool bReadAsPolylin = false);
 
-  void ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, 
-                     int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
+  void ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj,
+    const Handle(HYDROData_PolylineXY)& aPolylineXY, 
+    NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
 
   HYDRODATA_EXPORT int ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, 
-                                       NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, int& theShapeTypeOfFile,
+                                       NCollection_IndexedDataMap<Handle(HYDROData_Entity), SHPObject*>& theEntitiesToSHPObj,
                                        ImportShapeType theShapeTypesToImport);
 
+  HYDRODATA_EXPORT int ImportPolylines3D(Handle(HYDROData_Document) theDocument, 
+                                         NCollection_IndexedDataMap<Handle(HYDROData_Entity), SHPObject*> thePolyXYToObj, 
+                                         NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities,
+                                         ImportShapeType theShapeTypesToImport);
+
+  HYDRODATA_EXPORT int OpenAndParse(const QString& theFileName);
+
+
   HYDRODATA_EXPORT QString GetShapeTypeName(int theType);
 
+  HYDRODATA_EXPORT int GetShapeType() const;
+
+
   //DBF I/O Methods
   HYDRODATA_EXPORT bool CheckDBFFileExisting(const QString& theSHPFilePath, QString& thePathToDBFFile);
   HYDRODATA_EXPORT bool DBF_OpenDBF(const QString& thePathToDBFFile);
@@ -168,7 +179,7 @@ private:
 
 private:
   std::vector<SHPObject*> mySHPObjects;
-  SHPHandle myHSHP;
+  SHPHandle     myHSHP;
   DBFHandle    myHDBF;
 
   friend class test_HYDROData_ShapeFile;
index a18d59eb6e8617732fca8a2eee0705c20a079185..4e9368525f26778ee220812792fad125371a4097 100644 (file)
@@ -86,8 +86,7 @@ QString HYDROData_SinusX::GetName(const QString& theName)
 }
 
 
-bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument,
-  NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
+bool HYDROData_SinusX::OpenAndParse(const QString& theFilePath)
 {
   if ( theFilePath.isEmpty() )
   { 
@@ -103,10 +102,6 @@ bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Docum
     aFile.open(QIODevice::ReadOnly);
 
     Parse(aFile);
-   
-    CollectExistingNames(theDocument);
-    SXToHydro(theDocument, theEntities);
-    
     aFile.close();
     
     return true;
@@ -116,104 +111,136 @@ bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Docum
 
 }
 
-void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
+void HYDROData_SinusX::Import(Handle(HYDROData_Document) theDocument,
+  NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, std::vector<ImportOptions>* importOptions)
+{
+  CollectExistingNames(theDocument);
+  SXToHydro(theDocument, theEntities, importOptions);
+}
+
+
+void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities,
+    std::vector<ImportOptions>* importOptions )
 { 
+  if (importOptions && (myCurveBlocks.size() != importOptions->size()))
+    importOptions = NULL; //incorrect input
+
   for ( size_t i = 0; i < myCurveBlocks.size(); i++ )
   {
     if (myCurveBlocks[i].myType == 4) ///  scatter plot -> to bathy
     {
-      Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( theDocument->CreateObject( KIND_BATHYMETRY ) );
-      HYDROData_Bathymetry::AltitudePoints aAPoints;
-      size_t n = myCurveBlocks[i].myXYZPoints.size();
-      aAPoints.reserve( n );
-      for (size_t j = 0; j < n; j++)
+      if (!importOptions || (importOptions && (*importOptions)[i].ImportAsBathy == true))
       {
-        gp_XYZ aLocalPoint = gp_XYZ (myCurveBlocks[i].myXYZPoints[j]);
-        theDocument->Transform(aLocalPoint, true);
-        HYDROData_Bathymetry::AltitudePoint p;
-        p.X = aLocalPoint.X();
-        p.Y = aLocalPoint.Y();
-        p.Z = aLocalPoint.Z();
-        aAPoints.push_back(p);
-      }
+        Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( theDocument->CreateObject( KIND_BATHYMETRY ) );
+        HYDROData_Bathymetry::AltitudePoints aAPoints;
+        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);
+          HYDROData_Bathymetry::AltitudePoint p;
+          p.X = aLocalPoint.X();
+          p.Y = aLocalPoint.Y();
+          p.Z = aLocalPoint.Z();
+          aAPoints.push_back(p);
+        }
 
-      aBath->SetAltitudePoints(aAPoints);
-      aBath->SetName(GetName(myCurveBlocks[i].myName));
-      theEntities.Append(aBath);
+        aBath->SetAltitudePoints(aAPoints);
+        aBath->SetName(GetName(myCurveBlocks[i].myName));
+        theEntities.Append(aBath);
+      }
     }
     if (myCurveBlocks[i].myType == 1 || myCurveBlocks[i].myType == 3) // XYZ curve or isocontour
     {
-      NCollection_Sequence<gp_XYZ> aPoints;
-      for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+      if (!importOptions || (importOptions && (*importOptions)[i].ImportAsPolyXY == true))
       {
-        gp_XYZ aLocalPoint = gp_XYZ (myCurveBlocks[i].myXYZPoints[j]);
-        theDocument->Transform(aLocalPoint, true);
-        aPoints.Append(aLocalPoint);
-      }
-      /*if (myCurveBlocks[i].myIsClosed)
-        aPoints.Append(gp_XYZ (myCurveBlocks[i].myXYZPoints[0]));*/
-      Handle(HYDROData_ProfileUZ) aProfileUZ = Handle(HYDROData_ProfileUZ)::DownCast( theDocument->CreateObject( KIND_PROFILEUZ ) );
-      Handle(HYDROData_PolylineXY) aPolyXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
-      aPolyXY->AddSection( "",  
-        myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE, 
-        myCurveBlocks[i].myIsClosed ? true : false); 
-      aProfileUZ->CalculateAndAddPoints(aPoints, aPolyXY);
-      Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
-      aProfile->SetParametricPoints(aProfileUZ->GetPoints());
-      aPolyXY->SetName(GetName(myCurveBlocks[i].myName));
-      aProfileUZ->SetName(GetName(myCurveBlocks[i].myName));
-      aProfile->SetName(GetName(myCurveBlocks[i].myName));
-      aPolyXY->SetWireColor(HYDROData_PolylineXY::DefaultWireColor());
-      theEntities.Append(aPolyXY);
-      theEntities.Append(aProfileUZ);
-      theEntities.Append(aProfile);
+        NCollection_Sequence<gp_XYZ> aPoints;
+        for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+        {
+          gp_XYZ aLocalPoint = gp_XYZ (myCurveBlocks[i].myXYZPoints[j]);
+          theDocument->Transform(aLocalPoint, true);
+          aPoints.Append(aLocalPoint);
+        }
+
+        Handle(HYDROData_PolylineXY) aPolyXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
+        aPolyXY->AddSection( "",  
+          myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE, 
+          myCurveBlocks[i].myIsClosed ? true : false); 
+        aPolyXY->SetName(GetName(myCurveBlocks[i].myName));
+        aPolyXY->SetWireColor(HYDROData_PolylineXY::DefaultWireColor());
+
+        for ( int k = 1; k <= aPoints.Size(); k++ ) {
+          const HYDROData_Profile::ProfilePoint& aBottomPoint = aPoints.Value( k );
+          aPolyXY->AddPoint( 0, HYDROData_PolylineXY::Point( aBottomPoint.X(), aBottomPoint.Y() ) );
+        }
+
+        theEntities.Append(aPolyXY);
+        if (!importOptions || (importOptions && (*importOptions)[i].ImportAsProfile == true))
+        {
+          Handle(HYDROData_ProfileUZ) aProfileUZ = Handle(HYDROData_ProfileUZ)::DownCast( theDocument->CreateObject( KIND_PROFILEUZ ) );
+          aProfileUZ->CalculateAndAddPoints(aPoints, aPolyXY, false);
+          Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
+          aProfile->SetParametricPoints(aProfileUZ->GetPoints());
+
+          aProfileUZ->SetName(GetName(myCurveBlocks[i].myName));
+          aProfile->SetName(GetName(myCurveBlocks[i].myName));
+
+          theEntities.Append(aProfileUZ);
+          theEntities.Append(aProfile);
+        }
+      }      
+
     }
     if (myCurveBlocks[i].myType == 2) // XYZ profile
     {
-      if (myCurveBlocks[i].myCurvePlane == 2) // plane XoZ
+      if (!importOptions || (importOptions && (*importOptions)[i].ImportAsProfile == true))
       {
-        if (myCurveBlocks[i].myAdditionalCurveInfo.size() == 4)
+        if (myCurveBlocks[i].myCurvePlane == 2) // plane XoZ
+        {
+          if (myCurveBlocks[i].myAdditionalCurveInfo.size() == 4)
+          {
+            Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
+            HYDROData_ProfileUZ::PointsList aPointList;
+            for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+              aPointList.Append(gp_XY (myCurveBlocks[i].myXYZPoints[j].X(), myCurveBlocks[i].myXYZPoints[j].Z()));
+            aProfile->GetProfileUZ()->SetSectionType(0,  myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE);
+            aProfile->GetProfileUZ()->SetSectionClosed(0, myCurveBlocks[i].myIsClosed ? true : false);
+            aProfile->SetParametricPoints(aPointList);
+            if ( ! (myCurveBlocks[i].myAdditionalCurveInfo[0] == 0 &&  myCurveBlocks[i].myAdditionalCurveInfo[1] == 0 && 
+              myCurveBlocks[i].myAdditionalCurveInfo[2] == 0 && myCurveBlocks[i].myAdditionalCurveInfo[3] == 0) )
+            { // georeferenced profile
+              double xl = myCurveBlocks[i].myAdditionalCurveInfo[0];
+              double yl = myCurveBlocks[i].myAdditionalCurveInfo[1];
+              double xr = myCurveBlocks[i].myAdditionalCurveInfo[2];
+              double yr = myCurveBlocks[i].myAdditionalCurveInfo[3];
+              theDocument->Transform(xl, yl , true);
+              theDocument->Transform(xr, yr , true);
+              aProfile->SetLeftPoint(gp_XY(xl, yl));
+              aProfile->SetRightPoint(gp_XY(xr, yr));
+              aProfile->Update();
+            }
+            aProfile->SetName(GetName(myCurveBlocks[i].myName));
+            theEntities.Append(aProfile);
+          }
+        }
+        if (myCurveBlocks[i].myCurvePlane == 0) // plane XoY
         {
           Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
-          HYDROData_ProfileUZ::PointsList aPointList;
+          HYDROData_Profile::ProfilePoints aPointList;
           for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
-            aPointList.Append(gp_XY (myCurveBlocks[i].myXYZPoints[j].X(), myCurveBlocks[i].myXYZPoints[j].Z()));
+          {
+            gp_XYZ aLocalPoint = gp_XYZ (myCurveBlocks[i].myXYZPoints[j]);
+            theDocument->Transform(aLocalPoint, true);
+            aPointList.Append(aLocalPoint);
+          }
           aProfile->GetProfileUZ()->SetSectionType(0,  myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE);
           aProfile->GetProfileUZ()->SetSectionClosed(0, myCurveBlocks[i].myIsClosed ? true : false);
-          aProfile->SetParametricPoints(aPointList);
-          if ( ! (myCurveBlocks[i].myAdditionalCurveInfo[0] == 0 &&  myCurveBlocks[i].myAdditionalCurveInfo[1] == 0 && 
-            myCurveBlocks[i].myAdditionalCurveInfo[2] == 0 && myCurveBlocks[i].myAdditionalCurveInfo[3] == 0) )
-          { // georeferenced profile
-            double xl = myCurveBlocks[i].myAdditionalCurveInfo[0];
-            double yl = myCurveBlocks[i].myAdditionalCurveInfo[1];
-            double xr = myCurveBlocks[i].myAdditionalCurveInfo[2];
-            double yr = myCurveBlocks[i].myAdditionalCurveInfo[3];
-            theDocument->Transform(xl, yl , true);
-            theDocument->Transform(xr, yr , true);
-            aProfile->SetLeftPoint(gp_XY(xl, yl));
-            aProfile->SetRightPoint(gp_XY(xr, yr));
-            aProfile->Update();
-          }
+          aProfile->SetProfilePoints(aPointList);
           aProfile->SetName(GetName(myCurveBlocks[i].myName));
           theEntities.Append(aProfile);
         }
       }
-      if (myCurveBlocks[i].myCurvePlane == 0) // plane XoY
-      {
-        Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
-        HYDROData_Profile::ProfilePoints aPointList;
-        for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
-        {
-          gp_XYZ aLocalPoint = gp_XYZ (myCurveBlocks[i].myXYZPoints[j]);
-          theDocument->Transform(aLocalPoint, true);
-          aPointList.Append(aLocalPoint);
-        }
-        aProfile->GetProfileUZ()->SetSectionType(0,  myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE);
-        aProfile->GetProfileUZ()->SetSectionClosed(0, myCurveBlocks[i].myIsClosed ? true : false);
-        aProfile->SetProfilePoints(aPointList);
-        aProfile->SetName(GetName(myCurveBlocks[i].myName));
-        theEntities.Append(aProfile);
-      }
     }
   }
 
@@ -433,3 +460,10 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Hand
     }
   }
 }
+
+std::vector<HYDROGUI_CurveBlock> HYDROData_SinusX::GetCurveBlocks() const
+{
+  return myCurveBlocks;
+}
+
+
index 03899572d0bb9013bb3c9aa58608f11191918020..564676ad98b34f2a46831071d1e5eda344f8a439 100644 (file)
@@ -20,6 +20,7 @@
 #define HYDRODATA_SINUSX_H
 
 #include <vector>
+#include <utility>
 #include <HYDROData.h>
 #include <NCollection_Sequence.hxx>
 #include <QString>
@@ -47,15 +48,30 @@ struct HYDROGUI_CurveBlock
 
 class HYDRODATA_EXPORT HYDROData_SinusX 
 {
+public:
+  struct ImportOptions
+  {
+    ImportOptions() : ImportAsBathy(false), ImportAsProfile(false), ImportAsPolyXY(false)
+    {};
+    bool ImportAsBathy;
+    bool ImportAsProfile;
+    bool ImportAsPolyXY;
+  };
 
 public:
   HYDROData_SinusX( );
   virtual ~HYDROData_SinusX();
-  bool Import (const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
+
+  bool OpenAndParse(const QString& theFilePath);
+  void Import(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities,
+       std::vector<ImportOptions>* importOptions = NULL);
+  
   bool Export(const QString& theFilePath, const NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
+  std::vector<HYDROGUI_CurveBlock> GetCurveBlocks() const;
   
 private:
-  void SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
+  void SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities,
+    std::vector<ImportOptions>* importOptions);
   bool Parse( QFile& theFile );
   void CollectExistingNames(Handle(HYDROData_Document) theDocument);
   QString GetName(const QString& theName);
index 2cf711653065978c1d331327b8b2a39ffb4761a1..6ecd009f286947ebf12b33085f997ff6edc42bca 100644 (file)
@@ -977,7 +977,7 @@ bool HYDROData_Stream::GenerateBottomPolyline()
   
   aProfileUZ->RemoveSection( 0 );
 
-  aProfileUZ->CalculateAndAddPoints(aBottomPoints, aPolylineXY);
+  aProfileUZ->CalculateAndAddPoints(aBottomPoints, aPolylineXY, true);
   
   return true;
 }
index 17441f3aa5df015faa798f503703232735c4125b..ba89018fc9f70564683aab85c2cc2fd79f49733c 100755 (executable)
@@ -161,6 +161,8 @@ set(PROJECT_HEADERS
     HYDROGUI_MeasurementToolDlg.h
     HYDROGUI_SIProgressIndicator.h
     HYDROGUI_ZIProgressIndicator.h
+    HYDROGUI_ImportPolylineDlg.h
+    HYDROGUI_ImportSinusXDlg.h
 )
 
 QT_WRAP_MOC(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
@@ -324,6 +326,8 @@ set(PROJECT_SOURCES
     HYDROGUI_MeasurementToolDlg.cxx
     HYDROGUI_SIProgressIndicator.cxx
     HYDROGUI_ZIProgressIndicator.cxx
+    HYDROGUI_ImportPolylineDlg.cxx
+    HYDROGUI_ImportSinusXDlg.cxx
 )
 
 add_definitions(
diff --git a/src/HYDROGUI/HYDROGUI_ImportPolylineDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportPolylineDlg.cxx
new file mode 100644 (file)
index 0000000..2c80c08
--- /dev/null
@@ -0,0 +1,112 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ImportPolylineDlg.h"
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QLabel>
+
+HYDROGUI_ImportPolylineDlg::HYDROGUI_ImportPolylineDlg( QWidget* theParent, 
+  const NCollection_Sequence<Handle(HYDROData_Entity)>& PolyEnts )
+  : QDialog( theParent )
+{
+  QVBoxLayout* aMainLayout = new QVBoxLayout( this );
+  aMainLayout->setMargin(5);
+  aMainLayout->setSpacing(5);
+
+  QLabel* gLabel = new QLabel();
+  gLabel->setText(tr("POLYLINES_3D_IN_FILES"));
+
+  myPolylineTable = new QTableWidget(PolyEnts.Size(), 2);
+
+  myPolyEnts = PolyEnts;
+
+  QStringList header;
+  header << tr("POLYLINE_NAME") << tr("FULL_IMPORT");
+  myPolylineTable->setHorizontalHeaderLabels(header);
+  myPolylineTable->setShowGrid(true);
+
+  for (int i = 1; i <= myPolyEnts.Size(); i++)
+  {
+    QTableWidgetItem* item = new QTableWidgetItem(myPolyEnts(i)->GetName());
+    item->setFlags(item->flags() ^ Qt::ItemIsEditable);
+    myPolylineTable->setItem(i-1, 0, item);
+
+    QTableWidgetItem* itemCheckbox = new QTableWidgetItem("");
+    itemCheckbox->setFlags(itemCheckbox->flags() ^ Qt::ItemIsEditable);
+    itemCheckbox->setCheckState(Qt::Unchecked);
+    myPolylineTable->setItem(i-1, 1, itemCheckbox);
+  }
+
+  aMainLayout->addWidget(gLabel);
+  aMainLayout->addWidget(myPolylineTable);
+
+  QPushButton* CheckAllButton = new QPushButton( tr("CHECK_ALL"), this );
+  QPushButton* UncheckAllButton = new QPushButton( tr("UNCHECK_ALL"), this );
+
+  QPushButton* anOkButton = new QPushButton( tr("OK"), this );
+  anOkButton->setDefault( true ); 
+
+  aMainLayout->addWidget( CheckAllButton );
+  aMainLayout->addWidget( UncheckAllButton );
+  aMainLayout->addWidget( anOkButton );
+
+  connect( anOkButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
+  connect( CheckAllButton, SIGNAL( clicked() ), this, SLOT( onCheckAll() ) );
+  connect( UncheckAllButton, SIGNAL( clicked() ), this, SLOT( onUncheckAll() ) );
+
+  setLayout(aMainLayout);
+}
+
+HYDROGUI_ImportPolylineDlg::~HYDROGUI_ImportPolylineDlg()
+{
+}
+
+void HYDROGUI_ImportPolylineDlg::onCheckAll()
+{
+  for (int i = 1; i <= myPolyEnts.Size(); i++)
+  {
+    QTableWidgetItem* itemCheckbox = myPolylineTable->item(i-1, 1);
+    itemCheckbox->setCheckState(Qt::Checked);
+  }
+}
+
+void HYDROGUI_ImportPolylineDlg::onUncheckAll()
+{
+  for (int i = 1; i <= myPolyEnts.Size(); i++)
+  {
+    QTableWidgetItem* itemCheckbox = myPolylineTable->item(i-1, 1);
+    itemCheckbox->setCheckState(Qt::Unchecked);
+  }
+}
+
+NCollection_Sequence<Handle(HYDROData_Entity)> HYDROGUI_ImportPolylineDlg::GetCheckedPolylines() const
+{
+  NCollection_Sequence<Handle(HYDROData_Entity)> checkedPolys;
+  for (int i = 1; i <= myPolyEnts.Size(); i++)
+  {
+    QTableWidgetItem* itemCheckbox = myPolylineTable->item(i-1, 1);
+    if (itemCheckbox->checkState() == Qt::CheckState::Checked)
+      checkedPolys.Append(myPolyEnts(i));
+  }
+  return checkedPolys;
+}
+
+
+
+
diff --git a/src/HYDROGUI/HYDROGUI_ImportPolylineDlg.h b/src/HYDROGUI/HYDROGUI_ImportPolylineDlg.h
new file mode 100644 (file)
index 0000000..f845e17
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+
+
+#ifndef HYDROGUI_IMPORTPOLYLINEDLG_H
+#define HYDROGUI_IMPORTPOLYLINEDLG_H
+
+#include <QTableWidget>
+#include <QDialog>
+#include <NCollection_Sequence.hxx>
+#include <HYDROData_Entity.h>
+
+class HYDROGUI_ImportPolylineDlg : public QDialog
+{
+  Q_OBJECT
+
+public:
+
+  HYDROGUI_ImportPolylineDlg( QWidget* theParent, const NCollection_Sequence<Handle(HYDROData_Entity)>& PolyEnts );
+  virtual ~HYDROGUI_ImportPolylineDlg();
+
+  NCollection_Sequence<Handle(HYDROData_Entity)> GetCheckedPolylines() const;
+
+private slots:
+  void onCheckAll();
+  void onUncheckAll();
+  
+private:
+  QTableWidget* myPolylineTable;
+  NCollection_Sequence<Handle(HYDROData_Entity)> myPolyEnts;
+
+};
+
+#endif
index 8889bd5c45d786d185948146f1d5f6474c5e562e..e4ffa108ace36a5bfb39093e7f7561761c980a1a 100644 (file)
@@ -41,7 +41,9 @@
 #include <QFileInfo>
 #include <SUIT_MessageBox.h>
 #include <gp_XY.hxx>
-
+#include <HYDROGUI_ImportPolylineDlg.h>
+#include <HYDROGUI_Module.h>
+#include <HYDROGUI_Operation.h>
 
 HYDROGUI_ImportPolylineOp::HYDROGUI_ImportPolylineOp( HYDROGUI_Module* theModule )
 : HYDROGUI_Operation( theModule )
@@ -91,11 +93,22 @@ NCollection_Sequence<Handle(HYDROData_Entity)> HYDROGUI_ImportPolylineOp::Import
     }
     if (anExt == "shp")
     {
+      QApplication::setOverrideCursor( Qt::WaitCursor );
       HYDROData_ShapeFile anImporter;
-      NCollection_Sequence<Handle(HYDROData_Entity)> theEntities;
+      NCollection_IndexedDataMap<Handle(HYDROData_Entity), SHPObject*> theEntitiesToSHPObj;
+      NCollection_Sequence<Handle(HYDROData_Entity)> PolyEnt;
       int aShapeTypeOfFile = -1;
-      int aStat = anImporter.ImportPolylines(theDocument, aFileName, theEntities, 
-        aShapeTypeOfFile, theShapeTypesToImport ); 
+      int aStat = anImporter.OpenAndParse(aFileName);
+      QApplication::restoreOverrideCursor();
+      if (aStat == 1)
+      {
+        QApplication::setOverrideCursor( Qt::WaitCursor );
+        aStat = anImporter.ImportPolylines(theDocument, aFileName, theEntitiesToSHPObj, theShapeTypesToImport); 
+        QApplication::restoreOverrideCursor();
+        for (int k=1;k<=theEntitiesToSHPObj.Extent();k++)
+        {
+          PolyEnt.Append(theEntitiesToSHPObj.FindKey(k));
+        }
       if (aStat == 1 || aStat == 2)
       {
         //try to import DBF
@@ -106,8 +119,8 @@ NCollection_Sequence<Handle(HYDROData_Entity)> HYDROGUI_ImportPolylineOp::Import
         {
           QStringList aFieldList = anImporter.DBF_GetFieldList();
           int nbRecords = anImporter.DBF_GetNbRecords();
-          assert (theEntities.Length() == nbRecords);
-          if (theEntities.Length() == nbRecords)
+            assert (theEntitiesToSHPObj.Extent() == nbRecords);
+            if (theEntitiesToSHPObj.Extent() == nbRecords)
           {
             int indNameAttrFound = -1;
             int k = 0;
@@ -135,9 +148,9 @@ NCollection_Sequence<Handle(HYDROData_Entity)> HYDROGUI_ImportPolylineOp::Import
             }
 
             int indNULL = 1;
-            for (int i = 1; i <= theEntities.Length(); i++)
+                for (int i = 1; i <= theEntitiesToSHPObj.Extent(); i++)
             {
-              Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theEntities(i) );
+                  Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theEntitiesToSHPObj.FindKey(i) );
               QStringList aDBFinfo;
               aDBFinfo << aFieldList; //first, the table header
               for (int j = 0; j < aFieldList.size(); j++)
@@ -170,11 +183,35 @@ NCollection_Sequence<Handle(HYDROData_Entity)> HYDROGUI_ImportPolylineOp::Import
           }
         }        
       }
+
+        if (anImporter.GetShapeType() == 13) //Polyline 3D
+        {
+          HYDROGUI_ImportPolylineDlg* aDLG = new HYDROGUI_ImportPolylineDlg( module->getApp()->desktop(), PolyEnt );
+          aDLG->setModal( true );
+          aDLG->setWindowTitle(tr("IMPORT_POLYLINE"));
+          //QApplication::restoreOverrideCursor();
+          if( aDLG->exec()==QDialog::Accepted )
+          {
+            NCollection_Sequence<Handle(HYDROData_Entity)> CheckedPolylines = aDLG->GetCheckedPolylines();
+            NCollection_IndexedDataMap<Handle(HYDROData_Entity), SHPObject*> CheckedEntitiesToSHPObj;
+            for (int k=1;k<=CheckedPolylines.Size();k++)
+            {
+              SHPObject* const* SHPObkP = theEntitiesToSHPObj.Seek(CheckedPolylines(k));
+              if (SHPObkP != NULL)
+                CheckedEntitiesToSHPObj.Add(CheckedPolylines(k), *SHPObkP);
+            }
+            NCollection_Sequence<Handle(HYDROData_Entity)> theEntitiesPoly3D;
+            anImporter.ImportPolylines3D(theDocument, CheckedEntitiesToSHPObj, theEntitiesPoly3D, theShapeTypesToImport);          
+            PolyEnt.Append(theEntitiesPoly3D);
+          }
+        }
+        anImporter.Free();
+      }
       if (aStat == 1)
-        UpdateView(module, theEntities);
+        UpdateView(module, PolyEnt);
       else if (aStat == 2)
       {
-        UpdateView(module, theEntities);
+        UpdateView(module, PolyEnt);
         if (theShapeTypesToImport == HYDROData_ShapeFile::ImportShapeType_All) //if other flag = > no need to show this messagebox
           SUIT_MessageBox::information(module->getApp()->desktop(), 
             tr( "IMPORT_POLYLINE" ), tr ("POLYGON_IMPORTED_AS_POLYLINE"));
@@ -195,7 +232,7 @@ NCollection_Sequence<Handle(HYDROData_Entity)> HYDROGUI_ImportPolylineOp::Import
           aMess += tr ("SHAPE_TYPE_IS") + anImporter.GetShapeTypeName(aShapeTypeOfFile);
         SUIT_MessageBox::warning( module->getApp()->desktop(), tr( "IMPORT_POLYLINE" ), aMess);
       }
-      importedEntities.Append(theEntities);
+      importedEntities.Append(PolyEnt);
     }
     else if ( anExt == "xy" || (importXY && anExt == "xyz"))
     {
@@ -221,7 +258,7 @@ void HYDROGUI_ImportPolylineOp::onApply()
 
   QStringList aFileNames = myFileDlg->selectedFiles();
   
-  QApplication::setOverrideCursor( Qt::WaitCursor );  
+  //QApplication::setOverrideCursor( Qt::WaitCursor );  
   startDocOperation();
 
   ImportPolyOp(aFileNames, doc(), module(), HYDROData_ShapeFile::ImportShapeType_All);
diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportSinusXDlg.cxx
new file mode 100644 (file)
index 0000000..8957c2d
--- /dev/null
@@ -0,0 +1,164 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ImportSinusXDlg.h"
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QLabel>
+#include <HYDROData_SinusX.h>
+#include <assert.h>
+#include <QHeaderView>
+#include <QSizePolicy>
+
+HYDROGUI_ImportSinusXDlg::HYDROGUI_ImportSinusXDlg( QWidget* theParent, const QStringList& theNames,
+  const std::vector<int>& theTypes )
+  : QDialog( theParent )
+{
+  QVBoxLayout* aMainLayout = new QVBoxLayout( this );
+  aMainLayout->setMargin(5);
+  aMainLayout->setSpacing(5);
+  this->resize(600, 500);
+
+  QLabel* gLabel = new QLabel();
+  gLabel->setText(tr("ENTITIES_TO_IMPORT"));
+
+  assert (theNames.size() == theTypes.size());
+  myTable = new QTableWidget(theNames.size(), 5);
+
+  QStringList header;
+  header << tr("NAME") << tr("TYPE") << tr("AS_BATHY") << tr("AS_POLYXY") << tr("AS_PROFILE");
+  myTable->setHorizontalHeaderLabels(header);
+
+  myTable->setShowGrid(true);
+  myTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
+
+  for (int i = 0; i < theNames.size(); i++)
+  {
+    QTableWidgetItem* item_name = new QTableWidgetItem(theNames[i]);
+    item_name->setFlags(item_name->flags() ^ Qt::ItemIsEditable);
+    myTable->setItem(i, 0, item_name);
+
+    QString TypeName;
+    if (theTypes[i] == 1)
+      TypeName = tr("XYZ_CURVE");
+    else if (theTypes[i] == 2)
+      TypeName = tr("XYZ_PROFILE");
+    else if (theTypes[i] == 3)
+      TypeName = tr("ISOCONTOUR");
+    else if (theTypes[i] == 4)
+      TypeName = tr("SCATTER");
+
+    QTableWidgetItem* item_type = new QTableWidgetItem(TypeName);
+    item_type->setFlags(item_type->flags() ^ Qt::ItemIsEditable);
+    myTable->setItem(i, 1, item_type);
+
+    QTableWidgetItem* itemCheckbox1 = new QTableWidgetItem(""); //as bathy
+    itemCheckbox1->setFlags(itemCheckbox1->flags() ^ Qt::ItemIsEditable);
+    itemCheckbox1->setCheckState(Qt::Checked);
+    myTable->setItem(i, 2, itemCheckbox1);
+
+    QTableWidgetItem* itemCheckbox2 = new QTableWidgetItem("");  ; //as polyXY
+    itemCheckbox2->setFlags(itemCheckbox2->flags() ^ Qt::ItemIsEditable);
+    itemCheckbox2->setCheckState(Qt::Checked);
+    myTable->setItem(i, 3, itemCheckbox2);
+
+    QTableWidgetItem* itemCheckbox3 = new QTableWidgetItem("");  ; //as profile
+    itemCheckbox3->setFlags(itemCheckbox3->flags() ^ Qt::ItemIsEditable);
+    itemCheckbox3->setCheckState(Qt::Checked);
+    myTable->setItem(i, 4, itemCheckbox3);
+
+    if (theTypes[i] == 1 || theTypes[i] == 3) ///XYZ curve 
+    {
+      itemCheckbox1->setFlags(item_type->flags() & ~Qt::ItemIsEnabled); //disable bathy
+      itemCheckbox1->setCheckState(Qt::Unchecked);
+    }
+    else if (theTypes[i] == 2)
+    {
+      itemCheckbox1->setFlags(item_type->flags() & ~Qt::ItemIsEnabled); 
+      itemCheckbox2->setFlags(item_type->flags() & ~Qt::ItemIsEnabled); 
+      itemCheckbox1->setCheckState(Qt::Unchecked);
+      itemCheckbox2->setCheckState(Qt::Unchecked);
+    }
+    else if (theTypes[i] == 4)
+    {
+      //as bathy only
+      itemCheckbox2->setFlags(item_type->flags() & ~Qt::ItemIsEnabled); 
+      itemCheckbox3->setFlags(item_type->flags() & ~Qt::ItemIsEnabled); 
+      itemCheckbox2->setCheckState(Qt::Unchecked);
+      itemCheckbox3->setCheckState(Qt::Unchecked);
+    }
+  }
+
+  aMainLayout->addWidget(gLabel);
+  aMainLayout->addWidget(myTable);
+
+  //QPushButton* CheckAllButton = new QPushButton( tr("CHECK_ALL"), this );
+  //QPushButton* UncheckAllButton = new QPushButton( tr("UNCHECK_ALL"), this );
+
+  QPushButton* anOkButton = new QPushButton( tr("OK"), this );
+  anOkButton->setDefault( true ); 
+
+  //aMainLayout->addWidget( CheckAllButton );
+  //aMainLayout->addWidget( UncheckAllButton );
+  aMainLayout->addWidget( anOkButton );
+
+  connect( anOkButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
+  //connect( CheckAllButton, SIGNAL( clicked() ), this, SLOT( onCheckAll() ) );
+  //connect( UncheckAllButton, SIGNAL( clicked() ), this, SLOT( onUncheckAll() ) );
+
+  connect(myTable, SIGNAL(cellChanged(int,int)), this, SLOT(onCheckChecked(int, int)));
+
+  setLayout(aMainLayout);
+}
+
+HYDROGUI_ImportSinusXDlg::~HYDROGUI_ImportSinusXDlg()
+{
+}
+
+void HYDROGUI_ImportSinusXDlg::onCheckChecked(int r, int c)
+{
+  ///if it's "as POLYLINE" column and now it's unchecked => disable "as PROFILE" checkbox
+  if (c == 3 && myTable->item(r, 3)->checkState() == Qt::Unchecked) 
+  {
+    QString text = myTable->item(r, 1)->text();
+    if (text == tr("XYZ_CURVE") || text == tr("ISOCONTOUR"))
+      myTable->item(r, 4)->setCheckState(Qt::Unchecked);
+  }
+}
+
+std::vector<HYDROData_SinusX::ImportOptions> HYDROGUI_ImportSinusXDlg::GetImportOptions() const
+{
+  std::vector<HYDROData_SinusX::ImportOptions> options; 
+  int size = myTable->rowCount();
+  for (int i = 0; i < size; i++)
+  {
+    HYDROData_SinusX::ImportOptions option;
+    if (myTable->item(i, 2)->checkState() == Qt::CheckState::Checked)
+      option.ImportAsBathy = true;
+    if (myTable->item(i, 3)->checkState() == Qt::CheckState::Checked)
+      option.ImportAsPolyXY = true;
+    if (myTable->item(i, 4)->checkState() == Qt::CheckState::Checked)
+      option.ImportAsProfile = true;
+    options.push_back(option);
+  }
+  return options;
+}
+
+
+
+
diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXDlg.h b/src/HYDROGUI/HYDROGUI_ImportSinusXDlg.h
new file mode 100644 (file)
index 0000000..83e8913
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+
+
+#ifndef HYDROGUI_IMPORTSINUSXDLG_H
+#define HYDROGUI_IMPORTSINUSXDLG_H
+
+#include <QTableWidget>
+#include <QDialog>
+#include <NCollection_Sequence.hxx>
+#include <HYDROData_Entity.h>
+#include <HYDROData_SinusX.h>
+
+class HYDROGUI_ImportSinusXDlg : public QDialog
+{
+  Q_OBJECT
+
+public:
+
+  HYDROGUI_ImportSinusXDlg( QWidget* theParent, const QStringList& theNames,
+     const std::vector<int>& theTypes);
+  virtual ~HYDROGUI_ImportSinusXDlg();
+
+  std::vector<HYDROData_SinusX::ImportOptions> GetImportOptions() const;
+
+private slots:
+  void onCheckChecked(int r, int c);
+
+  //private slots:
+//  void onCheckAll();
+//  void onUncheckAll();
+  
+private:
+  QTableWidget* myTable;
+  //NCollection_Sequence<Handle(HYDROData_Entity)> myPolyEnts;
+};
+
+#endif
index 38b5cf4cb14ebf1389c2fa81d81e76b30d58512f..73125df6a68e8fe99247229ba4f374dbe31d81ec 100644 (file)
@@ -40,6 +40,7 @@
 #include <QMessageBox>
 
 #include <HYDROData_SinusX.h>
+#include <HYDROGUI_ImportSinusXDlg.h>
 
 
 HYDROGUI_ImportSinusXOp::HYDROGUI_ImportSinusXOp( HYDROGUI_Module* theModule )
@@ -77,8 +78,7 @@ void HYDROGUI_ImportSinusXOp::onApply()
 
   QStringList aFileNames = myFileDlg->selectedFiles();
   bool IsImported = false;
-  
-  QApplication::setOverrideCursor( Qt::WaitCursor );  
+
   startDocOperation();
 
   foreach (QString aFileName, aFileNames) 
@@ -92,10 +92,33 @@ void HYDROGUI_ImportSinusXOp::onApply()
     {
       HYDROData_SinusX aSinusXImporter;
       NCollection_Sequence<Handle(HYDROData_Entity)> anEntities;
-      if (aSinusXImporter.Import(aFileName, doc(), anEntities)) 
+      QApplication::setOverrideCursor( Qt::WaitCursor );  
+      bool ParseStat = aSinusXImporter.OpenAndParse(aFileName);
+      QApplication::restoreOverrideCursor();
+      if (ParseStat)
       {
-        UpdateView(anEntities);
-        IsImported = true;
+        std::vector<HYDROGUI_CurveBlock> aCurveBlocks = aSinusXImporter.GetCurveBlocks();
+        QStringList names;
+        std::vector<int> types;
+        for (int i=0;i<aCurveBlocks.size();i++)
+        {
+          HYDROGUI_CurveBlock CurveBlock = aCurveBlocks[i];
+          types.push_back(CurveBlock.myType);
+          names << CurveBlock.myName;
+        }
+        HYDROGUI_ImportSinusXDlg* aDLG = new HYDROGUI_ImportSinusXDlg( module()->getApp()->desktop(), names, types );
+        aDLG->setModal( true );
+        aDLG->setWindowTitle(tr("ENTITIES_TO_IMPORT_FROM_SX"));
+        //QApplication::restoreOverrideCursor();
+        if( aDLG->exec()==QDialog::Accepted ) //??
+        {
+          QApplication::setOverrideCursor( Qt::WaitCursor );
+          std::vector<HYDROData_SinusX::ImportOptions> options = aDLG->GetImportOptions();
+          aSinusXImporter.Import(doc(), anEntities, &options);
+          UpdateView(anEntities);
+          QApplication::restoreOverrideCursor();
+          IsImported = true;
+        }
       }
     }
   }
index 73582eb4a48fdbfd2e32a52b3ea1618e34290bb8..4b0824d90a79a99a587c28bac779d87c6e878f33 100755 (executable)
@@ -2803,6 +2803,11 @@ file cannot be correctly imported for an Obstacle definition.</translation>
       <source>NO_ONE_ENTITY_IMPORTED</source>\r
       <translation>Entities cant be read</translation>\r
     </message>\r
+    <message>\r
+      <source>ENTITIES_TO_IMPORT_FROM_SX</source>\r
+      <translation>SinusX file entities</translation>\r
+    </message>\r
+\r
   </context>\r
 \r
   <context>\r
@@ -3800,6 +3805,62 @@ Polyline should consist from one not closed curve.</translation>
       <translation>Measurement Tool</translation>\r
     </message>\r
   </context>\r
+\r
+  <context>\r
+    <name>HYDROGUI_ImportSinusXDlg</name>\r
+     <message>\r
+      <source>ENTITIES_TO_IMPORT</source>\r
+      <translation>The file contains the entities listed below. Check the entities which you wish to import and their importing type</translation>\r
+    </message>\r
+     <message>\r
+      <source>NAME</source>\r
+      <translation>Entity name</translation>\r
+    </message>\r
+     <message>\r
+      <source>TYPE</source>\r
+      <translation>Type</translation>\r
+    </message>\r
+     <message>\r
+      <source>AS_BATHY</source>\r
+      <translation>As bathymetry</translation>\r
+    </message>\r
+    <message>\r
+      <source>AS_BATHY</source>\r
+      <translation>As bathymetry</translation>\r
+    </message>\r
+     <message>\r
+      <source>AS_POLYXY</source>\r
+      <translation>As PolylineXY</translation>\r
+    </message>\r
+     <message>\r
+      <source>AS_BATHY</source>\r
+      <translation>As bathymetry</translation>\r
+    </message>\r
+     <message>\r
+      <source>AS_PROFILE</source>\r
+      <translation>As profile</translation>\r
+    </message>\r
+     <message>\r
+      <source>XYZ_CURVE</source>\r
+      <translation>XYZ curve</translation>\r
+    </message>\r
+     <message>\r
+      <source>XYZ_PROFILE</source>\r
+      <translation>XYZ profile</translation>\r
+    </message>\r
+     <message>\r
+      <source>ISOCONTOUR</source>\r
+      <translation>Isocontour</translation>\r
+    </message>\r
+     <message>\r
+      <source>SCATTER</source>\r
+      <translation>Scatter plot</translation>\r
+    </message>\r
+     <message>\r
+      <source>OK</source>\r
+      <translation>Ok</translation>\r
+    </message>\r
+  </context>\r
   \r
   <context>\r
     <name>HYDROGUI_SIProgressIndicator</name>\r
@@ -3853,4 +3914,39 @@ Polyline should consist from one not closed curve.</translation>
      </message>\r
   </context>\r
 \r
+\r
+ <context>\r
+    <name>HYDROGUI_ImportPolylineDlg</name>\r
+     <message>\r
+      <source>POLYLINES_3D_IN_FILES</source>\r
+      <translation>The shp file contains polyline3D objects (ARCZ). \r
+They have been imported as polylineXY only, \r
+but can be imported with Z part (additional profile and bathymetry). \r
+If checkbox of corresponding polyline in the table below is checked \r
+then it will be imported with Z part, otherwise as PolylineXY only</translation>\r
+    </message>\r
+     <message>\r
+      <source>POLYLINE_NAME</source>\r
+      <translation>Polyline name</translation>\r
+    </message>\r
+     <message>\r
+      <source>FULL_IMPORT</source>\r
+      <translation>Full import</translation>\r
+    </message>\r
+     <message>\r
+      <source>CHECK_ALL</source>\r
+      <translation>Check all</translation>\r
+    </message>\r
+    <message>\r
+      <source>UNCHECK_ALL</source>\r
+      <translation>Uncheck all</translation>\r
+    </message>\r
+    <message>\r
+      <source>OK</source>\r
+      <translation>Ok</translation>\r
+    </message>\r
+\r
+  </context>\r
+\r
+\r
 </TS>\r