2007-08-08 04:50:02 +02:00
|
|
|
/*
|
2008-11-05 05:03:03 +01:00
|
|
|
SEGMENT.hpp - Segment of the timeline for rendering.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
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
|
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.
|
|
|
|
|
|
2007-08-08 04:50:02 +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
|
|
|
|
2007-08-08 04:50:02 +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
|
|
|
|
2007-08-08 04:50:02 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2016-11-03 18:22:31 +01:00
|
|
|
/** @file segment.hpp
|
2016-11-09 22:22:55 +01:00
|
|
|
** Building block of the backbone of the low-level (render node) model
|
|
|
|
|
** @todo stalled effort towards a session implementation from 2008
|
|
|
|
|
** @todo 2016 likely to stay, but expect some extensive rework
|
2016-11-03 18:20:10 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2023-04-25 18:27:16 +02:00
|
|
|
#ifndef STEAM_FIXTURE_SEGMENT_H
|
|
|
|
|
#define STEAM_FIXTURE_SEGMENT_H
|
2007-08-08 04:50:02 +02:00
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
|
|
2018-11-15 23:42:43 +01:00
|
|
|
#include "steam/common.hpp"
|
|
|
|
|
#include "steam/mobject/explicitplacement.hpp"
|
2023-04-27 22:30:49 +02:00
|
|
|
#include "steam/engine/job-ticket.hpp"
|
2011-05-16 08:37:36 +02:00
|
|
|
#include "lib/time/timevalue.hpp"
|
2007-08-08 04:50:02 +02:00
|
|
|
|
|
|
|
|
using std::list;
|
|
|
|
|
|
2018-11-15 23:55:13 +01:00
|
|
|
namespace steam {
|
2023-04-25 18:27:16 +02:00
|
|
|
namespace fixture {
|
2011-12-02 16:10:03 +01:00
|
|
|
|
2023-04-25 18:27:16 +02:00
|
|
|
using mobject::ExplicitPlacement;
|
2023-04-27 19:38:37 +02:00
|
|
|
using lib::time::TimeSpan;
|
2023-04-27 22:30:49 +02:00
|
|
|
using lib::time::Time;
|
2011-12-02 16:10:03 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* For the purpose of building and rendering, the fixture (for each timeline)
|
2023-04-27 19:38:37 +02:00
|
|
|
* is partitioned such that each segment is _structurally constant._
|
|
|
|
|
* For each segment there is a RenderGraph (unit of the render engine)
|
|
|
|
|
* which is able to render all ExitNodes for this segment.
|
2012-01-28 23:12:42 +01:00
|
|
|
*
|
2023-04-25 18:27:16 +02:00
|
|
|
* @ingroup fixture
|
2012-01-28 23:12:42 +01:00
|
|
|
* @todo 1/2012 Just a Placeholder. The real thing is not yet implemented.
|
2023-04-27 19:38:37 +02:00
|
|
|
* @todo WIP-WIP as of 4/2023 -- about to pull up the engine backbone
|
2012-01-28 23:12:42 +01:00
|
|
|
* @see http://lumiera.org/wiki/renderengine.html#Fixture
|
2011-12-02 16:10:03 +01:00
|
|
|
*/
|
|
|
|
|
class Segment
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
/** begin of this timeline segment. */
|
2023-04-27 19:38:37 +02:00
|
|
|
TimeSpan span_;
|
2011-12-02 16:10:03 +01:00
|
|
|
|
2023-04-27 22:30:49 +02:00
|
|
|
/** render plan / blueprint to use for this segment */
|
|
|
|
|
const engine::JobTicket* jobTicket_;
|
|
|
|
|
|
2023-04-27 19:38:37 +02:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #725 : placeholder code
|
2011-12-02 16:10:03 +01:00
|
|
|
/** relevant MObjects comprising this segment. */
|
|
|
|
|
list<ExplicitPlacement> elements;
|
|
|
|
|
// TODO: actually necessary??
|
|
|
|
|
// TODO: ownership??
|
2023-04-27 19:38:37 +02:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #725 : placeholder code
|
|
|
|
|
public:
|
|
|
|
|
Segment (TimeSpan covered =TimeSpan::ALL)
|
|
|
|
|
: span_{covered}
|
2023-04-27 22:30:49 +02:00
|
|
|
, jobTicket_{&engine::JobTicket::NOP}
|
2023-04-27 19:38:37 +02:00
|
|
|
{ }
|
2011-12-02 16:10:03 +01:00
|
|
|
|
2023-04-27 19:38:37 +02:00
|
|
|
// default copy acceptable
|
2023-04-27 22:30:49 +02:00
|
|
|
|
|
|
|
|
Time start() const { return span_.start(); }
|
2023-05-02 21:24:26 +02:00
|
|
|
Time after() const { return span_.end(); }
|
2023-04-27 22:30:49 +02:00
|
|
|
|
|
|
|
|
engine::JobTicket const&
|
|
|
|
|
jobTicket() const
|
|
|
|
|
{
|
|
|
|
|
REQUIRE (jobTicket_);
|
|
|
|
|
return *jobTicket_;
|
|
|
|
|
}
|
2011-12-02 16:10:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-25 18:27:16 +02:00
|
|
|
}} // namespace steam::fixture
|
|
|
|
|
#endif /*STEAM_FIXTURE_SEGMENT_H*/
|