Skip to content

Commit

Permalink
fall back to Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Jan 17, 2025
1 parent 49020f9 commit 763df4b
Show file tree
Hide file tree
Showing 106 changed files with 18,058 additions and 19,375 deletions.
6 changes: 0 additions & 6 deletions 3rd_party/QGLViewer/CHANGELOG

This file was deleted.

138 changes: 95 additions & 43 deletions 3rd_party/QGLViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,48 +1,100 @@
set(PROJECT_NAME 3rd_QGLViewer)

include(../../cmake/UseQt.cmake)
include(../../cmake/UseQt5.cmake)

set(qglviewer_HEADERS
camera.h
config.h
constraint.h
domUtils.h
frame.h
ImageInterface.h
keyFrameInterpolator.h
manipulatedCameraFrame.h
manipulatedFrame.h
mouseGrabber.h
qglviewer.h
quaternion.h
vec.h
VRender/AxisAlignedBox.h
VRender/Exporter.h
VRender/gpc.h
VRender/NVector3.h
VRender/Optimizer.h
VRender/ParserGL.h
VRender/Primitive.h
VRender/PrimitivePositioning.h
VRender/SortMethod.h
VRender/Types.h
VRender/Vector2.h
VRender/Vector3.h
VRender/VRender.h
)

set(qglviewer_SOURCES
camera.cpp
constraint.cpp
frame.cpp
ImageInterface.cpp
keyFrameInterpolator.cpp
manipulatedCameraFrame.cpp
manipulatedFrame.cpp
mouseGrabber.cpp
qglviewer.cpp
quaternion.cpp
saveSnapshot.cpp
vec.cpp
VRender/BackFaceCullingOptimizer.cpp
VRender/BSPSortMethod.cpp
VRender/EPSExporter.cpp
VRender/Exporter.cpp
VRender/FIGExporter.cpp
VRender/gpc.cpp
VRender/NVector3.cpp
VRender/ParserGL.cpp
VRender/Primitive.cpp
VRender/PrimitivePositioning.cpp
VRender/TopologicalSortMethod.cpp
VRender/Vector2.cpp
VRender/Vector3.cpp
VRender/VisibilityOptimizer.cpp
VRender/VRender.cpp
)


add_library(${PROJECT_NAME} SHARED ${qglviewer_SOURCES} ${qglviewer_HEADERS})
set_target_properties(${PROJECT_NAME} PROPERTIES
FOLDER "3rd_party")


target_include_directories(${PROJECT_NAME} PRIVATE
${POLYFIT_qglviewer_DIR}/shared
${POLYFIT_qglviewer_DIR}/bfp
${POLYFIT_qglviewer_DIR}/bfp/bfp_LUSOL
${POLYFIT_qglviewer_DIR}/bfp/bfp_LUSOL/LUSOL
${POLYFIT_qglviewer_DIR}/colamd
)


if (MSVC)
target_compile_definitions(${PROJECT_NAME} PRIVATE
_CRT_SECURE_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
CREATE_QGLVIEWER_DLL
)
endif()


target_link_libraries( ${PROJECT_NAME} Qt5::Core )
target_link_libraries( ${PROJECT_NAME} Qt5::Gui )
target_link_libraries( ${PROJECT_NAME} Qt5::Widgets )
target_link_libraries( ${PROJECT_NAME} Qt5::OpenGL )
target_link_libraries( ${PROJECT_NAME} Qt5::Xml )


