#include <pqVCRController.h>
#include <pqTabbedMultiViewWidget.h>
#include <pqPipelineSource.h>
-//#include <vtkPVMain.h>
+#include <pqActiveObjects.h>
#include <vtkProcessModule.h>
#include <pqParaViewBehaviors.h>
#include <pqHelpReaction.h>
#include <pqPythonScriptEditor.h>
#include <pqStandardSummaryPanelImplementation.h>
#include <pqCollaborationBehavior.h>
+#include <pqDataRepresentation.h>
+#include <pqPipelineRepresentation.h>
+#include <pqLookupTableManager.h>
+#include <pqDisplayColorWidget.h>
#include <PARAVIS_version.h>
#include <vtkPVConfig.h>
+#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
+
/*
* Make sure all the kits register their classes with vtkInstantiator.
* Since ParaView uses Tcl wrapping, all of VTK is already compiled in
#include <pqViewFrameActionsBehavior.h>
#include <pqServerManagerObserver.h>
+#include <vtkClientServerInterpreterInitializer.h>
+
//----------------------------------------------------------------------------
pqPVApplicationCore* PVGUI_Module::MyCoreApp = 0;
SALOME module wrapping ParaView GUI.
*/
+
+/*
+ Fix for the issue 21730: [CEA 596] Slice of polyhedron in PARAVIS returns no cell.
+ Wrap vtkEDFCutter filter.
+*/
+
+extern "C" void vtkEDFCutterCS_Initialize(vtkClientServerInterpreter*);
+static void vtkEDFHelperInit();
+
+void vtkEDFHelperInit(vtkClientServerInterpreter* interp){
+ vtkEDFCutterCS_Initialize(interp);
+}
+
+void vtkEDFHelperInit() {
+ vtkClientServerInterpreterInitializer::GetInitializer()->
+ RegisterCallback(&vtkEDFHelperInit);
+}
+
+
+ _PTR(SComponent)
+ ClientFindOrCreateParavisComponent(_PTR(Study) theStudyDocument)
+ {
+ _PTR(SComponent) aSComponent = theStudyDocument->FindComponent("PARAVIS");
+ if (!aSComponent) {
+ _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+ aStudyBuilder->NewCommand();
+ int aLocked = theStudyDocument->GetProperties()->IsLocked();
+ if (aLocked) theStudyDocument->GetProperties()->SetLocked(false);
+ aSComponent = aStudyBuilder->NewComponent("PARAVIS");
+ _PTR(GenericAttribute) anAttr =
+ aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName");
+ _PTR(AttributeName) aName (anAttr);
+
+ CORBA::ORB_var anORB = PARAVIS::PARAVIS_Gen_i::GetORB();
+ SALOME_NamingService *NamingService = new SALOME_NamingService( anORB );
+ CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog");
+ SALOME_ModuleCatalog::ModuleCatalog_var Catalogue =
+ SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
+ SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "PARAVIS" );
+ if (!Comp->_is_nil()) {
+ aName->SetValue(Comp->componentusername());
+ }
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap");
+ _PTR(AttributePixMap) aPixmap (anAttr);
+ aPixmap->SetPixMap( "pqAppIcon16.png" );
+
+ // Create Attribute parameters for future using
+ anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeParameter");
+
+
+ PARAVIS::PARAVIS_Gen_var aPARAVIS = PARAVIS::PARAVIS_Gen_i::GetParavisGenImpl()->_this();
+
+ aStudyBuilder->DefineComponentInstance(aSComponent, aPARAVIS->GetIOR());
+ if (aLocked) theStudyDocument->GetProperties()->SetLocked(true);
+ aStudyBuilder->CommitCommand();
+ }
+ return aSComponent;
+ }
+
/*!
\brief Constructor. Sets the default name for the module.
*/
connect(pqApplicationCore::instance()->getObjectBuilder(), SIGNAL(finishedAddingServer(pqServer*)),
this, SLOT(onFinishedAddingServer(pqServer*)));
+ connect(pqApplicationCore::instance()->getObjectBuilder(), SIGNAL(dataRepresentationCreated(pqDataRepresentation*)),
+ this, SLOT(onDataRepresentationCreated(pqDataRepresentation*)));
+
+
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
bool isStop = aResourceMgr->booleanValue( "PARAVIS", "stop_trace", false );
// start timer to activate trace in a proper moment
this, SLOT(onStartProgress()));
this->VTKConnect->Connect(pm, vtkCommand::EndEvent,
this, SLOT(onEndProgress()));
+
+ connect(&pqActiveObjects::instance(),
+ SIGNAL(representationChanged(pqRepresentation*)),
+ this, SLOT(onRepresentationChanged(pqRepresentation*)));
}
void PVGUI_Module::onStartProgress()
startTimer( 50 );
}
+void PVGUI_Module::onDataRepresentationCreated(pqDataRepresentation* data) {
+ if(!data)
+ return;
+
+ if(!data->getLookupTable())
+ return;
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ if(!aResourceMgr)
+ return;
+
+ bool visible = aResourceMgr->booleanValue( "PARAVIS", "show_color_legend", false );
+ pqLookupTableManager* lut_mgr = pqApplicationCore::instance()->getLookupTableManager();
+
+ if(lut_mgr) {
+ lut_mgr->setScalarBarVisibility(data,visible);
+ }
+}
+
+void PVGUI_Module::onVariableChanged(pqVariableType t, const QString) {
+
+ pqDisplayColorWidget* colorWidget = qobject_cast<pqDisplayColorWidget*>(sender());
+ if( !colorWidget )
+ return;
+
+ if( t == VARIABLE_TYPE_NONE )
+ return;
+
+ pqDataRepresentation* data = colorWidget->getRepresentation();
+
+ if( !data->getLookupTable() )
+ return;
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ if(!aResourceMgr)
+ return;
+
+ bool visible = aResourceMgr->booleanValue( "PARAVIS", "show_color_legend", false );
+
+ if(!visible)
+ return;
+
+ pqLookupTableManager* lut_mgr = pqApplicationCore::instance()->getLookupTableManager();
+
+ if(lut_mgr) {
+ lut_mgr->setScalarBarVisibility(data,visible);
+ }
+
+}
+
+
/*!
\brief Launches a tracing of current server
*/
if ( myRecentMenuId != -1 ) menuMgr()->show(myRecentMenuId);
+ ClientFindOrCreateParavisComponent(PARAVIS::GetCStudy(this));
+
return isDone;
}
aStrings<<tr("PREF_SAVE_TYPE_2");
setPreferenceProperty(aSaveType, "strings", aStrings);
setPreferenceProperty(aSaveType, "indexes", aIndices);
+
+ //rnv: imp 21712: [CEA 581] Preference to display legend by default
+ int aDispColoreLegend = addPreference( tr( "PREF_SHOW_COLOR_LEGEND" ), aParaVisSettingsTab,
+ LightApp_Preferences::Bool, "PARAVIS", "show_color_legend");
}
/*!
}
}
+void PVGUI_Module::onRepresentationChanged(pqRepresentation*) {
+
+
+ //rnv: to fix the issue "21712: [CEA 581] Preference to display legend by default"
+ // find the pqDisplayColorWidget instances and connect the variableChanged SIGNAL on the
+ // onVariableChanged slot of this class. This connection needs to change visibility
+ // of the "Colored Legend" after change the "Color By" array.
+ QList<pqDisplayColorWidget*> aWidget = getApp()->desktop()->findChildren<pqDisplayColorWidget*>();
+
+ for (int i = 0; i < aWidget.size() ; i++ ) {
+ if( aWidget[i] ) {
+ connect( aWidget[i], SIGNAL ( variableChanged ( pqVariableType, const QString ) ),
+ this, SLOT(onVariableChanged( pqVariableType, const QString) ), Qt::UniqueConnection );
+ }
+ }
+}
+
+
/*!
\fn CAM_Module* createModule();
\brief Export module instance (factory function).
#endif // WNT
extern "C" {
+
+ bool flag = false;
PVGUI_EXPORT CAM_Module* createModule() {
+ if(!flag) {
+ vtkEDFHelperInit();
+ flag = true;
+ }
return new PVGUI_Module();
}
#include <LightApp_Application.h>
#include <SUIT_Desktop.h>
+#include <QApplication>
#include <QAction>
#include <QDockWidget>
#include <QToolBar>
#include <QShortcut>
#include <QScrollArea>
#include <QVBoxLayout>
+#include <QShowEvent>
#include <pqAnimationViewWidget.h>
+#include <pqAnimationWidget.h>
#include <pqApplicationCore.h>
#include <pqComparativeVisPanel.h>
#include <pqCollaborationPanel.h>
#include <pqMemoryInspector.h>
+class ResizeHelper : public pqPVAnimationWidget
+{
+ // TEMPORARILY WORKAROUND AROUND PARAVIEW 3.14 BUG:
+ // WHEN ANIMATION VIEW IS RESIZED, ITS CONTENTS IS NOT PREPERLY RE-ARRANGED
+ // CAUSING SOME CONTROLS TO STAY NON-VISIBLE
+ // THIS BUG IS NATURALLY FIXED BY ADDING
+ // this->updateGeometries();
+ // TO THE
+ // void pqAnimationWidget::resizeEvent(QResizeEvent* e);
+ // BUT THIS CANNOT BE DONE DIRECTLY, SINCE CORRESPONDING API IS NOT PUBLIC
+ // THE ONLY WAY TO DO THIS BY SENDING SHOW EVENT TO THE WIDGET
+
+public:
+ ResizeHelper( QWidget* parent ) : pqPVAnimationWidget( parent ) {}
+protected:
+ void resizeEvent(QResizeEvent* e)
+ {
+ pqAnimationWidget* w = findChild<pqAnimationWidget*>( "pqAnimationWidget" );
+ if ( w ) {
+ QShowEvent e;
+ QApplication::sendEvent( w, &e );
+ }
+ pqPVAnimationWidget::resizeEvent( e );
+ }
+};
+
/*!
\brief Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc.
ParaView pqMainWIndowCore class is fully responsible for these dock widgets' contents.
QDockWidget* animationViewDock = new QDockWidget( tr( "TTL_ANIMATION_VIEW" ), desk );
animationViewDock->setObjectName("animationViewDock");
desk->addDockWidget( Qt::BottomDockWidgetArea, animationViewDock );
- pqPVAnimationWidget* animation_panel = new pqPVAnimationWidget(animationViewDock);
+ pqPVAnimationWidget* animation_panel = new ResizeHelper(animationViewDock); //pqPVAnimationWidget
animationViewDock->setWidget(animation_panel);
myDockWidgets[animationViewDock] = false; // hidden by default