HYDROGUI_StricklerTableOp.h
HYDROGUI_StricklerTypeComboBox.h
HYDROGUI_SubmersibleOp.h
+ HYDROGUI_UnSubmersibleOp.h
HYDROGUI_Tool.h
HYDROGUI_Tool2.h
HYDROGUI_TwoImagesDlg.h
HYDROGUI_SplitPolylinesDlg.cxx
HYDROGUI_SplitPolylinesOp.cxx
HYDROGUI_SubmersibleOp.cxx
+ HYDROGUI_UnSubmersibleOp.cxx
HYDROGUI_Tool.cxx
HYDROGUI_Tool2.cxx
HYDROGUI_TwoImagesDlg.cxx
#include "HYDROGUI_DataObject.h"
#include <HYDROData_DummyObject3D.h>
+#include <HYDROData_ImmersibleZone.h>
#include <HYDROData_Object.h>
#include <TDF_Tool.hxx>
QString aNeedUpdate( aDataObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) ? "M_" : "" );
int anObjectKind = (int)aDataObject->GetKind();
+ bool IsUnsImmZone = false;
if ( anObjectKind == KIND_DUMMY_3D )
{
Handle(HYDROData_DummyObject3D) anObject3D =
if ( !aFatherObj.IsNull() )
anObjectKind = aFatherObj->GetKind();
}
-
- anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() );
+ else if ( anObjectKind == 5 )
+ {
+ Handle(HYDROData_ImmersibleZone) anImmZone = Handle(HYDROData_ImmersibleZone)::DownCast( aDataObject );
+ IsUnsImmZone = !anImmZone->IsSubmersible();
+ }
+ if (!IsUnsImmZone)
+ anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() );
+ else
+ anIcon = QObject::tr( QString("HYDRO_%1TYPE5U_ICO").arg( aNeedUpdate ).toLatin1() ); //icon fot unsumb imm zone
}
return aResMgr->loadPixmap( "HYDRO", anIcon );
if( !anObject.IsNull() )
{
theMenu->addSeparator();
- theMenu->addAction( action( SubmersibleId ) );
- action( SubmersibleId )->setCheckable( true );
- action( SubmersibleId )->setChecked( anObject->IsSubmersible() );
+ bool IsSubmersible = anObject->IsSubmersible();
+ if (!IsSubmersible)
+ {
+ theMenu->addAction( action( SubmersibleId ) );
+ action( SubmersibleId )->setCheckable(true);
+ action( SubmersibleId )->setChecked(true);
+ }
+ else
+ {
+ theMenu->addAction( action( UnSubmersibleId ) );
+ action( UnSubmersibleId )->setCheckable(true);
+ action( UnSubmersibleId )->setChecked(true);
+ }
}
}
}
#include "HYDROGUI_ProfileInterpolateOp.h"
#include "HYDROGUI_RecognizeContoursOp.h"
#include "HYDROGUI_SubmersibleOp.h"
+#include "HYDROGUI_UnSubmersibleOp.h"
#include "HYDROGUI_StricklerTableOp.h"
#include "HYDROGUI_DuplicateOp.h"
#include "HYDROGUI_LandCoverMapOp.h"
createAction( ProfileInterpolateId, "PROFILE_INTERPOLATE", "PROFILE_INTERPOLATE_ICO" );
createAction( SubmersibleId, "SUBMERSIBLE", "SUBMERSIBLE_ICO" );
+ createAction( UnSubmersibleId, "UNSUBMERSIBLE", "UNSUBMERSIBLE_ICO" );
createAction( ExportToShapeFileID, "EXPORT_TO_SHAPE_FILE", "EXPORT_TO_SHAPE_FILE_ICO" );
createAction( PolylineExtractionId, "POLYLINE_EXTRACTION" );
case SubmersibleId:
anOp = new HYDROGUI_SubmersibleOp( aModule );
break;
+ case UnSubmersibleId:
+ anOp = new HYDROGUI_UnSubmersibleOp( aModule );
+ break;
case PolylineExtractionId:
anOp = new HYDROGUI_PolylineExtractionOp( aModule );
break;
RecognizeContoursId,
SubmersibleId,
+ UnSubmersibleId,
ImportPolylineId,
ImportSinusXId,
ExportSinusXId,
theUpdateFlags = 0;
if( isOK )
{
- myObject->SetIsSubmersible( !myObject->IsSubmersible() );
+ bool IsSubmersible = myObject->IsSubmersible();
+ if (!IsSubmersible)
+ myObject->SetIsSubmersible( true );
theUpdateFlags = 0;
}
return isOK;
--- /dev/null
+// 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_UnSubmersibleOp.h>
+#include <HYDROGUI_Tool2.h>
+#include <HYDROGUI_Module.h>
+
+HYDROGUI_UnSubmersibleOp::HYDROGUI_UnSubmersibleOp( HYDROGUI_Module* theModule )
+ : HYDROGUI_Operation( theModule )
+{
+}
+
+HYDROGUI_UnSubmersibleOp::~HYDROGUI_UnSubmersibleOp()
+{
+}
+
+void HYDROGUI_UnSubmersibleOp::startOperation()
+{
+ HYDROGUI_Operation::startOperation();
+ myObject = Handle(HYDROData_Object)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+ if( myObject.IsNull() )
+ onCancel();
+ else
+ onApply();
+}
+
+bool HYDROGUI_UnSubmersibleOp::processApply( int& theUpdateFlags, QString& theErrorMsg, QStringList& theBrowseObjectsEntries )
+{
+ theUpdateFlags = 0;
+ if( !myObject.IsNull() )
+ {
+ bool IsSubmersible = myObject->IsSubmersible();
+ if (IsSubmersible)
+ myObject->SetIsSubmersible( false );
+ return true;
+ }
+ return false;
+}
+
--- /dev/null
+// 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_UNSubmersibleOP_H
+#define HYDROGUI_UNSubmersibleOP_H
+
+#include <HYDROGUI_Operation.h>
+#include <HYDROData_Object.h>
+
+class HYDROGUI_UnSubmersibleOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_UnSubmersibleOp( HYDROGUI_Module* theModule );
+ virtual ~HYDROGUI_UnSubmersibleOp();
+
+protected:
+ virtual void startOperation();
+ virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+ QStringList& theBrowseObjectsEntries );
+
+private:
+ Handle(HYDROData_Object) myObject;
+};
+
+#endif
<source>SUBMERSIBLE_ICO</source>
<translation>icon_submersible.png</translation>
</message>
+ <message>
+ <source>UNSUBMERSIBLE_ICO</source>
+ <translation>icon_imm_uns_zone.png</translation>
+ </message>
<!-- Icons for objects -->
<source>HYDRO_TYPE5_ICO</source>
<translation>icon_imm_zone.png</translation>
</message>
+ <message>
+ <source>HYDRO_TYPE5U_ICO</source>
+ <translation>icon_imm_uns_zone.png</translation>
+ </message>
<message>
<source>HYDRO_TYPE6_ICO</source>
<translation>icon_river.png</translation>
<source>HYDRO_M_TYPE5_ICO</source>
<translation>icon_mimm_zone.png</translation>
</message>
+ <message>
+ <source>HYDRO_M_TYPE5U_ICO</source>
+ <translation>icon_mimm_uns_zone.png</translation>
+ </message>
<message>
<source>HYDRO_M_TYPE6_ICO</source>
<translation>icon_mriver.png</translation>
<source>DSK_SUBMERSIBLE</source>
<translation>Submersible</translation>
</message>
+ <message>
+ <source>DSK_UNSUBMERSIBLE</source>
+ <translation>Unsubmersible</translation>
+ </message>
<message>
<source>DSK_EXPORT_TO_SHAPE_FILE</source>
<translation>Export</translation>
<source>MEN_SUBMERSIBLE</source>
<translation>Submersible</translation>
</message>
+ <message>
+ <source>MEN_UNSUBMERSIBLE</source>
+ <translation>Unsubmersible</translation>
+ </message>
<message>
<source>MEN_EXPORT_TO_SHAPE_FILE</source>
<translation>Export</translation>
<source>STB_SUBMERSIBLE</source>
<translation>If the object is submersible</translation>
</message>
+ <message>
+ <source>STB_UNSUBMERSIBLE</source>
+ <translation>If the object is non submersible</translation>
+ </message>
<message>
<source>STB_EXPORT_TO_SHAPE_FILE</source>
<translation>Export</translation>