예제 #1
0
void drawGrid(sf::RenderWindow &window, bool change) {
	sf::View view = window.getView();
	static std::vector<sf::Vertex> Line;
	if(change) {
		xSep = getSep(view.getSize().x, window.getSize().x);
		ySep = getSep(view.getSize().y, window.getSize().y);
//		change = false;
//		val(xSep);
//		val(ySep);
		Line.clear();
		gridLine(view, xSep * 0.25, ySep * 0.25, sf::Color(0, 0, 0, 63), Line);
		gridLine(view, xSep, ySep, sf::Color(0, 0, 0, 100), Line);
	}
	window.draw(&Line[0], Line.size(), sf::Lines);
	//gridLable(window, xSep, ySep, sf::Color::Black);
	xyAxis(window);
}
예제 #2
0
std::vector<float> DestinNetworkAlt::getLayersSeparations()
{
    std::vector<float> separations(destin->nLayers);
    for (int i = 0; i < destin->nLayers; i++)
    {
        separations[i] = getSep(i);
    }
    return separations;
}
예제 #3
0
static QList<QByteArray> split(const QByteArray &a)
{
    QList<QByteArray> rv;
    int lastPos=-1;
    for (;;) {
        int pos=getSep(a, lastPos);

        if (pos==(lastPos+1)) {
            lastPos++;
        } else if (pos>-1) {
            lastPos++;
            rv.append(a.mid(lastPos, pos-lastPos));
            lastPos=pos;
        } else {
            lastPos++;
            rv.append(a.mid(lastPos));
            break;
        }
    }
    return rv;
}
예제 #4
0
float DestinNetworkAlt::getQuality(int layer) //Quality= separation-variance
{
    return getSep(layer)-getVar(layer);
}
예제 #5
0
float DestinNetworkAlt::getQuality(int layer)
{
    return getSep(layer)-getVar(layer);
}