Initial sketch for plugins.
This commit is contained in:
parent
b101a5f87c
commit
ab3ffc77dc
16 changed files with 96 additions and 6 deletions
|
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10)
|
|||
# set the project name
|
||||
project(NotesTK)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set_property( GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
set (CMAKE_MODULE_PATH infra/cmake)
|
||||
|
@ -14,11 +14,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|||
|
||||
if(FALSE)
|
||||
set(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
|
||||
set(GCC_COVERAGE_LINK_FLAGS "-lgcov")
|
||||
set(GCC_COVERAGE_LINK_FLAGS "-lgcov")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(test)
|
||||
add_subdirectory(plugins)
|
||||
add_subdirectory(apps)
|
||||
add_subdirectory(test)
|
4
plugins/CMakeLists.txt
Normal file
4
plugins/CMakeLists.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
add_subdirectory(circuits)
|
||||
add_subdirectory(machine_learning)
|
||||
add_subdirectory(physics_simulation)
|
||||
add_subdirectory(quantum_computing)
|
15
plugins/circuits/CMakeLists.txt
Normal file
15
plugins/circuits/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
set(PLUGIN_NAME circuits)
|
||||
|
||||
list(APPEND client_HEADERS
|
||||
ElectronicCircuit.h)
|
||||
|
||||
list(APPEND client_LIB_INCLUDES
|
||||
ElectronicCircuit.cpp)
|
||||
|
||||
add_library(${PLUGIN_NAME} SHARED ${client_LIB_INCLUDES})
|
||||
|
||||
target_include_directories(${PLUGIN_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_link_libraries(${PLUGIN_NAME} PUBLIC core)
|
||||
set_property(TARGET ${PLUGIN_NAME} PROPERTY FOLDER plugins)
|
0
plugins/circuits/ElectronicCircuit.cpp
Normal file
0
plugins/circuits/ElectronicCircuit.cpp
Normal file
24
plugins/circuits/ElectronicCircuit.h
Normal file
24
plugins/circuits/ElectronicCircuit.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class Terminal
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class Wire
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class LogicGate
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class ElectronicCircuit
|
||||
{
|
||||
|
||||
};
|
15
plugins/machine_learning/CMakeLists.txt
Normal file
15
plugins/machine_learning/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
set(PLUGIN_NAME machine_learning)
|
||||
|
||||
list(APPEND client_HEADERS
|
||||
NeuralNetwork.h)
|
||||
|
||||
list(APPEND client_LIB_INCLUDES
|
||||
NeuralNetwork.cpp)
|
||||
|
||||
add_library(${PLUGIN_NAME} SHARED ${client_LIB_INCLUDES})
|
||||
|
||||
target_include_directories(${PLUGIN_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_link_libraries(${PLUGIN_NAME} PUBLIC core)
|
||||
set_property(TARGET ${PLUGIN_NAME} PROPERTY FOLDER plugins)
|
0
plugins/machine_learning/NeuralNetwork.cpp
Normal file
0
plugins/machine_learning/NeuralNetwork.cpp
Normal file
0
plugins/machine_learning/NeuralNetwork.h
Normal file
0
plugins/machine_learning/NeuralNetwork.h
Normal file
15
plugins/physics_simulation/CMakeLists.txt
Normal file
15
plugins/physics_simulation/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
set(PLUGIN_NAME physics_simulation)
|
||||
|
||||
list(APPEND client_HEADERS
|
||||
FiniteElementSolver.h)
|
||||
|
||||
list(APPEND client_LIB_INCLUDES
|
||||
FiniteElementSolver.cpp)
|
||||
|
||||
add_library(${PLUGIN_NAME} SHARED ${client_LIB_INCLUDES})
|
||||
|
||||
target_include_directories(${PLUGIN_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_link_libraries(${PLUGIN_NAME} PUBLIC core)
|
||||
set_property(TARGET ${PLUGIN_NAME} PROPERTY FOLDER plugins)
|
0
plugins/physics_simulation/FiniteElementSolver.cpp
Normal file
0
plugins/physics_simulation/FiniteElementSolver.cpp
Normal file
0
plugins/physics_simulation/FiniteElementSolver.h
Normal file
0
plugins/physics_simulation/FiniteElementSolver.h
Normal file
15
plugins/quantum_computing/CMakeLists.txt
Normal file
15
plugins/quantum_computing/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
set(PLUGIN_NAME quantum_computing)
|
||||
|
||||
list(APPEND client_HEADERS
|
||||
QuantumCircuit.h)
|
||||
|
||||
list(APPEND client_LIB_INCLUDES
|
||||
QuantumCircuit.cpp)
|
||||
|
||||
add_library(${PLUGIN_NAME} SHARED ${client_LIB_INCLUDES})
|
||||
|
||||
target_include_directories(${PLUGIN_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_link_libraries(${PLUGIN_NAME} PUBLIC core)
|
||||
set_property(TARGET ${PLUGIN_NAME} PROPERTY FOLDER plugins)
|
0
plugins/quantum_computing/QuantumCircuit.cpp
Normal file
0
plugins/quantum_computing/QuantumCircuit.cpp
Normal file
0
plugins/quantum_computing/QuantumCircuit.h
Normal file
0
plugins/quantum_computing/QuantumCircuit.h
Normal file
|
@ -45,6 +45,7 @@ std::unique_ptr<TriMesh> MeshPrimitives::buildCircleAsTriMesh(unsigned numSegmen
|
|||
const double y = cos(theta);
|
||||
locations[idx] = {x, y};
|
||||
theta += delta_theta;
|
||||
std::cout << "Adding node at: " << x << " | " << y << std::endl;
|
||||
}
|
||||
|
||||
EdgeIds edge_ids(2*numSegments);
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
TEST_CASE(TestSvgConverter, "[publishing]")
|
||||
{
|
||||
Scene scene;
|
||||
scene.setShowMeshOutline(true);
|
||||
//scene.setShowMeshOutline(true);
|
||||
|
||||
CircleNode circle({10, 10}, 20);
|
||||
CircleNode circle({40, 40}, 20);
|
||||
circle.setFillColor({255, 0, 0});
|
||||
scene.addNode(&circle);
|
||||
|
||||
|
@ -26,7 +26,7 @@ TEST_CASE(TestSvgConverter, "[publishing]")
|
|||
|
||||
SvgConverter converter;
|
||||
auto svg_document = converter.convert(&scene);
|
||||
svg_document->setViewBox(0, 0, 100, 100);
|
||||
svg_document->setViewBox(0, 0, 200, 200);
|
||||
|
||||
SvgWriter writer;
|
||||
auto content = writer.toString(svg_document.get());
|
||||
|
|
Loading…
Reference in a new issue