2008-05-27 07:22:27 +02:00
|
|
|
/*
|
2008-10-13 04:33:10 +02:00
|
|
|
NodeFactory - Interface for creating processing nodes of various kinds
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-05-27 07:22:27 +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
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "proc/engine/nodefactory.hpp"
|
|
|
|
|
#include "proc/mobject/session/effect.hpp"
|
2010-12-18 00:58:19 +01:00
|
|
|
#include "lib/allocation-cluster.hpp"
|
2008-05-27 07:22:27 +02:00
|
|
|
|
2008-10-17 05:48:02 +02:00
|
|
|
#include "proc/engine/nodewiring.hpp"
|
|
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
namespace engine {
|
2008-10-17 05:48:02 +02:00
|
|
|
|
|
|
|
|
namespace { // Details of node fabrication
|
2008-05-27 07:22:27 +02:00
|
|
|
|
2009-09-05 04:10:51 +02:00
|
|
|
////////////////////////////////////////////////TODO: still needed?
|
|
|
|
|
|
2008-10-17 05:48:02 +02:00
|
|
|
} // (END) Details of node fabrication
|
|
|
|
|
|
|
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
using mobject::Placement;
|
|
|
|
|
using mobject::session::Effect;
|
|
|
|
|
|
2008-10-17 05:48:02 +02:00
|
|
|
|
2008-05-27 07:22:27 +02:00
|
|
|
/** create a processing node able to render an effect */
|
2009-09-05 04:10:51 +02:00
|
|
|
PNode
|
|
|
|
|
NodeFactory::operator() (Placement<Effect> const& effect, WiringSituation& intendedWiring)
|
2008-05-27 07:22:27 +02:00
|
|
|
{
|
2009-09-05 04:10:51 +02:00
|
|
|
intendedWiring.resolveProcessor(effect->getProcAsset());
|
|
|
|
|
WiringDescriptor& wiring = wiringFac_(intendedWiring);
|
|
|
|
|
|
2009-09-05 18:15:58 +02:00
|
|
|
ProcNode& newNode = alloc_.create<ProcNode> (wiring);
|
|
|
|
|
ENSURE (newNode.isValid());
|
|
|
|
|
return &newNode;
|
2008-05-27 07:22:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace engine
|