Example #1
0
void Graphics::Draw() {
	fps_overlay->AddFrame();

	if (transition->IsErased()) {
		DisplayUi->CleanDisplay();
		GlobalDraw();
		DisplayUi->UpdateDisplay();
		return;
	}
	LocalDraw();
	GlobalDraw();
	DisplayUi->UpdateDisplay();
}
Example #2
0
BitmapRef Graphics::SnapToBitmap(int priority) {
	LocalDraw(priority);
	GlobalDraw(priority);
	return DisplayUi->CaptureScreen();
}
Example #3
0
double DrawTree::RecursiveDraw(const Link* from, ostream& os, double X, double Y, double scaleX, double scaleY)	{

	// string format = "";
	// string format = "\\tiny ";
	// double thickness = 0.5;
//	os << "\\linethickness{" << thickness << "mm}\n";

	double ret = 0;

	if (from->isLeaf())	{
		if (withleafnames)	{
			// write species name
			os << "\\path (" << texapprox(X) + shiftname << "," << texapprox(Y) << ") node { " << GetPreLeafNodeName(from) << " \\,  " << "\\it " <<  GetLeafNodeName(from) << " };\n";
			// os << "\\path (" << texapprox(X) + 10 * shiftname << "," << texapprox(Y) << ") node { \\it " <<  GetLeafNodeName(from) << " };\n";
		}
		ret = Y;
	}

	else	{

		double y = Y - 0.5 * GetSize(from) * scaleY;

		if (groupname[from->GetNode()] != "")	{
			groupy[from->GetNode()] = Y;
		}

		const Link* link = from->Next();
		double yfirst = 0;
		double ylast = 0;

		while (link != from)	{

			// compute horizontal offset for child node
			double xoffset = GetLength(link) * scaleX;

			// compute vertical span of child node
			double yspan = GetSize(link->Out()) * scaleY;

			// shift half the vertical offset
			y += 0.5 * yspan;

			// draw child node
			double x = X + xoffset;
			double downret = RecursiveDraw(link->Out(), os, x, y, scaleX, scaleY);

			// draw horizontal line
			LocalDrawBranch(link,os,X,downret,xoffset);

			LocalDraw(link,os,x,downret,scaleX,scaleY);

			if (link == from->Next())	{
				yfirst = downret;
			}

			if (link->Next() == from)	{
				ylast = downret;
			}

			// shift half the vertical offset again
			y += 0.5 * yspan;

			link = link->Next();
		}

		// draw vertical line
		LocalDrawVerticalTrait(from, os, X, yfirst, ylast);

		ret = (yfirst + ylast) / 2;

		if (from->isRoot())	{
			LocalDraw(from,os,X,ret,scaleX,scaleY);
			LocalDrawBranch(from,os,X,ret,0);
		}
	}
	return ret;
}