fix: remove duplicate inputs in engine, add icecream for debugging
This commit is contained in:
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
extern/* linguist-vendored
|
||||
@@ -50,6 +50,10 @@ set(GUI_SOURCES
|
||||
src/Gui/Parameters/AbstractFormParm.cpp
|
||||
src/Gui/Parameters/FloatParm.cpp
|
||||
)
|
||||
set(ENGINE_INCLUDE_DIRECTORIES
|
||||
src
|
||||
extern/icecream-cpp/include
|
||||
)
|
||||
|
||||
# qt
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets SvgWidgets OpenGLWidgets)
|
||||
@@ -75,7 +79,9 @@ qt_add_executable(${AppExec}
|
||||
)
|
||||
|
||||
target_link_libraries(${AppExec} PRIVATE Qt6::Core Qt6::Widgets Qt6::SvgWidgets Qt6::OpenGLWidgets glm::glm Eigen3::Eigen TBB::tbb Boost::filesystem Boost::system)
|
||||
target_include_directories(${AppExec} PUBLIC src)
|
||||
target_include_directories(${AppExec} PUBLIC
|
||||
${ENGINE_INCLUDE_DIRECTORIES}
|
||||
)
|
||||
|
||||
# compile nodes
|
||||
add_subdirectory(src/OpDefs)
|
||||
@@ -100,7 +106,7 @@ add_executable(${TestExec}
|
||||
target_link_libraries(${TestExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb Boost::filesystem Boost::system)
|
||||
target_compile_definitions(${TestExec} PRIVATE UNIT_TEST)
|
||||
target_include_directories(${TestExec} PUBLIC
|
||||
src
|
||||
${ENGINE_INCLUDE_DIRECTORIES}
|
||||
${BOOST_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
@@ -112,5 +118,7 @@ add_executable(${BenchExec}
|
||||
)
|
||||
target_link_libraries(${BenchExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb Boost::filesystem Boost::system)
|
||||
target_compile_definitions(${BenchExec} PRIVATE UNIT_TEST)
|
||||
target_include_directories(${BenchExec} PUBLIC src)
|
||||
target_include_directories(${BenchExec} PUBLIC
|
||||
${ENGINE_INCLUDE_DIRECTORIES}
|
||||
)
|
||||
|
||||
|
||||
5865
extern/icecream-cpp/include/icecream.hpp
vendored
Normal file
5865
extern/icecream-cpp/include/icecream.hpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
||||
#include "Engine/Parameter/Parameter.h"
|
||||
#include "Engine/Parameter/Template.h"
|
||||
#include <iostream>
|
||||
#include "icecream.hpp"
|
||||
|
||||
using namespace enzo;
|
||||
|
||||
@@ -66,11 +67,29 @@ geo::Geometry& enzo::nt::GeometryOperator::getOutputGeo(unsigned outputIndex)
|
||||
return opDef_->getOutputGeo(outputIndex);
|
||||
}
|
||||
|
||||
void nt::GeometryOperator::addInputConnection(std::shared_ptr<nt::GeometryConnection> connection)
|
||||
void nt::GeometryOperator::addInputConnection(std::shared_ptr<nt::GeometryConnection> newConnection)
|
||||
{
|
||||
std::cout << "Input connection added\nConnecting ops " << connection->getInputOpId() << " -> " << connection->getOutputOpId() << "\n";
|
||||
std::cout << "Connecting index " << connection->getInputIndex() << " -> " << connection->getOutputIndex() << "\n";
|
||||
inputConnections_.push_back(connection);
|
||||
// delete previous input
|
||||
IC();
|
||||
for(auto it=inputConnections_.begin(); it!=inputConnections_.end();)
|
||||
{
|
||||
IC();
|
||||
if((*it)->getOutputIndex()==newConnection->getOutputIndex())
|
||||
{
|
||||
IC();
|
||||
inputConnections_.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
}
|
||||
}
|
||||
IC();
|
||||
|
||||
std::cout << "Input newConnection added\nConnecting ops " << newConnection->getInputOpId() << " -> " << newConnection->getOutputOpId() << "\n";
|
||||
std::cout << "Connecting index " << newConnection->getInputIndex() << " -> " << newConnection->getOutputIndex() << "\n";
|
||||
// add new newConnection
|
||||
inputConnections_.push_back(newConnection);
|
||||
std::cout << "size: " << inputConnections_.size() << "\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -26,5 +26,8 @@ target_link_libraries(${libName} PRIVATE Qt6::Core Qt6::Widgets Qt6::SvgWidgets
|
||||
|
||||
|
||||
MESSAGE("CURRENT SOURCE DIR" ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(${libName} PUBLIC ../)
|
||||
target_include_directories(${libName} PUBLIC .)
|
||||
target_include_directories(${libName} PUBLIC
|
||||
../
|
||||
.
|
||||
../../extern/icecream-cpp/include
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user