Graphics_scene does not uses Qt

This commit is contained in:
Guillaume Damiand 2023-11-30 16:21:08 +01:00
parent b8c5b1ca27
commit 2d256951cb
2 changed files with 7 additions and 10 deletions

View File

@ -14,7 +14,6 @@
#define CGAL_GRAPHICS_SCENE_H #define CGAL_GRAPHICS_SCENE_H
// TODO #include <CGAL/license/GraphicsView.h> // TODO #include <CGAL/license/GraphicsView.h>
#include <QString>
#include <iostream> #include <iostream>
#include <map> #include <map>
@ -270,18 +269,15 @@ public:
} }
template <typename KPoint> template <typename KPoint>
void add_text(const KPoint &kp, const QString &txt) void add_text(const KPoint &kp, const std::string &txt)
{ {
Local_point p = get_local_point(kp); Local_point p = get_local_point(kp);
m_texts.push_back(std::make_tuple(p, txt)); m_texts.push_back(std::make_tuple(p, txt));
} }
template <typename KPoint> void add_text(const KPoint &kp, const char *txt)
{ add_text(kp, QString(txt)); }
template <typename KPoint> template <typename KPoint>
void add_text(const KPoint &kp, const std::string &txt) void add_text(const KPoint &kp, const char *txt)
{ add_text(kp, txt.c_str()); } { add_text(kp, std::string(txt)); }
bool empty() const bool empty() const
{ {
@ -381,7 +377,7 @@ public:
int m_texts_size() const int m_texts_size() const
{ return m_texts.size(); } { return m_texts.size(); }
const std::vector<std::tuple<Local_point, QString>>& get_m_texts() const const std::vector<std::tuple<Local_point, std::string>>& get_m_texts() const
{ return m_texts; } { return m_texts; }
public: public:
@ -428,7 +424,7 @@ protected:
Buffer_for_vao m_buffer_for_mono_faces; Buffer_for_vao m_buffer_for_mono_faces;
Buffer_for_vao m_buffer_for_colored_faces; Buffer_for_vao m_buffer_for_colored_faces;
std::vector<std::tuple<Local_point, QString>> m_texts; std::vector<std::tuple<Local_point, std::string>> m_texts;
std::vector<BufferType> arrays[LAST_INDEX]; std::vector<BufferType> arrays[LAST_INDEX];

View File

@ -598,7 +598,8 @@ public:
std::get<0>(m_texts_vec[i]).y(), std::get<0>(m_texts_vec[i]).y(),
std::get<0>(m_texts_vec[i]).z())); std::get<0>(m_texts_vec[i]).z()));
drawText((int)screenPos[0], (int)screenPos[1], std::get<1>(m_texts_vec[i])); drawText((int)screenPos[0], (int)screenPos[1],
QString(std::get<1>(m_texts_vec[i]).c_str()));
} }
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
} }