Lumiera  0.pre.03
»edit your freedom«
placement-basic-test.cpp
Go to the documentation of this file.
1 /*
2  PlacementBasic(Test) - basic Placement and MObject handling
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 
19 #include "lib/test/run.hpp"
20 #include "steam/asset/media.hpp"
26 #include "lib/time/timevalue.hpp"
27 //#include "lib/util.hpp"
28 
29 
30 using lib::time::Time;
31 
32 
33 namespace steam {
34 namespace mobject {
35 namespace session {
36 namespace test {
37 
38  using asset::VIDEO;
39 
40 
41 
42  /***************************************************************/
49  class PlacementBasic_test : public Test
50  {
53 
54  virtual void
55  run (Arg)
56  {
57  // create Clip-MObject, which is wrapped into a placement (smart ptr)
58  PM media = asset::Media::create("test-1", VIDEO);
59  PCA clipAsset = Media::create(*media);
60  Placement<Clip> pc = MObject::create (*clipAsset, *media);
61 
62  // use of the Clip-MObject interface by dereferencing the placement
63  PM clip_media = pc->getMedia();
64  CHECK (clip_media->ident.category.hasKind (VIDEO));
65 
66  // using the Placement interface
67  // TODO: how to handle insufficiently determinated Placement? Throw?
68  FixedLocation & fixloc = pc.chain (Time(0,1)); // TODO: the fork??
69  ExplicitPlacement expla = pc.resolve();
70  CHECK (expla.time == Time(0,1));
71  CHECK (!expla.chain.isOverdetermined());
72 // CHECK (*expla == *pc); ////////////////////////////////////////////TICKET #511 define equivalence of locating chains and solutions
73 
74  // now overconstraining with another Placement
75  pc.chain (Time(0,2));
76  ExplicitPlacement expla2 = pc.resolve();
77  CHECK (expla2.time == Time(0,2)); // the latest addition wins
78  CHECK (expla2.chain.isOverdetermined());
79  }
80  };
81 
82 
84  LAUNCHER (PlacementBasic_test, "unit session");
85 
86 
87 
88 }}}} // namespace steam::mobject::session::test
Media data represented a specific kind of Asset.
Core abstraction: completely resolved placement of an MObject Within the session model, all media objects are attached with the help of mobject::Placement elements.
Definition: run.hpp:40
Core abstraction: placement of a media object into session context.
Special kind of Placement, where the location of the MObject has been nailed down to a fixed position...
static MediaFactory create
storage for the static MediaFactory instance
Definition: media.hpp:75
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:299
The most common case of positioning a MObject in the Session: directly specifying a constant position...
Simplistic test class runner.
A stub implementation of the Clip interface for unit testing.
Core factory to generate media objects for use in the Session model.
represents moving (or still) image data
Primary Interface to the current Session.
static session::MObjectFactory create
Storage for the (single, static) MObject factory object.
Definition: mobject.hpp:89
a family of time value like entities and their relationships.