HYDROGUI_Operations.h
HYDROGUI_PolylineDlg.h
HYDROGUI_PolylineOp.h
+ HYDROGUI_ProfileDlg.h
+ HYDROGUI_ProfileOp.h
HYDROGUI_Prs.h
HYDROGUI_PrsDriver.h
HYDROGUI_PrsImage.h
HYDROGUI_Operations.cxx
HYDROGUI_PolylineDlg.cxx
HYDROGUI_PolylineOp.cxx
+ HYDROGUI_ProfileDlg.cxx
+ HYDROGUI_ProfileOp.cxx
HYDROGUI_Prs.cxx
HYDROGUI_PrsDriver.cxx
HYDROGUI_PrsImage.cxx
#include <HYDROData_ImmersibleZone.h>
#include <HYDROData_Iterator.h>
#include <HYDROData_Polyline.h>
+#include <HYDROData_Profile.h>
#include <HYDROData_VisualState.h>
#include <HYDROData_Region.h>
#include <HYDROData_Zone.h>
createObject( aPolylineRootObj, aPolylineObj );
}
+ LightApp_DataObject* aProfileRootObj = createObject( aRootObj, tr( partitionName( KIND_PROFILE ).toAscii() ) );
+
+ anIterator = HYDROData_Iterator( aDocument, KIND_PROFILE );
+ for( ; anIterator.More(); anIterator.Next() )
+ {
+ Handle(HYDROData_Profile) aProfileObj =
+ Handle(HYDROData_Profile)::DownCast( anIterator.Current() );
+ if( !aProfileObj.IsNull() )
+ createObject( aProfileRootObj, aProfileObj );
+ }
+
LightApp_DataObject* aZonesRootObj = createObject( aRootObj, tr( partitionName( KIND_IMMERSIBLE_ZONE ).toAscii() ) );
anIterator = HYDROData_Iterator( aDocument, KIND_IMMERSIBLE_ZONE );
ObjectKind aKind = anObject->GetKind();
if( aKind == KIND_IMAGE ||
aKind == KIND_POLYLINE ||
+ aKind == KIND_PROFILE ||
aKind == KIND_CALCULATION )
return true;
{
case KIND_IMAGE: return "IMAGES";
case KIND_POLYLINE: return "POLYLINES";
+ case KIND_PROFILE: return "PROFILES";
case KIND_VISUAL_STATE: return "VISUAL_STATES";
case KIND_BATHYMETRY: return "BATHYMETRIES";
case KIND_CALCULATION: return "CALCULATION_CASES";
bool anIsSplittedImage = false;
bool anIsMustBeUpdatedImage = false;
bool anIsPolyline = false;
+ bool anIsProfile = false;
bool anIsBathymetry = false;
bool anIsCalculation = false;
bool anIsImmersibleZone = false;
}
else if( anObject->GetKind() == KIND_POLYLINE )
anIsPolyline = true;
+ else if( anObject->GetKind() == KIND_PROFILE )
+ anIsProfile = true;
else if( anObject->GetKind() == KIND_CALCULATION )
anIsCalculation = true;
else if( anObject->GetKind() == KIND_IMMERSIBLE_ZONE )
case KIND_POLYLINE:
theMenu->addAction( action( CreatePolylineId ) );
break;
+ case KIND_PROFILE:
+ theMenu->addAction( action( CreateProfileId ) );
+ break;
case KIND_VISUAL_STATE:
theMenu->addAction( action( SaveVisualStateId ) );
break;
theMenu->addAction( action( EditPolylineId ) );
theMenu->addSeparator();
}
+ else if( anIsProfile )
+ {
+ theMenu->addAction( action( EditProfileId ) );
+ theMenu->addSeparator();
+ }
else if( anIsCalculation )
{
theMenu->addAction( action( EditCalculationId ) );
#include "HYDROGUI_Module.h"
#include "HYDROGUI_ObserveImageOp.h"
#include "HYDROGUI_PolylineOp.h"
+#include "HYDROGUI_ProfileOp.h"
#include "HYDROGUI_RemoveImageRefsOp.h"
#include "HYDROGUI_ShowHideOp.h"
#include "HYDROData_SplitToZonesTool.h"
createAction( CreatePolylineId, "CREATE_POLYLINE" );
createAction( EditPolylineId, "EDIT_POLYLINE" );
+ createAction( CreateProfileId, "CREATE_PROFILE" );
+ createAction( EditProfileId, "EDIT_PROFILE" );
+
createAction( ImportBathymetryId, "IMPORT_BATHYMETRY", "", Qt::CTRL + Qt::Key_B );
createAction( CreateImmersibleZoneId, "CREATE_IMMERSIBLE_ZONE" );
createMenu( ImportImageId, aHydroId, -1, -1 );
createMenu( ImportBathymetryId, aHydroId, -1, -1 );
createMenu( CreatePolylineId, aHydroId, -1, -1 );
+ createMenu( CreateProfileId, aHydroId, -1, -1 );
createMenu( CreateImmersibleZoneId, aHydroId, -1, -1 );
int aNewObstacleId = createMenu( tr( "MEN_OBSTACLE" ), aHydroId, -1 );
case EditPolylineId:
anOp = new HYDROGUI_PolylineOp( aModule, theId == EditPolylineId );
break;
+ case CreateProfileId:
+ case EditProfileId:
+ anOp = new HYDROGUI_ProfileOp( aModule, theId == EditProfileId );
+ break;
case ImportBathymetryId:
anOp = new HYDROGUI_ImportBathymetryOp( aModule );
break;
CreatePolylineId,
EditPolylineId,
+ CreateProfileId,
+ EditProfileId,
+
ImportBathymetryId,
EditImportedBathymetryId,
: HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL)
{
QHBoxLayout* aNameLayout = new QHBoxLayout();
- QLabel* aNameLabel = new QLabel(tr("CURVE_NAME_TLT"), this);
+ QLabel* aNameLabel = new QLabel(tr("POLYLINE_NAME_TLT"), this);
aNameLayout->addWidget(aNameLabel);
myName = new QLineEdit(this);
aNameLayout->addWidget(myName);
--- /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_ProfileDlg.h"
+
+#include "HYDROGUI_Module.h"
+#include <CurveCreator_Widget.h>
+#include <CurveCreator_ICurve.hxx>
+
+#include <OCCViewer_ViewModel.h>
+
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QLineEdit>
+
+HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL)
+{
+ QHBoxLayout* aNameLayout = new QHBoxLayout();
+ QLabel* aNameLabel = new QLabel(tr("PROFILE_NAME_TLT"), this);
+ aNameLayout->addWidget(aNameLabel);
+ myName = new QLineEdit(this);
+ aNameLayout->addWidget(myName);
+
+ addLayout(aNameLayout);
+
+ myEditorWidget = new CurveCreator_Widget( this, NULL );
+ addWidget( myEditorWidget, 3 );
+
+ myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this );
+ addWidget( myAddElementBox, 2 );
+
+ QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox );
+ anAddElementLayout->setMargin( 0 );
+ anAddElementLayout->setSpacing( 5 );
+
+ connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
+ connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) );
+ connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
+
+ myAddElementBox->hide();
+}
+
+HYDROGUI_ProfileDlg::~HYDROGUI_ProfileDlg()
+{
+}
+
+void HYDROGUI_ProfileDlg::setOCCViewer( OCCViewer_Viewer* theViewer )
+{
+ myEditorWidget->setOCCViewer( theViewer );
+}
+
+void HYDROGUI_ProfileDlg::processStartedSubOperation( QWidget* theWidget )
+{
+ myEditorWidget->setEnabled( false );
+
+ QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+ anAddElementLayout->addWidget( theWidget );
+
+ theWidget->show();
+ myAddElementBox->show();
+}
+
+void HYDROGUI_ProfileDlg::processFinishedSubOperation( QWidget* theWidget )
+{
+ myEditorWidget->setEnabled( true );
+
+ QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+ anAddElementLayout->removeWidget( theWidget );
+
+ theWidget->hide();
+ myAddElementBox->hide();
+}
+
+void HYDROGUI_ProfileDlg::reset()
+{
+}
+
+void HYDROGUI_ProfileDlg::setProfileName( const QString& theName )
+{
+ myName->setText(theName);
+}
+
+QString HYDROGUI_ProfileDlg::getProfileName() const
+{
+ return myName->text();
+}
+
+void HYDROGUI_ProfileDlg::setCurve( CurveCreator_ICurve* theCurve )
+{
+ myEditorWidget->setCurve( theCurve );
+}
+
+QList<int> HYDROGUI_ProfileDlg::getSelectedSections()
+{
+ return myEditorWidget->getSelectedSections();
+}
+
+QList< QPair< int, int > > HYDROGUI_ProfileDlg::getSelectedPoints()
+{
+ return myEditorWidget->getSelectedPoints();
+}
+
+/**
+ * Redirect the delete action to editor widget
+ */
+void HYDROGUI_ProfileDlg::deleteSelected()
+{
+ myEditorWidget->removeSelected();
+}
+
+/**
+ * Checks whether there are some to delete
+ */
+bool HYDROGUI_ProfileDlg::deleteEnabled()
+{
+ return myEditorWidget->removeEnabled();
+}
--- /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_PROFILEDLG_H
+#define HYDROGUI_PROFILEDLG_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class QGroupBox;
+class QLineEdit;
+class CurveCreator_Widget;
+class CurveCreator_ICurve;
+class OCCViewer_Viewer;
+
+class HYDROGUI_ProfileDlg : public HYDROGUI_InputPanel
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+ virtual ~HYDROGUI_ProfileDlg();
+
+ void setOCCViewer( OCCViewer_Viewer* theViewer );
+
+ void setProfileName( const QString& theName );
+ QString getProfileName() const;
+
+ void setCurve( CurveCreator_ICurve* theCurve );
+
+ void reset();
+
+ QList<int> getSelectedSections();
+ QList< QPair< int, int > > getSelectedPoints();
+
+ void deleteSelected();
+ bool deleteEnabled();
+
+protected slots:
+ void processStartedSubOperation( QWidget* );
+ void processFinishedSubOperation( QWidget* );
+signals:
+ void createPreview( QString );
+ void selectionChanged();
+ void widgetCreated(QWidget*);
+ void subOperationStarted(QWidget*);
+ void subOperationFinished(QWidget*);
+private:
+ QLineEdit* myName;
+ CurveCreator_Widget* myEditorWidget;
+ QGroupBox* myAddElementBox;
+};
+
+#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_Module.h"
+#include "HYDROGUI_ProfileOp.h"
+#include "HYDROGUI_ProfileDlg.h"
+#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
+
+#include "HYDROData_Document.h"
+#include "HYDROData_Profile.h"
+#include "CurveCreator_Curve.hxx"
+#include "CurveCreator_Displayer.h"
+
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_UpdateFlags.h>
+
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewWindow.h>
+
+#include <OCCViewer_AISSelector.h>
+
+#include <Precision.hxx>
+
+//static int ZValueIncrement = 0;
+
+HYDROGUI_ProfileOp::HYDROGUI_ProfileOp( HYDROGUI_Module* theModule, bool theIsEdit )
+: HYDROGUI_Operation( theModule ), myIsEdit(theIsEdit), myCurve(NULL)//,
+ //myViewManager(NULL)
+{
+ setName( theIsEdit ? tr( "EDIT_PROFILE" ) : tr( "CREATE_PROFILE" ) );
+}
+
+HYDROGUI_ProfileOp::~HYDROGUI_ProfileOp()
+{
+ //erasePreview();
+}
+
+/**
+ * Redirect the delete action to input panel
+ */
+void HYDROGUI_ProfileOp::deleteSelected()
+{
+ HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ aPanel->deleteSelected();
+}
+
+/**
+ * Checks whether there are some to delete
+ */
+bool HYDROGUI_ProfileOp::deleteEnabled()
+{
+ HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ return aPanel->deleteEnabled();
+}
+
+void HYDROGUI_ProfileOp::startOperation()
+{
+ if( myCurve )
+ {
+ delete myCurve;
+ myCurve = 0;
+ }
+
+ HYDROGUI_Operation::startOperation();
+
+ HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ aPanel->reset();
+
+ //LightApp_Application* anApp = module()->getApp();
+ //myViewManager =
+ // dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
+ //aPanel->setOCCViewer( myViewManager ? myViewManager->getOCCViewer() : 0 );
+
+ if( myIsEdit )
+ myEditedObject = Handle(HYDROData_Profile)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+ if( !myEditedObject.IsNull() )
+ {
+ /*int anIntDim = myEditedObject->GetDimension();
+ CurveCreator::Dimension aDim = CurveCreator::Dim3d;
+ if( anIntDim == 2 )
+ aDim = CurveCreator::Dim2d;
+ myCurve = new CurveCreator_Curve(aDim);
+ QList<PolylineSection> aPolylineData = myEditedObject->GetPolylineData();
+
+ for( int i = 0 ; i < aPolylineData.size() ; i++ ){
+ std::string aName = HYDROGUI_Tool::ToQString(aPolylineData[i].mySectionName).toStdString();
+ bool isClosed = aPolylineData[i].myIsClosed;
+ CurveCreator::SectionType aType = CurveCreator::Polyline;
+ if( aPolylineData[i].myType == PolylineSection::SECTION_SPLINE ){
+ aType = CurveCreator::Spline;
+ }
+ CurveCreator::Coordinates aCoords;
+ for( int j = 0 ; j < aPolylineData[i].myCoords.size() ; j++ ){
+ aCoords.push_back(aPolylineData[i].myCoords[j]);
+ }
+ myCurve->addSectionInternal( aName, aType, isClosed, aCoords );
+ }
+ aPanel->setProfileName( myEditedObject->GetName() );
+ */
+ }
+ else{
+ /*myCurve = new CurveCreator_Curve(CurveCreator::Dim2d);*/
+ //aPanel->setCurve(myCurve);
+ QString aNewName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_PROFILE_NAME" ) );
+ aPanel->setProfileName(aNewName);
+ }
+ /*aPanel->setCurve(myCurve);*/
+ //displayPreview();
+}
+
+void HYDROGUI_ProfileOp::abortOperation()
+{
+ //HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ //if ( aPanel )
+ // aPanel->setOCCViewer( 0 );
+ //erasePreview();
+
+ HYDROGUI_Operation::abortOperation();
+}
+
+void HYDROGUI_ProfileOp::commitOperation()
+{
+ //HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ //if ( aPanel )
+ // aPanel->setOCCViewer( 0 );
+ //erasePreview();
+
+ HYDROGUI_Operation::commitOperation();
+}
+
+HYDROGUI_InputPanel* HYDROGUI_ProfileOp::createInputPanel() const
+{
+ HYDROGUI_ProfileDlg* aDlg = new HYDROGUI_ProfileDlg( module(), getName() );
+ //connect( aDlg, SIGNAL( selectionChanged() ), this, SLOT( onEditorSelectionChanged() ) );
+ return aDlg;
+}
+
+bool HYDROGUI_ProfileOp::processApply( int& theUpdateFlags,
+ QString& theErrorMsg )
+{
+ HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+
+ int aStudyId = module()->getStudyId();
+ bool aHasDoc = HYDROData_Document::HasDocument(aStudyId);
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( aStudyId );
+ if( aDocument.IsNull() )
+ return false;
+
+ Handle(HYDROData_Profile) aProfileObj;
+ if( myIsEdit ){
+ aProfileObj = myEditedObject;
+ }
+ else{
+ aProfileObj = Handle(HYDROData_Profile)::DownCast( aDocument->CreateObject( KIND_PROFILE ) );
+
+ //double aZValue = double( ++ZValueIncrement ) * 1e-2; // empiric value, to be revised
+ //aProfileObj->SetZValue( aZValue );
+ }
+
+ if( aProfileObj.IsNull() )
+ return false;
+
+ QString aProfileName = aPanel->getProfileName();
+ aProfileObj->SetName(aProfileName);
+ /*
+ int aDimInt = 3;
+ if( myCurve->getDimension() == CurveCreator::Dim2d )
+ aDimInt = 2;
+ aProfileObj->SetDimension(aDimInt);
+ QList<PolylineSection> aPolylineData;
+ for( int i=0 ; i < myCurve->getNbSections() ; i++ ){
+ PolylineSection aSect;
+ aSect.mySectionName = HYDROGUI_Tool::ToExtString( QString::fromLocal8Bit(myCurve->getSectionName(i).c_str()));
+ aSect.myIsClosed = myCurve->isClosed(i);
+ aSect.myType = PolylineSection::SECTION_POLYLINE;
+ if( myCurve->getSectionType(i) == CurveCreator::Spline ){
+ aSect.myType = PolylineSection::SECTION_SPLINE;
+ }
+ CurveCreator::Coordinates aCoords = myCurve->getPoints(i);
+ for( int j = 0 ; j < aCoords.size() ; j++ ){
+ aSect.myCoords << aCoords.at(j);
+ }
+ aPolylineData << aSect;
+ }
+ aProfileObj->SetPolylineData(aPolylineData);
+
+ // the viewer should be release from the widget before the module update it
+ // because it has an opened local context and updated presentation should not be displayed in it
+ //if ( aPanel )
+ // aPanel->setOCCViewer( 0 );
+
+ if( !myIsEdit )
+ module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), aProfileObj, true );
+*/
+ theUpdateFlags = UF_Model;
+ return true;
+}
+
+/*void HYDROGUI_ProfileOp::onEditorSelectionChanged()
+{
+ HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ if( !aPanel )
+ return;
+ if( !myCurve )
+ return;
+ CurveCreator_Displayer* aDisplayer = myCurve->getDisplayer();
+ if( !aDisplayer )
+ return;
+ QList<int> aSelSections = aPanel->getSelectedSections();
+ for( int i = 0 ; i < myCurve->getNbSections() ; i++ ){
+ bool aIsHl = false;
+ if( aSelSections.contains(i) ){
+ aDisplayer->highlight( myCurve->constructSection(i), aIsHl );
+ }
+ }
+}*/
+
+/*void HYDROGUI_ProfileOp::displayPreview()
+{
+ if( myViewManager )
+ {
+ if( OCCViewer_Viewer* aViewer = myViewManager->getOCCViewer() )
+ {
+ Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+ if( !aCtx.IsNull() )
+ {
+ CurveCreator_Displayer* aDisplayer = new CurveCreator_Displayer( aCtx );
+ myCurve->setDisplayer( aDisplayer );
+ aDisplayer->display( myCurve->constructWire() );
+ }
+ }
+ }
+}*/
+
+/*void HYDROGUI_ProfileOp::erasePreview()
+{
+ CurveCreator_Displayer* aDisplayer = myCurve ? myCurve->getDisplayer() : 0;
+ if( myViewManager && aDisplayer )
+ {
+ if( OCCViewer_Viewer* aViewer = myViewManager->getOCCViewer() )
+ {
+ Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+ if( !aCtx.IsNull() )
+ {
+ aDisplayer->erase();
+ }
+ }
+ }
+}*/
--- /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_PROFILEOP_H
+#define HYDROGUI_PROFILEOP_H
+
+#include "HYDROGUI_Operation.h"
+
+#include <HYDROData_Profile.h>
+
+//class OCCViewer_ViewManager;
+class CurveCreator_Curve;
+
+class HYDROGUI_ProfileOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ProfileOp( HYDROGUI_Module* theModule, bool isEdit );
+ virtual ~HYDROGUI_ProfileOp();
+
+ void deleteSelected();
+ bool deleteEnabled();
+
+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 onEditorSelectionChanged();
+
+//private:
+ //void displayPreview();
+ //void erasePreview();
+
+private:
+ //OCCViewer_ViewManager* myViewManager;
+
+ bool myIsEdit;
+ Handle(HYDROData_Profile) myEditedObject;
+ CurveCreator_Curve* myCurve;
+};
+
+#endif
<source>DEFAULT_POLYLINE_NAME</source>
<translation>Polyline</translation>
</message>
+ <message>
+ <source>DEFAULT_PROFILE_NAME</source>
+ <translation>Profile</translation>
+ </message>
<message>
<source>DEFAULT_VISUAL_STATE_NAME</source>
<translation>Visual state</translation>
<source>POLYLINES</source>
<translation>POLYLINES</translation>
</message>
+ <message>
+ <source>PROFILES</source>
+ <translation>PROFILES</translation>
+ </message>
<message>
<source>VISUAL_STATES</source>
<translation>VISUAL STATES</translation>
<source>DSK_CREATE_POLYLINE</source>
<translation>Create polyline</translation>
</message>
+ <message>
+ <source>DSK_CREATE_PROFILE</source>
+ <translation>Create profile</translation>
+ </message>
<message>
<source>DSK_CREATE_IMMERSIBLE_ZONE</source>
<translation>Create immersible zone</translation>
<source>MEN_CREATE_POLYLINE</source>
<translation>Create polyline</translation>
</message>
+ <message>
+ <source>MEN_CREATE_PROFILE</source>
+ <translation>Create profile</translation>
+ </message>
<message>
<source>MEN_CREATE_ZONE</source>
<translation>Create zone</translation>
<source>MEN_EDIT_POLYLINE</source>
<translation>Edit polyline</translation>
</message>
+ <message>
+ <source>MEN_EDIT_PROFILE</source>
+ <translation>Edit profile</translation>
+ </message>
<message>
<source>MEN_EDIT_SPLITTED_IMAGE</source>
<translation>Edit splitted image</translation>
<source>STB_CREATE_POLYLINE</source>
<translation>Create polyline</translation>
</message>
+ <message>
+ <source>STB_CREATE_PROFILE</source>
+ <translation>Create profile</translation>
+ </message>
<message>
<source>STB_CREATE_IMMERSIBLE_ZONE</source>
<translation>Create immersible zone</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_ProfileOp</name>
+ <message>
+ <source>CREATE_PROFILE</source>
+ <translation>Create profile</translation>
+ </message>
+ <message>
+ <source>EDIT_PROFILE</source>
+ <translation>Edit profile</translation>
+ </message>
+ </context>
+
<context>
<name>HYDROGUI_RemoveImageRefsOp</name>
<message>
<translation>Add element</translation>
</message>
<message>
- <source>CURVE_NAME_TLT</source>
+ <source>POLYLINE_NAME_TLT</source>
<translation>Name</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_ProfileDlg</name>
+ <message>
+ <source>ADD_ELEMENT</source>
+ <translation>Add element</translation>
+ </message>
+ <message>
+ <source>PROFILE_NAME_TLT</source>
+ <translation>Name</translation>
+ </message>
+ </context>
+
<context>
<name>HYDROGUI_TwoImagesDlg</name>
<message>