WriteBufferOperation *OutputSocket::findAttachedWriteBufferOperation() const
{
	unsigned int index;
	for (index = 0; index < this->m_connections.size(); index++) {
		SocketConnection *connection = this->m_connections[index];
		NodeBase *node = connection->getToNode();
		if (node->isOperation()) {
			NodeOperation *operation = (NodeOperation *)node;
			if (operation->isWriteBufferOperation()) {
				return (WriteBufferOperation *)operation;
			}
		}
	}
	return NULL;
}
void OutputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
	NodeBase *node = this->getNode();
	if (node->isOperation()) {
		NodeOperation *operation = (NodeOperation *)node;
		if (operation->isResolutionSet()) {
			resolution[0] = operation->getWidth();
			resolution[1] = operation->getHeight();
		}
		else {
			operation->determineResolution(resolution, preferredResolution);
			operation->setResolution(resolution);
		}
	}
}