https://github.com/ialhashim/topo-blend
Revision 39b13612ebd645a65eda854771b517371f2f858a authored by ennetws on 13 March 2015, 18:17:18 UTC, committed by ennetws on 13 March 2015, 18:17:18 UTC
1 parent c702819
Raw File
Tip revision: 39b13612ebd645a65eda854771b517371f2f858a authored by ennetws on 13 March 2015, 18:17:18 UTC
Create README.md
Tip revision: 39b1361
Relink.h
#pragma once
#include "StructureGraph.h"
#include "Task.h"
#include <QQueue>

struct LinkConstraint{
    Structure::Link *link;
    Task *task, *otherTask;
    LinkConstraint(Structure::Link * l=NULL, Task* t=NULL, Task* otherT=NULL)
    { link = l; task = t; otherTask = otherT; }
};
typedef QMap< Task*, QVector<LinkConstraint> > TasksConstraints;

class Scheduler;

struct Relink
{
    Relink( Scheduler * scheduler );

    Scheduler * s;
    Structure::Graph *activeGraph, *targetGraph;
	
    TasksConstraints constraints;

	// Tracking
	typedef QPair<QString,int> PropagationEdge;
	typedef QVector< PropagationEdge > PropagationEdges;
	QMap< QString, PropagationEdges > propagationGraph;
	int propagationIndex;

	void execute();
	void fixTask( Task* task );

	// Helpers
	void moveByConstraints( Structure::Node * n, QVector<LinkConstraint> consts );
	Vector3 getToDelta( Structure::Link * link, QString otherID );
	bool doesPropagate( Task* task );
	bool isInActiveGroup( Task* task );
};
back to top