#include "MEDPresentationSlices.hxx"
#include "MEDPresentationPointSprite.hxx"
#include "MEDPresentationVectorField.hxx"
-//#include "MEDPresentationDeflectionShape.hxx"
+#include "MEDPresentationDeflectionShape.hxx"
#include "MEDWidgetHelperMeshView.hxx"
#include "MEDWidgetHelperScalarMap.hxx"
#include "MEDWidgetHelperSlices.hxx"
#include "MEDWidgetHelperPointSprite.hxx"
#include "MEDWidgetHelperVectorField.hxx"
-//#include "MEDWidgetHelperDeflectionShape.hxx"
+#include "MEDWidgetHelperDeflectionShape.hxx"
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
label = tr("LAB_DELETE_PRESENTATION");
tooltip = tr("TIP_DELETE_PRESENTATION");
- icon = tr(_getIconName("ICO_DELETE_PRESENTATION").c_str());
+ icon = tr("ICO_DELETE_PRESENTATION");
actionId = _salomeModule->createStandardAction(label,this, SLOT(onDeletePresentation()),icon,tooltip);
// _salomeModule->createTool(actionId, presentationToolbarId);
// _salomeModule->action(actionId)->setIconVisibleInMenu(true);
_salomeModule->createMenu(actionId, presentationMenuId);
- //
- // Actions for popup menu only
- //
// Low level PARAVIS dump
label = tr("LAB_PARAVIS_DUMP");
- //icon = tr("ICO_DATASOURCE_EXPAND_FIELD");
+ tooltip = tr("TIP_PARAVIS_DUMP");
actionId = _salomeModule->createStandardAction(label,this,SLOT(onParavisDump()),"");
- _salomeModule->addActionInPopupMenu(actionId);
+ _salomeModule->createMenu(actionId, presentationMenuId);
+ //
+ // Actions for popup menu only
+ //
}
QString scalarBarRange = getScalarBarRangePython();
MEDCALC::FieldHandler* fieldHandler = event->fieldHandler;
QStringList commands;
+
+ // [ABN] using event mechanism for all this is awkward? TODO: direct implementation in each
+ // dedicated widget helper class?
+
if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_MESH_VIEW ) {
commands += QString("presentation_id = medcalc.MakeMeshView(accessField(%1), viewMode=%2)").arg(fieldHandler->id).arg(viewMode);
commands += QString("presentation_id");
.arg(fieldHandler->id).arg(viewMode).arg(scalarBarRange).arg(colorMap);
commands += QString("presentation_id");
}
+ else if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_DEFLECTION_SHAPE ) {
+ commands += QString("presentation_id = medcalc.MakeDeflectionShape(accessField(%1), viewMode=%2, scalarBarRange=%3, colorMap=%4)")
+ .arg(fieldHandler->id).arg(viewMode).arg(scalarBarRange).arg(colorMap);
+ commands += QString("presentation_id");
+ }
- // else if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_DEFLECTION_SHAPE ) {
- // commands += QString("presentation_id = medcalc.MakeDeflectionShape(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
- // commands += QString("presentation_id");
- // [ABN] using event mechanism for this is awkward? TODO: direct implementation in each
- // dedicated widget helper class?
else if ( event->eventtype == PresentationEvent::EVENT_CHANGE_COMPONENT ) {
std::string typ = getPresTypeFromWidgetHelper(event->presentationId);
commands += QString("params = medcalc.Get%1Parameters(%2)").arg(QString::fromStdString(typ)).arg(event->presentationId);
wh = new MEDWidgetHelperVectorField(this, _presManager, presId, name, _widgetPresentationParameters);
else if (type == MEDPresentationPointSprite::TYPE_NAME)
wh = new MEDWidgetHelperPointSprite(this, _presManager, presId, name, _widgetPresentationParameters);
+ else if (type == MEDPresentationDeflectionShape::TYPE_NAME)
+ wh = new MEDWidgetHelperDeflectionShape(this, _presManager, presId, name, _widgetPresentationParameters);
else
{
const char * msg ="findOrCreateWidgetHelper(): NOT IMPLEMENTED !!!";
continue;
std::string dump(_presManager->getParavisDump(presId));
- std::cerr << "#====== ParaVis dump =============== " << std::endl;
+ std::cerr << "#====== ParaVis dump (presentation " << presId << ") =====" << std::endl;
std::cerr << dump;
- std::cerr << "#====== End of ParaVis dump ======== " << std::endl;
+ std::cerr << "#====== End of ParaVis dump =============== " << std::endl;
break; // stop at the first one
}
STDLOG("Removing pres " << (*lstModule)[i] << " from OB.");
// Presentation in module but not in manager anymore: to be deleted from OB:
updateTreeViewForPresentationRemoval((*lstModule)[i]);
+ onPresentationSelected(-1, "", ""); // make sure param widget is hidden
}
}
}
else if ( event->type == MEDCALC::EVENT_REMOVE_PRESENTATION ) {
updateTreeViewForPresentationRemoval(event->presentationId);
+ // Hide parameter widget if necessary:
+ onPresentationSelected(-1, "", "");
}
else if ( event->type == MEDCALC::EVENT_MODIFY_PRESENTATION ) {
// Update parameter widget if shown: