Skip to content

Commit

Permalink
Update version to v0.21.33
Browse files Browse the repository at this point in the history
  • Loading branch information
Atraxus committed Oct 1, 2024
1 parent e4672ce commit 88375d9
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.25.2 FATAL_ERROR)

# ---- Project ----
project(RAYX VERSION 0.21.32)
project(RAYX VERSION 0.21.33)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_STANDARD 20)
Expand Down
4 changes: 2 additions & 2 deletions Intern/rayx-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data/
DESTINATION ${INSTALL_DATA_DIR}
FILES_MATCHING PATTERN "*")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Scripts
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Scripts/
DESTINATION ${INSTALL_DATA_DIR}
FILES_MATCHING PATTERN "*")
include(InstallRequiredSystemLibraries)
Expand Down
6 changes: 3 additions & 3 deletions Intern/rayx-core/src/Data/Locate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ std::filesystem::path getExecutablePath() {
// General method to get the full path based on the base directory (e.g., data or font directory)
std::filesystem::path getFullPath(const std::string& baseDir, const std::string& relativePath) {
#if defined(__linux__)
// First, check in /usr
// First, check in /usr (package install)
std::string path = std::string("/usr/") + baseDir + "/" + relativePath;
if (fileExists(path)) return path;

// Next, check next to the executable
// Next, check next to the executable (built from source)
std::string execDir = getExecutablePath().string();
execDir = execDir.substr(0, execDir.find_last_of("/\\"));
path = execDir + "/" + relativePath;
if (fileExists(path)) return path;

// Lastly, check in /usr/local
// Lastly, check in /usr/local (make install)
path = std::string("/usr/local/") + baseDir + "/" + relativePath;
if (fileExists(path)) return path;
#elif defined(_WIN32)
Expand Down
9 changes: 8 additions & 1 deletion Intern/rayx-core/src/Data/xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,18 @@ bool paramPositionNoGroup(const rapidxml::xml_node<>* node, glm::dvec4* out) {

std::filesystem::path Parser::parseEnergyDistributionFile() const {
std::filesystem::path datpath = Parser::parseStr("photonEnergyDistributionFile");
// Check if the path is empty
if (datpath.empty()) {
// Since the photon energy distribution file is optional, return an empty path
RAYX_VERB << "No photon energy distribution file specified.";
return std::filesystem::path(); // Or handle as per your application's logic
}

std::filesystem::path combinedPath = rmlFile.parent_path() / datpath;
try {
combinedPath = std::filesystem::canonical(combinedPath);
} catch (const std::exception& e) {
RAYX_EXIT << "Failed to canonicalize datfile path: " << e.what();
RAYX_EXIT << "Failed to canonicalize datfile path: " << combinedPath.string() << " -- Error: " << e.what();
}

RAYX_VERB << "Combined datfile path: " << combinedPath;
Expand Down
2 changes: 1 addition & 1 deletion Intern/rayx-core/src/Material/NffTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bool NffTable::load(const char* element, NffTable* out) {

std::transform(elementString.begin(), elementString.end(), elementString.begin(), [](unsigned char c) { return std::tolower(c); });

std::filesystem::path f = getResourcePath("Data/nff/" + elementString + ".nff");
std::filesystem::path f = getResourcePath("nff/" + elementString + ".nff");
RAYX_VERB << "Loading NffTable from " << f;
std::ifstream s(f);

Expand Down
2 changes: 1 addition & 1 deletion Intern/rayx-core/src/Material/PalikTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bool PalikTable::load(const char* element, PalikTable* out) {
std::string elementString = element;
std::transform(elementString.begin(), elementString.end(), elementString.begin(), [](unsigned char c) { return std::toupper(c); });

std::filesystem::path f = getResourcePath("Data/PALIK/" + elementString + ".NKP");
std::filesystem::path f = getResourcePath("PALIK/" + elementString + ".NKP");
RAYX_VERB << "Loading PalikTable from " << f;
std::ifstream s(f);

Expand Down
4 changes: 2 additions & 2 deletions Intern/rayx-ui/src/RenderSystem/GridRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ void GridRenderSystem::render(FrameInfo& frameInfo, [[maybe_unused]] const std::

RenderSystem::Input GridRenderSystem::fillInput(VkRenderPass renderPass) const {
return RenderSystem::Input{.renderPass = renderPass,
.vertShaderPath = RAYX::getResourcePath("/Shaders/grid_shader_vert.spv").string(),
.fragShaderPath = RAYX::getResourcePath("/Shaders/grid_shader_frag.spv").string(),
.vertShaderPath = RAYX::getResourcePath("Shaders/grid_shader_vert.spv").string(),
.fragShaderPath = RAYX::getResourcePath("Shaders/grid_shader_frag.spv").string(),
.bindingDescriptions = std::vector<VkVertexInputBindingDescription>{},
.attributeDescriptions = std::vector<VkVertexInputAttributeDescription>{},
.topology = std::nullopt,
Expand Down
4 changes: 2 additions & 2 deletions Intern/rayx-ui/src/RenderSystem/ObjectRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ void ObjectRenderSystem::render(FrameInfo& frameInfo, const std::vector<RenderOb

RenderSystem::Input ObjectRenderSystem::fillInput(VkRenderPass renderPass) const {
return RenderSystem::Input{.renderPass = renderPass,
.vertShaderPath = RAYX::getResourcePath("/Shaders/shader_vert.spv").string(),
.fragShaderPath = RAYX::getResourcePath("/Shaders/shader_frag.spv").string(),
.vertShaderPath = RAYX::getResourcePath("Shaders/shader_vert.spv").string(),
.fragShaderPath = RAYX::getResourcePath("Shaders/shader_frag.spv").string(),
.bindingDescriptions = TextureVertex::getBindingDescriptions(),
.attributeDescriptions = TextureVertex::getAttributeDescriptions(),
.topology = std::nullopt,
Expand Down
4 changes: 2 additions & 2 deletions Intern/rayx-ui/src/RenderSystem/RayRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ void RayRenderSystem::render(FrameInfo& frameInfo, const std::vector<RenderObjec

RenderSystem::Input RayRenderSystem::fillInput(VkRenderPass renderPass) const {
return RenderSystem::Input{.renderPass = renderPass,
.vertShaderPath = RAYX::getResourcePath("/Shaders/ray_shader_vert.spv").string(),
.fragShaderPath = RAYX::getResourcePath("/Shaders/ray_shader_frag.spv").string(),
.vertShaderPath = RAYX::getResourcePath("Shaders/ray_shader_vert.spv").string(),
.fragShaderPath = RAYX::getResourcePath("Shaders/ray_shader_frag.spv").string(),
.bindingDescriptions = ColorVertex::getBindingDescriptions(),
.attributeDescriptions = ColorVertex::getAttributeDescriptions(),
.topology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST,
Expand Down
2 changes: 1 addition & 1 deletion Intern/rayx/src/TerminalApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void TerminalApp::tracePath(const std::filesystem::path& path) {
RAYX_EXIT << "Have you selected .csv exporting?";
}

auto cmd = std::string("python ") + RAYX::getResourcePath("/Scripts/plot.py").string() + " " + file;
auto cmd = std::string("python ") + RAYX::getResourcePath("Scripts/plot.py").string() + " " + file;
auto ret = system(cmd.c_str());
if (ret != 0) {
RAYX_WARN << "received error code while printing";
Expand Down

0 comments on commit 88375d9

Please sign in to comment.