-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VolumetricRendering][SofaCUDA] Move CUDA files related to Volumetric…
…Rendering (#4487) * New plugin for VolumetricRendering.CUDA * Move files from SofaCUDA to VolumetricRendering --------- Co-authored-by: Paul Baksic <30337881+bakpaul@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
178 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
applications/plugins/VolumetricRendering/extensions/CUDA/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
project(VolumetricRendering.CUDA) | ||
|
||
set(HEADER_FILES | ||
src/VolumetricRendering/CUDA/init.h | ||
src/VolumetricRendering/CUDA/config.h.in | ||
|
||
src/VolumetricRendering/CUDA/CudaTetrahedralVisualModel.h | ||
src/VolumetricRendering/CUDA/CudaTetrahedralVisualModel.inl | ||
) | ||
|
||
set(SOURCE_FILES | ||
src/VolumetricRendering/CUDA/init.cpp | ||
|
||
src/VolumetricRendering/CUDA/CudaTetrahedralVisualModel.cpp | ||
) | ||
|
||
sofa_find_package(VolumetricRendering REQUIRED) | ||
sofa_find_package(SofaCUDA REQUIRED) | ||
|
||
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) | ||
target_link_libraries(${PROJECT_NAME} VolumetricRendering) | ||
target_link_libraries(${PROJECT_NAME} SofaCUDA) | ||
|
||
sofa_create_package_with_targets( | ||
PACKAGE_NAME ${PROJECT_NAME} | ||
PACKAGE_VERSION ${Sofa_VERSION} | ||
TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES | ||
INCLUDE_SOURCE_DIR "src" | ||
INCLUDE_INSTALL_DIR "${PROJECT_NAME}" | ||
RELOCATABLE "plugins" | ||
) |
9 changes: 9 additions & 0 deletions
9
...tions/plugins/VolumetricRendering/extensions/CUDA/VolumetricRendering.CUDAConfig.cmake.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# CMake package configuration file for the VolumetricRendering.CUDA library | ||
|
||
@PACKAGE_GUARD@ | ||
@PACKAGE_INIT@ | ||
|
||
find_package(VolumetricRendering QUIET REQUIRED) | ||
find_package(SofaCUDA QUIET REQUIRED) | ||
|
||
check_required_components(VolumetricRendering.CUDA) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
...ions/plugins/VolumetricRendering/extensions/CUDA/src/VolumetricRendering/CUDA/config.h.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/****************************************************************************** | ||
* SOFA, Simulation Open-Framework Architecture * | ||
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the GNU Lesser General Public License as published by * | ||
* the Free Software Foundation; either version 2.1 of the License, or (at * | ||
* your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, but WITHOUT * | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
* for more details. * | ||
* * | ||
* You should have received a copy of the GNU Lesser General Public License * | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
******************************************************************************* | ||
* Authors: The SOFA Team and external contributors (see Authors.txt) * | ||
* * | ||
* Contact information: contact@sofa-framework.org * | ||
******************************************************************************/ | ||
#pragma once | ||
|
||
#include <sofa/config.h> | ||
|
||
#ifdef SOFA_BUILD_VOLUMETRICRENDERING_CUDA | ||
# define SOFA_TARGET @PROJECT_NAME@ | ||
# define SOFA_VOLUMETRICRENDERING_CUDA_API SOFA_EXPORT_DYNAMIC_LIBRARY | ||
#else | ||
# define SOFA_VOLUMETRICRENDERING_CUDA_API SOFA_IMPORT_DYNAMIC_LIBRARY | ||
#endif | ||
|
||
namespace volumetricrendering::cuda | ||
{ | ||
constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; | ||
constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; | ||
} // namespace volumetricrendering::cuda |
67 changes: 67 additions & 0 deletions
67
...cations/plugins/VolumetricRendering/extensions/CUDA/src/VolumetricRendering/CUDA/init.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/****************************************************************************** | ||
* SOFA, Simulation Open-Framework Architecture * | ||
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the GNU Lesser General Public License as published by * | ||
* the Free Software Foundation; either version 2.1 of the License, or (at * | ||
* your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, but WITHOUT * | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
* for more details. * | ||
* * | ||
* You should have received a copy of the GNU Lesser General Public License * | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
******************************************************************************* | ||
* Authors: The SOFA Team and external contributors (see Authors.txt) * | ||
* * | ||
* Contact information: contact@sofa-framework.org * | ||
******************************************************************************/ | ||
#include <VolumetricRendering/CUDA/init.h> | ||
#include <VolumetricRendering/initVolumetricRendering.h> | ||
#include <sofa/core/ObjectFactory.h> | ||
namespace volumetricrendering::cuda | ||
{ | ||
|
||
extern "C" { | ||
SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); | ||
SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); | ||
SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); | ||
SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleComponentList(); | ||
} | ||
|
||
void initExternalModule() | ||
{ | ||
init(); | ||
} | ||
|
||
const char* getModuleName() | ||
{ | ||
return MODULE_NAME; | ||
} | ||
|
||
const char* getModuleVersion() | ||
{ | ||
return MODULE_VERSION; | ||
} | ||
|
||
void init() | ||
{ | ||
static bool first = true; | ||
if (first) | ||
{ | ||
volumetricrendering::init(); | ||
first = false; | ||
} | ||
} | ||
|
||
const char* getModuleComponentList() | ||
{ | ||
/// string containing the names of the classes provided by the plugin | ||
static std::string classes = sofa::core::ObjectFactory::getInstance()->listClassesFromTarget(MODULE_NAME); | ||
return classes.c_str(); | ||
} | ||
|
||
} // namespace volumetricrendering::cuda |
29 changes: 29 additions & 0 deletions
29
applications/plugins/VolumetricRendering/extensions/CUDA/src/VolumetricRendering/CUDA/init.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/****************************************************************************** | ||
* SOFA, Simulation Open-Framework Architecture * | ||
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the GNU Lesser General Public License as published by * | ||
* the Free Software Foundation; either version 2.1 of the License, or (at * | ||
* your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, but WITHOUT * | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
* for more details. * | ||
* * | ||
* You should have received a copy of the GNU Lesser General Public License * | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
******************************************************************************* | ||
* Authors: The SOFA Team and external contributors (see Authors.txt) * | ||
* * | ||
* Contact information: contact@sofa-framework.org * | ||
******************************************************************************/ | ||
#pragma once | ||
|
||
#include <VolumetricRendering/CUDA/config.h> | ||
|
||
namespace volumetricrendering::cuda | ||
{ | ||
SOFA_VOLUMETRICRENDERING_CUDA_API void init(); | ||
} // namespace volumetricrendering::cuda |