Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CommonGUI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Frédéric Larue
CommonGUI
Commits
bac91c72
Commit
bac91c72
authored
Oct 14, 2019
by
Frédéric Larue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Demo mode added that makes it possible to show logos of the university, the lab and the team.
parent
7066ecf5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
85 additions
and
3 deletions
+85
-3
GLViewer/CMakeLists.txt
GLViewer/CMakeLists.txt
+4
-1
GLViewer/GLViewer.cpp
GLViewer/GLViewer.cpp
+53
-0
GLViewer/GLViewer.h
GLViewer/GLViewer.h
+10
-1
GLViewer/GLViewer.qrc
GLViewer/GLViewer.qrc
+7
-0
GLViewer/resources/icube-logo.png
GLViewer/resources/icube-logo.png
+0
-0
GLViewer/resources/igg-logo.png
GLViewer/resources/igg-logo.png
+0
-0
GLViewer/resources/unistra-logo.png
GLViewer/resources/unistra-logo.png
+0
-0
GUI_main/UIMainWindow.cpp
GUI_main/UIMainWindow.cpp
+2
-1
GUI_main/mainwindow.ui
GUI_main/mainwindow.ui
+9
-0
No files found.
GLViewer/CMakeLists.txt
View file @
bac91c72
...
...
@@ -5,11 +5,14 @@ message( STATUS " - " ${CURRENT_TARGET} )
project
(
${
CURRENT_TARGET
}
LANGUAGES CXX
)
set
(
CMAKE_AUTOMOC ON
)
set
(
CMAKE_AUTORCC ON
)
file
(
GLOB LIB_HEADERS
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.h
)
file
(
GLOB LIB_SOURCES
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.cpp
)
file
(
GLOB LIB_RESOURCES
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.qrc
)
generate_resource_solution_folders
(
${
LIB_RESOURCES
}
ALL_RESOURCE_FILES
)
add_library
(
${
PROJECT_NAME
}
SHARED
${
LIB_HEADERS
}
${
LIB_SOURCES
}
)
add_library
(
${
PROJECT_NAME
}
SHARED
${
LIB_HEADERS
}
${
LIB_SOURCES
}
${
LIB_RESOURCES
}
${
ALL_RESOURCE_FILES
}
)
if
(
WIN32
)
target_link_libraries
(
${
CURRENT_TARGET
}
...
...
GLViewer/GLViewer.cpp
View file @
bac91c72
...
...
@@ -40,6 +40,8 @@ float GLViewer::Shininess = 80.0f;
QString GLViewer::s_MetricGrid2DSuffix;
QString GLViewer::s_MetricGrid3DSuffix;
QImage GLViewer::s_Logos[4];
...
...
@@ -839,6 +841,53 @@ void GLViewer::manageAnimations()
}
void GLViewer::setDemoModeEnabled( bool enabled )
{
if( m_IsDemoModeEnabled = enabled )
{
updateDemoModeLogos();
update();
}
}
void GLViewer::updateDemoModeLogos()
{
if( m_IsDemoModeEnabled )
{
if( s_Logos[0].isNull() )
{
s_Logos[0] = QImage( ":/images/resources/unistra-logo.png" );
s_Logos[1] = QImage( ":/images/resources/igg-logo.png" );
s_Logos[2] = QImage( ":/images/resources/icube-logo.png" );
}
int h = int(0.075f * height());
if( h != m_CurrentLogos[0].height() )
for( int i=0; i<3; ++i )
{
h = int(((i == 1)? 0.09f : 0.075f) * height());
int w = int(float(h)*s_Logos[i].width()/s_Logos[i].height());
m_CurrentLogos[i] = s_Logos[i].scaled( QSize(w,h), Qt::KeepAspectRatio, Qt::SmoothTransformation );
}
}
}
void GLViewer::displayDemoModeLogos()
{
if( m_IsDemoModeEnabled )
{
QPainter painter;
painter.begin( this );
painter.drawImage( 25, height()-m_CurrentLogos[0].height()-10, m_CurrentLogos[0] );
painter.drawImage( (width()-m_CurrentLogos[1].width())/2, height()-m_CurrentLogos[1].height()-10, m_CurrentLogos[1] );
painter.drawImage( width()-m_CurrentLogos[2].width()-25, height()-m_CurrentLogos[2].height()-10, m_CurrentLogos[2] );
painter.end();
}
}
void GLViewer::paintGL()
{
manageAnimations();
...
...
@@ -1006,6 +1055,8 @@ void GLViewer::paintGL()
// Display the information bar.
m_InfoBarManager->display();
displayDemoModeLogos();
}
...
...
@@ -1154,6 +1205,8 @@ void GLViewer::resizeGL( int width, int height )
m_SelectionCurrentTool->onResize();
updateSelectionZBuffer();
updateDemoModeLogos();
}
...
...
GLViewer/GLViewer.h
View file @
bac91c72
...
...
@@ -60,7 +60,7 @@ public:
class
GLVIEWER_API
NavigationControl
{
GLViewer
*
m_Viewer
;
GLViewer
*
m_Viewer
;
public:
inline
NavigationControl
(
GLViewer
*
viewer
)
:
m_Viewer
(
viewer
)
{}
...
...
@@ -130,6 +130,12 @@ protected:
static
QString
s_MetricGrid2DSuffix
;
static
QString
s_MetricGrid3DSuffix
;
static
QImage
s_Logos
[
4
];
bool
m_IsDemoModeEnabled
=
false
;
QImage
m_CurrentLogos
[
4
];
void
updateDemoModeLogos
();
void
displayDemoModeLogos
();
public:
static
QVector3D
BgTopColor
;
static
QVector3D
BgBottomColor
;
...
...
@@ -458,6 +464,9 @@ public slots:
inline
void
setMetricGrid2DSuffix
(
const
QString
&
suffix
)
{
s_MetricGrid2DSuffix
=
suffix
;
}
inline
void
setMetricGrid3DSuffix
(
const
QString
&
suffix
)
{
s_MetricGrid3DSuffix
=
suffix
;
}
void
setDemoModeEnabled
(
bool
enabled
);
inline
void
setDemoModeDisabled
(
bool
disabled
)
{
setDemoModeEnabled
(
!
disabled
);
}
};
...
...
GLViewer/GLViewer.qrc
0 → 100644
View file @
bac91c72
<RCC>
<qresource prefix="/images">
<file>resources/icube-logo.png</file>
<file>resources/igg-logo.png</file>
<file>resources/unistra-logo.png</file>
</qresource>
</RCC>
GLViewer/resources/icube-logo.png
0 → 100644
View file @
bac91c72
41.6 KB
GLViewer/resources/igg-logo.png
0 → 100644
View file @
bac91c72
33.5 KB
GLViewer/resources/unistra-logo.png
0 → 100644
View file @
bac91c72
14.4 KB
GUI_main/UIMainWindow.cpp
View file @
bac91c72
...
...
@@ -248,7 +248,8 @@ void UIMainWindow::init()
connect( ui->actionCloseProject, SIGNAL(triggered()), this, SLOT(closeCurrentProject()) );
connect( ui->comboTypeFilter, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(updateCurrentProjectContent()) );
connect( ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAboutDialog()) );
connect( ui->actionDisplayPluginsList, SIGNAL(triggered()), this, SLOT(displayPluginsList()) );
connect( ui->actionShowLogos, SIGNAL(toggled(bool)), m_CurrentViewer, SLOT(setDemoModeEnabled(bool)) );
connect( ui->actionDisplayPluginsList, SIGNAL(triggered()), this, SLOT(displayPluginsList()) );
connect( ui->action2DViewer, SIGNAL(triggered()), this, SLOT(setDefault3DViewer()) );
connect( ui->action3DViewer, SIGNAL(triggered()), this, SLOT(setDefault2DViewer()) );
connect( ui->actionClone, SIGNAL(triggered()), this, SLOT(cloneSelectedManageables()) );
...
...
GUI_main/mainwindow.ui
View file @
bac91c72
...
...
@@ -70,6 +70,7 @@
<string>
Help
</string>
</property>
<addaction
name=
"actionDisplayPluginsList"
/>
<addaction
name=
"actionShowLogos"
/>
<addaction
name=
"actionAbout"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuSettings"
>
...
...
@@ -830,6 +831,14 @@
<string>
Render options
</string>
</property>
</action>
<action
name=
"actionShowLogos"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Show logos
</string>
</property>
</action>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<customwidgets>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment