feat: register parameter list
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void enzo::op::OperatorTable::addOperator(const char* internalName, const char* displayName, nt::opConstructor ctorFunc)
|
||||
void enzo::op::OperatorTable::addOperator(const char* internalName, const char* displayName, nt::opConstructor ctorFunc, prm::Template templateList[])
|
||||
{
|
||||
std::cout << "OPERATOR TABLE ADDED\n";
|
||||
std::cout << "adding operator: " << displayName << "\n";
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include "Engine/Network/NetworkManager.h"
|
||||
#include "Engine/Operator/GeometryOpDef.h"
|
||||
#include "Engine/Parameter/Template.h"
|
||||
|
||||
|
||||
namespace enzo::op
|
||||
@@ -17,7 +18,7 @@ struct OpInfo
|
||||
class BOOST_SYMBOL_EXPORT OperatorTable
|
||||
{
|
||||
public:
|
||||
static void addOperator(const char* internalName, const char* displayName, nt::opConstructor ctorFunc);
|
||||
static void addOperator(const char* internalName, const char* displayName, nt::opConstructor ctorFunc, prm::Template templateList[]);
|
||||
static nt::opConstructor getOpConstructor(std::string name);
|
||||
static std::vector<OpInfo> getData();
|
||||
// TODO: move to better spot (maybe engine class)
|
||||
@@ -25,6 +26,6 @@ public:
|
||||
private:
|
||||
static std::vector<OpInfo> opInfoStore_;
|
||||
};
|
||||
using addOperatorPtr = void (*)(const char* internalName, const char* displayName, nt::opConstructor ctorFunc);
|
||||
using addOperatorPtr = void (*)(const char* internalName, const char* displayName, nt::opConstructor ctorFunc, prm::Template templateList[]);
|
||||
}
|
||||
|
||||
|
||||
1
src/Engine/Parameter/FloatType.cpp
Normal file
1
src/Engine/Parameter/FloatType.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "Engine/Parameter/FloatType.h"
|
||||
12
src/Engine/Parameter/FloatType.h
Normal file
12
src/Engine/Parameter/FloatType.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include "Engine/Parameter/Type.h"
|
||||
|
||||
// namespace enzo::prm
|
||||
// {
|
||||
// class FloatType
|
||||
// : public Type
|
||||
// {
|
||||
// public:
|
||||
|
||||
// };
|
||||
// }
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "Engine/Parameter/Template.h"
|
||||
#include "Engine/Parameter/Type.h"
|
||||
|
||||
enzo::prm::Template::Template()
|
||||
enzo::prm::Template::Template(enzo::prm::Type type)
|
||||
: type_{type}
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#pragma once
|
||||
#include "Engine/Parameter/Type.h"
|
||||
|
||||
namespace enzo::prm
|
||||
{
|
||||
|
||||
class Template
|
||||
{
|
||||
Template();
|
||||
public:
|
||||
Template(enzo::prm::Type type);
|
||||
private:
|
||||
enzo::prm::Type type_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -2,10 +2,22 @@
|
||||
|
||||
namespace enzo::prm
|
||||
|
||||
{
|
||||
class Type
|
||||
{
|
||||
|
||||
enum class Type
|
||||
{
|
||||
STRING,
|
||||
FLOAT,
|
||||
INT,
|
||||
};
|
||||
|
||||
|
||||
// class Type
|
||||
// {
|
||||
|
||||
// };
|
||||
|
||||
// const extern prm::Type FlOAT_TYPE;
|
||||
// const extern prm::Type STRING_TYPE;
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ add_library(${libName} SHARED
|
||||
../Engine/Operator/Geometry.cpp
|
||||
../Engine/Operator/Attribute.cpp
|
||||
../Engine/Network/NetworkManager.cpp
|
||||
../Engine/Parameter/Template.cpp
|
||||
GopTransform.cpp
|
||||
GopHouse.cpp
|
||||
)
|
||||
|
||||
@@ -79,3 +79,4 @@ void GOP_house::cookOp(enzo::op::Context context)
|
||||
// }
|
||||
}
|
||||
|
||||
enzo::prm::Template GOP_house::parameterList[] = {};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Engine/Operator/GeometryOpDef.h"
|
||||
#include "Engine/Parameter/Template.h"
|
||||
|
||||
class GOP_house
|
||||
: public enzo::nt::GeometryOpDef
|
||||
@@ -12,4 +13,6 @@ public:
|
||||
return new GOP_house(opId);
|
||||
}
|
||||
|
||||
static BOOST_SYMBOL_EXPORT enzo::prm::Template parameterList[];
|
||||
|
||||
};
|
||||
|
||||
@@ -38,3 +38,5 @@ void GopTransform::cookOp(enzo::op::Context context)
|
||||
|
||||
}
|
||||
|
||||
enzo::prm::Template GopTransform::parameterList[] = {};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Engine/Operator/GeometryOpDef.h"
|
||||
#include "Engine/Parameter/Template.h"
|
||||
|
||||
class GopTransform
|
||||
: public enzo::nt::GeometryOpDef
|
||||
@@ -12,4 +13,6 @@ public:
|
||||
return new GopTransform(opId);
|
||||
}
|
||||
|
||||
static BOOST_SYMBOL_EXPORT enzo::prm::Template parameterList[];
|
||||
|
||||
};
|
||||
|
||||
@@ -11,12 +11,14 @@ extern "C"
|
||||
addOperator(
|
||||
"transform",
|
||||
"Transform",
|
||||
&GopTransform::ctor
|
||||
&GopTransform::ctor,
|
||||
GopTransform::parameterList
|
||||
);
|
||||
addOperator(
|
||||
"house",
|
||||
"House",
|
||||
&GOP_house::ctor
|
||||
&GOP_house::ctor,
|
||||
GopTransform::parameterList
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user