mobject::session::LocatingPin Class Reference

Positioning specification, possibliy chained to further specifications. More...

#include <locatingpin.hpp>

Inheritance diagram for mobject::session::LocatingPin:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual LocatingPinclone () const
bool isOverdetermined () const
 LocatingPin (const LocatingPin &)
 it's OK to copy a LocainngPin, causing duplication of any chained lPins
RelativeLocation & operator() (PMO refObj, Time offset=0)
FixedLocationoperator() (Time start, Track track=0)
LocatingPinoperator= (const LocatingPin &)
const SolutionData resolve () const
 implementing the core Placement functionality.

Protected Types

typedef std::tr1::shared_ptr
< asset::Pipe
Pipe
typedef std::pair< Time, PipeSolutionData
typedef lumiera::Time Time
typedef TimeTrack

Protected Member Functions

LocatingPinaddChain (LocatingPin *)
virtual int getPrioLevel () const
 order to consider when resolving.
virtual void intersect (LocatingSolution &) const
void resolve (LocatingSolution &) const

Protected Attributes

scoped_ptr< LocatingPinnext_
 next additional Pin, if any

Friends

class Placement< MObject >

Classes

struct  LocatingSolution


Detailed Description

The base class LocatingPin is a "no-op" specification which doesn't constrain the possible locations and thus can be embedded into pristine Placement by default. The Functor operators provide a way to add concrete positioning specifications, thereby defining the position of the MObject to be placed.

Note:
to the implementer of subclasses: LocatingPins are copyable and need to handle cloning (incl the chain)

Definition at line 81 of file locatingpin.hpp.


Member Function Documentation

LocatingPin & mobject::session::LocatingPin::addChain ( LocatingPin newLp  )  [protected]

Parameters:
newLp 
Note:
we take ownership of newLp

Definition at line 69 of file locatingpin.cpp.

References getPrioLevel(), and next_.

00070     {
00071       REQUIRE (newLp);
00072       REQUIRE (!newLp->next_, "can insert only single LocatingPins");
00073       
00074       if (next_ && newLp->getPrioLevel() > next_->getPrioLevel())
00075         return next_->addChain (newLp);
00076       else
00077         {
00078           scoped_ptr<LocatingPin> tmp_next (newLp);
00079           tmp_next->next_.swap(next_);
00080           next_.swap(tmp_next);
00081           return *newLp;
00082         }
00083     }

Here is the call graph for this function:

virtual int mobject::session::LocatingPin::getPrioLevel (  )  const [inline, protected, virtual]

0=highest

Definition at line 94 of file locatingpin.hpp.

Referenced by addChain().

00094 { return 0; }

Here is the caller graph for this function:

const LocatingPin::SolutionData mobject::session::LocatingPin::resolve (  )  const

By combining all the chained locating pins, try to get at a definite position (for this chain and consequently for the MObject handled by the enclosing Placement object).

Todo:
this could/should be replaced by a full-blown constraint solver at some point in the future
Todo:
we are packing and unpacking the information (time,track) several times. Ichthyo considers a more elegant solution.

Definition at line 97 of file locatingpin.cpp.

References mobject::session::LocatingPin::LocatingSolution::getPipe(), and mobject::session::LocatingPin::LocatingSolution::getTime().

00098     {
00099       LocatingSolution solution;
00100       resolve (solution);
00101       return SolutionData (solution.getTime(), solution.getPipe());
00102     }

Here is the call graph for this function:


The documentation for this class was generated from the following files:

Generated on Sat Aug 16 18:10:47 2008 for Lumiera by  doxygen 1.5.5