Merge branch 'feat/parameterUI'
This commit is contained in:
@@ -54,6 +54,7 @@ set(GUI_SOURCES
|
|||||||
# qt
|
# qt
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets SvgWidgets OpenGLWidgets)
|
find_package(Qt6 REQUIRED COMPONENTS Core Widgets SvgWidgets OpenGLWidgets)
|
||||||
qt_standard_project_setup()
|
qt_standard_project_setup()
|
||||||
|
ADD_DEFINITIONS(-DQT_NO_KEYWORDS)
|
||||||
|
|
||||||
# glm
|
# glm
|
||||||
find_package(glm REQUIRED)
|
find_package(glm REQUIRED)
|
||||||
|
|||||||
@@ -15,7 +15,19 @@ enzo::nt::OpId enzo::nt::NetworkManager::addOperator(op::OpInfo opInfo)
|
|||||||
{
|
{
|
||||||
|
|
||||||
maxOpId_++;
|
maxOpId_++;
|
||||||
gopStore_.emplace(maxOpId_, std::make_unique<GeometryOperator>(maxOpId_, opInfo));
|
std::unique_ptr<GeometryOperator> newOp = std::make_unique<GeometryOperator>(maxOpId_, opInfo);
|
||||||
|
newOp->nodeDirtied.connect(
|
||||||
|
[this](nt::OpId opId)
|
||||||
|
{
|
||||||
|
cookOp(opId);
|
||||||
|
|
||||||
|
if(getDisplayOp()==opId)
|
||||||
|
{
|
||||||
|
enzo::nt::GeometryOperator& displayOp = getGeoOperator(opId);
|
||||||
|
updateDisplay(displayOp.getOutputGeo(0));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
gopStore_.emplace(maxOpId_, std::move(newOp));
|
||||||
std::cout << "adding operator " << maxOpId_ << "\n";
|
std::cout << "adding operator " << maxOpId_ << "\n";
|
||||||
|
|
||||||
return maxOpId_;
|
return maxOpId_;
|
||||||
@@ -51,27 +63,25 @@ bool enzo::nt::NetworkManager::isValidOp(nt::OpId opId)
|
|||||||
|
|
||||||
void enzo::nt::NetworkManager::setDisplayOp(OpId opId)
|
void enzo::nt::NetworkManager::setDisplayOp(OpId opId)
|
||||||
{
|
{
|
||||||
std::cout << "gop size before: " << gopStore_.size() <<"\n";
|
|
||||||
displayOp_=opId;
|
displayOp_=opId;
|
||||||
std::vector<enzo::nt::OpId> dependencyGraph = getDependencyGraph(opId);
|
|
||||||
enzo::geo::Geometry prevGeometry;
|
|
||||||
std::cout << "size: " << dependencyGraph.size() << "\n";
|
|
||||||
|
|
||||||
for(enzo::nt::OpId dependencyOpId : dependencyGraph)
|
cookOp(opId);
|
||||||
{
|
|
||||||
cookOp(dependencyOpId);
|
|
||||||
}
|
|
||||||
std::cout << "gop size middle: " << gopStore_.size() <<"\n"; // <- size: 1
|
|
||||||
enzo::nt::GeometryOperator& displayOp = getGeoOperator(opId);
|
enzo::nt::GeometryOperator& displayOp = getGeoOperator(opId);
|
||||||
updateDisplay(displayOp.getOutputGeo(0));
|
updateDisplay(displayOp.getOutputGeo(0));
|
||||||
std::cout << "gop size after: " << gopStore_.size() <<"\n";
|
displayNodeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void enzo::nt::NetworkManager::cookOp(enzo::nt::OpId opId)
|
void enzo::nt::NetworkManager::cookOp(enzo::nt::OpId opId)
|
||||||
{
|
{
|
||||||
enzo::nt::GeometryOperator& op = getGeoOperator(opId);
|
std::vector<enzo::nt::OpId> dependencyGraph = getDependencyGraph(opId);
|
||||||
enzo::op::Context context(opId, enzo::nt::nm());
|
|
||||||
op.cookOp(context);
|
for(enzo::nt::OpId dependencyOpId : dependencyGraph)
|
||||||
|
{
|
||||||
|
enzo::nt::GeometryOperator& op = getGeoOperator(dependencyOpId);
|
||||||
|
enzo::op::Context context(dependencyOpId, enzo::nt::nm());
|
||||||
|
op.cookOp(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<enzo::nt::OpId> enzo::nt::NetworkManager::getDependencyGraph(enzo::nt::OpId opId)
|
std::vector<enzo::nt::OpId> enzo::nt::NetworkManager::getDependencyGraph(enzo::nt::OpId opId)
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ public:
|
|||||||
GeometryOperator& getGeoOperator(nt::OpId opId);
|
GeometryOperator& getGeoOperator(nt::OpId opId);
|
||||||
void setDisplayOp(OpId opId);
|
void setDisplayOp(OpId opId);
|
||||||
|
|
||||||
|
boost::signals2::signal<void ()> displayNodeChanged;
|
||||||
|
|
||||||
#ifdef UNIT_TEST
|
#ifdef UNIT_TEST
|
||||||
void _reset();
|
void _reset();
|
||||||
#endif
|
#endif
|
||||||
@@ -42,7 +44,9 @@ private:
|
|||||||
enzo::nt::OpId maxOpId_=0;
|
enzo::nt::OpId maxOpId_=0;
|
||||||
// operator selected for displaying in the viewport
|
// operator selected for displaying in the viewport
|
||||||
std::optional<OpId> displayOp_=std::nullopt;
|
std::optional<OpId> displayOp_=std::nullopt;
|
||||||
signals:
|
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
void updateDisplay(enzo::geo::Geometry& geometry);
|
void updateDisplay(enzo::geo::Geometry& geometry);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#include "Engine/Operator/Context.h"
|
#include "Engine/Operator/Context.h"
|
||||||
#include "Engine/Network/NetworkManager.h"
|
#include "Engine/Network/NetworkManager.h"
|
||||||
|
#include "Engine/Parameter/Parameter.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
enzo::op::Context::Context(enzo::nt::OpId opId, enzo::nt::NetworkManager& networkManager)
|
enzo::op::Context::Context(enzo::nt::OpId opId, enzo::nt::NetworkManager& networkManager)
|
||||||
@@ -23,3 +25,13 @@ enzo::geo::Geometry enzo::op::Context::cloneInputGeo(unsigned int inputIndex)
|
|||||||
return networkManager_.getGeoOperator(inputConnection->getInputOpId()).getOutputGeo(inputConnection->getInputIndex());
|
return networkManager_.getGeoOperator(inputConnection->getInputOpId()).getOutputGeo(inputConnection->getInputIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enzo::bt::floatT enzo::op::Context::evalFloatParm(const char* parmName) const
|
||||||
|
{
|
||||||
|
enzo::nt::GeometryOperator& selfOp = networkManager_.getGeoOperator(opId_);
|
||||||
|
std::weak_ptr<prm::Parameter> parameter = selfOp.getParameter(parmName);
|
||||||
|
|
||||||
|
if(auto sharedParm = parameter.lock())
|
||||||
|
{
|
||||||
|
return sharedParm->evalFloat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class Context
|
|||||||
public:
|
public:
|
||||||
Context(enzo::nt::OpId opId, enzo::nt::NetworkManager& networkManager);
|
Context(enzo::nt::OpId opId, enzo::nt::NetworkManager& networkManager);
|
||||||
enzo::geo::Geometry cloneInputGeo(unsigned int inputIndex);
|
enzo::geo::Geometry cloneInputGeo(unsigned int inputIndex);
|
||||||
|
bt::floatT evalFloatParm(const char* parmName) const;
|
||||||
private:
|
private:
|
||||||
enzo::nt::OpId opId_;
|
enzo::nt::OpId opId_;
|
||||||
enzo::nt::NetworkManager& networkManager_;
|
enzo::nt::NetworkManager& networkManager_;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ private:
|
|||||||
unsigned int minInputs_;
|
unsigned int minInputs_;
|
||||||
unsigned int maxInputs_;
|
unsigned int maxInputs_;
|
||||||
unsigned int maxOutputs_;
|
unsigned int maxOutputs_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enzo::nt::OpId opId_;
|
enzo::nt::OpId opId_;
|
||||||
const enzo::geo::Geometry& getInputGeoView(unsigned int inputIndex);
|
const enzo::geo::Geometry& getInputGeoView(unsigned int inputIndex);
|
||||||
|
|||||||
@@ -41,16 +41,24 @@ void nt::GeometryOperator::initParameters()
|
|||||||
{
|
{
|
||||||
std::cout << "name: " << t->getName() << "\n";
|
std::cout << "name: " << t->getName() << "\n";
|
||||||
// create parameter
|
// create parameter
|
||||||
parameters_.push_back(
|
auto parameter = std::make_shared<prm::Parameter>(*t);
|
||||||
std::make_shared<prm::Parameter>(*t)
|
parameter->valueChanged.connect(boost::bind(&GeometryOperator::dirtyNode, this));
|
||||||
);
|
|
||||||
|
parameters_.push_back(parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void enzo::nt::GeometryOperator::dirtyNode()
|
||||||
|
{
|
||||||
|
dirty_=true;
|
||||||
|
nodeDirtied(opId_);
|
||||||
|
}
|
||||||
|
|
||||||
void enzo::nt::GeometryOperator::cookOp(op::Context context)
|
void enzo::nt::GeometryOperator::cookOp(op::Context context)
|
||||||
{
|
{
|
||||||
opDef_->cookOp(context);
|
opDef_->cookOp(context);
|
||||||
|
dirty_=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
geo::Geometry& enzo::nt::GeometryOperator::getOutputGeo(unsigned outputIndex)
|
geo::Geometry& enzo::nt::GeometryOperator::getOutputGeo(unsigned outputIndex)
|
||||||
@@ -74,6 +82,19 @@ void nt::GeometryOperator::addOutputConnection(std::shared_ptr<nt::GeometryConne
|
|||||||
std::cout << "size: " << outputConnections_.size() << "\n";
|
std::cout << "size: " << outputConnections_.size() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::weak_ptr<prm::Parameter> nt::GeometryOperator::getParameter(std::string parameterName)
|
||||||
|
{
|
||||||
|
for(auto parm : parameters_)
|
||||||
|
{
|
||||||
|
if(parm->getName()==parameterName)
|
||||||
|
{
|
||||||
|
return parm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return std::weak_ptr<prm::Parameter>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::shared_ptr<const nt::GeometryConnection>> nt::GeometryOperator::getInputConnections() const
|
std::vector<std::shared_ptr<const nt::GeometryConnection>> nt::GeometryOperator::getInputConnections() const
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<const nt::GeometryConnection>> inputConnections;
|
std::vector<std::shared_ptr<const nt::GeometryConnection>> inputConnections;
|
||||||
|
|||||||
@@ -27,11 +27,18 @@ public:
|
|||||||
std::vector<std::shared_ptr<const GeometryConnection>> getInputConnections() const;
|
std::vector<std::shared_ptr<const GeometryConnection>> getInputConnections() const;
|
||||||
std::vector<std::shared_ptr<const GeometryConnection>> getOutputConnections() const;
|
std::vector<std::shared_ptr<const GeometryConnection>> getOutputConnections() const;
|
||||||
std::vector<std::weak_ptr<prm::Parameter>> getParameters();
|
std::vector<std::weak_ptr<prm::Parameter>> getParameters();
|
||||||
|
std::weak_ptr<prm::Parameter> getParameter(std::string parameterName);
|
||||||
|
|
||||||
|
void dirtyNode();
|
||||||
|
|
||||||
|
|
||||||
unsigned int getMaxInputs() const;
|
unsigned int getMaxInputs() const;
|
||||||
unsigned int getMaxOutputs() const;
|
unsigned int getMaxOutputs() const;
|
||||||
|
|
||||||
|
// signals
|
||||||
|
boost::signals2::signal<void (nt::OpId)> nodeDirtied;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initParameters();
|
void initParameters();
|
||||||
@@ -45,5 +52,6 @@ private:
|
|||||||
std::unique_ptr<enzo::nt::GeometryOpDef> opDef_;
|
std::unique_ptr<enzo::nt::GeometryOpDef> opDef_;
|
||||||
enzo::nt::OpId opId_;
|
enzo::nt::OpId opId_;
|
||||||
enzo::op::OpInfo opInfo_;
|
enzo::op::OpInfo opInfo_;
|
||||||
|
bool dirty_ = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "Engine/Parameter/Parameter.h"
|
#include "Engine/Parameter/Parameter.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
enzo::prm::Parameter::Parameter(Template prmTemplate)
|
enzo::prm::Parameter::Parameter(Template prmTemplate)
|
||||||
: template_{prmTemplate}
|
: template_{prmTemplate}
|
||||||
{
|
{
|
||||||
|
floatValue_ = prmTemplate.getDefault();
|
||||||
std::cout << "created new parameter: " << prmTemplate.getName() << "\n";
|
std::cout << "created new parameter: " << prmTemplate.getName() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,5 +20,6 @@ enzo::bt::floatT enzo::prm::Parameter::evalFloat() const
|
|||||||
void enzo::prm::Parameter::setFloat(bt::floatT value)
|
void enzo::prm::Parameter::setFloat(bt::floatT value)
|
||||||
{
|
{
|
||||||
floatValue_ = value;
|
floatValue_ = value;
|
||||||
|
valueChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Engine/Parameter/Template.h"
|
#include "Engine/Parameter/Template.h"
|
||||||
#include "Engine/Types.h"
|
#include "Engine/Types.h"
|
||||||
|
#include <boost/signals2.hpp>
|
||||||
|
|
||||||
namespace enzo::prm
|
namespace enzo::prm
|
||||||
{
|
{
|
||||||
@@ -11,6 +12,7 @@ public:
|
|||||||
std::string getName() const;
|
std::string getName() const;
|
||||||
bt::floatT evalFloat() const;
|
bt::floatT evalFloat() const;
|
||||||
void setFloat(bt::floatT value);
|
void setFloat(bt::floatT value);
|
||||||
|
boost::signals2::signal<void ()> valueChanged;
|
||||||
private:
|
private:
|
||||||
Template template_;
|
Template template_;
|
||||||
bt::floatT floatValue_ = 0;
|
bt::floatT floatValue_ = 0;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include "Engine/Parameter/Template.h"
|
#include "Engine/Parameter/Template.h"
|
||||||
#include "Engine/Parameter/Type.h"
|
#include "Engine/Parameter/Type.h"
|
||||||
|
|
||||||
enzo::prm::Template::Template(enzo::prm::Type type, const char* name)
|
enzo::prm::Template::Template(enzo::prm::Type type, const char* name, bt::floatT theDefault)
|
||||||
: type_{type}, name_{name}
|
: type_{type}, name_{name}, default_{theDefault}
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,11 @@ bool enzo::prm::Template::isValid() const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const enzo::bt::floatT enzo::prm::Template::getDefault() const
|
||||||
|
{
|
||||||
|
return default_;
|
||||||
|
}
|
||||||
|
|
||||||
const char* enzo::prm::Template::getName() const
|
const char* enzo::prm::Template::getName() const
|
||||||
{
|
{
|
||||||
return name_;
|
return name_;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Engine/Parameter/Type.h"
|
#include "Engine/Parameter/Type.h"
|
||||||
|
#include "Engine/Types.h"
|
||||||
|
|
||||||
namespace enzo::prm
|
namespace enzo::prm
|
||||||
{
|
{
|
||||||
@@ -7,12 +8,19 @@ namespace enzo::prm
|
|||||||
class Template
|
class Template
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Template(enzo::prm::Type type, const char* name);
|
Template(
|
||||||
|
enzo::prm::Type type,
|
||||||
|
const char* name,
|
||||||
|
// TODO: change default to class that can store multiple types
|
||||||
|
bt::floatT theDefault
|
||||||
|
);
|
||||||
Template();
|
Template();
|
||||||
const char* getName() const;
|
const char* getName() const;
|
||||||
|
const bt::floatT getDefault() const;
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
private:
|
private:
|
||||||
enzo::prm::Type type_;
|
enzo::prm::Type type_;
|
||||||
|
bt::floatT default_;
|
||||||
// TODO: make a class that holds token and name
|
// TODO: make a class that holds token and name
|
||||||
const char* name_;
|
const char* name_;
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ EnzoUI::EnzoUI()
|
|||||||
|
|
||||||
// connect signals
|
// connect signals
|
||||||
connect(&enzo::nt::nm(), &enzo::nt::NetworkManager::updateDisplay, viewport, &Viewport::geometryChanged);
|
connect(&enzo::nt::nm(), &enzo::nt::NetworkManager::updateDisplay, viewport, &Viewport::geometryChanged);
|
||||||
connect(&enzo::nt::nm(), &enzo::nt::NetworkManager::updateDisplay, parametersPanel, &ParametersPanel::selectionChanged);
|
enzo::nt::nm().displayNodeChanged.connect([parametersPanel](){parametersPanel->selectionChanged();});
|
||||||
|
// connect(&enzo::nt::nm(), &enzo::nt::NetworkManager::updateDisplay, parametersPanel, &ParametersPanel::selectionChanged);
|
||||||
|
|
||||||
// ─── end of EnzoUI ctor ───
|
// ─── end of EnzoUI ctor ───
|
||||||
QTimer::singleShot(0, this, [=] {
|
QTimer::singleShot(0, this, [=] {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ protected:
|
|||||||
void focusOutEvent(QFocusEvent *event) override;
|
void focusOutEvent(QFocusEvent *event) override;
|
||||||
bool event(QEvent *event) override;
|
bool event(QEvent *event) override;
|
||||||
// void resizeEvent(QResizeEvent *event) override;
|
// void resizeEvent(QResizeEvent *event) override;
|
||||||
protected slots:
|
protected Q_SLOTS:
|
||||||
void nodeClicked();
|
void nodeClicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ enzo::ui::AbstractFormParm::AbstractFormParm(std::weak_ptr<prm::Parameter> param
|
|||||||
label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||||
|
|
||||||
auto slider = new AbstractSliderParm();
|
auto slider = new AbstractSliderParm();
|
||||||
connect(slider, &AbstractSliderParm::valueChanged, this, &AbstractFormParm::changeValue);
|
|
||||||
slider->setValue(sharedParameter->evalFloat());
|
slider->setValue(sharedParameter->evalFloat());
|
||||||
|
|
||||||
mainLayout_ = new QHBoxLayout();
|
mainLayout_ = new QHBoxLayout();
|
||||||
@@ -28,6 +27,8 @@ enzo::ui::AbstractFormParm::AbstractFormParm(std::weak_ptr<prm::Parameter> param
|
|||||||
setProperty("class", "Parameter");
|
setProperty("class", "Parameter");
|
||||||
setStyleSheet(".Parameter { background-color: none;}");
|
setStyleSheet(".Parameter { background-color: none;}");
|
||||||
setLayout(mainLayout_);
|
setLayout(mainLayout_);
|
||||||
|
|
||||||
|
connect(slider, &AbstractSliderParm::valueChanged, this, &AbstractFormParm::changeValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
namespace enzo::ui
|
namespace enzo::ui
|
||||||
{
|
{
|
||||||
@@ -9,13 +10,13 @@ namespace enzo::ui
|
|||||||
class AbstractFormParm
|
class AbstractFormParm
|
||||||
: public QWidget
|
: public QWidget
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AbstractFormParm(std::weak_ptr<prm::Parameter> parameter);
|
AbstractFormParm(std::weak_ptr<prm::Parameter> parameter);
|
||||||
|
|
||||||
protected slots:
|
protected Q_SLOTS:
|
||||||
void changeValue(bt::floatT value);
|
void changeValue(bt::floatT value);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHBoxLayout* mainLayout_;
|
QHBoxLayout* mainLayout_;
|
||||||
std::weak_ptr<prm::Parameter> parameter_;
|
std::weak_ptr<prm::Parameter> parameter_;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public:
|
|||||||
AbstractSliderParm(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
AbstractSliderParm(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||||
void setValue(bt::floatT value);
|
void setValue(bt::floatT value);
|
||||||
|
|
||||||
signals:
|
Q_SIGNALS:
|
||||||
void valueChanged(bt::floatT value);
|
void valueChanged(bt::floatT value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class ParametersPanel
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ParametersPanel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
ParametersPanel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||||
public slots:
|
public Q_SLOTS:
|
||||||
void selectionChanged();
|
void selectionChanged();
|
||||||
private:
|
private:
|
||||||
QVBoxLayout* mainLayout_;
|
QVBoxLayout* mainLayout_;
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ private:
|
|||||||
QPointF leftStartPos_;
|
QPointF leftStartPos_;
|
||||||
bool rightMouseDown_=false;
|
bool rightMouseDown_=false;
|
||||||
QPointF rightStartPos_;
|
QPointF rightStartPos_;
|
||||||
public slots:
|
public Q_SLOTS:
|
||||||
void geometryChanged(enzo::geo::Geometry& geometry);
|
void geometryChanged(enzo::geo::Geometry& geometry);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,6 +25,6 @@ protected:
|
|||||||
void resizeGL(int w, int h) override;
|
void resizeGL(int w, int h) override;
|
||||||
void paintGL() override;
|
void paintGL() override;
|
||||||
|
|
||||||
public slots:
|
public Q_SLOTS:
|
||||||
void geometryChanged(enzo::geo::Geometry& geometry);
|
void geometryChanged(enzo::geo::Geometry& geometry);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ add_library(${libName} SHARED
|
|||||||
../Engine/Operator/Attribute.cpp
|
../Engine/Operator/Attribute.cpp
|
||||||
../Engine/Network/NetworkManager.cpp
|
../Engine/Network/NetworkManager.cpp
|
||||||
../Engine/Parameter/Template.cpp
|
../Engine/Parameter/Template.cpp
|
||||||
|
../Engine/Parameter/Parameter.cpp
|
||||||
GopTransform.cpp
|
GopTransform.cpp
|
||||||
GopHouse.cpp
|
GopHouse.cpp
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ void GOP_house::cookOp(enzo::op::Context context)
|
|||||||
for(int i=0; i<PAttrHandle.getAllValues().size(); ++i)
|
for(int i=0; i<PAttrHandle.getAllValues().size(); ++i)
|
||||||
{
|
{
|
||||||
enzo::bt::Vector3 vector = PAttrHandle.getValue(i);
|
enzo::bt::Vector3 vector = PAttrHandle.getValue(i);
|
||||||
vector.x()+=2.5;
|
vector*=context.evalFloatParm("size");
|
||||||
PAttrHandle.setValue(i, vector);
|
PAttrHandle.setValue(i, vector);
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
@@ -69,18 +69,10 @@ void GOP_house::cookOp(enzo::op::Context context)
|
|||||||
setOutputGeometry(0, geo);
|
setOutputGeometry(0, geo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(outputRequested(1))
|
|
||||||
// {
|
|
||||||
// // create new geometry
|
|
||||||
// const geo::Geometry& geo1 = getInputGeoView(0);
|
|
||||||
// geo::Geometry geo2;
|
|
||||||
|
|
||||||
// setOutputGeometry(1, geo2);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enzo::prm::Template GOP_house::parameterList[] =
|
enzo::prm::Template GOP_house::parameterList[] =
|
||||||
{
|
{
|
||||||
enzo::prm::Template(enzo::prm::Type::FLOAT, "Size"),
|
enzo::prm::Template(enzo::prm::Type::FLOAT, "size", 1),
|
||||||
enzo::prm::Terminator
|
enzo::prm::Terminator
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ void GopTransform::cookOp(enzo::op::Context context)
|
|||||||
for(int i=0; i<PAttrHandle.getAllValues().size(); ++i)
|
for(int i=0; i<PAttrHandle.getAllValues().size(); ++i)
|
||||||
{
|
{
|
||||||
enzo::bt::Vector3 vector = PAttrHandle.getValue(i);
|
enzo::bt::Vector3 vector = PAttrHandle.getValue(i);
|
||||||
vector.y()+=2.5;
|
vector.x()+=context.evalFloatParm("translateX");
|
||||||
|
vector.y()+=context.evalFloatParm("translateY");
|
||||||
|
vector.z()+=context.evalFloatParm("translateZ");
|
||||||
PAttrHandle.setValue(i, vector);
|
PAttrHandle.setValue(i, vector);
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
@@ -41,9 +43,9 @@ void GopTransform::cookOp(enzo::op::Context context)
|
|||||||
|
|
||||||
enzo::prm::Template GopTransform::parameterList[] =
|
enzo::prm::Template GopTransform::parameterList[] =
|
||||||
{
|
{
|
||||||
enzo::prm::Template(enzo::prm::Type::FLOAT, "translateX"),
|
enzo::prm::Template(enzo::prm::Type::FLOAT, "translateX", 0),
|
||||||
enzo::prm::Template(enzo::prm::Type::FLOAT, "translateY"),
|
enzo::prm::Template(enzo::prm::Type::FLOAT, "translateY", 0),
|
||||||
enzo::prm::Template(enzo::prm::Type::FLOAT, "translateZ"),
|
enzo::prm::Template(enzo::prm::Type::FLOAT, "translateZ", 0),
|
||||||
enzo::prm::Terminator
|
enzo::prm::Terminator
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user