public:
typedef ::CORBA::Long TypeID;
+ virtual void initFieldMeshInfos();
+
virtual ~MEDPresentation();
static const std::string PROP_NAME; // name of the presentation
virtual void setIntProperty(const std::string& propName, const int propValue);
int getIntProperty(const std::string& propName) const;
- void activateView(); // non const because generates a Python trace
+ // returns True if the view was still alive, False if it must have been recreated
+ // because the user closed it.
+ bool activateView();
+ virtual void recreateViewSetup();
void dumpIntProperties() const;
void dumpStringProperties() const;
typedef std::pair<int, PyObject *> PyObjectId;
static int GeneratePythonId();
- MEDPresentation(MEDPresentation::TypeID fieldHandlerId, const std::string& name,
+ MEDPresentation(MEDPresentation::TypeID handlerId, const std::string& name,
const MEDCALC::ViewModeType viewMode,
const MEDCALC::ColorMapType colorMap,
const MEDCALC::ScalarBarRangeType sbRange);
void createSource();
void selectFieldComponent();
void showObject();
- void colorBy(const std::string & fieldType);
+ void colorBy();
void showScalarBar();
void rescaleTransferFunction();
void selectColorMap();
virtual void internalGeneratePipeline();
PyObject* getPythonObjectFromMain(const char* var) const;
-// void pushPyObjects(PyObjectId obj, PyObjectId disp);
void execPyLine(const std::string & lin);
void pushAndExecPyLine(const std::string & lin);
- MEDPresentation::TypeID getID() const { return _fieldHandlerId; }
+ MEDPresentation::TypeID getID() const { return _handlerId; }
void fillAvailableFieldComponents();
void applyCellToPointIfNeeded();
- void convertTo3DVectorField();
-// double computeCellAverageSize();
- //void computeFieldRange
-
-// virtual MEDCALC::ViewModeType getViewMode() = 0;
+ void extractFileName(const std::string& name);
+// void convertTo3DVectorField();
template<typename PresentationType, typename PresentationParameters>
void updateComponent(const std::string& newCompo);
void setParameters(const PresentationParameters& params);
private:
- std::string getFieldTypeString(MEDCoupling::TypeOfField fieldType) const;
+ std::string getPVFieldTypeString(MEDCoupling::TypeOfField fieldType) const;
// The following functions are reserved to friend class MEDPresentationManager
void generatePipeline();
std::string _meshName;
std::string _fileName;
std::string _fieldName;
- std::string _fieldType;
- MEDPresentation::TypeID _fieldHandlerId;
+ ///! MEDCoupling field type (ON_NODES, ON_CELLS, ON_GAUSS_PT, ON_GAUSS_NE
+ MEDCoupling::TypeOfField _mcFieldType;
+ ///! ParaView field type: "CELLS" or "POINTS"
+ std::string _pvFieldType;
+ ///! ParaView field type: "CELLS" or "POINTS" used in the ColorBy method. Not necessarily equal to _pvFieldType.
+ std::string _colorByType;
+
+ MEDPresentation::TypeID _handlerId; // either a field or a mesh id (a field ID though, most of the time)
int _selectedComponentIndex;
MEDCALC::ViewModeType _viewMode;
std::string _rangeVar;
private:
- ///! Pipeline elements
-// std::vector<PyObjectId> _pipeline;
-
- ///! Corresponding display object, if any:
-// std::vector<PyObjectId> _display;
-
///! Presentation properties <key,value>
std::map<std::string, std::string> _propertiesStr;
std::map<std::string, int> _propertiesInt;