Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Compile Radium Plugins

defaults:
run:
shell: bash

on:
pull_request:
branches:
- master
env:
ext-dir: ${GITHUB_WORKSPACE//\\//}/external/install/

jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { name: "Windows MSVC", suffix: "Windows", os: windows-latest, cc: "cl.exe", cxx: "cl.exe", assimp: "OFF" }
- { name: "Ubuntu gcc", suffix: "Linux-gcc8", os: ubuntu-18.04, cc: "gcc-8", cxx: "g++-8", assimp: "ON" }
- { name: "Ubuntu gcc", suffix: "Linux-gcc10", os: ubuntu-20.04, cc: "gcc-10", cxx: "g++-10", assimp: "ON" }
- { name: "MacOS clang", suffix: "macOS", os: macos-latest, cc: "clang", cxx: "clang++", assimp: "ON" }

steps:
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Add msbuild to PATH
uses: seanmiddleditch/gha-setup-vsdevenv@master
if: runner.os == 'Windows'

- name: Cache Qt
id: cache-qt
uses: actions/cache@v2
with:
path: ../Qt
key: ${{ runner.os }}-${{ matrix.config.cc }}-QtCache

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}

- name: Prepare directories
run: |
mkdir -p install/
mkdir -p src/
mkdir -p src/Radium-Plugins
mkdir -p build/Radium-Engine
mkdir -p build/Radium-Plugins
mkdir -p external/install/
mkdir -p external/build/

- name: Clone Radium
run: |
cd src && git clone https://github.com/STORM-IRIT/Radium-Engine.git --single-branch && cd ..

- name: Cache externals
id: cache-external
uses: actions/cache@v2
with:
path: external
key: ${{ runner.os }}-${{ matrix.config.cc }}-external-${{ hashFiles('src/Radium-Engine/external/**/CMakeLists.txt') }}

- name: Configure and build external
if: steps.cache-external.outputs.cache-hit != 'true'
run: |
cd external/build/
cmake ../../src/Radium-Engine/external -GNinja -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_BUILD_TYPE=Release -DRADIUM_IO_ASSIMP=${{ matrix.config.assimp }} -DCMAKE_EXECUTE_PROCESS_COMMAND_ECHO=STDOUT -DRADIUM_UPDATE_VERSION=OFF -DRADIUM_EXTERNAL_CMAKE_INSTALL_MESSAGE=LAZY -DCMAKE_INSTALL_PREFIX=../install/
cmake --build . --parallel --config Release

- name: Configure Radium
run: |
cd build/Radium-Engine
cmake ../../src/Radium-Engine -GNinja -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../install/ -DRADIUM_IO_ASSIMP=${{ matrix.config.assimp }} -DCMAKE_EXECUTE_PROCESS_COMMAND_ECHO=STDOUT -DRADIUM_UPDATE_VERSION=OFF -DRADIUM_EXTERNAL_CMAKE_INSTALL_MESSAGE=LAZY -DRADIUM_INSTALL_DOC=OFF -DRADIUM_ENABLE_TESTING=ON -DEigen3_DIR=${{env.ext-dir}}/share/eigen3/cmake/ -DOpenMesh_DIR=${{env.ext-dir}}/share/OpenMesh/cmake/ -Dcpplocate_DIR=${{env.ext-dir}}/share/cpplocate/ -Dglm_DIR=${{env.ext-dir}}/lib/cmake/glm/ -Dglbinding_DIR=${{env.ext-dir}}/share/glbinding/ -Dglobjects_DIR=${{env.ext-dir}}/share/globjects/ -Dstb_DIR=${{env.ext-dir}}/include/stb/ -Dassimp_DIR=${{env.ext-dir}}/lib/cmake/assimp-5.0/ -Dtinyply_DIR=${{env.ext-dir}}/lib/cmake/tinyply/

- name: Build Radium
run: |
cd build/Radium-Engine
cmake --build . --parallel --config Release --target install

- name: Clone Radium Plugins
uses: actions/checkout@master
with:
path: src/Radium-Plugins

- name: Configure Radium Plugins
run: |
cd build/Radium-Plugins
cmake ../../src/Radium-Plugins -GNinja -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../install/ -DRadium_DIR=../../install/lib/cmake/Radium

- name: Build Radium Plugins
run: |
cd build/Radium-Plugins
cmake --build . --parallel --config Release --target install
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif ()

option(INSTALL_IN_RADIUM_BUNDLE "Install plugins in Radium-Bundle dir" OFF)

add_subdirectory(fake-toon)
#add_subdirectory(fake-toon)
add_subdirectory(laplacian-smoothing)
add_subdirectory(CameraManip)
add_subdirectory(Dummy)
Expand Down
20 changes: 10 additions & 10 deletions Dummy/src/DummyPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

