Salome HOME
projects
/
modules
/
hydro.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lots 3,8 - corrections
[modules/hydro.git]
/
src
/
HYDROGUI
/
HYDROGUI_ImportLandCoverMapOp.cxx
diff --git
a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx
b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx
index 403a22634b0a72b8ccb03b995849078091a385cf..c4a5a0d5f851756953061a3ce8aad9cf2e8f28d3 100644
(file)
--- a/
src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx
+++ b/
src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx
@@
-132,7
+132,7
@@
void HYDROGUI_ImportLandCoverMapOp::onFileSelected()
//Import polygons from SHP file as faces
//This faces should be added to the new LCM object
//Import polygons from SHP file as faces
//This faces should be added to the new LCM object
- int aStat = myImporter.ImportPolygons(myFileName, aPolygonsList, myPolygonFaces, aShapeTypeOfFile);
+ int aStat = myImporter.ImportPolygons(
doc(),
myFileName, aPolygonsList, myPolygonFaces, aShapeTypeOfFile);
if (aStat == 1)
{
aPanel->setPolygonNames(aPolygonsList);
if (aStat == 1)
{
aPanel->setPolygonNames(aPolygonsList);
@@
-188,6
+188,7
@@
void HYDROGUI_ImportLandCoverMapOp::onFileSelected()
aPanel->setAttributeNames(myFieldList);
}
aPanel->setDbfState(DBF_Stat);
aPanel->setAttributeNames(myFieldList);
}
aPanel->setDbfState(DBF_Stat);
+ aPanel->setDbfRecordsNb(myImporter.DBF_GetNbRecords());
}
else
{
}
else
{
@@
-262,7
+263,7
@@
bool HYDROGUI_ImportLandCoverMapOp::processApply( int& theUpdateFlags,
if ( !aPanel->getFileName().isEmpty() )
anObjName = aPanel->getObjectName();
if ( !aPanel->getFileName().isEmpty() )
anObjName = aPanel->getObjectName();
- Handle
_HYDROData_Document
aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
+ Handle
(HYDROData_Document)
aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
//check if name of LCM is already exists
QSet<QString> aNameList;
//check if name of LCM is already exists
QSet<QString> aNameList;
@@
-310,7
+311,7
@@
void HYDROGUI_ImportLandCoverMapOp::onSelectionChanged( const QStringList& theSe
foreach ( QString aName, myPolygonName2PrsShape.keys() )
{
Handle(AIS_InteractiveObject) anObject =
foreach ( QString aName, myPolygonName2PrsShape.keys() )
{
Handle(AIS_InteractiveObject) anObject =
- myPolygonName2PrsShape.value(aName)->getAISObject
()
;
+ myPolygonName2PrsShape.value(aName)->getAISObject
s()[0]
;
bool isSelected = theSelectedNames.contains( aName );
if ( ( isSelected && !aCtx->IsSelected( anObject) ) || ( !isSelected && aCtx->IsSelected( anObject) ) )
bool isSelected = theSelectedNames.contains( aName );
if ( ( isSelected && !aCtx->IsSelected( anObject) ) || ( !isSelected && aCtx->IsSelected( anObject) ) )
@@
-337,24
+338,22
@@
void HYDROGUI_ImportLandCoverMapOp::onViewerSelectionChanged()
return;
int aCurIndex = -1;
return;
int aCurIndex = -1;
- aCurIndex = aPanel->
G
etCurrentWizardIndex();
+ aCurIndex = aPanel->
g
etCurrentWizardIndex();
if (aCurIndex != 0)
return;
OCCViewer_ViewManager* aViewManager = getPreviewManager();
Handle(AIS_InteractiveContext) aCtx = NULL;
if (aCurIndex != 0)
return;
OCCViewer_ViewManager* aViewManager = getPreviewManager();
Handle(AIS_InteractiveContext) aCtx = NULL;
- if ( aViewManager )
{
- if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
{
+ if ( aViewManager )
+ if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
aCtx = aViewer->getAISContext();
aCtx = aViewer->getAISContext();
- }
- }
if ( !aCtx.IsNull() )
{
QStringList aSelectedNames;
foreach ( QString aName, myPolygonName2PrsShape.keys() ) {
if ( !aCtx.IsNull() )
{
QStringList aSelectedNames;
foreach ( QString aName, myPolygonName2PrsShape.keys() ) {
- bool isSelected = aCtx->IsSelected( myPolygonName2PrsShape.value(aName)->getAISObject
()
);
+ bool isSelected = aCtx->IsSelected( myPolygonName2PrsShape.value(aName)->getAISObject
s()[0]
);
if ( isSelected )
aSelectedNames << aName;
}
if ( isSelected )
aSelectedNames << aName;
}
@@
-410,7
+409,7
@@
void HYDROGUI_ImportLandCoverMapOp::onNext( const int theIndex )
//Collect all strickler_types
QSet<QString> aSTSet;
//Collect all strickler_types
QSet<QString> aSTSet;
- Handle
_HYDROData_Document
aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
+ Handle
(HYDROData_Document)
aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
Handle(HYDROData_StricklerTable) DefStricklerTableObj;
if ( aDoc )
{
Handle(HYDROData_StricklerTable) DefStricklerTableObj;
if ( aDoc )
{
@@
-444,7
+443,7
@@
void HYDROGUI_ImportLandCoverMapOp::onNext( const int theIndex )
aSTColors.prepend(QColor(Qt::gray));
QVector<int> aCurCBIndices(aSetOfAttrValuesList.size());
aSTColors.prepend(QColor(Qt::gray));
QVector<int> aCurCBIndices(aSetOfAttrValuesList.size());
- if (DefStricklerTableObj->GetAttrName()
== aPanel->getSelectedFieldName
())
+ if (DefStricklerTableObj->GetAttrName()
.trimmed() == aPanel->getSelectedFieldName().trimmed
())
for (int i = 0; i < aSetOfAttrValuesList.size(); i++)
{
QString aST = DefStricklerTableObj->GetType(aSetOfAttrValuesList[i]);
for (int i = 0; i < aSetOfAttrValuesList.size(); i++)
{
QString aST = DefStricklerTableObj->GetType(aSetOfAttrValuesList[i]);
@@
-464,6
+463,13
@@
void HYDROGUI_ImportLandCoverMapOp::onNext( const int theIndex )
void HYDROGUI_ImportLandCoverMapOp::onApply()
{
void HYDROGUI_ImportLandCoverMapOp::onApply()
{
+ HYDROGUI_ImportLandCoverMapDlg* aPanel = ::qobject_cast<HYDROGUI_ImportLandCoverMapDlg*>( inputPanel() );
+ if ( !aPanel )
+ return;
+
+ if (!aPanel->CheckFirstPageFilling())
+ return;
+
QApplication::setOverrideCursor( Qt::WaitCursor );
int anUpdateFlags = 0;
QString anErrorMsg;
QApplication::setOverrideCursor( Qt::WaitCursor );
int anUpdateFlags = 0;
QString anErrorMsg;
@@
-490,8
+496,7
@@
void HYDROGUI_ImportLandCoverMapOp::onApply()
}
else
{
}
else
{
- Handle(HYDROData_Entity) LCM = Handle(HYDROData_Entity)::DownCast( myLCM );
- LCM->Remove();
+ myLCM->Remove();
module()->setObjectRemoved( myLCM );
abort();
}
module()->setObjectRemoved( myLCM );
abort();
}