#include "SPlot2d_ViewModel.h"
#include "SPlot2d_SetupPlot2dDlg.h"
+#include "Plot2d_SetupCurveDlg.h"
#include "OB_Browser.h"
QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
+ QApplication::setOverrideCursor(Qt::waitCursor);
TPrs3d_i* aPrs3d =
CreatePrs3d<TPrs3d_i>(theModule,
theTimeStamp,
(Entity)anEntity.toInt(),
aFieldName.latin1(),
aTimeStampId.toInt());
+ QApplication::restoreOverrideCursor();
if(aPrs3d){
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
int aValue = aResourceMgr->integerValue("Visu:BuildDefaultPrs3d",0);
if(IsDlgModal)
if(aDlg->exec() && (aDlg->storeToPrsObject(aPrs3d))) {
// Optionally, create table and curves for cut lines
+ QApplication::setOverrideCursor(Qt::waitCursor);
CreateCurves( theModule, dynamic_cast<VISU::CutLines_i*>( aPrs3d ), aDlg, true ); // in creation mode
+ QApplication::restoreOverrideCursor();
delete aDlg;
} else {
DeletePrs3d(theModule,aPrs3d,theIO);
VisuGUI::
OnEraseAll()
{
- SVTK_ViewWindow* vw = GetViewWindow();
- if (!vw) return;
-
- vw->unHighlightAll();
- if (vtkRenderer *aRen = vw->getRenderer()) {
- vtkActor *anActor;
- vtkActorCollection *anActColl = aRen->GetActors();
- for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
- if (anActor->GetVisibility() > 0)
- if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- anVISUActor = anVISUActor->GetParent();
- anVISUActor->VisibilityOff();
- }
+ if (SVTK_ViewWindow* vw = GetViewWindow()) {
+ vw->unHighlightAll();
+ if (vtkRenderer *aRen = vw->getRenderer()) {
+ vtkActor *anActor;
+ vtkActorCollection *anActColl = aRen->GetActors();
+ for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
+ if (anActor->GetVisibility() > 0)
+ if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
+ anVISUActor = anVISUActor->GetParent();
+ anVISUActor->VisibilityOff();
+ }
+ }
+ vw->Repaint();
}
- vw->Repaint();
+ } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
+ aPlot2d->EraseAll();
}
}
VisuGUI::
OnCurveProperties()
{
+ SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+ if (aListIO.Extent() != 1) return;
+
+ SalomeApp_Study* aAppStudy = GetAppStudy(this);
+ const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+ CORBA::Object_var anObject = GetSelectedObj( aAppStudy, anIO->getEntry() );
+ if (CORBA::is_nil( anObject )) return;
+
+ VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
+ if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) {
+ // Curve object
+ CORBA::Object_ptr aCurve = VISU::Curve::_narrow( anObject );
+ if( !CORBA::is_nil( aCurve ) ) {
+ VISU::Curve_i* aDSCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ if ( aDSCurve && (!IsStudyLocked( GetCStudy(aAppStudy) )) ) {
+ Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
+
+ aDlg.setLine( (int)aDSCurve->GetLine(), aDSCurve->GetLineWidth() );
+ aDlg.setMarker( (int)aDSCurve->GetMarker() );
+ SALOMEDS::Color aColor = aDSCurve->GetColor();
+ aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
+ if( aDlg.exec() == QDialog::Accepted ) {
+ aDSCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
+ aDSCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
+ SALOMEDS::Color newColor;
+ newColor.R = aDlg.getColor().red()/255.;
+ newColor.G = aDlg.getColor().green()/255.;
+ newColor.B = aDlg.getColor().blue()/255.;
+ aDSCurve->SetColor( newColor );
+ PlotCurve(this, aDSCurve, VISU::eDisplay);
+ }
+ }
+ }
+ }
}
void
activateModule( SUIT_Study* theStudy )
{
SalomeApp_Module::activateModule( theStudy );
-
+ studyActivated();
setMenuShown( true );
setToolShown( true );
return true;
return new VisuGUI_Selection( (SalomeApp_Module*)this );
}
+//******************************************************************
+void VisuGUI::studyActivated()
+{
+ GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
+}
+
+
extern "C" {
CAM_Module*
createModule()