Example #1
0
	void GraphvizPlotter::plot() {
		if(path.length() == 0) {
			throw "Path is empty";
		}

		if(name.length() == 0) {
			throw "Name is empty";
		}

		// nacte nastaveny format grafu
		std::string format = getStringOutputFormat();
		// vytvori konecne umisteni a nazev souboru
		std::string filename = path + name + "." + format;

		// vytvori potrebne struktury graphvizu
		GVC_t *gvc;
		Agraph_t *g;
		gvc = gvContext();

		// parsovani ze struktury DOT do interni reprezentace graphvizu
		g = agmemread(getDot().c_str());

		// pouziti defaultniho nastroje dot
		gvLayout(gvc, g, "dot");
		// vykresleni grafu do souboru
		gvRenderFilename(gvc, g, format.c_str(), filename.c_str());
		// uvolneni vsech struktur graphvizu z pameti
		gvFreeLayout(gvc, g);
		agclose(g);
	}
Example #2
0
void DotMatrix::reverseDot(byte col, byte row)
{
	this->setDot(col, row, !getDot(col, row));
}
Example #3
0
	double getAngle (Vector a, Vector b) { return acos(getDot(a, b) / getLength(a) / getLength(b)); }
Example #4
0
	double getLength (Vector a) { return sqrt(getDot(a, a)); }
Example #5
0
File: math.cpp Project: qwook/spine
float Vector2Df::getLength() const {
    return sqrt( getDot(*this) );
}
Example #6
0
	Point3 getPlaneProjection (Point3 p, Point3 p0, Vector3 v) { return p - v * getDot(p-p0, v); }
Example #7
0
	double getDistancePointToPlane (Point3 p, Point3 p0, Vector3 v) { return fabs(getDot(p-p0, v)); }