From 63f1adaf6ff45898597e763332d3c88a39861b07 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 24 Jan 2009 22:22:22 +0000 Subject: [PATCH] basic per-window visibility (to be refined...) --- Fltk/GUI.cpp | 1 - Fltk/Makefile | 52 ++++++++++++----------- Fltk/extraDialogs.cpp | 2 +- Fltk/openglWindow.cpp | 23 ++++++---- Fltk/openglWindow.h | 1 + Fltk/visibilityWindow.cpp | 88 ++++++++++++++++++++++++++++++++++++++- Fltk/visibilityWindow.h | 4 +- Graphics/drawContext.h | 19 +++++++++ Graphics/drawGeom.cpp | 2 +- Graphics/drawGraph2d.cpp | 5 ++- Graphics/drawMesh.cpp | 18 ++++---- Graphics/drawPost.cpp | 1 + Graphics/drawScales.cpp | 3 +- 13 files changed, 168 insertions(+), 51 deletions(-) diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index cecd91af21..a0530707bd 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -552,7 +552,6 @@ void GUI::updateFields() void GUI::resetVisibility() { - visibility->browser->clear(); if(visibility->win->shown()) visibility_cb(NULL, NULL); } diff --git a/Fltk/Makefile b/Fltk/Makefile index f94287216c..4dba34befb 100644 --- a/Fltk/Makefile +++ b/Fltk/Makefile @@ -116,19 +116,19 @@ graphicWindow${OBJEXT}: graphicWindow.cpp GUI.h graphicWindow.h openglWindow.h \ ../Common/Context.h ../Geo/CGNSOptions.h ../Mesh/meshPartitionOptions.h openglWindow${OBJEXT}: openglWindow.cpp openglWindow.h ../Graphics/drawContext.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h graphicWindow.h manipWindow.h \ - contextWindow.h ../Common/GmshDefines.h ../Common/GmshMessage.h \ - ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ - ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \ - ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ - ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \ - ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../Geo/MElement.h ../Geo/MVertex.h \ - ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h ../Geo/MVertex.h \ - ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \ - ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h \ - ../Common/GmshConfig.h ../Numeric/Gauss.h Draw.h ../Numeric/Numeric.h \ + contextWindow.h visibilityWindow.h ../Common/GmshConfig.h \ + ../Common/GmshDefines.h ../Common/GmshMessage.h ../Geo/GModel.h \ + ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ + ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ + ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h \ + ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h \ + ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h \ + ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/MElement.h \ + ../Geo/MVertex.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h \ + ../Geo/MVertex.h ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h \ + ../Geo/SVector3.h ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h \ + ../Numeric/Gauss.h Draw.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Numeric/GmshMatrix.h GUI.h \ ../Common/VertexArray.h ../Common/Context.h ../Geo/CGNSOptions.h \ ../Mesh/meshPartitionOptions.h @@ -219,18 +219,20 @@ statisticsWindow${OBJEXT}: statisticsWindow.cpp GUI.h Draw.h statisticsWindow.h ../Geo/CGNSOptions.h ../Mesh/meshPartitionOptions.h visibilityWindow${OBJEXT}: visibilityWindow.cpp ../Common/GmshConfig.h GUI.h \ Draw.h visibilityWindow.h paletteWindow.h contextWindow.h \ - ../Common/GmshDefines.h ../Common/GmshMessage.h ../Geo/GModel.h \ - ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \ - ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ - ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \ - ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../Geo/MElement.h ../Geo/MVertex.h \ - ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h ../Geo/MVertex.h \ - ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \ - ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h ../Numeric/Gauss.h \ + graphicWindow.h openglWindow.h ../Graphics/drawContext.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/GmshDefines.h \ + ../Common/GmshMessage.h ../Geo/GModel.h ../Geo/GVertex.h \ + ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ + ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ + ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h \ + ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h \ + ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h \ + ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/MElement.h \ + ../Geo/MVertex.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/MEdge.h \ + ../Geo/MVertex.h ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h \ + ../Geo/SVector3.h ../Numeric/FunctionSpace.h ../Numeric/GmshMatrix.h \ + ../Numeric/Gauss.h ../Post/PView.h ../Post/PViewData.h \ ../Geo/GeoStringInterface.h ../Common/ListUtils.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Context.h ../Geo/CGNSOptions.h \ ../Mesh/meshPartitionOptions.h ../Parser/Parser.h diff --git a/Fltk/extraDialogs.cpp b/Fltk/extraDialogs.cpp index 0de9c08749..c6dbfe2598 100644 --- a/Fltk/extraDialogs.cpp +++ b/Fltk/extraDialogs.cpp @@ -185,7 +185,7 @@ int model_chooser() menu->browser->clear(); for(unsigned int i = 0; i < GModel::list.size(); i++){ char tmp[256]; - sprintf(tmp, "Model %d <<%s>>", i, GModel::list[i]->getName().c_str()); + sprintf(tmp, "Model [%d] <<%s>>", i, GModel::list[i]->getName().c_str()); menu->browser->add(tmp); if(GModel::list[i] == GModel::current()) menu->browser->value(i + 1); } diff --git a/Fltk/openglWindow.cpp b/Fltk/openglWindow.cpp index f0071d57eb..ad131c710b 100644 --- a/Fltk/openglWindow.cpp +++ b/Fltk/openglWindow.cpp @@ -8,6 +8,7 @@ #include "graphicWindow.h" #include "manipWindow.h" #include "contextWindow.h" +#include "visibilityWindow.h" #include "GmshDefines.h" #include "GmshMessage.h" #include "GModel.h" @@ -231,16 +232,22 @@ void openglWindow::draw() locked = 0; } -// The event model in FLTK is pretty different from other toolkits: -// the events are passed to the widget handle of the widget that has -// the focus. If this handle returns 1, then the event is considered -// as treated, and is suppressed. If the handle returns 0, the event -// is passed to the parent. - openglWindow *openglWindow::_lastHandled = 0; +void openglWindow::_setLastHandled(openglWindow* w) +{ + _lastHandled = w; + GUI::instance()->visibility->updatePerWindow(); +} + int openglWindow::handle(int event) { + // The event model in FLTK is pretty different from other toolkits: + // the events are passed to the widget handle of the widget that has + // the focus. If this handle returns 1, then the event is considered + // as treated, and is suppressed. If the handle returns 0, the event + // is passed to the parent. + switch (event) { case FL_FOCUS: // accept the focus when I'm asked if I want it @@ -255,7 +262,7 @@ int openglWindow::handle(int event) return Fl_Gl_Window::handle(event); case FL_PUSH: - _lastHandled = this; + _setLastHandled(this); take_focus(); // force keyboard focus when we click in the window _curr.set(_ctx); if(Fl::event_button() == 1 && @@ -339,7 +346,6 @@ int openglWindow::handle(int event) return 1; case FL_RELEASE: - _lastHandled = this; _curr.set(_ctx); CTX.draw_rotation_center = 0; if(!lassoMode) { @@ -364,7 +370,6 @@ int openglWindow::handle(int event) return 1; case FL_DRAG: - _lastHandled = this; _curr.set(_ctx); { double dx = _curr.win[0] - _prev.win[0]; diff --git a/Fltk/openglWindow.h b/Fltk/openglWindow.h index 0a418efb28..63da66ae5a 100644 --- a/Fltk/openglWindow.h +++ b/Fltk/openglWindow.h @@ -45,6 +45,7 @@ class mousePosition { class openglWindow : public Fl_Gl_Window { private: static openglWindow *_lastHandled; + static void _setLastHandled(openglWindow*); mousePosition _click, _curr, _prev; drawContext *_ctx; double _point[3]; diff --git a/Fltk/visibilityWindow.cpp b/Fltk/visibilityWindow.cpp index acf5fb751d..554ec7eab4 100644 --- a/Fltk/visibilityWindow.cpp +++ b/Fltk/visibilityWindow.cpp @@ -4,6 +4,7 @@ // bugs and problems to <gmsh@geuz.org>. #include <string> +#include <sstream> #include <map> #include <vector> #include <string.h> @@ -16,10 +17,13 @@ #include "visibilityWindow.h" #include "paletteWindow.h" #include "contextWindow.h" +#include "graphicWindow.h" #include "GmshDefines.h" #include "GmshMessage.h" #include "GModel.h" #include "MElement.h" +#include "PView.h" +#include "PViewData.h" #include "GeoStringInterface.h" #include "Options.h" #include "Context.h" @@ -553,7 +557,7 @@ static void _rebuild_tree_browser(bool force) std::string s(" <<"); s += m->getName() + ">>"; if(m == GModel::current()) s += " (Active)"; - sprintf(str, "Model %d %s/", i, s.c_str()); + sprintf(str, "Model [%d] %s/", i, s.c_str()); Flu_Tree_Browser::Node *n = GUI::instance()->visibility->tree->add(str); if(m->getVisibility()) n->select(true); Flu_Tree_Browser::Node *e = n->add("Elementary entities/"); @@ -686,6 +690,7 @@ void visibility_cb(Fl_Widget *w, void *data) #if defined(HAVE_TREE_BROWSER) _rebuild_tree_browser(false); #endif + GUI::instance()->visibility->updatePerWindow(true); } static void visibility_save_cb(Fl_Widget *w, void *data) @@ -1039,6 +1044,37 @@ static void visibility_interactive_cb(Fl_Widget *w, void *data) Msg::StatusBar(3, false, ""); } +static void visibility_per_window_cb(Fl_Widget *w, void *data) +{ + std::string what = (const char*)data; + if(what == "item"){ + drawContext *ctx = GUI::instance()->getCurrentOpenglWindow()->getDrawContext(); + for(int i = 0; i < GUI::instance()->visibility->per_window->size(); i++){ + if(i < GModel::list.size()){ + GModel *m = GModel::list[i]; + if(GUI::instance()->visibility->per_window->selected(i + 1)) ctx->show(m); + else ctx->hide(m); + } + else if(i < GModel::list.size() + PView::list.size()){ + PView *v = PView::list[i - GModel::list.size()]; + if(GUI::instance()->visibility->per_window->selected(i + 1)) ctx->show(v); + else ctx->hide(v); + } + } + } + else if(what == "reset_all"){ + for(unsigned int i = 0; i < GUI::instance()->graph.size(); i++){ + for(unsigned int j = 0; j < GUI::instance()->graph[i]->gl.size(); j++){ + drawContext *ctx = GUI::instance()->graph[i]->gl[j]->getDrawContext(); + ctx->showAll(); + } + } + for(int i = 0; i < GUI::instance()->visibility->per_window->size(); i++) + GUI::instance()->visibility->per_window->select(i + 1); + } + Draw(); +} + visibilityWindow::visibilityWindow(int deltaFontSize) { FL_NORMAL_SIZE -= deltaFontSize; @@ -1141,7 +1177,6 @@ visibilityWindow::visibilityWindow(int deltaFontSize) tree->branch_icons(0, 0); tree->branch_text(FL_BLACK, FL_HELVETICA_BOLD, FL_NORMAL_SIZE - 1); tree->leaf_text(FL_BLACK, FL_HELVETICA, FL_NORMAL_SIZE - 1); - Fl_Group::current()->resizable(tree); tree->hide(); tree_create = new Fl_Button @@ -1155,6 +1190,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize) (width - 1 * BB - 2 * WB, height - 2 * BH - 3 * WB, BB, BH, "Apply"); b1->callback(visibility_tree_apply_cb); + g->resizable(tree); g->end(); } #endif @@ -1296,6 +1332,22 @@ visibilityWindow::visibilityWindow(int deltaFontSize) g->end(); } + { + Fl_Group *g = new Fl_Group + (WB, WB + BH, width - 2 * WB, height - 3 * WB - 2 * BH, "Per window"); + g->resizable(NULL); + + per_window = new Fl_Multi_Browser + (2 * WB, 2 * WB + BH, brw, height - 6 * WB - 3 * BH); + per_window->callback(visibility_per_window_cb, (void*)"item"); + + Fl_Button *b1 = new Fl_Button + (width - 1 * BB - 2 * WB, height - 2 * BH - 3 * WB, BB, BH, "Reset all"); + b1->callback(visibility_per_window_cb, (void*)"reset_all"); + + g->resizable(per_window); + g->end(); + } o->end(); win->resizable(o); @@ -1326,3 +1378,35 @@ void visibilityWindow::show(bool redrawOnly) else win->show(); } + +void visibilityWindow::updatePerWindow(bool force) +{ + static openglWindow *gl = 0; + if(!force && gl == GUI::instance()->getCurrentOpenglWindow()) return; + + gl = GUI::instance()->getCurrentOpenglWindow(); + drawContext *ctx = gl->getDrawContext(); + + per_window->clear(); + int line = 1; + + for(unsigned int i = 0; i < GModel::list.size(); i++){ + GModel *m = GModel::list[i]; + std::ostringstream sstream; + sstream << "Model [" << i << "] <<" << m->getName() << ">>"; + per_window->add(sstream.str().c_str()); + if(ctx->isVisible(m)) + per_window->select(line, 1); + line++; + } + + for(unsigned int i = 0; i < PView::list.size(); i++){ + PView *v = PView::list[i]; + std::ostringstream sstream; + sstream << "View [" << i << "] <<" << v->getData()->getName() << ">>"; + per_window->add(sstream.str().c_str()); + if(ctx->isVisible(v)) + per_window->select(line, 1); + line++; + } +} diff --git a/Fltk/visibilityWindow.h b/Fltk/visibilityWindow.h index ce80595ab4..b18b64b2e5 100644 --- a/Fltk/visibilityWindow.h +++ b/Fltk/visibilityWindow.h @@ -7,9 +7,9 @@ #define _VISIBILITY_WINDOW_H_ #include <FL/Fl_Window.H> -#include <FL/Fl_Group.H> #include <FL/Fl_Choice.H> #include <FL/Fl_Browser.H> +#include <FL/Fl_Multi_Browser.H> #include <FL/Fl_Button.H> #include <FL/Fl_Check_Button.H> #include <FL/Fl_Input.H> @@ -24,6 +24,7 @@ class visibilityWindow{ Fl_Window *win; Fl_Choice *browser_type; Fl_Browser *browser; + Fl_Multi_Browser *per_window; #if defined(HAVE_TREE_BROWSER) Flu_Tree_Browser *tree; Fl_Button *tree_create; @@ -34,6 +35,7 @@ class visibilityWindow{ public: visibilityWindow(int deltaFontSize=0); void show(bool redrawOnly); + void updatePerWindow(bool force=false); }; void visibility_cb(Fl_Widget *w, void *data); diff --git a/Graphics/drawContext.h b/Graphics/drawContext.h index 512370a1da..b3f757ea40 100644 --- a/Graphics/drawContext.h +++ b/Graphics/drawContext.h @@ -7,6 +7,7 @@ #define _DRAW_CONTEXT_H_ #include <string> +#include <set> #include <FL/gl.h> //FIXME: workaround faulty fltk installs @@ -20,6 +21,7 @@ #include "SBoundingBox3d.h" class PView; +class GModel; class drawTransform { public: @@ -70,6 +72,8 @@ class drawContext { drawTransform *_transform; GLUquadricObj *_quadric; GLuint _displayLists; + std::set<GModel*> _hiddenModels; + std::set<PView*> _hiddenViews; public: double r[3]; // current Euler angles (in degrees!) @@ -102,6 +106,21 @@ class drawContext { { if(_transform) _transform->transformTwoForm(x, y, z); } + void hide(GModel *m){ _hiddenModels.insert(m); } + void hide(PView *v){ _hiddenViews.insert(v); } + void show(GModel *m) + { + std::set<GModel*>::iterator it = _hiddenModels.find(m); + if(it != _hiddenModels.end()) _hiddenModels.erase(it); + } + void show(PView *v) + { + std::set<PView*>::iterator it = _hiddenViews.find(v); + if(it != _hiddenViews.end()) _hiddenViews.erase(it); + } + void showAll(){ _hiddenModels.clear(); _hiddenViews.clear(); } + bool isVisible(GModel *m){ return (_hiddenModels.find(m) == _hiddenModels.end()); } + bool isVisible(PView *v){ return (_hiddenViews.find(v) == _hiddenViews.end()); } void createQuadricsAndDisplayLists(); void buildRotationMatrix(); void setQuaternion(double p1x, double p1y, double p2x, double p2y); diff --git a/Graphics/drawGeom.cpp b/Graphics/drawGeom.cpp index c21c2b2941..ca7543544a 100644 --- a/Graphics/drawGeom.cpp +++ b/Graphics/drawGeom.cpp @@ -472,7 +472,7 @@ void drawContext::drawGeom() for(unsigned int i = 0; i < GModel::list.size(); i++){ GModel *m = GModel::list[i]; - if(m->getVisibility()){ + if(m->getVisibility() && isVisible(m)){ if(CTX.geom.points || CTX.geom.points_num) std::for_each(m->firstVertex(), m->lastVertex(), drawGVertex(this)); if(CTX.geom.lines || CTX.geom.lines_num || CTX.geom.tangents) diff --git a/Graphics/drawGraph2d.cpp b/Graphics/drawGraph2d.cpp index 7d19185273..1e6feaeb73 100644 --- a/Graphics/drawGraph2d.cpp +++ b/Graphics/drawGraph2d.cpp @@ -37,7 +37,7 @@ void drawContext::drawText2d() for(unsigned int i = 0; i < PView::list.size(); i++){ PViewData *data = PView::list[i]->getData(); PViewOptions *opt = PView::list[i]->getOptions(); - if(opt->Visible && opt->DrawStrings){ + if(opt->Visible && opt->DrawStrings && isVisible(PView::list[i])){ glColor4ubv((GLubyte *) & opt->color.text2d); for(int j = 0; j < data->getNumStrings2D(); j++){ double x, y, style; @@ -409,7 +409,8 @@ void drawContext::drawGraph2d() for(unsigned int i = 0; i < PView::list.size(); i++){ PViewData *data = PView::list[i]->getData(); PViewOptions *opt = PView::list[i]->getOptions(); - if(!data->getDirty() && opt->Visible && opt->Type != PViewOptions::Plot3D) + if(!data->getDirty() && opt->Visible && opt->Type != PViewOptions::Plot3D && + isVisible(PView::list[i])) graphs.push_back(PView::list[i]); } if(graphs.empty()) return; diff --git a/Graphics/drawMesh.cpp b/Graphics/drawMesh.cpp index e3ff5d6381..a250fb8f1a 100644 --- a/Graphics/drawMesh.cpp +++ b/Graphics/drawMesh.cpp @@ -968,14 +968,16 @@ void drawContext::drawMesh() if(status >= 3 && CTX.mesh.changed & ENT_VOLUME) std::for_each(m->firstRegion(), m->lastRegion(), initMeshGRegion()); } - if(status >= 0) - std::for_each(m->firstVertex(), m->lastVertex(), drawMeshGVertex(this)); - if(status >= 1) - std::for_each(m->firstEdge(), m->lastEdge(), drawMeshGEdge(this)); - if(status >= 2) - std::for_each(m->firstFace(), m->lastFace(), drawMeshGFace(this)); - if(status >= 3) - std::for_each(m->firstRegion(), m->lastRegion(), drawMeshGRegion(this)); + if(isVisible(m)){ + if(status >= 0) + std::for_each(m->firstVertex(), m->lastVertex(), drawMeshGVertex(this)); + if(status >= 1) + std::for_each(m->firstEdge(), m->lastEdge(), drawMeshGEdge(this)); + if(status >= 2) + std::for_each(m->firstFace(), m->lastFace(), drawMeshGFace(this)); + if(status >= 3) + std::for_each(m->firstRegion(), m->lastRegion(), drawMeshGRegion(this)); + } } } diff --git a/Graphics/drawPost.cpp b/Graphics/drawPost.cpp index 7b018e3d53..6def33887c 100644 --- a/Graphics/drawPost.cpp +++ b/Graphics/drawPost.cpp @@ -1373,6 +1373,7 @@ class drawPView { if(data->getDirty() || !data->getNumTimeSteps()) return; if(!opt->Visible || opt->Type != PViewOptions::Plot3D) return; + if(!_ctx->isVisible(p)) return; glPointSize(opt->PointSize); gl2psPointSize(opt->PointSize * CTX.print.eps_point_size_factor); diff --git a/Graphics/drawScales.cpp b/Graphics/drawScales.cpp index 9dd4eecbc6..3cff148e7b 100644 --- a/Graphics/drawScales.cpp +++ b/Graphics/drawScales.cpp @@ -223,7 +223,8 @@ void drawContext::drawScales() PViewData *data = PView::list[i]->getData(); PViewOptions *opt = PView::list[i]->getOptions(); if(!data->getDirty() && opt->Visible && opt->ShowScale && - opt->Type == PViewOptions::Plot3D && data->getNumElements()) + opt->Type == PViewOptions::Plot3D && data->getNumElements() && + isVisible(PView::list[i])) scales.push_back(PView::list[i]); } if(scales.empty()) return; -- GitLab