Commit 7693a255 authored by Sylvain Thery's avatar Sylvain Thery

add color choice of BB (python only)

parent c9c01aed
......@@ -2,4 +2,5 @@
CMakeLists.txt.user
bin/
ThirdParty/bin/
SCHNApps/bin
\ No newline at end of file
SCHNApps/bin/
windows_dependencies/
......@@ -106,6 +106,12 @@ public slots:
*/
bool isBBshown() const;
/**
* @brief [PYTHON] set color for drawing BB the bounding-box
* @param color color name (red,green,...) or color format #rrggbb
*/
void setBBColor(const QString& color);
/**
* @brief [PYTHON] choose the vertex attribute used to compute the bounding-box
* @param name name of attribute
......@@ -385,6 +391,7 @@ protected:
AttributeMultiVectorGen* m_bbVertexAttribute;
float m_bbDiagSize;
Utils::Drawer* m_bbDrawer;
glm::vec3 m_bbColor;
Algo::Render::GL2::MapRender* m_render;
Algo::Render::GL2::TopoRender* m_topoRender;
......
......@@ -157,7 +157,7 @@ void MapHandler<PFP>::updateBBDrawer()
bbmax += Geom::Vec3f(shift, shift, shift);
m_bbDrawer->newList(GL_COMPILE);
m_bbDrawer->color3f(0.0f, 1.0f, 0.0f);
m_bbDrawer->color3f(m_bbColor[0], m_bbColor[1], m_bbColor[2]);
m_bbDrawer->lineWidth(2.0f);
// m_bbDrawer->lineWidth(shift);
m_bbDrawer->begin(GL_LINE_LOOP);
......
......@@ -316,10 +316,29 @@ public slots:
void showHidePluginDock();
void showHidePythonDock();
/**
* @brief [PYTHON] set if control dock is floating or docked
* @param 1: floating / 0: docked
*/
void setFloatingControlDock(bool f);
/**
* @brief [PYTHON] set if plugin dock is floating or docked
* @param 1: floating / 0: docked
*/
void setFloatingPluginDock(bool f);
/**
* @brief [PYTHON] set if python dock is floating or docked
* @param 1: floating / 0: docked
*/
void setFloatingPythonDock(bool f);
/**
* @brief [PYTHON] Load a python script store in a file.
* @param fileName the filename with absolute path or relative to path set with setPythonPath
* #return true if reading file ok
* @return true if reading file ok
*/
bool loadPythonScriptFromFile(const QString& fileName);
......
......@@ -16,6 +16,7 @@ MapHandlerGen::MapHandlerGen(const QString& name, SCHNApps* s, GenericMap* map)
m_transfoMatrixInv(1.0f),
m_bbVertexAttribute(NULL),
m_bbDrawer(NULL),
m_bbColor(0,1,0),
m_render(NULL),
m_topoRender(NULL)
{
......@@ -108,6 +109,16 @@ bool MapHandlerGen::isBBshown() const
return m_showBB;
}
void MapHandlerGen::setBBColor(const QString& color)
{
QColor col(color);
m_bbColor[0] = col.redF();
m_bbColor[1] = col.greenF();
m_bbColor[2] = col.blueF();
updateBB();
}
void MapHandlerGen::setBBVertexAttribute(const QString& name)
{
m_bbVertexAttribute = m_map->getAttributeVectorGen(VERTEX, name.toStdString());
......
......@@ -1000,6 +1000,22 @@ void SCHNApps::showHidePythonDock()
}
void SCHNApps::setFloatingControlDock(bool f)
{
m_controlDock->setFloating(f);
}
void SCHNApps::setFloatingPluginDock(bool f)
{
m_pluginDock->setFloating(f);
}
void SCHNApps::setFloatingPythonDock(bool f)
{
if (m_pythonDock->isVisible())
m_pythonDock->setFloating(f);
}
void SCHNApps::execPythonCmd(const QString& cmd)
{
......@@ -1090,6 +1106,11 @@ void SCHNApps::pyRecording()
//windows
out << "schnapps.setWindowSize(" << this->width() << ", "<< this->height() << ")" << endl;
// docks
out << "schnapps.setFloatingControlDock(" << m_controlDock->isFloating() << ")" << endl;
out << "schnapps.setFloatingPluginDock(" << m_pluginDock->isFloating() << ")" << endl;
out << "schnapps.setFloatingPythonDock(" << m_pythonDock->isFloating() << ")" << endl;
m_pyRecFile->close();
delete m_pyRecording;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment