2007-08-08 04:50:02 +02:00
|
|
|
/*
|
|
|
|
|
PROCNODE.hpp - Key abstraction of the Render Engine: a Processing Node
|
|
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
2007-08-08 04:50:02 +02:00
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
#ifndef ENGINE_PROCNODE_H
|
|
|
|
|
#define ENGINE_PROCNODE_H
|
2007-08-08 04:50:02 +02:00
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
#include "proc/mobject/parameter.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
namespace engine {
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
using std::vector;
|
|
|
|
|
|
|
|
|
|
class ProcNode;
|
|
|
|
|
class NodeFactory;
|
|
|
|
|
|
|
|
|
|
typedef ProcNode* PNode; ///< @todo handle ProcNode by pointer or by shared-ptr??
|
2007-08-08 04:50:02 +02:00
|
|
|
|
|
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
/**
|
|
|
|
|
* Key abstraction of the Render Engine: A Data processing Node
|
|
|
|
|
*/
|
|
|
|
|
class ProcNode
|
|
|
|
|
{
|
|
|
|
|
typedef mobject::Parameter<double> Param;
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
/** The predecessor in a processing pipeline.
|
|
|
|
|
* I.e. a source to get data to be processed
|
|
|
|
|
*/
|
2008-05-27 07:22:27 +02:00
|
|
|
PNode datasrc;
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
vector<Param> params;
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
protected:
|
|
|
|
|
ProcNode();
|
|
|
|
|
virtual ~ProcNode() {};
|
|
|
|
|
|
|
|
|
|
friend class NodeFactory;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** do the actual calculations.
|
|
|
|
|
* @internal dispatch to implementation.
|
|
|
|
|
* Client code should use #render()
|
|
|
|
|
* @todo obviously we need a parameter!!!
|
|
|
|
|
*/
|
|
|
|
|
virtual void process() = 0;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static NodeFactory create;
|
|
|
|
|
|
|
|
|
|
/** render and pull output from this node.
|
|
|
|
|
* @todo define the parameter!!!
|
|
|
|
|
*/
|
|
|
|
|
void render() { this->process(); }
|
|
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
};
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
} // namespace engine
|
2007-08-08 04:50:02 +02:00
|
|
|
#endif
|