HYDROGUI_AbstractDisplayer.h
HYDROGUI_CalculationDlg.h
HYDROGUI_CalculationOp.h
+ HYDROGUI_ChannelDlg.h
+ HYDROGUI_ChannelOp.h
HYDROGUI_ColorWidget.h
HYDROGUI_CopyPasteOp.h
HYDROGUI_DataBrowser.h
HYDROGUI_AbstractDisplayer.cxx
HYDROGUI_CalculationDlg.cxx
HYDROGUI_CalculationOp.cxx
+ HYDROGUI_ChannelDlg.cxx
+ HYDROGUI_ChannelOp.cxx
HYDROGUI_ColorWidget.cxx
HYDROGUI_CopyPasteOp.cxx
HYDROGUI_DataBrowser.cxx
--- /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_ChannelDlg.h"
+
+#include "HYDROGUI_Tool.h"
+
+#include <QComboBox>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLayout>
+#include <QLineEdit>
+
+HYDROGUI_ChannelDlg::HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+ // Channel name
+ myObjectNameGroup = new QGroupBox( tr( "CHANNEL_NAME" ), mainFrame() );
+
+ myObjectName = new QLineEdit( myObjectNameGroup );
+
+ QBoxLayout* aNameLayout = new QHBoxLayout( myObjectNameGroup );
+ aNameLayout->setMargin( 5 );
+ aNameLayout->setSpacing( 5 );
+ aNameLayout->addWidget( new QLabel( tr( "NAME" ), myObjectNameGroup ) );
+ aNameLayout->addWidget( myObjectName );
+
+ // Channel parameters
+ QGroupBox* aParamGroup = new QGroupBox( tr( "CHANNEL_PARAMETERS" ), mainFrame() );
+
+ //myGuideLines = new HYDROGUI_ObjComboSelector( theModule, KIND_POLYLINE, aParamGroup );
+ myGuideLines = new QComboBox( aParamGroup );
+ myGuideLines->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ //myProfiles = new HYDROGUI_ObjComboSelector( theModule, KIND_PROFILE, aParamGroup );
+ myProfiles = new QComboBox( aParamGroup );
+ myProfiles->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ QGridLayout* aParamsLayout = new QGridLayout( aParamGroup );
+ aParamsLayout->setMargin( 5 );
+ aParamsLayout->setSpacing( 5 );
+ aParamsLayout->addWidget( new QLabel( tr( "CHANNEL_GUIDE_LINE" ), aParamGroup ), 0, 0 );
+ aParamsLayout->addWidget( myGuideLines, 0, 1 );
+ aParamsLayout->addWidget( new QLabel( tr( "CHANNEL_PROFILE" ), aParamGroup ), 1, 0 );
+ aParamsLayout->addWidget( myProfiles, 1, 1 );
+
+ // Common
+ addWidget( myObjectNameGroup );
+ addWidget( aParamGroup );
+
+ addStretch();
+
+ // Connect signals and slots
+ connect( myGuideLines, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onChannelDefChanged() ) );
+ connect( myProfiles, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onChannelDefChanged() ) );
+}
+
+HYDROGUI_ChannelDlg::~HYDROGUI_ChannelDlg()
+{
+}
+
+void HYDROGUI_ChannelDlg::reset()
+{
+ bool isBlocked = blockSignals( true );
+
+ myObjectName->clear();
+
+ myGuideLines->clear();
+ myProfiles->clear();
+
+ blockSignals( isBlocked );
+
+ onChannelDefChanged();
+}
+
+void HYDROGUI_ChannelDlg::setObjectName( const QString& theName )
+{
+ myObjectName->setText( theName );
+}
+
+QString HYDROGUI_ChannelDlg::getObjectName() const
+{
+ return myObjectName->text();
+}
+
+void HYDROGUI_ChannelDlg::setGuideLineNames( const QStringList& theGuideLines )
+{
+ bool isBlocked = blockSignals( true );
+
+ myGuideLines->clear();
+ myGuideLines->addItems( theGuideLines );
+
+ blockSignals( isBlocked );
+}
+
+void HYDROGUI_ChannelDlg::setGuideLineName( const QString& theGuideLine )
+{
+ int aNewIdx = myGuideLines->findText( theGuideLine );
+ if ( aNewIdx != myGuideLines->currentIndex() )
+ {
+ myGuideLines->setCurrentIndex( aNewIdx );
+ }
+ else
+ {
+ onChannelDefChanged();
+ }
+}
+
+QString HYDROGUI_ChannelDlg::getGuideLineName() const
+{
+ return myGuideLines->currentText();
+}
+
+void HYDROGUI_ChannelDlg::setProfileNames( const QStringList& theProfiles )
+{
+ bool isBlocked = blockSignals( true );
+
+ myProfiles->clear();
+ myProfiles->addItems( theProfiles );
+
+ blockSignals( isBlocked );
+}
+
+void HYDROGUI_ChannelDlg::setProfileName( const QString& theProfile )
+{
+ int aNewIdx = myProfiles->findText( theProfile );
+ if ( aNewIdx != myProfiles->currentIndex() )
+ {
+ myProfiles->setCurrentIndex( aNewIdx );
+ }
+ else
+ {
+ onChannelDefChanged();
+ }
+}
+
+QString HYDROGUI_ChannelDlg::getProfileName() const
+{
+ return myProfiles->currentText();
+}
+
+void HYDROGUI_ChannelDlg::onChannelDefChanged()
+{
+ if ( signalsBlocked() )
+ return;
+
+ emit CreatePreview();
+}
--- /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_ChannelDlg_H
+#define HYDROGUI_ChannelDlg_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class QComboBox;
+class QGroupBox;
+class QLineEdit;
+
+class HYDROGUI_ChannelDlg : public HYDROGUI_InputPanel
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+ virtual ~HYDROGUI_ChannelDlg();
+
+ void reset();
+
+ void setObjectName( const QString& theName );
+ QString getObjectName() const;
+
+ void setGuideLineNames( const QStringList& theGuideLines );
+ void setGuideLineName( const QString& theGuideLine );
+ QString getGuideLineName() const;
+
+ void setProfileNames( const QStringList& theProfiles );
+ void setProfileName( const QString& theProfile );
+ QString getProfileName() const;
+
+signals:
+ void CreatePreview();
+
+private slots:
+ void onChannelDefChanged();
+
+private:
+
+ QGroupBox* myObjectNameGroup;
+ QLineEdit* myObjectName;
+
+ QComboBox* myGuideLines;
+ QComboBox* myProfiles;
+};
+
+#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_ChannelOp.h"
+
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_ChannelDlg.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_Shape.h"
+#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
+
+#include <HYDROData_Iterator.h>
+#include <HYDROData_Polyline3D.h>
+#include <HYDROData_Profile.h>
+
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewModel.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_UpdateFlags.h>
+
+
+HYDROGUI_ChannelOp::HYDROGUI_ChannelOp( HYDROGUI_Module* theModule,
+ const bool theIsEdit )
+: HYDROGUI_Operation( theModule ),
+ myIsEdit( theIsEdit ),
+ myViewManager( 0 ),
+ myPreviewPrs( 0 )
+{
+ setName( theIsEdit ? tr( "EDIT_CHANNEL" ) : tr( "CREATE_CHANNEL" ) );
+}
+
+HYDROGUI_ChannelOp::~HYDROGUI_ChannelOp()
+{
+ erasePreview();
+}
+
+void HYDROGUI_ChannelOp::startOperation()
+{
+ HYDROGUI_Operation::startOperation();
+
+ // We start operation in the document
+ startDocOperation();
+
+ HYDROGUI_ChannelDlg* aPanel = ::qobject_cast<HYDROGUI_ChannelDlg*>( inputPanel() );
+
+ aPanel->blockSignals( true );
+
+ aPanel->reset();
+
+ if( myIsEdit )
+ myEditedObject = Handle(HYDROData_Channel)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+ else
+ myEditedObject = Handle(HYDROData_Channel)::DownCast( doc()->CreateObject( KIND_CHANNEL ) );
+
+ QString aSelectedGuideLine, aSelectedProfile;
+
+ QString anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_CHANNEL_NAME" ) );
+ if ( myIsEdit && !myEditedObject.IsNull() )
+ {
+ anObjectName = myEditedObject->GetName();
+
+ Handle(HYDROData_Polyline3D) aRefGuideLine = myEditedObject->GetGuideLine();
+ if ( !aRefGuideLine.IsNull() )
+ aSelectedGuideLine = aRefGuideLine->GetName();
+
+ Handle(HYDROData_Profile) aRefProfile = myEditedObject->GetProfile();
+ if ( !aRefProfile.IsNull() )
+ aSelectedProfile = aRefProfile->GetName();
+ }
+
+ // collect information about existing 3d polylines
+ QStringList aGuideLines = HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_POLYLINE );
+
+ // collect information about existing profiles
+ QStringList aProfiles = HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_PROFILE );
+
+ aPanel->setObjectName( anObjectName );
+
+ aPanel->setGuideLineNames( aGuideLines );
+ aPanel->setProfileNames( aProfiles );
+
+ aPanel->setGuideLineName( aSelectedGuideLine );
+ aPanel->setProfileName( aSelectedProfile );
+
+ aPanel->blockSignals( false );
+
+ onCreatePreview( true );
+}
+
+void HYDROGUI_ChannelOp::abortOperation()
+{
+ erasePreview();
+
+ HYDROGUI_Operation::abortOperation();
+}
+
+void HYDROGUI_ChannelOp::commitOperation()
+{
+ erasePreview();
+
+ HYDROGUI_Operation::commitOperation();
+}
+
+HYDROGUI_InputPanel* HYDROGUI_ChannelOp::createInputPanel() const
+{
+ HYDROGUI_ChannelDlg* aPanel = new HYDROGUI_ChannelDlg( module(), getName() );
+ connect( aPanel, SIGNAL( CreatePreview() ), this, SLOT( onCreatePreview() ) );
+ return aPanel;
+}
+
+bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
+ QString& theErrorMsg )
+{
+ HYDROGUI_ChannelDlg* aPanel = ::qobject_cast<HYDROGUI_ChannelDlg*>( inputPanel() );
+ if ( !aPanel )
+ return false;
+
+ QString anObjectName = aPanel->getObjectName().simplified();
+ if ( anObjectName.isEmpty() )
+ {
+ theErrorMsg = tr( "INCORRECT_OBJECT_NAME" );
+ return false;
+ }
+
+ if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) )
+ {
+ // check that there are no other objects with the same name in the document
+ Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName );
+ if( !anObject.IsNull() )
+ {
+ theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anObjectName );
+ return false;
+ }
+ }
+
+ if ( myEditedObject.IsNull() )
+ return false;
+
+ myEditedObject->SetName( anObjectName );
+
+ if ( !myIsEdit ) {
+ myEditedObject->SetFillingColor( HYDROData_Channel::DefaultFillingColor() );
+ myEditedObject->SetBorderColor( HYDROData_Channel::DefaultBorderColor() );
+ }
+
+ erasePreview();
+
+ if( !myIsEdit )
+ module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), myEditedObject, true );
+
+ theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced;
+
+ return true;
+}
+
+void HYDROGUI_ChannelOp::onCreatePreview( const bool theIsInit )
+{
+ HYDROGUI_ChannelDlg* aPanel = ::qobject_cast<HYDROGUI_ChannelDlg*>( inputPanel() );
+ if ( !aPanel || myEditedObject.IsNull() )
+ return;
+
+ QString aGuideLineName = aPanel->getGuideLineName();
+ QString aProfileName = aPanel->getProfileName();
+ if ( aGuideLineName.isEmpty() || aProfileName.isEmpty() )
+ {
+ if ( !theIsInit )
+ {
+ myEditedObject->RemoveGuideLine();
+ myEditedObject->RemoveProfile();
+ myEditedObject->Update();
+ }
+
+ erasePreview();
+ return;
+ }
+
+ // Update channel data
+ if ( !theIsInit )
+ {
+ Handle(HYDROData_Polyline3D) aGuideLine = Handle(HYDROData_Polyline3D)::DownCast(
+ HYDROGUI_Tool::FindObjectByName( module(), aGuideLineName, KIND_POLYLINE ) );
+ myEditedObject->SetGuideLine( aGuideLine );
+
+ Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast(
+ HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) );
+ myEditedObject->SetProfile( aProfile );
+
+ if ( myEditedObject->IsMustBeUpdated() )
+ myEditedObject->Update();
+ }
+
+ LightApp_Application* anApp = module()->getApp();
+ if ( !myViewManager )
+ myViewManager = ::qobject_cast<OCCViewer_ViewManager*>(
+ anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
+
+ if ( myViewManager && !myPreviewPrs )
+ {
+ if ( OCCViewer_Viewer* aViewer = myViewManager->getOCCViewer() )
+ {
+ Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+ if ( !aCtx.IsNull() )
+ myPreviewPrs = new HYDROGUI_Shape( aCtx, myEditedObject );
+ }
+ }
+
+ if ( !myViewManager || !myPreviewPrs )
+ return;
+
+ myPreviewPrs->update();
+}
+
+void HYDROGUI_ChannelOp::erasePreview()
+{
+ if( myPreviewPrs )
+ {
+ delete myPreviewPrs;
+ myPreviewPrs = 0;
+ }
+}
--- /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_ChannelOp_H
+#define HYDROGUI_ChannelOp_H
+
+#include "HYDROGUI_Operation.h"
+
+#include <HYDROData_Channel.h>
+
+class OCCViewer_ViewManager;
+
+class HYDROGUI_Shape;
+
+class HYDROGUI_ChannelOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ChannelOp( HYDROGUI_Module* theModule, const bool theIsEdit );
+ virtual ~HYDROGUI_ChannelOp();
+
+protected:
+ virtual void startOperation();
+ virtual void abortOperation();
+ virtual void commitOperation();
+
+ virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+ virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg );
+
+protected slots:
+ void onCreatePreview( const bool theIsInit = false );
+
+private:
+ void erasePreview();
+
+private:
+ bool myIsEdit;
+ Handle(HYDROData_Channel) myEditedObject;
+
+ OCCViewer_ViewManager* myViewManager;
+
+ HYDROGUI_Shape* myPreviewPrs;
+};
+
+#endif
bool anIsZone = false;
bool anIsObstacle = false;
bool anIsStream = false;
+ bool anIsChannel = false;
bool anIsGeomObject = false;
// check the selected GEOM objects
anIsObstacle = true;
else if( anObjectKind == KIND_STREAM )
anIsStream = true;
+ else if( anObjectKind == KIND_CHANNEL )
+ anIsChannel = true;
}
anIsGeomObject = HYDROData_Tool::IsGeometryObject( anObject );
theMenu->addAction( action( ImportBathymetryId ) );
break;
case KIND_ARTIFICIAL_OBJECT:
+ theMenu->addAction( action( CreateChannelId ) );
break;
case KIND_NATURAL_OBJECT:
theMenu->addAction( action( CreateImmersibleZoneId ) );
theMenu->addAction( action( EditStreamId ) );
theMenu->addSeparator();
}
+ else if( anIsChannel )
+ {
+ theMenu->addAction( action( EditChannelId ) );
+ theMenu->addSeparator();
+ }
else if( anIsVisualState && anIsObjectBrowser )
{
theMenu->addAction( action( SaveVisualStateId ) );
theMenu->addAction( action( DeleteId ) );
theMenu->addSeparator();
- if( anIsImage || anIsPolyline || anIsPolyline3D || anIsImmersibleZone || anIsZone ||
- anIsRegion || anIsBathymetry || anIsObstacle || anIsStream || anIsValidProfile )
+ if( anIsImage || anIsPolyline || anIsPolyline3D ||
+ anIsImmersibleZone || anIsZone || anIsRegion ||
+ anIsBathymetry || anIsObstacle || anIsStream ||
+ anIsChannel || anIsValidProfile )
{
if( anIsHiddenInSelection )
theMenu->addAction( action( ShowId ) );
anObjectKind != KIND_ZONE &&
anObjectKind != KIND_OBSTACLE &&
anObjectKind != KIND_PROFILE &&
- anObjectKind != KIND_STREAM )
+ anObjectKind != KIND_STREAM &&
+ anObjectKind != KIND_CHANNEL )
return aResShape;
aResShape = new HYDROGUI_Shape( theContext, theObject );
#include "HYDROGUI_CopyPasteOp.h"
#include "HYDROGUI_CalculationOp.h"
+#include "HYDROGUI_ChannelOp.h"
#include "HYDROGUI_DataModel.h"
#include "HYDROGUI_DeleteOp.h"
#include "HYDROGUI_ExportImageOp.h"
createAction( CreateStreamId, "CREATE_STREAM" );
createAction( EditStreamId, "EDIT_STREAM" );
+ createAction( CreateChannelId, "CREATE_CHANNEL" );
+ createAction( EditChannelId, "EDIT_CHANNEL" );
+
createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE" );
createAction( ImportGeomObjectId, "IMPORT_GEOM_OBJECT" );
createAction( CreateBoxId, "CREATE_BOX" );
createMenu( CreatePolylineId, aHydroId, -1, -1 );
createMenu( CreatePolyline3DId, aHydroId, -1, -1 );
- int aNewProfileId = createMenu( tr( "MEN_PROFILE" ), aHydroId, -1 );
+ int aNewProfileId = createMenu( tr( "MEN_DESK_PROFILE" ), aHydroId, -1 );
createMenu( CreateProfileId, aNewProfileId, -1, -1 );
createMenu( ImportProfilesId, aNewProfileId, -1, -1 );
createMenu( AllGeoreferencementId, aNewProfileId, -1, -1 );
- createMenu( CreateImmersibleZoneId, aHydroId, -1, -1 );
- createMenu( CreateStreamId, aHydroId, -1, -1 );
+ int anArtificialMenuId = createMenu( tr( "MEN_DESK_ARTIFICIAL" ), aHydroId, -1 );
+ createMenu( CreateImmersibleZoneId, anArtificialMenuId, -1, -1 );
+ createMenu( CreateStreamId, anArtificialMenuId, -1, -1 );
+
+ int aNaturalMenuId = createMenu( tr( "MEN_DESK_NATURAL" ), aHydroId, -1 );
+ createMenu( CreateChannelId, aNaturalMenuId, -1, -1 );
- int aNewObstacleId = createMenu( tr( "MEN_OBSTACLE" ), aHydroId, -1 );
- createMenu( ImportObstacleFromFileId, aNewObstacleId, -1, -1 );
- createMenu( CreateBoxId, aNewObstacleId, -1, -1 );
- createMenu( CreateCylinderId, aNewObstacleId, -1, -1 );
+ int anObstacleMenuId = createMenu( tr( "MEN_DESK_OBSTACLE" ), aHydroId, -1 );
+ createMenu( ImportObstacleFromFileId, anObstacleMenuId, -1, -1 );
+ createMenu( CreateBoxId, anObstacleMenuId, -1, -1 );
+ createMenu( CreateCylinderId, anObstacleMenuId, -1, -1 );
createMenu( CreateCalculationId, aHydroId, -1, -1 );
createMenu( separator(), aHydroId );
case EditStreamId:
anOp = new HYDROGUI_StreamOp( aModule, theId == EditStreamId );
break;
+ case CreateChannelId:
+ case EditChannelId:
+ anOp = new HYDROGUI_ChannelOp( aModule, theId == EditChannelId );
+ break;
case CreateCalculationId:
case EditCalculationId:
anOp = new HYDROGUI_CalculationOp( aModule, theId == EditCalculationId );
CreateStreamId,
EditStreamId,
+ CreateChannelId,
+ EditChannelId,
+
CreateCalculationId,
EditCalculationId,
ExportCalculationId,
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_MaterialAspect.hxx>
+#include <HYDROData_Channel.h>
#include <HYDROData_Document.h>
#include <HYDROData_Image.h>
#include <HYDROData_ImmersibleZone.h>
QColor aFillingColor = aStream->GetFillingColor();
QColor aBorderColor = aStream->GetBorderColor();
+ setFillingColor( aFillingColor, false, false );
+ setBorderColor( aBorderColor, false, false );
+ }
+ else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Channel) ) )
+ {
+ Handle(HYDROData_Channel) aChannel =
+ Handle(HYDROData_Channel)::DownCast( myObject );
+
+ TopoDS_Face aChannelShape = TopoDS::Face( aChannel->GetTopShape() );
+
+ setShape( aChannelShape, false, false );
+
+ QColor aFillingColor = aChannel->GetFillingColor();
+ QColor aBorderColor = aChannel->GetBorderColor();
+
setFillingColor( aFillingColor, false, false );
setBorderColor( aBorderColor, false, false );
}
( anObject->GetKind() == KIND_ZONE ) ||
( anObject->GetKind() == KIND_OBSTACLE ) ||
( anObject->GetKind() == KIND_PROFILE ) ||
- ( anObject->GetKind() == KIND_STREAM ) ) )
+ ( anObject->GetKind() == KIND_STREAM ) ||
+ ( anObject->GetKind() == KIND_CHANNEL ) ) )
{
theSeq.Append( anObject );
}
<source>DSK_EDIT_STREAM</source>
<translation>Edit stream</translation>
</message>
+ <message>
+ <source>DSK_CREATE_CHANNEL</source>
+ <translation>Create channel</translation>
+ </message>
+ <message>
+ <source>DSK_EDIT_CHANNEL</source>
+ <translation>Edit channel</translation>
+ </message>
<message>
<source>DSK_COPY</source>
<translation>Copy</translation>
<source>MEN_EDIT_STREAM</source>
<translation>Edit stream</translation>
</message>
+ <message>
+ <source>MEN_CREATE_CHANNEL</source>
+ <translation>Create channel</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_CHANNEL</source>
+ <translation>Edit channel</translation>
+ </message>
<message>
<source>MEN_CUT_IMAGES</source>
<translation>Cut images</translation>
<source>MEN_DELETE</source>
<translation>Delete</translation>
</message>
+ <message>
+ <source>MEN_DESK_ARTIFICIAL</source>
+ <translation>Artificial objects</translation>
+ </message>
<message>
<source>MEN_DESK_HYDRO</source>
<translation>HYDRO</translation>
</message>
+ <message>
+ <source>MEN_DESK_NATURAL</source>
+ <translation>Natural objects</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_OBSTACLE</source>
+ <translation>Obstacle</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_PROFILE</source>
+ <translation>Profile</translation>
+ </message>
<message>
<source>MEN_EDIT_CALCULATION</source>
<translation>Edit calculation case</translation>
<source>MEN_UPDATE_IMAGE</source>
<translation>Update image</translation>
</message>
- <message>
- <source>MEN_OBSTACLE</source>
- <translation>Obstacle</translation>
- </message>
- <message>
- <source>MEN_PROFILE</source>
- <translation>Profile</translation>
- </message>
<message>
<source>MEN_IMPORT_OBSTACLE_FROM_FILE</source>
<translation>Import obstacle</translation>
<source>STB_EDIT_STREAM</source>
<translation>Edit stream</translation>
</message>
+ <message>
+ <source>STB_CREATE_CHANNEL</source>
+ <translation>Create channel</translation>
+ </message>
+ <message>
+ <source>STB_EDIT_CHANNEL</source>
+ <translation>Edit channel</translation>
+ </message>
<message>
<source>STB_COPY</source>
<translation>Copy</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_ChannelDlg</name>
+ <message>
+ <source>NAME</source>
+ <translation>Name</translation>
+ </message>
+ <message>
+ <source>CHANNEL_NAME</source>
+ <translation>Channel name</translation>
+ </message>
+ <message>
+ <source>CHANNEL_PARAMETERS</source>
+ <translation>Parameters</translation>
+ </message>
+ <message>
+ <source>CHANNEL_GUIDE_LINE</source>
+ <translation>Guide line</translation>
+ </message>
+ <message>
+ <source>CHANNEL_PROFILE</source>
+ <translation>Profile</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>HYDROGUI_ChannelOp</name>
+ <message>
+ <source>CREATE_CHANNEL</source>
+ <translation>Create channel</translation>
+ </message>
+ <message>
+ <source>EDIT_CHANNEL</source>
+ <translation>Edit channel</translation>
+ </message>
+ <message>
+ <source>DEFAULT_CHANNEL_NAME</source>
+ <translation>Channel</translation>
+ </message>
+ </context>
+
</TS>