# User options
# ============
OPTION(SALOME_CURVEPLOT_STANDALONE "Standalone installation of CURVEPLOT" OFF)
-OPTION(SALOME_BUILD_DOC "Generate SALOME CURVEPLOT documentation" OFF)
+OPTION(SALOME_BUILD_DOC "Generate SALOME CURVEPLOT documentation" ON)
OPTION(SALOME_BUILD_TESTS "Generate SALOME CURVEPLOT tests" ON)
# Common CMake macros
# Directories
# ===========
+message(STATUS "*********************************************************************************************************")
+message(STATUS "------- CURVE PLOT : SALOME_INSTALL_PYTHON=${SALOME_INSTALL_PYTHON}")
+message(STATUS "------- CURVE PLOT : SALOME_INSTALL_SCRIPT_PYTHON=${SALOME_INSTALL_SCRIPT_PYTHON}")
+message(STATUS "------- CURVE PLOT : SALOME_CURVEPLOT_INSTALL_PYTHON=${SALOME_CURVEPLOT_INSTALL_PYTHON}")
+message(STATUS "------- CURVE PLOT : SALOME_CURVEPLOT_INSTALL_SCRIPT_PYTHON=${SALOME_CURVEPLOT_INSTALL_SCRIPT_PYTHON}")
+message(STATUS "*********************************************************************************************************")
+
IF(SALOME_CURVEPLOT_STANDALONE)
SET(SALOME_INSTALL_LIBS lib/salome CACHE PATH "Install path: SALOME libs")
SET(_pydir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
# --- options ---
# additional include directories
+
+MESSAGE(STATUS "*======================================================================*")
+MESSAGE(STATUS "VARIABLE PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}")
+MESSAGE(STATUS "VARIABLE NUMPY_INCLUDE_DIRS = ${NUMPY_INCLUDE_DIRS}")
+MESSAGE(STATUS "VARIABLE GUI_INCLUDE_DIRS = ${GUI_INCLUDE_DIRS}")
+MESSAGE(STATUS "VARIABLE PYTHON_DEFINITIONS = ${PYTHON_DEFINITIONS}")
+MESSAGE(STATUS "VARIABLE PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
+MESSAGE(STATUS "VARIABLE GUI_PyInterp = ${GUI_PyInterp}")
+
+MESSAGE(STATUS "*======================================================================*")
+
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_DIRS}
${NUMPY_INCLUDE_DIR}
code = std::string("import curveplot;")+
std::string("__cont=curveplot.PlotController.GetInstance()");
+ PyRun_SimpleString("import site\n");
+ PyRun_SimpleString("print(site.getsitepackages())\n");
+
int ret = PyRun_SimpleString(const_cast<char*>(code.c_str()));
if (ret == -1)
throw Exception("CurvePlot::CurvePlot(): Unable to load curveplot Python module!");
PyRun_SimpleString("import threading\n");
+ std::cout << " > Inside initPython() - inside condition" << std::endl;
+
+ // PyRun_SimpleString("import site\n");
+ // PyRun_SimpleString("print(site.getsitepackages())\n");
+
PyThreadState *pts = PyGILState_GetThisThreadState();
PyEval_ReleaseThread(pts);
+
}
+ std::cout << " > Inside initPython()" << std::endl;
+
}
/* Little hack to gather widgets created on the Python side */
mw.show();
initPython(); // mimic SALOME Python's initialisation.
+ std::cout << " > initPython() done" << std::endl;
+
+
InitializeCurvePlot();
+ std::cout << " > InitializeCurvePlot() done" << std::endl;
{
// Make sure the first instanciation of CurvePlot is made in test mode!
SALOME_INSTALL_SCRIPTS("${_all_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}/tests)
SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/mockup/SalomePyQt_MockUp.py ${SALOME_INSTALL_SCRIPT_PYTHON}/tests)
+SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/mockup/SalomePyQt_MockUp.py ${SALOME_CURVEPLOT_INSTALL_PYTHON})
+
INSTALL(DIRECTORY baselines DESTINATION ${SALOME_INSTALL_SCRIPT_PYTHON}/tests)
def setAlpha(self, opacity):
m = self._model
- # Check si BarModel ou CurveModel
+ # Check si BarModel ou CurveModel00
if (m._name == "BarModel"):
- bar = self._mplBars
- bar.set_alpha(opacity)
+ for rect in self._mplBars:
+ rect.set_alpha(opacity)
else:
lin = self._mplLines[0]
lin.set_alpha(opacity)
a = event.artist
Logger.Debug(" > Artist picked : {}".format(a))
- for crv_id, legHandler in enumerate(self._legend.legendHandles):
- if legHandler is a :
- selected_id = crv_id
- Logger.Debug("Legend {} selected".format(selected_id))
+ if self._legend is not None:
+ for leg_idx,legHandler in enumerate(self._legend.legendHandles):
+ if legHandler is a :
+ selected_id = leg_idx
+ Logger.Debug("Legend {} selected".format(selected_id))
+ # if legHandler is a:
+ # Logger.Debug(" ---> Picked artist : {}, adress : {}".format(legHandler, id(legHandler)))
+ # for crv_id, cv in list(self._curveViews.items()):
+ # if (cv._model._name == "BarModel") :
+ # if legHandler in cv._mplBars:
+ # selected_id = crv_id
+ # Logger.Debug("Barplot {} selected".format(selected_id))
for crv_id, cv in list(self._curveViews.items()):
if (cv._model._name == "BarModel") :