#include <TopoDS_Edge.hxx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
-#include <Handle_Geom_Curve.hxx>
-#include <Handle_Geom_Line.hxx>
-#include <Handle_Geom_TrimmedCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <HYDROData_ShapeFile.h>
#include <SUIT_Desktop.h>
Handle(HYDROData_PolylineXY) aPolyXY;
Handle(HYDROData_Polyline3D) aPoly3D;
- NCollection_Sequence<Handle_HYDROData_PolylineXY> aPolyXYSeq;
- NCollection_Sequence<Handle_HYDROData_Polyline3D> aPoly3DSeq;
+ NCollection_Sequence<Handle(HYDROData_PolylineXY)> aPolyXYSeq;
+ NCollection_Sequence<Handle(HYDROData_Polyline3D)> aPoly3DSeq;
//
HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() );
for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
{
QStringList aNonExpList;
HYDROData_ShapeFile anExporter;
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
if (!aPolyXYSeq.IsEmpty() || !aPolyXYSeq.IsEmpty())
//Export polylines
- anExporter.Export(aFileName, aPolyXYSeq, aPoly3DSeq, aNonExpList);
+ anExporter.Export(aDoc, aFileName, aPolyXYSeq, aPoly3DSeq, aNonExpList);
else
{
//Export polygons
//Extract all attribute names from all strickler tables
- Handle_HYDROData_Document aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
QSet<QString> anAttrNames;
//use QSet to store attribute names. Yet it's not so good if the document contains two strickler types
//with the same name
QStringList SortedListOfAttr = anAttrNames.toList();
SortedListOfAttr.sort();
//
- Handle_HYDROData_LandCoverMap aLCM = Handle(HYDROData_LandCoverMap)::DownCast( aSeq(1) );
+ Handle(HYDROData_LandCoverMap) aLCM = Handle(HYDROData_LandCoverMap)::DownCast( aSeq(1) );
bool IsLinear = aLCM->CheckLinear();
HYDROGUI_ExportLandCoverMapDlg aDlg( module()->getApp()->desktop(), IsLinear, SortedListOfAttr);
if ( aDlg.exec() == HYDROGUI_ExportLandCoverMapDlg::Accepted )
}
//export shape-data
- anExporter.Export(aFileName, aLCM, aNonExpList, false, !IsLinear, aDlg.getDeflValue());
+ anExporter.Export(aDoc, aFileName, aLCM, aNonExpList, false, !IsLinear, aDlg.getDeflValue());
QString aDBFFileName = aFileName.replace( ".shp", ".dbf", Qt::CaseInsensitive);
//Even if attribute-checkbox is unchecked, the .dbf-file should be removed.
//otherwise it may be used with wrong .shp-file. This is an incorrect behaivor.
remove (aDBFFileName.toStdString().c_str());
- bool bToSaveAttrInfo = aDlg.getAttrCheckBoxState();
+ bool bToSaveAttrInfo = aDlg.getAttrCheckBoxState() && !aDlg.getCurrentItem().isEmpty();
if (bToSaveAttrInfo)
{
//export attribute info