diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-02-24 01:19:33 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-02-24 01:19:33 (GMT) |
commit | bebc7a37344b3b831e5ff9540e85a6c389901b77 (patch) | |
tree | b00b0598aff48ddb1f6f98ed3a2de99165e65a2c | |
parent | 0f977609b40d5a6b6b5237060198e6dd97df06c5 (diff) |
finish unify camera. unify getRenderInfo. fix width on libraryinfo box.
-rw-r--r-- | src/GLView.cc | 16 | ||||
-rw-r--r-- | src/GLView.h | 17 | ||||
-rw-r--r-- | src/OffscreenView.cc | 2 | ||||
-rw-r--r-- | src/OffscreenView.h | 22 | ||||
-rw-r--r-- | src/QGLView.h | 19 | ||||
-rw-r--r-- | src/mainwin.cc | 2 | ||||
-rw-r--r-- | src/qglview.cc | 11 |
7 files changed, 15 insertions, 74 deletions
diff --git a/src/GLView.cc b/src/GLView.cc index 0c23f97..cb1f9c1 100644 --- a/src/GLView.cc +++ b/src/GLView.cc @@ -66,7 +66,6 @@ void GLView::setupOrtho(bool offset) -FAR_FAR_AWAY, +FAR_FAR_AWAY); } - /* void initializeGL(); // void resizeGL(int w, int h); // @@ -75,22 +74,7 @@ void GLView::setupOrtho(bool offset) void paintGL(); // bool save(const char *filename); // //bool save(std::ostream &output); // not implemented in qgl? - std::string getRendererInfo(); // GLint shaderinfo[11]; // -private: - Renderer *renderer;// - double w_h_ratio;// - - bool orthomode;// - bool showaxes;// - bool showfaces;// - bool showedges;// - - Eigen::Vector3d object_rot;// - Eigen::Vector3d camera_eye;// - Eigen::Vector3d camera_center;// -}; - */ diff --git a/src/GLView.h b/src/GLView.h index 32e3898..e98bfe0 100644 --- a/src/GLView.h +++ b/src/GLView.h @@ -18,7 +18,6 @@ class GLView public: GLView(); void setRenderer(Renderer* r); - virtual bool save(const char *filename) = 0; Renderer *renderer; /* void initializeGL(); // @@ -33,6 +32,8 @@ public: void setupPerspective(); void setupOrtho(bool offset=false); + virtual bool save(const char *filename) = 0; + virtual std::string getRendererInfo() const = 0; double viewer_distance;// double w_h_ratio;// @@ -49,24 +50,10 @@ public: void paintGL(); // bool save(const char *filename); // //bool save(std::ostream &output); // not implemented in qgl? - std::string getRendererInfo(); // GLint shaderinfo[11]; // */ - - -/* double w_h_ratio;// - - bool orthomode;// - bool showaxes;// - bool showfaces;// - bool showedges;// - - Eigen::Vector3d object_rot;// - Eigen::Vector3d camera_eye;// - Eigen::Vector3d camera_center;// -*/ }; #endif diff --git a/src/OffscreenView.cc b/src/OffscreenView.cc index 0604ba4..837252f 100644 --- a/src/OffscreenView.cc +++ b/src/OffscreenView.cc @@ -155,7 +155,7 @@ bool OffscreenView::save(std::ostream &output) return save_framebuffer(this->ctx, output); } -std::string OffscreenView::getRendererInfo() +std::string OffscreenView::getRendererInfo() const { std::stringstream out; diff --git a/src/OffscreenView.h b/src/OffscreenView.h index e41acf9..5842ba2 100644 --- a/src/OffscreenView.h +++ b/src/OffscreenView.h @@ -21,36 +21,16 @@ public: void initializeGL(); // void resizeGL(int w, int h); // -/* - void setGimbalCamera(const Eigen::Vector3d &pos, const Eigen::Vector3d &rot, double distance); // - void setupGimbalPerspective(); // - void setupGimbalOrtho(double distance, bool offset=false); // - - void setCamera(const Eigen::Vector3d &pos, const Eigen::Vector3d ¢er); // - void setupPerspective(); // - void setupOrtho(bool offset=false); // -*/ - void paintGL(); // bool save(const char *filename); // bool save(std::ostream &output); // not implemented in qgl? - std::string getRendererInfo(); // + std::string getRendererInfo() const; GLint shaderinfo[11]; // OffscreenContext *ctx; // not size_t width; // not size_t height; // not -/*private: - double w_h_ratio;// - bool orthomode;// - bool showaxes;// - bool showfaces;// - bool showedges;// - - Eigen::Vector3d object_rot;// - Eigen::Vector3d camera_eye;// - Eigen::Vector3d camera_center;//*/ }; #endif diff --git a/src/QGLView.h b/src/QGLView.h index ae382c2..e53a411 100644 --- a/src/QGLView.h +++ b/src/QGLView.h @@ -36,17 +36,11 @@ public: void setShowCrosshairs(bool enabled) { this->showcrosshairs = enabled; } bool orthoMode() const { return this->orthomode; } void setOrthoMode(bool enabled) { this->orthomode = enabled; } - std::string getRendererInfo() const { return this->rendererInfo; } + std::string getRendererInfo() const; bool save(const char *filename); public: QLabel *statusLabel; - -/* Eigen::Vector3d object_rot; - Eigen::Vector3d object_trans; - Eigen::Vector3d camera_eye; - Eigen::Vector3d camera_center;*/ - GLint shaderinfo[11]; #ifdef ENABLE_OPENCSG @@ -59,15 +53,7 @@ private: std::string rendererInfo; -// bool showfaces; -// bool showedges; -// bool showaxes; bool showcrosshairs; -// bool orthomode; - -// double viewer_distance; - -// double w_h_ratio; bool mouse_drag_active; QPoint last_mouse; @@ -81,13 +67,14 @@ private: void initializeGL(); void resizeGL(int w, int h); - void setGimbalCamera(const Eigen::Vector3d &pos, const Eigen::Vector3d &rot, double distance); +/* void setGimbalCamera(const Eigen::Vector3d &pos, const Eigen::Vector3d &rot, double distance); void setupGimbalPerspective(); void setupGimbalOrtho(double distance,bool offset=false); void setCamera(const Eigen::Vector3d &pos, const Eigen::Vector3d ¢er); void setupPerspective(); void setupOrtho(bool offset=false); +*/ void paintGL(); void normalizeAngle(GLdouble& angle); diff --git a/src/mainwin.cc b/src/mainwin.cc index 89e39a1..edd534f 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -1747,7 +1747,7 @@ void MainWindow::helpLibrary() if (!this->openglbox) { this->openglbox = new QMessageBox(QMessageBox::Information, - "OpenGL Info", "Detailed Library Info", + "OpenGL Info", "OpenSCAD Detailed Library Info ", QMessageBox::Ok, this); this->openglbox->setMinimumSize( QSize(400,200) ); } diff --git a/src/qglview.cc b/src/qglview.cc index f1c2cc6..f303965 100644 --- a/src/qglview.cc +++ b/src/qglview.cc @@ -137,10 +137,6 @@ void QGLView::initializeGL() fprintf(stderr, "GLEW Error: %s\n", glewGetErrorString(err)); } - std::string glewinfo = glew_dump(); - std::string glextlist = glew_extensions_dump(); - rendererInfo = glewinfo + std::string("\n") + glextlist; - const char *openscad_disable_gl20_env = getenv("OPENSCAD_DISABLE_GL20"); if (openscad_disable_gl20_env && !strcmp(openscad_disable_gl20_env, "0")) { openscad_disable_gl20_env = NULL; @@ -286,6 +282,13 @@ void QGLView::initializeGL() #endif /* ENABLE_OPENCSG */ } +std::string QGLView::getRendererInfo() const +{ + std::string glewinfo = glew_dump(); + std::string glextlist = glew_extensions_dump(); + return glewinfo + std::string("\nUsing QGLWidget\n\n") + glextlist; +} + #ifdef ENABLE_OPENCSG void QGLView::display_opencsg_warning() { |