+ return getRenderViewVar() + ".ResetCamera();";
+}
+
+std::string
+MEDPresentation::getComponentSelectionCommand() const
+{
+ std::ostringstream oss, oss_l;
+ std::string ret;
+
+ if (_selectedComponentIndex != -1)
+ {
+ oss << _lutVar << ".VectorMode = 'Component';\n";
+ oss << _lutVar << ".VectorComponent = " << _selectedComponentIndex << ";";
+ }
+ else // Euclidean norm
+ {
+ oss << _lutVar << ".VectorMode = 'Magnitude';";
+ }
+ return oss.str();
+}
+
+std::string
+MEDPresentation::getColorMapCommand() const
+{
+ std::string ret;
+ switch (_colorMap) {
+ case MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW:
+ ret = _lutVar + ".ApplyPreset('Blue to Red Rainbow',True);";
+ break;
+ case MEDCALC::COLOR_MAP_COOL_TO_WARM:
+ ret = _lutVar + ".ApplyPreset('Cool to Warm',True);";
+ break;
+ default:
+ STDLOG("MEDPresentation::getColorMapCommand(): invalid colormap!");
+ throw KERNEL::createSalomeException("MEDPresentation::getColorMapCommand(): invalid colormap!");
+ }
+ return ret;
+}
+std::string
+MEDPresentation::getRescaleCommand() const
+{
+ std::string ret;
+ switch(_sbRange)
+ {
+ case MEDCALC::SCALAR_BAR_ALL_TIMESTEPS:
+ ret = _dispVar + ".RescaleTransferFunctionToDataRangeOverTime();";
+ break;
+ case MEDCALC::SCALAR_BAR_CURRENT_TIMESTEP:
+ ret = _dispVar + ".RescaleTransferFunctionToDataRange(False);";
+ break;
+ default:
+ STDLOG("MEDPresentation::getRescaleCommand(): invalid range!");
+ throw KERNEL::createSalomeException("MEDPresentation::getRescaleCommand(): invalid range!");
+ }
+ return ret;
+}
+
+int
+MEDPresentation::GeneratePythonId()
+{
+ static int INIT_ID = 0;
+ return INIT_ID++;
+}
+
+void
+MEDPresentation::activateView()
+{
+ MEDPyLockWrapper lock;
+ pushAndExecPyLine("pvs.SetActiveView(" + getRenderViewVar() + ");");
+}
+
+
+std::string
+MEDPresentation::paravisDump() const
+{
+ using namespace std;
+ ostringstream oss;
+ for (vector<string>::const_iterator it=_pythonCmds.begin(); it != _pythonCmds.end(); ++it)
+ {
+ oss << (*it);
+ oss << "\n";
+ }
+ return oss.str();
+}
+
+/**
+ * Query all available component names for the field associated with this presentation.
+ * Fills in all the corresponding string properties:
+ * - PROP_COMPONENT1
+ * - PROP_COMPONENT2
+ * etc...
+ * and the number of components.
+ */
+void
+MEDPresentation::fillAvailableFieldComponents()
+{
+ MEDPyLockWrapper lock; // GIL!
+ std::string typ;
+
+ if(_fieldType == "CELLS") {
+ typ = "CellData";
+ }
+ else if (_fieldType == "POINTS") {
+ typ = "PointData";