Windows refactoring
This commit is contained in:
parent
02295c4ba5
commit
3531b1ad47
|
@ -12,9 +12,11 @@ else()
|
|||
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
|
||||
endif()
|
||||
|
||||
set(EXTERNAL_DEPS_DIR "/home/iason/Coding/build/external dependencies")
|
||||
if(NOT EXISTS ${EXTERNAL_DEPS_DIR})
|
||||
set(EXTERNAL_DEPS_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
set(EXTERNAL_DEPS_DIR "C:/Users/iason/Downloads/ReducedModelOptimization/build/externalDependencies/")
|
||||
else()
|
||||
set(EXTERNAL_DEPS_DIR "/home/iason/Coding/build/external dependencies/")
|
||||
endif()
|
||||
##Create directory for the external libraries
|
||||
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})
|
||||
|
@ -49,6 +51,9 @@ add_subdirectory(${MYSOURCES_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/MySourcesBi
|
|||
#Add the project sources
|
||||
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp ${POLYSCOPE_SOURCE_DIR}/deps/imgui/imgui/misc/cpp/imgui_stdlib.cpp)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_definitions(_HAS_STD_BYTE=0)
|
||||
endif(MSVC)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCES} )
|
||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "misc/cpp/imgui_stdlib.h"
|
||||
#include "simulationhistoryplotter.hpp"
|
||||
#include <wrap/io_trimesh/export_obj.h>
|
||||
#include <algorithm>
|
||||
|
||||
void ReducedPatternSimulator::applyOptimizationResults_elements(
|
||||
const ReducedPatternOptimization::Results &reducedPattern_optimizationResults,
|
||||
|
@ -162,8 +163,8 @@ std::pair<DRMFullSimulationResults, ReducedSimulationResults> ReducedPatternSimu
|
|||
std::cerr << "Full pattern simulation failed." << std::endl;
|
||||
} else if (!randomTesselationIsEnabled) {
|
||||
std::filesystem::create_directories(fullResultsFolderPath);
|
||||
simulationResults_fullPattern_drm.save(fullResultsFolderPath);
|
||||
pJob_tiledFullPattern->save(fullPatternJobFolderPath);
|
||||
simulationResults_fullPattern_drm.save(fullResultsFolderPath.string());
|
||||
pJob_tiledFullPattern->save(fullPatternJobFolderPath.string());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,8 +230,10 @@ void ReducedPatternSimulator::shuffleReducedPatterns(
|
|||
const std::vector<int> &perSurfaceFacePatternIndices)
|
||||
{
|
||||
std::vector<int> randomShufflePerSurfaceFacePatternIndices = perSurfaceFacePatternIndices;
|
||||
std::random_shuffle(randomShufflePerSurfaceFacePatternIndices.begin(),
|
||||
randomShufflePerSurfaceFacePatternIndices.end());
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(randomShufflePerSurfaceFacePatternIndices.begin(),
|
||||
randomShufflePerSurfaceFacePatternIndices.end(),g);
|
||||
std::vector<size_t> tileIntoEdgesToTiledReducedVi;
|
||||
tileReducedPatterns(optimizationResults,
|
||||
randomShufflePerSurfaceFacePatternIndices,
|
||||
|
@ -312,7 +315,7 @@ std::vector<ReducedPatternOptimization::Results> ReducedPatternSimulator::loadOp
|
|||
optimizationResultPaths.size());
|
||||
size_t optimizationResultIndex = 0;
|
||||
for (const auto &p : optimizationResultPaths) {
|
||||
optimizationResults[optimizationResultIndex++].load(p);
|
||||
optimizationResults[optimizationResultIndex++].load(p.string());
|
||||
}
|
||||
|
||||
return optimizationResults;
|
||||
|
@ -370,8 +373,10 @@ void ReducedPatternSimulator::createShufflings(
|
|||
{
|
||||
std::vector<int> shuffledPerSurfaceFacePatternIndices = computePerSurfaceFacePatternsIndices(
|
||||
optimizationResults);
|
||||
std::random_shuffle(shuffledPerSurfaceFacePatternIndices.begin(),
|
||||
shuffledPerSurfaceFacePatternIndices.end());
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(shuffledPerSurfaceFacePatternIndices.begin(),
|
||||
shuffledPerSurfaceFacePatternIndices.end(),g);
|
||||
|
||||
createTiledSimulationMeshes(pTileIntoSurface,
|
||||
optimizationResults,
|
||||
|
@ -905,7 +910,8 @@ void ReducedPatternSimulator::loadTessellation(const std::filesystem::path &json
|
|||
std::ifstream ifs(jsonFilePath);
|
||||
ifs >> json;
|
||||
const std::string jsonLabel_tesselation{"faceToPatternIndices"};
|
||||
gui_faceToPatternIndex = static_cast<std::vector<int>>(json.at(jsonLabel_tesselation));
|
||||
|
||||
gui_faceToPatternIndex = json[jsonLabel_tesselation].get<std::vector<int>>();
|
||||
computeSurfaceColorsFromPerFacePatterns(gui_faceToPatternIndex);
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ private:
|
|||
std::pair<FullPatternVertexIndex, ReducedPatternVertexIndex> getPickedInterfaceVertices(
|
||||
const std::pair<std::string, size_t> &selection) const;
|
||||
void reset();
|
||||
void saveJobs(const filesystem::__cxx11::path &outputFolderPath);
|
||||
void saveJobs(const std::filesystem::path &outputFolderPath);
|
||||
void saveResults(const std::string &outputFolderPath,
|
||||
SimulationResults &fullResults,
|
||||
SimulationResults &reducedResults);
|
||||
|
|
Loading…
Reference in New Issue