-// Copyright (C) 2007-2008 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
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_FeatureEdgesPanel.cxx
// Author : Oleg Uvarov
#include <QLayout>
#include <QPushButton>
-#include <QtxDoubleSpinBox.h>
-
#include <SUIT_MessageBox.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <LightApp_SelectionMgr.h>
-VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule, QWidget* theParent ) :
+VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( VisuGUI* theModule, QWidget* theParent ) :
VisuGUI_Panel( tr( "WINDOW_TITLE" ), theModule, theParent, ApplyBtn | CloseBtn | HelpBtn ),
myActor( 0 )
{
+ setWindowTitle( tr( "WINDOW_TITLE" ) );
+ setObjectName( tr( "WINDOW_TITLE" ) );
+
QVBoxLayout* aTopLayout = new QVBoxLayout( mainFrame() );
myGrp = new QGroupBox( tr( "FEATURE_EDGES_PROPERTIES" ), mainFrame() );
aLayout->setAlignment( Qt::AlignTop );
QLabel* anAngleLbl = new QLabel( tr( "FEATURE_EDGES_ANGLE" ), myGrp );
- myAngleSpinBox = new QtxDoubleSpinBox( 0.0, 90.0, 10.0, myGrp );
+ myAngleSpinBox = new SalomeApp_DoubleSpinBox( myGrp );
+ VISU::initSpinBox( myAngleSpinBox, 0.0, 90.0, 10.0, "angle_precision" );
myFeatureEdgesCB = new QCheckBox( tr( "SHOW_FEATURE_EDGES" ), myGrp );
myBoundaryEdgesCB = new QCheckBox( tr( "SHOW_BOUNDARY_EDGES" ), myGrp );
aTopLayout->addWidget( myGrp );
- SalomeApp_Application* anApp =
- dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
- LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
- connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) );
+ connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
}
VisuGUI_FeatureEdgesPanel::~VisuGUI_FeatureEdgesPanel()
anIsManifoldEdges = false,
anIsNonManifoldEdges = false;
myActor->GetFeatureEdgesFlags( anIsFeatureEdges,
- anIsBoundaryEdges,
- anIsManifoldEdges,
- anIsNonManifoldEdges );
+ anIsBoundaryEdges,
+ anIsManifoldEdges,
+ anIsNonManifoldEdges );
- float aColoring = myActor->GetFeatureEdgesColoring();
+ //float aColoring = myActor->GetFeatureEdgesColoring();
myAngleSpinBox->setValue( anAngle );
myFeatureEdgesCB->setChecked( anIsFeatureEdges );
{
myActor->SetFeatureEdgesAngle( myAngleSpinBox->value() );
myActor->SetFeatureEdgesFlags( myFeatureEdgesCB->isChecked(),
- myBoundaryEdgesCB->isChecked(),
- myManifoldEdgesCB->isChecked(),
- myNonManifoldEdgesCB->isChecked() );
+ myBoundaryEdgesCB->isChecked(),
+ myManifoldEdgesCB->isChecked(),
+ myNonManifoldEdgesCB->isChecked() );
//myActor->SetFeatureEdgesColoring( myColoringCB->isChecked() );
myActor->Update();
}
void VisuGUI_FeatureEdgesPanel::onClose()
{
- close();
+ // hide();
VisuGUI_Panel::onClose();
}
onHelp();
}
}
+
+void VisuGUI_FeatureEdgesPanel::onModuleActivated()
+{
+ disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ VisuGUI_Panel::onModuleActivated();
+}
+
+void VisuGUI_FeatureEdgesPanel::onModuleDeactivated()
+{
+ disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionEvent() ) );
+ VisuGUI_Panel::onModuleDeactivated();
+}