#define PYTHON_DIGUE_ID "KIND_DIGUE"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Digue,HYDROData_ArtificialObject)
-IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Digue,HYDROData_ArtificialObject)
+IMPLEMENT_STANDARD_HANDLE(HYDROData_Digue,HYDROData_Channel)
+IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Digue,HYDROData_Channel)
HYDROData_Digue::HYDROData_Digue()
-: HYDROData_ArtificialObject()
+: HYDROData_Channel()
{
}
return aResList;
}
-TopoDS_Shape HYDROData_Digue::GetTopShape() const
-{
- // TODO
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Digue::GetShape3D() const
-{
- // TODO
- return getShape3D();
-}
-
#ifndef HYDROData_Digue_HeaderFile
#define HYDROData_Digue_HeaderFile
-#include "HYDROData_ArtificialObject.h"
+#include "HYDROData_Channel.h"
-DEFINE_STANDARD_HANDLE(HYDROData_Digue, HYDROData_ArtificialObject)
+DEFINE_STANDARD_HANDLE(HYDROData_Digue, HYDROData_Channel)
/**\class HYDROData_Digue
* \brief
*
*/
-class HYDROData_Digue : public HYDROData_ArtificialObject
+class HYDROData_Digue : public HYDROData_Channel
{
protected:
/**
*/
enum DataTag
{
- DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve
+ DataTag_First = HYDROData_Channel::DataTag_First + 100, ///< first tag, to reserve
};
public:
*/
HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
- /**
- * Returns the top shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
-
- /**
- * Returns the 3d shape of the object.
- */
- HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
-
protected:
friend class HYDROData_Iterator;
HYDROGUI_DataModel.h
HYDROGUI_DataObject.h
HYDROGUI_DeleteOp.h
+ HYDROGUI_DigueDlg.h
+ HYDROGUI_DigueOp.h
HYDROGUI_Displayer.h
HYDROGUI_ExportImageOp.h
HYDROGUI_GVSelector.h
HYDROGUI_DataModel.cxx
HYDROGUI_DataObject.cxx
HYDROGUI_DeleteOp.cxx
+ HYDROGUI_DigueDlg.cxx
+ HYDROGUI_DigueOp.cxx
HYDROGUI_Displayer.cxx
HYDROGUI_ExportImageOp.cxx
HYDROGUI_GVSelector.cxx
private slots:
void onChannelDefChanged();
-private:
+protected:
QGroupBox* myObjectNameGroup;
QLineEdit* myObjectName;
aPanel->reset();
- if( myIsEdit )
- myEditedObject = Handle(HYDROData_Channel)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
- else
- myEditedObject = Handle(HYDROData_Channel)::DownCast( doc()->CreateObject( KIND_CHANNEL ) );
+ myEditedObject = getObjectToEdit();
QString aSelectedGuideLine, aSelectedProfile;
onCreatePreview( true );
}
+
void HYDROGUI_ChannelOp::abortOperation()
{
erasePreview();
return true;
}
+Handle(HYDROData_Channel) HYDROGUI_ChannelOp::getObjectToEdit() const
+{
+ return myIsEdit ? Handle(HYDROData_Channel)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) ) :
+ Handle(HYDROData_Channel)::DownCast( doc()->CreateObject( KIND_CHANNEL ) );
+}
+
void HYDROGUI_ChannelOp::onCreatePreview( const bool theIsInit )
{
HYDROGUI_ChannelDlg* aPanel = ::qobject_cast<HYDROGUI_ChannelDlg*>( inputPanel() );
virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg );
protected slots:
- void onCreatePreview( const bool theIsInit = false );
+ virtual void onCreatePreview( const bool theIsInit = false );
-private:
- void erasePreview();
+protected:
+ virtual void erasePreview();
+ virtual Handle(HYDROData_Channel) getObjectToEdit() const;
-private:
+protected:
bool myIsEdit;
Handle(HYDROData_Channel) myEditedObject;
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
+//
+// 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_DigueDlg.h"
+
+#include <QGroupBox>
+
+HYDROGUI_DigueDlg::HYDROGUI_DigueDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_ChannelDlg( theModule, theTitle )
+{
+ if ( myObjectNameGroup )
+ myObjectNameGroup->setTitle( tr( "DIGUE_NAME" ) );
+}
+
+HYDROGUI_DigueDlg::~HYDROGUI_DigueDlg()
+{
+}
+
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
+//
+// 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_DigueDlg_H
+#define HYDROGUI_DigueDlg_H
+
+#include "HYDROGUI_ChannelDlg.h"
+
+class HYDROGUI_DigueDlg : public HYDROGUI_ChannelDlg
+{
+ Q_OBJECT
+
+public:
+
+ HYDROGUI_DigueDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+ virtual ~HYDROGUI_DigueDlg();
+
+private:
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
+//
+// 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_DigueOp.h"
+
+#include "HYDROGUI_DigueDlg.h"
+#include "HYDROGUI_Tool.h"
+
+#include <HYDROData_Document.h>
+#include <HYDROData_Digue.h>
+
+HYDROGUI_DigueOp::HYDROGUI_DigueOp( HYDROGUI_Module* theModule,
+ const bool theIsEdit )
+: HYDROGUI_ChannelOp( theModule, theIsEdit )
+{
+ setName( theIsEdit ? tr( "EDIT_DIGUE" ) : tr( "CREATE_DIGUE" ) );
+}
+
+HYDROGUI_DigueOp::~HYDROGUI_DigueOp()
+{
+}
+
+void HYDROGUI_DigueOp::startOperation()
+{
+ HYDROGUI_ChannelOp::startOperation();
+
+ HYDROGUI_DigueDlg* aPanel = ::qobject_cast<HYDROGUI_DigueDlg*>( inputPanel() );
+
+ if ( !myIsEdit || myEditedObject.IsNull() )
+ {
+ QString anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_DIGUE_NAME" ) );
+ aPanel->setObjectName( anObjectName );
+ }
+}
+
+HYDROGUI_InputPanel* HYDROGUI_DigueOp::createInputPanel() const
+{
+ HYDROGUI_DigueDlg* aPanel = new HYDROGUI_DigueDlg( module(), getName() );
+ connect( aPanel, SIGNAL( CreatePreview() ), this, SLOT( onCreatePreview() ) );
+ return aPanel;
+}
+
+Handle(HYDROData_Channel) HYDROGUI_DigueOp::getObjectToEdit() const
+{
+ return myIsEdit ? Handle(HYDROData_Digue)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) ) :
+ Handle(HYDROData_Digue)::DownCast( doc()->CreateObject( KIND_DIGUE ) );
+}
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
+//
+// 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_DigueOp_H
+#define HYDROGUI_DigueOp_H
+
+#include "HYDROGUI_ChannelOp.h"
+
+class HYDROGUI_DigueOp : public HYDROGUI_ChannelOp
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_DigueOp( HYDROGUI_Module* theModule, const bool theIsEdit );
+ virtual ~HYDROGUI_DigueOp();
+
+protected:
+
+ virtual void startOperation();
+
+ virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+ virtual Handle(HYDROData_Channel) getObjectToEdit() const;
+
+private:
+
+};
+
+#endif
bool anIsObstacle = false;
bool anIsStream = false;
bool anIsChannel = false;
+ bool anIsDigue = false;
bool anIsGeomObject = false;
// check the selected GEOM objects
anIsStream = true;
else if( anObjectKind == KIND_CHANNEL )
anIsChannel = true;
+ else if( anObjectKind == KIND_DIGUE )
+ anIsDigue = true;
}
anIsGeomObject = HYDROData_Tool::IsGeometryObject( anObject );
break;
case KIND_ARTIFICIAL_OBJECT:
theMenu->addAction( action( CreateChannelId ) );
+ theMenu->addAction( action( CreateDigueId ) );
break;
case KIND_NATURAL_OBJECT:
theMenu->addAction( action( CreateImmersibleZoneId ) );
theMenu->addAction( action( EditChannelId ) );
theMenu->addSeparator();
}
+ else if( anIsDigue )
+ {
+ theMenu->addAction( action( EditDigueId ) );
+ theMenu->addSeparator();
+ }
else if( anIsVisualState && anIsObjectBrowser )
{
theMenu->addAction( action( SaveVisualStateId ) );
if( anIsImage || anIsPolyline || anIsPolyline3D ||
anIsImmersibleZone || anIsZone || anIsRegion ||
anIsBathymetry || anIsObstacle || anIsStream ||
- anIsChannel || anIsValidProfile )
+ anIsChannel || anIsDigue || anIsValidProfile )
{
if( anIsHiddenInSelection )
theMenu->addAction( action( ShowId ) );
#include "HYDROGUI_ChannelOp.h"
#include "HYDROGUI_DataModel.h"
#include "HYDROGUI_DeleteOp.h"
+#include "HYDROGUI_DigueOp.h"
#include "HYDROGUI_ExportImageOp.h"
#include "HYDROGUI_ImportImageOp.h"
#include "HYDROGUI_ImportBathymetryOp.h"
createAction( CreateChannelId, "CREATE_CHANNEL", "CREATE_CHANNEL_ICO" );
createAction( EditChannelId, "EDIT_CHANNEL", "EDIT_CHANNEL_ICO" );
+ createAction( CreateDigueId, "CREATE_DIGUE" );
+ createAction( EditDigueId, "EDIT_DIGUE" );
+
createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" );
createAction( ImportGeomObjectId, "IMPORT_GEOM_OBJECT", "IMPORT_GEOM_OBJECT_ICO" );
createAction( CreateBoxId, "CREATE_BOX", "CREATE_BOX_ICO" );
int anArtificialMenuId = createMenu( tr( "MEN_DESK_ARTIFICIAL" ), aHydroId, -1 );
createMenu( CreateChannelId, anArtificialMenuId, -1, -1 );
+ createMenu( CreateDigueId, anArtificialMenuId, -1, -1 );
int aNaturalMenuId = createMenu( tr( "MEN_DESK_NATURAL" ), aHydroId, -1 );
createMenu( CreateImmersibleZoneId, aNaturalMenuId, -1, -1 );
case EditChannelId:
anOp = new HYDROGUI_ChannelOp( aModule, theId == EditChannelId );
break;
+ case CreateDigueId:
+ case EditDigueId:
+ anOp = new HYDROGUI_DigueOp( aModule, theId == EditDigueId );
+ break;
case CreateCalculationId:
case EditCalculationId:
anOp = new HYDROGUI_CalculationOp( aModule, theId == EditCalculationId );
CreateChannelId,
EditChannelId,
+ CreateDigueId,
+ EditDigueId,
+
CreateCalculationId,
EditCalculationId,
ExportCalculationId,
<source>DSK_EDIT_CHANNEL</source>
<translation>Edit channel</translation>
</message>
+ <message>
+ <source>DSK_CREATE_DIGUE</source>
+ <translation>Create digue</translation>
+ </message>
+ <message>
+ <source>DSK_EDIT_DIGUE</source>
+ <translation>Edit digue</translation>
+ </message>
<message>
<source>DSK_COPY</source>
<translation>Copy</translation>
<source>MEN_EDIT_CHANNEL</source>
<translation>Edit channel</translation>
</message>
+ <message>
+ <source>MEN_CREATE_DIGUE</source>
+ <translation>Create digue</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_DIGUE</source>
+ <translation>Edit digue</translation>
+ </message>
<message>
<source>MEN_CUT_IMAGES</source>
<translation>Cut images</translation>
<source>STB_EDIT_CHANNEL</source>
<translation>Edit channel</translation>
</message>
+ <message>
+ <source>STB_CREATE_DIGUE</source>
+ <translation>Create digue</translation>
+ </message>
+ <message>
+ <source>STB_EDIT_DIGUE</source>
+ <translation>Edit digue</translation>
+ </message>
<message>
<source>STB_COPY</source>
<translation>Copy</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_DigueDlg</name>
+ <message>
+ <source>DIGUE_NAME</source>
+ <translation>Digue name</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>HYDROGUI_DigueOp</name>
+ <message>
+ <source>CREATE_DIGUE</source>
+ <translation>Create digue</translation>
+ </message>
+ <message>
+ <source>EDIT_DIGUE</source>
+ <translation>Edit digue</translation>
+ </message>
+ <message>
+ <source>DEFAULT_DIGUE_NAME</source>
+ <translation>Digue</translation>
+ </message>
+ </context>
+
</TS>