2007-08-08 04:50:02 +02:00
|
|
|
/*
|
2007-10-18 17:29:01 +02:00
|
|
|
RELATIVELOCATION.hpp - Placement implementation attaching MObjects relative to another one
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
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
|
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2007-10-18 17:29:01 +02:00
|
|
|
#ifndef MOBJECT_SESSION_RELATIVELOCATION_H
|
|
|
|
|
#define MOBJECT_SESSION_RELATIVELOCATION_H
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2009-05-29 07:10:54 +02:00
|
|
|
#include "proc/mobject/placement-ref.hpp"
|
2007-10-18 17:29:01 +02:00
|
|
|
#include "proc/mobject/session/locatingpin.hpp"
|
2007-08-08 04:50:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
namespace mobject
|
2007-08-08 04:50:02 +02:00
|
|
|
{
|
2007-08-09 18:51:47 +02:00
|
|
|
namespace session
|
2007-08-08 04:50:02 +02:00
|
|
|
{
|
2007-08-09 18:51:47 +02:00
|
|
|
|
|
|
|
|
|
2009-05-29 07:10:54 +02:00
|
|
|
/**
|
|
|
|
|
* @todo just a design sketch, nothing finished yet.
|
|
|
|
|
* possibly to be reworked or phased out completely.
|
|
|
|
|
* See Trac #100
|
|
|
|
|
*/
|
2007-10-18 17:29:01 +02:00
|
|
|
class RelativeLocation : public LocatingPin
|
2007-08-08 04:50:02 +02:00
|
|
|
{
|
2009-05-29 07:10:54 +02:00
|
|
|
// const PMO & anchor_; ////////////TODO: ooooops, this is a nasty design problem!!!
|
|
|
|
|
|
|
|
|
|
const PlacementRef anchor_;
|
2007-11-12 02:05:39 +01:00
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* the possible kinds of RelativePlacements
|
|
|
|
|
*/
|
|
|
|
|
enum RelType
|
2007-08-17 00:36:07 +02:00
|
|
|
{ SAMETIME /**< place subject at the same time as the anchor */
|
|
|
|
|
, ATTACH /**< attach subject to anchor (e.g. an effect to a clip) */
|
2007-08-08 04:50:02 +02:00
|
|
|
};
|
|
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
protected:
|
2009-05-29 07:10:54 +02:00
|
|
|
RelativeLocation (PlacementRef const& a, Time ofs) : anchor_(a), offset_(ofs) { }
|
2007-11-12 02:05:39 +01:00
|
|
|
friend class LocatingPin;
|
2007-08-09 18:51:47 +02:00
|
|
|
|
|
|
|
|
/** the kind of relation denoted by this Placement */
|
|
|
|
|
RelType relType;
|
|
|
|
|
|
|
|
|
|
/** Offset the actual position by this (time) value relative to the anchor point. */
|
2007-11-12 02:05:39 +01:00
|
|
|
Time offset_;
|
2007-08-09 18:51:47 +02:00
|
|
|
//TODO: suitable representation?
|
2007-10-22 05:15:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual void intersect (LocatingSolution&) const;
|
2007-11-10 02:27:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2007-11-12 02:05:39 +01:00
|
|
|
virtual RelativeLocation* clone () const;
|
2007-08-09 18:51:47 +02:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace mobject::session
|
2007-08-08 04:50:02 +02:00
|
|
|
|
2007-08-09 18:51:47 +02:00
|
|
|
} // namespace mobject
|
2007-08-08 04:50:02 +02:00
|
|
|
#endif
|