Exemplo n.º 1
0
void ScenarioModel::setDurationAndGrow(const TimeValue& newDuration)
{
    ///* Should work but does not ?
    /*StandardDisplacementPolicy::setEventPosition(*this,
                                                 endEvent()->id(),
                                                 newDuration,
                                                 endEvent()->heightPercentage(),
                                                 [&] (ProcessModel* p, const TimeValue& t)
     { p->expandProcess(ExpandMode::Grow, t); }); */

    auto& eev = endEvent();

    eev.setDate(newDuration);
    timeNode(eev.timeNode()).setDate(newDuration);
    emit eventMoved(eev.id());
    this->setDuration(newDuration);
}
Exemplo n.º 2
0
void ScenarioModel::setDurationAndScale(const TimeValue& newDuration)
{
    double scale =  newDuration / duration();

    // Is it recursive ?? Make a scale() method on the constraint, maybe ?
    // TODO we should only have to set the date of the event / constraint
    for(TimeNodeModel* timenode : m_timeNodes)
    {
        timenode->setDate(timenode->date() * scale);
        // Since events will also move we do not need
        // to move the timenode.
    }

    for(EventModel* event : m_events)
    {
        event->setDate(event->date() * scale);
        emit eventMoved(event->id());
    }

    for(ConstraintModel* constraint : m_constraints)
    {
        constraint->setStartDate(constraint->startDate() * scale);
        // Note : scale the min / max.

        ConstraintModel::Algorithms::changeAllDurations(*constraint,
                                                        constraint->defaultDuration() * scale);

        for(auto& process : constraint->processes())
        {
            process->setDurationAndScale(constraint->defaultDuration() * scale);
        }

        emit constraintMoved(constraint->id());
    }

    this->setDuration(newDuration);
}
Exemplo n.º 3
0
			void ScrollView::touchMoved( po::scene::TouchEvent& event )
			{
				eventMoved( event.getId(), event.getLocalPos() );
			}
Exemplo n.º 4
0
			void ScrollView::mouseDrag( po::scene::MouseEvent& event )
			{

				eventMoved( 0, event.getLocalPos() );
			}