Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
toolfactory.cpp
Go to the documentation of this file.
1/*
2 ToolFactory - supply of Tool implementations for the Builder
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
22#include "lib/util.hpp"
23
24#include <memory>
25
26namespace steam {
27namespace mobject {
28namespace builder {
29
30 using util::isnil;
31 using std::unique_ptr;
32
33
35 {
36
38 unique_ptr<engine::RenderGraph> procSegment_;
39
40 unique_ptr<SegmentationTool> segmentation_;
41 unique_ptr<NodeCreatorTool> fabrication_;
42
43
45 : fixedTimeline_(theTimeline),
46 procSegment_(new engine::RenderGraph())
47 { }
48
49 };
50
52 : state_(new BuildProcessState (theFixture))
53 {
54 ENSURE (state_->fixedTimeline_.isValid());
55 ENSURE (state_->procSegment_.get());
56 }
57
58
61 {
62 REQUIRE (state_->fixedTimeline_.isValid());
63 REQUIRE (state_->procSegment_.get());
64
65 state_->segmentation_.reset (new SegmentationTool (state_->fixedTimeline_));
66 return *(state_->segmentation_);
67 }
68
69
72 {
73 REQUIRE (state_->procSegment_.get());
74 REQUIRE (!isnil (*(state_->segmentation_)));
75
76 state_->fabrication_.reset (new NodeCreatorTool(*this, *state_->procSegment_));
77 return *(state_->fabrication_);
78 }
79
80
83 {
84 state_->segmentation_.reset(0);
85 state_->fabrication_.reset(0);
86 UNIMPLEMENTED ("anything regarding the fixture and build process....");
87 return *state_->procSegment_;
88 }
89
90
91
92}}} // namespace steam::mobject::builder
This Tool implementation plays the central role in the build process: given a MObject from Session,...
Tool implementation for deriving a partitioning of the current timeline, such that each Segment has a...
ToolFactory(fixture::Fixture &)
prepare a builder tool kit for dealing with the given Fixture, which is a snapshot of some timeline m...
std::unique_ptr< BuildProcessState > state_
NodeCreatorTool & configureFabrication()
prepare a tool for building the render engine (graph) for a single segment
engine::RenderGraph & getProduct()
receive the finished product of the build process; effectively releases any other builder tool object
SegmentationTool & configureSegmentation()
prepare a tool for properly segmenting the Fixture
Steam-Layer implementation namespace root.
bool isnil(lib::time::Duration const &dur)
unique_ptr< SegmentationTool > segmentation_
unique_ptr< engine::RenderGraph > procSegment_
unique_ptr< NodeCreatorTool > fabrication_
BuildProcessState(fixture::Fixture &theTimeline)
Factory to create the tools for the build process.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...