#include "HYDROGUI_Tool.h"
#include "HYDROGUI_Tool2.h"
#include "HYDROGUI_UpdateFlags.h"
+#include "HYDROGUI_OCCDisplayer.h"
#include <HYDROData_Document.h>
#include <HYDROData_PolylineXY.h>
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewModel.h>
#include <OCCViewer_ViewWindow.h>
+#include <SVTK_ViewManager.h>
+#include <SVTK_ViewModel.h>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax3.hxx>
#include <QSet>
#include <HYDROData_StreamLinearInterpolation.h>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
void insertProfileInToOrder( const QString& theProfileName,
const double& theProfilePar,
QStringList& theProfiles,
QList<double>& theProfileParams )
{
+ DEBTRACE("insertProfileInToOrder");
bool anIsInserted = false;
for ( int k = 0; k < theProfileParams.length(); ++k )
{
}
}
-HYDROGUI_StreamOp::HYDROGUI_StreamOp( HYDROGUI_Module* theModule, bool theIsEdit )
-: HYDROGUI_Operation( theModule ),
- myIsEdit( theIsEdit ),
- myPreviewPrs( NULL )
+void HYDROGUI_StreamOp::hideBathy(HYDROGUI_Module *theModule)
+{
+ DEBTRACE("HYDROGUI_StreamOp::hideBathy");
+ Handle(HYDROData_Stream) editedObject =
+ Handle(HYDROData_Stream)::DownCast(HYDROGUI_Tool::GetSelectedObject(theModule));
+ if (!editedObject.IsNull())
+ {
+ QString bathyName = editedObject->GetBathyName();
+ DEBTRACE("bathyName " << bathyName.toStdString());
+ if (!bathyName.isEmpty())
+ {
+ Handle(HYDROData_Entity) aBathyObject = HYDROGUI_Tool::FindObjectByName(theModule, bathyName);
+ if (!aBathyObject.IsNull())
+ {
+ DEBTRACE("Hide " << bathyName.toStdString());
+ int anUpdateFlags = UF_OCCViewer;
+ size_t aViewerId = HYDROGUI_Tool::GetActiveOCCViewId(theModule);
+ theModule->setObjectVisible(aViewerId, aBathyObject, false);
+ theModule->update( anUpdateFlags );
+ }
+ }
+ }
+}
+
+HYDROGUI_StreamOp::HYDROGUI_StreamOp(HYDROGUI_Module *theModule, bool theIsEdit) :
+ HYDROGUI_Operation(theModule), myIsEdit(theIsEdit), myPreviewPrs( NULL)
{
- setName( theIsEdit ? tr( "EDIT_STREAM" ) : tr( "CREATE_STREAM" ) );
+ DEBTRACE("HYDROGUI_StreamOp");
+ setName(theIsEdit ? tr("EDIT_STREAM") : tr("CREATE_STREAM"));
}
HYDROGUI_StreamOp::~HYDROGUI_StreamOp()
{
+ DEBTRACE("~HYDROGUI_StreamOp");
erasePreview();
}
void HYDROGUI_StreamOp::startOperation()
{
+ DEBTRACE("startOperation");
HYDROGUI_Operation::startOperation();
int mode = 0; //DTM mode by def
{
mode = myEditedObject->GetInterpolationMethod();
anObjectName = myEditedObject->GetName();
+ DEBTRACE("anObjectName " << anObjectName.toStdString());
//aPanel->setMode(mode);
// Hydraulic axis
HYDROData_Stream::HasIntersection( aHydraulicAxis, aProfile, aPlane, aProfilePar );
myProfileParams << aProfilePar;
}
-
}
-
}
}
void HYDROGUI_StreamOp::abortOperation()
{
+ DEBTRACE("abortOperation");
erasePreview();
HYDROGUI_Operation::abortOperation();
}
void HYDROGUI_StreamOp::commitOperation()
{
+ DEBTRACE("commitOperation");
erasePreview();
HYDROGUI_Operation::commitOperation();
}
HYDROGUI_InputPanel* HYDROGUI_StreamOp::createInputPanel() const
{
+ DEBTRACE("createInputPanel");
HYDROGUI_StreamDlg* aPanel = new HYDROGUI_StreamDlg( module(), getName() );
connect( aPanel, SIGNAL( AddProfiles() ), this, SLOT( onAddProfiles() ) );
void HYDROGUI_StreamOp::apply()
{
+ DEBTRACE("apply");
QApplication::setOverrideCursor( Qt::WaitCursor );
+ if (myEditedObject)
+ {
+ QString anObjectName = myEditedObject->GetName();
+ DEBTRACE("anObjectName " << anObjectName.toStdString());
+ }
startDocOperation();
QString& theErrorMsg,
QStringList& theBrowseObjectsEntries )
{
+ DEBTRACE("processApply");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if ( !aPanel )
return false;
HYDROGUI_Tool::FindObjectByName( module(), aPanel->getLeftBankName(), KIND_POLYLINEXY ) );
Handle(HYDROData_PolylineXY) aRightBank = Handle(HYDROData_PolylineXY)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aPanel->getRightBankName(), KIND_POLYLINEXY ) );
- //myEditedObject->Se
myEditedObject->SetLeftBank(aLeftBank);
myEditedObject->SetRightBank(aRightBank);
void HYDROGUI_StreamOp::createPreview()
{
+ DEBTRACE("createPreview");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
int mode = aPanel->getMode();
void HYDROGUI_StreamOp::erasePreview()
{
+ DEBTRACE("erasePreview");
if( myPreviewPrs )
{
delete myPreviewPrs;
void HYDROGUI_StreamOp::onAddProfiles()
{
+ DEBTRACE("onAddProfiles");
//TODO skip if mode == 1??
Handle(HYDROData_PolylineXY) aHydAxis = Handle(HYDROData_PolylineXY)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), myHydAxis, KIND_POLYLINEXY ) );
void HYDROGUI_StreamOp::onRemoveProfiles( const QStringList& theProfilesToRemove )
{
+ DEBTRACE("onRemoveProfiles");
QStringList aToRemove = theProfilesToRemove;
aToRemove.removeDuplicates();
void HYDROGUI_StreamOp::onDDZValueChanged( double d )
{
+ DEBTRACE("onDDZValueChanged");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if (!aPanel)
return;
void HYDROGUI_StreamOp::onSSValueChanged( double d )
{
+ DEBTRACE("onSSValueChanged");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if (!aPanel)
return;
void HYDROGUI_StreamOp::onAxisChanged( const QString& theNewAxis )
{
+ DEBTRACE("onAxisChanged");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if (!aPanel)
return;
void HYDROGUI_StreamOp::onLeftBankChanged( const QString& theNewAxis )
{
+ DEBTRACE("onLeftBankChanged");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if (!aPanel)
return;
void HYDROGUI_StreamOp::onRightBankChanged( const QString& theNewAxis )
{
+ DEBTRACE("onRightBankChanged");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if (!aPanel)
return;
void HYDROGUI_StreamOp::onProfilePointsChanged( int d )
{
+ DEBTRACE("onProfilePointsChanged");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if (!aPanel)
return;
void HYDROGUI_StreamOp::onModeChanged( bool mode )
{
+ DEBTRACE("onModeChanged");
createPreview();
}
void HYDROGUI_StreamOp::updatePanelData()
{
+ DEBTRACE("updatePanelData");
HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
if ( !aPanel )
return;