disclaimer

This commit is contained in:
Paul Leroy
2024-05-14 16:49:07 +02:00
parent f4e94a02e6
commit 1f11e291b6
8 changed files with 240 additions and 1 deletions
+56 -1
View File
@@ -10,7 +10,9 @@ if ( PLUGIN_G3POINT )
project( G3PointPlugin )
AddPlugin( NAME ${PROJECT_NAME} )
set(QG3POINT_PLUGIN_VERSION "0.1")
add_subdirectory( include )
add_subdirectory( src )
add_subdirectory( ui )
@@ -31,4 +33,57 @@ if ( PLUGIN_G3POINT )
set( OPENCV_DEP_DLL_FILES ${Open3D_DIR}/../bin/Open3D.dll )
copy_files( "${OPENCV_DEP_DLL_FILES}" "${CLOUDCOMPARE_DEST_FOLDER}" ) #mind the quotes!
#================
# git commit hash
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH_G3POINT
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get the latest commit hash
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH_G3POINT
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get the latest commit hash
execute_process(
COMMAND git describe
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG_G3POINT
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH_CC
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get the latest commit hash
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH_CC
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(${PROJECT_NAME} " " GIT_BRANCH_G3POINT " " ${GIT_BRANCH_G3POINT})
message(${PROJECT_NAME} " " GIT_COMMIT_HASH_G3POINT " " ${GIT_COMMIT_HASH_G3POINT})
message(${PROJECT_NAME} " " GIT_TAG_G3POINT " " ${GIT_TAG_G3POINT})
message(${PROJECT_NAME} " " GIT_BRANCH_CC " " ${GIT_BRANCH_CC})
message(${PROJECT_NAME} " " GIT_COMMIT_HASH_CC " " ${GIT_COMMIT_HASH_CC})
message(${PROJECT_NAME} " " QG3POINT_VERSION " " ${QG3POINT_PLUGIN_VERSION})
target_compile_definitions(${PROJECT_NAME} PRIVATE
GIT_BRANCH_CC="${GIT_BRANCH_CC}"
GIT_COMMMIT_HASH_CC="${GIT_COMMIT_HASH_CC}"
PUBLIC GIT_BRANCH_G3POINT="${GIT_BRANCH_G3POINT}"
GIT_COMMMIT_HASH_G3POINT="${GIT_COMMIT_HASH_G3POINT}"
GIT_TAG_G3POINT="${GIT_TAG_G3POINT}"
G3POINT_VERSION="${QG3POINT_PLUGIN_VERSION}"
)
endif()
+1
View File
@@ -5,6 +5,7 @@ target_sources( ${PROJECT_NAME}
${CMAKE_CURRENT_LIST_DIR}/G3Point.h
${CMAKE_CURRENT_LIST_DIR}/G3PointDialog.h
${CMAKE_CURRENT_LIST_DIR}/GrainsAsEllipsoids.h
${CMAKE_CURRENT_LIST_DIR}/qG3PointDisclaimer.h
)
target_include_directories( ${PROJECT_NAME}
+29
View File
@@ -0,0 +1,29 @@
#ifndef QG3POINTDISCLAIMER_H
#define QG3POINTDISCLAIMER_H
#include <QDialog>
class ccMainAppInterface;
namespace Ui {
class G3PointDisclaimer;
}
class qG3PointDisclaimer : public QDialog
{
Q_OBJECT
public:
explicit qG3PointDisclaimer(QWidget *parent = nullptr);
~qG3PointDisclaimer();
static bool show(ccMainAppInterface* app);
private:
//whether disclaimer has already been displayed (and accepted) or not
static bool s_disclaimerAccepted;
Ui::G3PointDisclaimer *ui;
};
#endif // QG3POINTDISCLAIMER_H
+6
View File
@@ -37,6 +37,8 @@
#include <ccPointCloud.h>
#include <qG3PointDisclaimer.h>
namespace G3Point
{
G3PointAction* G3PointAction::s_g3PointAction = nullptr;
@@ -61,6 +63,10 @@ G3PointAction::~G3PointAction()
void G3PointAction::GetG3PointAction(ccPointCloud *cloud, ccMainAppInterface *app)
{
//disclaimer accepted?
if (!qG3PointDisclaimer::show(app))
return;
if (!s_g3PointAction) // create the singleton if needed
{
s_g3PointAction = new G3PointAction(cloud, app);
+1
View File
@@ -5,4 +5,5 @@ target_sources( ${PROJECT_NAME}
${CMAKE_CURRENT_LIST_DIR}/G3Point.cpp
${CMAKE_CURRENT_LIST_DIR}/G3PointDialog.cpp
${CMAKE_CURRENT_LIST_DIR}/GrainsAsEllipsoids.cpp
${CMAKE_CURRENT_LIST_DIR}/qG3PointDisclaimer.cpp
)
+51
View File
@@ -0,0 +1,51 @@
#include "qG3PointDisclaimer.h"
#include "ui_qG3PointDisclaimer.h"
//qCC_plugins
#include <ccMainAppInterface.h>
//Qt
#include <QMainWindow>
bool qG3PointDisclaimer::s_disclaimerAccepted = false;
qG3PointDisclaimer::qG3PointDisclaimer(QWidget *parent)
: QDialog(parent)
, ui(new Ui::G3PointDisclaimer)
{
ui->setupUi(this);
QString compilationInfo;
compilationInfo += "Version " + QString(G3POINT_VERSION);
compilationInfo += QStringLiteral("<br><i>Compiled with");
#if defined(_MSC_VER)
compilationInfo += QStringLiteral(" MSVC %1 and").arg(_MSC_VER);
#endif
compilationInfo += QStringLiteral(" Qt %1").arg(QT_VERSION_STR);
compilationInfo += QStringLiteral("</i>");
compilationInfo += " [cc " + QString(GIT_BRANCH_CC) + "/" + QString(GIT_COMMMIT_HASH_CC) + "]";
compilationInfo += " [g3point " +
QString(GIT_TAG_G3POINT) + " " +
QString(GIT_BRANCH_G3POINT) + "/" +
QString(GIT_COMMMIT_HASH_G3POINT) + "]";
ui->labelCompilationInformation->setText(compilationInfo);
}
qG3PointDisclaimer::~qG3PointDisclaimer()
{
delete ui;
}
bool qG3PointDisclaimer::show(ccMainAppInterface *app)
{
if ( !s_disclaimerAccepted )
{
//if the user "cancels" it, then he refuses the disclaimer
s_disclaimerAccepted = qG3PointDisclaimer(app ? app->getMainWindow() : 0).exec();
}
return s_disclaimerAccepted;
}
+1
View File
@@ -1,4 +1,5 @@
target_sources( ${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/qG3PointDialog.ui
${CMAKE_CURRENT_LIST_DIR}/qG3PointDisclaimer.ui
)
+95
View File
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>G3PointDisclaimer</class>
<widget class="QDialog" name="G3PointDisclaimer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1086</width>
<height>263</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextEdit" name="textEdit">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
hr { height: 1px; border-width: 0; }
li.unchecked::marker { content: &quot;\2610&quot;; }
li.checked::marker { content: &quot;\2612&quot;; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Calibri,sans-serif'; font-size:12pt; font-weight:700; color:#1f497d;&quot;&gt;G3Point: grain segmentation algorithm&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Slack-Lato','appleLogo','sans-serif'; font-size:10pt; font-weight:600; color:#1f497d;&quot;&gt;Code &lt;/span&gt;&lt;span style=&quot; font-family:'Slack-Lato','appleLogo','sans-serif'; font-size:10pt; color:#1f497d;&quot;&gt;P. Leroy&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Slack-Lato','appleLogo','sans-serif'; font-size:6pt; color:#1f497d; background-color:#ffffff;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Slack-Lato','appleLogo','sans-serif'; font-size:10pt; font-weight:700; color:#1f497d; background-color:#ffffff;&quot;&gt;Article&lt;/span&gt;&lt;span style=&quot; font-family:'Slack-Lato','appleLogo','sans-serif'; font-size:10pt; color:#1f497d; background-color:#ffffff;&quot;&gt; Steer, P., Guerit, L., Lague, D., Crave, A., and Gourdon, A.&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Slack-Lato','appleLogo','sans-serif'; font-size:10pt; font-style:italic; color:#1f497d; background-color:#ffffff;&quot;&gt;Size, shape and orientation matter: fast and semi-automatic measurement of grain geometries from 3D point clouds&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Slack-Lato','appleLogo','sans-serif'; font-size:10pt; color:#1f497d; background-color:#ffffff;&quot;&gt;Earth Surf. Dynam., 10, 12111232, https://doi.org/10.5194/esurf-10-1211-2022, 2022.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Calibri,sans-serif'; font-size:6pt; color:#1f497d;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:700; color:#ff0000;&quot;&gt;Comments / remarks =&amp;gt; Section G3Point of the forum https://www.cloudcompare.org/forum/&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:6pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot; font-family:'Calibri,sans-serif'; font-size:6pt; color:#1f497d; background-color:#ffffff;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Calibri,sans-serif'; font-size:10pt; color:#1f497d; background-color:#ffffff;&quot;&gt;Observatoire des Sciences de l'Univers de Rennes - Géosciences Rennes&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Calibri,sans-serif'; font-size:10pt; color:#1f497d; background-color:#ffffff;&quot;&gt;Université de Rennes - Centre National de la Recherche Scientifique&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelCompilationInformation">
<property name="text">
<string>Compilation information: -</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>G3PointDisclaimer</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>G3PointDisclaimer</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>