Skip to content

Commit

Permalink
external code is under dependency namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Nov 21, 2023
1 parent e05691b commit 0a995ee
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ if (TARGET vclib-external-qt)
if (TARGET vclib-external-qglviewer)
# header only sources
list(APPEND HEADERS
include/vclib/ext/qglviewer/gl_area.h)
include/vclib/ext/qglviewer/viewer.h)

# sources that must be built
list(APPEND HEADERS_LIB
Expand Down
10 changes: 5 additions & 5 deletions include/vclib/ext/opengl2/draw_objects2.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <vclib/space/color.h>
#include <vclib/space/point.h>

namespace vcl {
namespace vcl::opengl2 {

/**
* @brief drawPoint2
Expand Down Expand Up @@ -130,7 +130,7 @@ inline void drawQuad2(
bool fill = false)
{
for (unsigned int i = 0; i < 4; i++) {
vcl::drawLine2(points[i], points[(i + 1) % 4], c, width);
drawLine2(points[i], points[(i + 1) % 4], c, width);
}
if (fill) {
// find angle >=90°
Expand All @@ -142,14 +142,14 @@ inline void drawQuad2(
pivot = i;
}
assert(pivot >= 0);
vcl::drawTriangle2(
drawTriangle2(
points[pivot],
points[(pivot + 1) % 4],
points[(pivot + 2) % 4],
c,
0,
true);
vcl::drawTriangle2(
drawTriangle2(
points[(pivot + 2) % 4],
points[(pivot + 3) % 4],
points[pivot],
Expand All @@ -172,6 +172,6 @@ inline void drawQuad2(
vcl::drawQuad2(arr, c, width, fill);
}

} // namespace vcl
} // namespace vcl::opengl2

#endif // VCL_EXT_OPENGL2_DRAW_OBJECTS2_H
10 changes: 5 additions & 5 deletions include/vclib/ext/opengl2/draw_objects3.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include <vclib/space/color.h>

namespace vcl {
namespace vcl::opengl2 {

/**
* @brief Draws a point on the plane (coord z = 0 if 3D).
Expand Down Expand Up @@ -234,9 +234,9 @@ inline void drawTriangle(
bool fill = false)
{
if (width != 0) {
vcl::drawLine3(p1, p2, c, width);
vcl::drawLine3(p2, p3, c, width);
vcl::drawLine3(p3, p1, c, width);
drawLine3(p1, p2, c, width);
drawLine3(p2, p3, c, width);
drawLine3(p3, p1, c, width);
}
if (fill) {
glBegin(GL_TRIANGLES); // Begin triangle coordinates
Expand Down Expand Up @@ -361,6 +361,6 @@ inline void drawBox3(
drawBox3(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], c, width);
}

} // namespace vcl
} // namespace vcl::opengl2

#endif // VCL_EXT_OPENGL2_DRAW_OBJECTS3_H
6 changes: 3 additions & 3 deletions include/vclib/ext/opengl2/drawable_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include "draw_objects3.h"

namespace vcl {
namespace vcl::opengl2 {

// From:
// https://blog.nobel-joergensen.com/2013/01/29/debugging-opengl-using-glgeterror/
Expand Down Expand Up @@ -181,7 +181,7 @@ class DrawableMesh : public GenericDrawableMesh
}
}
if (mrs.isBboxEnabled()) {
vcl::drawBox3(mrb.bbMin(), mrb.bbMax(), vcl::Color(0, 0, 0));
drawBox3(mrb.bbMin(), mrb.bbMax(), vcl::Color(0, 0, 0));
}
}
}
Expand Down Expand Up @@ -506,6 +506,6 @@ class DrawableMesh : public GenericDrawableMesh
}
};

} // namespace vcl
} // namespace vcl::opengl2

#endif // VCL_EXT_OPENGL2_DRAWABLE_MESH_H
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* for more details. *
****************************************************************************/

#ifndef VCL_EXT_QGLVIEWER_GL_AREA_H
#define VCL_EXT_QGLVIEWER_GL_AREA_H
#ifndef VCL_EXT_QGLVIEWER_VIEWER_H
#define VCL_EXT_QGLVIEWER_VIEWER_H

#include <memory>

Expand All @@ -32,20 +32,20 @@
#include <vclib/render/drawable_object_vector.h>
#include <vclib/space/box.h>

namespace vcl {
namespace vcl::qglviewer {

class GLArea : public QGLViewer
class Viewer : public QGLViewer
{
// this GLArea does not normally own this drawList
std::shared_ptr<DrawableObjectVector> drawList;

public:
GLArea(QWidget* parent = nullptr) : QGLViewer(parent)
Viewer(QWidget* parent = nullptr) : QGLViewer(parent)
{
drawList = std::make_shared<DrawableObjectVector>();
}

GLArea(std::shared_ptr<DrawableObjectVector> v, QWidget* parent = nullptr) :
Viewer(std::shared_ptr<DrawableObjectVector> v, QWidget* parent = nullptr) :
QGLViewer(parent), drawList(v)
{
}
Expand Down Expand Up @@ -78,8 +78,8 @@ class GLArea : public QGLViewer
Point3d sceneCenter = bb.center();
double sceneRadius = bb.diagonal() / 2;

setSceneCenter(
qglviewer::Vec(sceneCenter.x(), sceneCenter.y(), sceneCenter.z()));
setSceneCenter(::qglviewer::Vec(
sceneCenter.x(), sceneCenter.y(), sceneCenter.z()));
setSceneRadius(sceneRadius);
showEntireScene();
}
Expand Down Expand Up @@ -127,6 +127,6 @@ class GLArea : public QGLViewer
}
};

} // namespace vcl
} // namespace vcl::qglviewer

#endif // VCL_EXT_QGLVIEWER_GL_AREA_H
#endif // VCL_EXT_QGLVIEWER_VIEWER_H
4 changes: 2 additions & 2 deletions include/vclib/ext/qglviewer/viewer_main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <vclib/render/generic_drawable_mesh.h>

namespace vcl {
namespace vcl::qglviewer {

/**
* @brief ViewerMainWindow constructor.
Expand Down Expand Up @@ -185,4 +185,4 @@ void ViewerMainWindow::renderSettingsUpdated()
}
}

} // namespace vcl
} // namespace vcl::qglviewer
4 changes: 2 additions & 2 deletions include/vclib/ext/qglviewer/viewer_main_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <vclib/render/drawable_object_vector.h>

namespace vcl {
namespace vcl::qglviewer {

namespace Ui {
class ViewerMainWindow;
Expand All @@ -54,6 +54,6 @@ public slots:
std::shared_ptr<vcl::DrawableObjectVector> drawVector;
};

} // namespace vcl
} // namespace vcl::qglviewer

#endif // VCL_EXT_QGLVIEWER_VIEWER_MAIN_WINDOW_H
18 changes: 9 additions & 9 deletions include/vclib/ext/qglviewer/viewer_main_window.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>vcl::ViewerMainWindow</class>
<widget class="QMainWindow" name="vcl::ViewerMainWindow">
<class>vcl::qglviewer::ViewerMainWindow</class>
<widget class="QMainWindow" name="vcl::qglviewer::ViewerMainWindow">
<property name="geometry">
<rect>
<x>0</x>
Expand All @@ -16,7 +16,7 @@
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="vcl::GLArea" name="glArea" native="true">
<widget class="vcl::qglviewer::Viewer" name="glArea" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
Expand All @@ -41,7 +41,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="vcl::DrawableObjectVectorFrame" name="drawVectorFrame">
<widget class="vcl::qt::DrawableObjectVectorFrame" name="drawVectorFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
Expand All @@ -57,7 +57,7 @@
</widget>
</item>
<item>
<widget class="vcl::MeshRenderSettingsFrame" name="renderSettingsFrame">
<widget class="vcl::qt::MeshRenderSettingsFrame" name="renderSettingsFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -91,19 +91,19 @@
</widget>
<customwidgets>
<customwidget>
<class>vcl::GLArea</class>
<class>vcl::qglviewer::Viewer</class>
<extends>QWidget</extends>
<header>vclib/ext/qglviewer/gl_area.h</header>
<header>vclib/ext/qglviewer/viewer.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>vcl::MeshRenderSettingsFrame</class>
<class>vcl::qt::MeshRenderSettingsFrame</class>
<extends>QFrame</extends>
<header>vclib/ext/qt/gui/mesh_render_settings_frame.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>vcl::DrawableObjectVectorFrame</class>
<class>vcl::qt::DrawableObjectVectorFrame</class>
<extends>QFrame</extends>
<header>vclib/ext/qt/gui/drawable_object_vector_frame.h</header>
<container>1</container>
Expand Down
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/drawable_object_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "drawable_object_frame.h"
#include "ui_drawable_object_frame.h"

namespace vcl {
namespace vcl::qt {

DrawableObjectFrame::DrawableObjectFrame(DrawableObject* obj, QWidget* parent) :
QFrame(parent), ui(new Ui::DrawableObjectFrame), obj(obj)
Expand All @@ -46,4 +46,4 @@ void DrawableObjectFrame::on_visibilityCheckBox_stateChanged(int arg1)
emit visibilityChanged();
}

} // namespace vcl
} // namespace vcl::qt
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/drawable_object_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <vclib/render/drawable_object.h>

namespace vcl {
namespace vcl::qt {

namespace Ui {
class DrawableObjectFrame;
Expand All @@ -55,6 +55,6 @@ private slots:
DrawableObject* obj;
};

} // namespace vcl
} // namespace vcl::qt

#endif // VCL_EXT_QT_GUI_DRAWABLE_OBJECT_FRAME_H
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/drawable_object_frame.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>vcl::DrawableObjectFrame</class>
<widget class="QFrame" name="vcl::DrawableObjectFrame">
<class>vcl::qt::DrawableObjectFrame</class>
<widget class="QFrame" name="vcl::qt::DrawableObjectFrame">
<property name="geometry">
<rect>
<x>0</x>
Expand Down
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/drawable_object_vector_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <QStandardItemModel>

namespace vcl {
namespace vcl::qt {

DrawableObjectVectorFrame::DrawableObjectVectorFrame(QWidget* parent) :
QFrame(parent), ui(new Ui::DrawableObjectVectorFrame)
Expand Down Expand Up @@ -92,4 +92,4 @@ void DrawableObjectVectorFrame::updateDrawableVectorWidget()
}
}

} // namespace vcl
} // namespace vcl::qt
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/drawable_object_vector_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "drawable_object_frame.h"

namespace vcl {
namespace vcl::qt {

namespace Ui {
class DrawableObjectVectorFrame;
Expand Down Expand Up @@ -66,6 +66,6 @@ private slots:
void updateDrawableVectorWidget();
};

} // namespace vcl
} // namespace vcl::qt

#endif // VCL_EXT_QT_GUI_DRAWABLE_OBJECT_VECTOR_FRAME_H
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/drawable_object_vector_frame.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>vcl::DrawableObjectVectorFrame</class>
<widget class="QFrame" name="vcl::DrawableObjectVectorFrame">
<class>vcl::qt::DrawableObjectVectorFrame</class>
<widget class="QFrame" name="vcl::qt::DrawableObjectVectorFrame">
<property name="geometry">
<rect>
<x>0</x>
Expand Down
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/mesh_render_settings_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <QColorDialog>
#include <QStandardItemModel>

namespace vcl {
namespace vcl::qt {

MeshRenderSettingsFrame::MeshRenderSettingsFrame(QWidget* parent) :
QFrame(parent), ui(new Ui::MeshRenderSettingsFrame)
Expand Down Expand Up @@ -385,4 +385,4 @@ QColor MeshRenderSettingsFrame::getButtonBackGround(QPushButton* b)
return px.color(QPalette::Button);
}

} // namespace vcl
} // namespace vcl::qt
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/mesh_render_settings_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class QPushButton;

namespace vcl {
namespace vcl::qt {

namespace Ui {
class MeshRenderSettingsFrame;
Expand Down Expand Up @@ -97,6 +97,6 @@ private slots:
QColor getButtonBackGround(QPushButton* b);
};

} // namespace vcl
} // namespace vcl::qt

#endif // VCL_EXT_QT_GUI_MESH_RENDER_SETTINGS_FRAME_H
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/mesh_render_settings_frame.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>vcl::MeshRenderSettingsFrame</class>
<widget class="QFrame" name="vcl::MeshRenderSettingsFrame">
<class>vcl::qt::MeshRenderSettingsFrame</class>
<widget class="QFrame" name="vcl::qt::MeshRenderSettingsFrame">
<property name="geometry">
<rect>
<x>0</x>
Expand Down
4 changes: 2 additions & 2 deletions include/vclib/ext/qt/gui/q_clickable_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "q_clickable_label.h"

namespace vcl {
namespace vcl::qt {

QClickableLabel::QClickableLabel(QWidget* parent, Qt::WindowFlags) :
QLabel(parent)
Expand All @@ -39,4 +39,4 @@ void QClickableLabel::mousePressEvent(QMouseEvent*)
emit clicked();
}

} // namespace vcl
} // namespace vcl::qt
Loading

0 comments on commit 0a995ee

Please sign in to comment.