Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
segment.hpp
Go to the documentation of this file.
1/*
2 SEGMENT.hpp - Segment of the timeline for rendering.
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
23#ifndef STEAM_FIXTURE_SEGMENT_H
24#define STEAM_FIXTURE_SEGMENT_H
25
26
27#include "steam/common.hpp"
33#include "lib/util.hpp"
34
35#include <utility>
36#include <deque>
37#include <tuple>
38
39
40namespace steam {
41namespace fixture {
42
43 using mobject::ExplicitPlacement;
45 using lib::time::Time;
46 using util::unConst;
47 using std::move;
48
59 class Segment
60 {
63 using PortTable = std::deque<std::reference_wrapper<JobTicket>>;
64
65 protected:
66
69
73
75
76 std::deque<ExplicitPlacement> elements;
77 // TODO: actually necessary??
78 // TODO: ownership??
80 public:
81 explicit
85
91 ,NodeGraphAttachment&& modelLink)
92 : span_{covered}
93 , ticketAlloc_{}
94 , portTable_{}
95 , exitNode{move (modelLink)}
96 { }
97
101 Segment (Segment const& original, TimeSpan changed)
102 : span_{changed}
103 , ticketAlloc_{} // Note: not cloning tickets owned by Segment
104 , portTable_{}
105 , exitNode{original.exitNode}
106 { }
107
108 // default copy acceptable
109
110 Time start() const { return span_.start(); }
111 Time after() const { return span_.end(); }
112
115
116
122 jobTicket (size_t portNr) const
123 {
124 if (portNr >= portTable_.size())
125 unConst(this)->generateTickets_onDemand (portNr);
126 ASSERT (portNr < portTable_.size());
127 return portTable_[portNr];
128 }
129
130 bool
131 empty() const
132 {
133 return exitNode.empty();
134 }
135
136
137 private:
138 void
140 {
141 for (size_t i = portTable_.size(); i <= portNr; ++i)
142 if (isnil (exitNode[portNr])) // ‣ disable this slot
143 portTable_.emplace_back (engine::JobTicket::NOP);
144 else
145 {// Ticket was not generated yet...
146 JobTicket& newTicket = ticketAlloc_(exitNode[portNr], ticketAlloc_);
147 portTable_.emplace_back (newTicket); // ref to new ticket ‣ slot
148 }
149 }
150 };
151
152
153
154}} // namespace steam::fixture
155#endif /*STEAM_FIXTURE_SEGMENT_H*/
A front-end/concept to allow access to custom memory management.
A time interval anchored at a specific point in time.
static const TimeSpan ALL
Time start() const
Lumiera's internal time value datatype.
execution plan for pulling a specific exit node.
static JobTicket NOP
special »do nothing« JobTicket marker
Binding and access point from a given Segment to access the actual render nodes.
For the purpose of building and rendering, the fixture (for each timeline) is partitioned such that e...
Definition segment.hpp:60
std::deque< ExplicitPlacement > elements
relevant MObjects comprising this segment.
Definition segment.hpp:76
TimeSpan span_
begin of this timeline segment.
Definition segment.hpp:68
std::deque< std::reference_wrapper< JobTicket > > PortTable
Definition segment.hpp:63
TicketAlloc ticketAlloc_
manage JobTicket: render plan / blueprint to use for this segment
Definition segment.hpp:71
engine::JobTicket & jobTicket(size_t portNr) const
Access the JobTicket for this segment and the given portNr.
Definition segment.hpp:122
NodeGraphAttachment exitNode
connection to the render nodes network
Definition segment.hpp:114
Segment(TimeSpan covered, NodeGraphAttachment &&modelLink)
create a new Segment to cover the given TimeSpan and to offer the rendering capabilities exposed by m...
Definition segment.hpp:90
void generateTickets_onDemand(size_t portNr)
Definition segment.hpp:139
Segment(TimeSpan span=TimeSpan::ALL)
create empty Segment
Definition segment.hpp:82
Segment(Segment const &original, TimeSpan changed)
copy-and-remould an existing Segment to sit at another time span
Definition segment.hpp:101
Core abstraction: completely resolved placement of an MObject Within the session model,...
Execution plan to generate render jobs within a specific render process.
Steam-Layer implementation namespace root.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
Definition util.hpp:358
Link from the Fixture datastructure into the render node network.
Basic set of definitions and includes commonly used together.
a family of time value like entities and their relationships.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...