set (OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
message(STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}")
target_link_libraries( ${PROJECT_NAME} ${OPENGL_LIBRARIES} )

# QGLViewer target.
set(QGLViewer_SRC
"QGLViewer/VRender/BackFaceCullingOptimizer.cpp"
"QGLViewer/VRender/BSPSortMethod.cpp"
"QGLViewer/VRender/EPSExporter.cpp"
"QGLViewer/VRender/Exporter.cpp"
"QGLViewer/VRender/FIGExporter.cpp"
"QGLViewer/VRender/gpc.cpp"
"QGLViewer/VRender/NVector3.cpp"
"QGLViewer/VRender/ParserGL.cpp"
"QGLViewer/VRender/Primitive.cpp"
"QGLViewer/VRender/PrimitivePositioning.cpp"
"QGLViewer/VRender/TopologicalSortMethod.cpp"
"QGLViewer/VRender/Vector2.cpp"
"QGLViewer/VRender/Vector3.cpp"
"QGLViewer/VRender/VisibilityOptimizer.cpp"
"QGLViewer/VRender/VRender.cpp"
"QGLViewer/camera.cpp"
"QGLViewer/constraint.cpp"
"QGLViewer/frame.cpp"
"QGLViewer/keyFrameInterpolator.cpp"
"QGLViewer/manipulatedCameraFrame.cpp"
"QGLViewer/manipulatedFrame.cpp"
"QGLViewer/mouseGrabber.cpp"
"QGLViewer/qglviewer.cpp"
"QGLViewer/quaternion.cpp"
"QGLViewer/saveSnapshot.cpp"
"QGLViewer/vec.cpp")

add_library(${PROJECT_NAME} STATIC ${QGLViewer_SRC})
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "3rd_party")

target_include_directories(${PROJECT_NAME} PRIVATE ${POLYFIT_INCLUDE_DIR})
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${PROJECT_NAME} PUBLIC ${QtLibs} OpenGL::GL OpenGL::GLU)

target_compile_definitions(${PROJECT_NAME} PUBLIC QGLVIEWER_STATIC)

# get a clean windows
if (WIN32 OR MSVC)
target_compile_definitions(${PROJECT_NAME} PUBLIC NOMINMAX)
endif()
set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER "3rd_party")
47 changes: 47 additions & 0 deletions 3rd_party/QGLViewer/ImageInterface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/****************************************************************************
Copyright (C) 2002-2013 Gilles Debunne. All rights reserved.
This file is part of the QGLViewer library version 2.4.0.
http://www.libqglviewer.com - [email protected]
This file may be used under the terms of the GNU General Public License
versions 2.0 or 3.0 as published by the Free Software Foundation and
appearing in the LICENSE file included in the packaging of this file.
In addition, as a special exception, Gilles Debunne gives you certain
additional rights, described in the file GPL_EXCEPTION in this package.
libQGLViewer uses dual licensing. Commercial/proprietary software must
purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*****************************************************************************/

#include "qglviewer.h"
#include "ImageInterface.h"


ImageInterface::ImageInterface(QWidget *parent)
: QDialog(parent), scale_(1)
{
setupUi(this);
imgScale->setValue(scale_);
viewer_ = dynamic_cast<QGLViewer*>(parent);

imgHeight->setValue(viewer_->height() * scale_);
imgWidth->setValue(viewer_->width() * scale_);

connect(imgScale, SIGNAL(valueChanged(int)), this, SLOT(scaleChanged(int)));
}

void ImageInterface::scaleChanged(int s) {
scale_ = s;
int h = viewer_->height() * scale_;
int w = viewer_->width() * scale_;

imgHeight->setValue(h);
imgWidth->setValue(w);
}
46 changes: 46 additions & 0 deletions 3rd_party/QGLViewer/ImageInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/****************************************************************************
Copyright (C) 2002-2013 Gilles Debunne. All rights reserved.
This file is part of the QGLViewer library version 2.4.0.
http://www.libqglviewer.com - [email protected]
This file may be used under the terms of the GNU General Public License
versions 2.0 or 3.0 as published by the Free Software Foundation and
appearing in the LICENSE file included in the packaging of this file.
In addition, as a special exception, Gilles Debunne gives you certain
additional rights, described in the file GPL_EXCEPTION in this package.
libQGLViewer uses dual licensing. Commercial/proprietary software must
purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*****************************************************************************/

#ifndef _SAVE_SNAPSHOT_H_
#define _SAVE_SNAPSHOT_H_

#include "qglviewer.h"
#include "ui_ImageInterface.h"


class QGLVIEWER_EXPORT ImageInterface: public QDialog, public Ui::ImageInterface
{
Q_OBJECT
public:
ImageInterface(QWidget *parent) ;

private Q_SLOTS:
void scaleChanged(int s);

private:
QGLViewer* viewer_;

int scale_;
};

#endif

Loading

0 comments on commit 763df4b

Please sign in to comment.