ImFusion SDK 4.3
ExampleAlgorithm.h
#pragma once
#include <ImFusion/Base/Algorithm.h>
#include <ImFusion/Base/SharedImageSet.h>
#include <ImFusion/Core/Mat.h>
#include <ImFusion/Core/Parameter.h>
#include <vector>
using namespace ImFusion;
class ExampleAlgorithm : public Algorithm
{
public:
// Algorithm can have any kind of constructor
// Usually it's a good idea to use the input data as arguments
explicit ExampleAlgorithm(SharedImageSet* image);
~ExampleAlgorithm();
static bool createCompatible(const DataList& data, Algorithm** a = 0);
void compute() override;
OwningDataList takeOutput() override;
void configure(const Properties* p) override;
void configuration(Properties* p) const override;
private:
SharedImageSet* m_image;
private:
public:
// Use the Parameter class for convenience to save some boilerplate code for
// (de)serialization. Define the name and initial (and default) value here, and register
// the Parameter with the parent Configurable interface.
Parameter<int> p_paramInt = {"paramInt", 0, this};
private:
// Alternatively, you can do the (de)serialization of members manually.
double m_paramDouble;
vec2 m_paramVec;
};
Interface for describing algorithms that can be made available in the ImFusion Suite through Algorith...
Definition Algorithm.h:41
Container for any number of Data instances such as image or meshes.
Definition DataList.h:30
Wrapper class to store a list of owned Data instances.
Definition OwningDataList.h:24
The Parameter class represents a single parameter of a Configurable entity.
Definition Parameter.h:53
Storage container for serialization of arbitrary types, internally backed by strings.
Definition Properties.h:50
Set of images independent of their storage location.
Definition SharedImageSet.h:42
Namespace of the ImFusion SDK.
Definition Assert.h:7
Search Tab / S to search, Esc to close