namespace DummyPlugin {

DummyPlugin::~DummyPlugin() {}
DummyPluginC::~DummyPluginC() {}

void DummyPlugin::registerPlugin( const Ra::Plugins::Context& context ) {
void DummyPluginC::registerPlugin( const Ra::Plugins::Context& context ) {
DummySystem* system = new DummySystem;
context.m_engine->registerSystem( "DummySystem", system );
}

bool DummyPlugin::doAddWidget( QString& name ) {
bool DummyPluginC::doAddWidget( QString& name ) {
name = "Dummy Mesh";
return true;
}

QWidget* DummyPlugin::getWidget() {
QWidget* DummyPluginC::getWidget() {
QWidget* widget = new QWidget;

m_label = new QLabel( "I am a dummy label", widget );
Expand All @@ -37,16 +37,16 @@ QWidget* DummyPlugin::getWidget() {
layout->addWidget( m_label );
layout->addWidget( button );

connect( button, &QPushButton::pressed, this, &DummyPlugin::sayHello );
connect( button, &QPushButton::pressed, this, &DummyPluginC::sayHello );

return widget;
}

bool DummyPlugin::doAddMenu() {
bool DummyPluginC::doAddMenu() {
return true;
}

QMenu* DummyPlugin::getMenu() {
QMenu* DummyPluginC::getMenu() {
QMenu* menu = new QMenu( "Dummy" );

QAction* a1 = menu->addAction( "Hello there" );
Expand All @@ -58,15 +58,15 @@ QMenu* DummyPlugin::getMenu() {
return menu;
}

bool DummyPlugin::doAddAction( int& /*nb*/ ) {
bool DummyPluginC::doAddAction( int& /*nb*/ ) {
return false;
}

QAction* DummyPlugin::getAction( int /*id*/ ) {
QAction* DummyPluginC::getAction( int /*id*/ ) {
return nullptr;
}

void DummyPlugin::sayHello() {
void DummyPluginC::sayHello() {
m_label->setText( "I have been clicked at least once !" );
QMessageBox::warning( nullptr, "Dummy Plugin", "Hello, Radium World !" );
}
Expand Down
6 changes: 3 additions & 3 deletions Dummy/src/DummyPlugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class RadiumEngine;
namespace DummyPlugin {
class DummySystem;

class DummyPlugin : public QObject, Ra::Plugins::RadiumPluginInterface
class DummyPluginC : public QObject, Ra::Plugins::RadiumPluginInterface
{
Q_OBJECT
Q_RADIUM_PLUGIN_METADATA
Q_INTERFACES( Ra::Plugins::RadiumPluginInterface )

public:
DummyPlugin() = default;
~DummyPlugin();
DummyPluginC() = default;
~DummyPluginC();

void registerPlugin( const Ra::Plugins::Context& context ) override;

Expand Down
6 changes: 3 additions & 3 deletions MeshFeatureTracking/src/MeshFeatureTrackingComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void MeshFeatureTrackingComponent::setData( const Ra::Engine::Renderer::PickingR
return;
}
// if lines, retrieve triangle-based indices
const auto& t = m_pickedMesh->getCoreGeometry().m_indices;
const auto& t = m_pickedMesh->getCoreGeometry().getIndices();
if ( rm == MeshRenderMode::RM_LINES )
{
uint v0, v1, t0, t1;
Expand Down Expand Up @@ -393,7 +393,7 @@ void MeshFeatureTrackingComponent::setVertexIdx( uint idx ) {
// also need to change second for feature Scale
const auto rm = m_pickedMesh->getRenderMode();
if ( rm == MeshRenderMode::RM_POINTS ) { return; }
const auto& triangles = m_pickedMesh->getCoreGeometry().m_indices;
const auto& triangles = m_pickedMesh->getCoreGeometry().getIndices();
if ( rm == MeshRenderMode::RM_LINES )
{
for ( uint i = 0; i < triangles.size(); ++i )
Expand Down Expand Up @@ -512,7 +512,7 @@ void MeshFeatureTrackingComponent::setTriangleIdx( uint idx ) {

// also need to change all for feature Scale, Position and Vector
const auto rm = m_pickedMesh->getRenderMode();
const auto& triangles = m_pickedMesh->getCoreGeometry().m_indices;
const auto& triangles = m_pickedMesh->getCoreGeometry().getIndices();
if ( rm == MeshRenderMode::RM_TRIANGLES )
{
const auto& t = triangles[idx];
Expand Down
2 changes: 1 addition & 1 deletion MeshPaint/src/MeshPaintComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void MeshPaintComponent::paintMesh( const Ra::Engine::Renderer::PickingResult& p
// auto triangleMesh = compMess->get<Ra::Core::Geometry::TriangleMesh>( getEntity(),
// m_dataId ); however here we skip the search in the component map

const auto& t = m_mesh->getCoreGeometry().m_indices;
const auto& t = m_mesh->getCoreGeometry().getIndices();
ON_DEBUG( auto colAttrib =
m_mesh->getCoreGeometry().getAttribHandle<Ra::Core::Vector4>( colAttribName ) );
CORE_ASSERT( colAttrib == m_currentColorAttribHdl, "Inconsistent AttribHandle used" );
Expand Down