diff --git a/bazaar/GLCanvas/GLCanvas.cpp b/bazaar/GLCanvas/GLCanvas.cpp index ac5f644a6..eaf16ac41 100644 --- a/bazaar/GLCanvas/GLCanvas.cpp +++ b/bazaar/GLCanvas/GLCanvas.cpp @@ -63,6 +63,10 @@ bool GLCanvas::Key(dword key, int ) { } void GLCanvas::ZoomToFit() { + if (env == nullptr) { + Exclamation(t_("No model is loaded")); + return; + } double mx = max(max(env->maxX, env->maxY), env->maxZ); SetZoomDistance(2*mx); Refresh(); @@ -395,18 +399,8 @@ void GLCanvas::PaintSurface0(const Vector &nodes, const Vector & } } -void GLCanvas::PaintSurface(const Surface &surf, const Color &linCol, - bool showMesh, bool showNormals, bool showWaterLevel, bool showSkewed, bool showFissure, bool showMultiPan) { +void GLCanvas::PaintSurface(const Surface &surf, const Color &linCol, bool showMesh, bool showNormals) { PaintSurface0(surf.nodes, surf.panels, showMesh, showNormals, surf.avgFacetSideLen, linCol); - - if (showSkewed) - PaintSegments(surf.skewed, LtRed()); - if (showFissure) - PaintSegments(surf.segTo1panel, LtRed()); - if (showWaterLevel) - PaintSegments(surf.segWaterlevel, LtBlue()); - if (showMultiPan) - PaintSegments(surf.segTo3panel, Black()); } } diff --git a/bazaar/GLCanvas/GLCanvas.h b/bazaar/GLCanvas/GLCanvas.h index 74f2bdca1..6281a0aa8 100644 --- a/bazaar/GLCanvas/GLCanvas.h +++ b/bazaar/GLCanvas/GLCanvas.h @@ -23,7 +23,7 @@ private: int buttonContext; void ExportViewAsImage(); - VolumeEnvelope *env = 0; + VolumeEnvelope *env = nullptr; String defaultFileName; int jpgQuality = 90; @@ -56,7 +56,7 @@ public: void PaintLine(const Segment3D &p, const Color &color); void PaintQuad(const Point3D &p0, const Point3D &p1, const Point3D &p2, const Point3D &p3, const Color &color, double alpha = 1); void PaintCuboid(const Point3D &p0, const Point3D &p1, const Color &color); - void PaintSurface(const Surface &surf, const Color &linCol, bool showMesh, bool showNormals, bool showWaterLevel, bool showSkewed, bool showFissure, bool showMultiPan); + void PaintSurface(const Surface &surf, const Color &linCol, bool showMesh, bool showNormals); void PaintSegments(const Vector& segs, const Color &color); void PaintAxis(double x, double y, double z, double len); void PaintAxis(const Point3D &p, double len); diff --git a/bazaar/GLCanvas/GLCanvas.upp b/bazaar/GLCanvas/GLCanvas.upp index 391144df6..36e0eb638 100644 --- a/bazaar/GLCanvas/GLCanvas.upp +++ b/bazaar/GLCanvas/GLCanvas.upp @@ -1,8 +1,10 @@ -description "A basic canvas for OpenGL drawings\377B255,170,0"; +description "A basic canvas for OpenGL primitives\377B255,170,0"; uses GLCtrl, - Surface; + Surface, + plugin/jpg, + PdfDraw; file GLCanvas.cpp,