Lumiera  0.pre.03
»edit your freedom«
toolfactory.cpp
Go to the documentation of this file.
1 /*
2  ToolFactory - supply of Tool implementations for the Builder
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
31 #include "lib/util.hpp"
32 
33 #include <memory>
34 
35 namespace steam {
36 namespace mobject {
37 namespace builder {
38 
39  using util::isnil;
40  using std::unique_ptr;
41 
42 
44  {
45 
46  fixture::Fixture & fixedTimeline_;
47  unique_ptr<engine::RenderGraph> procSegment_;
48 
49  unique_ptr<SegmentationTool> segmentation_;
50  unique_ptr<NodeCreatorTool> fabrication_;
51 
52 
53  BuildProcessState (fixture::Fixture& theTimeline)
54  : fixedTimeline_(theTimeline),
55  procSegment_(new engine::RenderGraph())
56  { }
57 
58  };
59 
61  : state_(new BuildProcessState (theFixture))
62  {
63  ENSURE (state_->fixedTimeline_.isValid());
64  ENSURE (state_->procSegment_.get());
65  }
66 
67 
70  {
71  REQUIRE (state_->fixedTimeline_.isValid());
72  REQUIRE (state_->procSegment_.get());
73 
74  state_->segmentation_.reset (new SegmentationTool (state_->fixedTimeline_));
75  return *(state_->segmentation_);
76  }
77 
78 
81  {
82  REQUIRE (state_->procSegment_.get());
83  REQUIRE (!isnil (*(state_->segmentation_)));
84 
85  state_->fabrication_.reset (new NodeCreatorTool(*this, *state_->procSegment_));
86  return *(state_->fabrication_);
87  }
88 
89 
92  {
93  state_->segmentation_.reset(0);
94  state_->fabrication_.reset(0);
95  UNIMPLEMENTED ("anything regarding the fixture and build process....");
96  return *state_->procSegment_;
97  }
98 
99 
100 
101 }}} // namespace steam::mobject::builder
NodeCreatorTool & configureFabrication()
prepare a tool for building the render engine (graph) for a single segment
Definition: toolfactory.cpp:80
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...
Definition: toolfactory.cpp:60
Steam-Layer implementation namespace root.
Factory to create the tools for the build process.
SegmentationTool & configureSegmentation()
prepare a tool for properly segmenting the Fixture
Definition: toolfactory.cpp:69
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
This Tool implementation plays the central role in the build process: given a MObject from Session...
engine::RenderGraph & getProduct()
receive the finished product of the build process; effectively releases any other builder tool object...
Definition: toolfactory.cpp:91