/* * @return a list of the LineStrings in the result of the * specified overlay operation */ vector<LineString*>* LineBuilder::build(OverlayOp::OpCode opCode) { findCoveredLineEdges(); collectLines(opCode); //labelIsolatedLines(&lineEdgesList); buildLines(opCode); return resultLineList; }
void ofxGridSystem::buildGrid(float iPageWidth, float iPageHeight, int iNumColumns, float iBaselineLeading, float iLeft, float iRight, float iHead, float iTail) { width = iPageWidth; height = iPageHeight; numCol = iNumColumns; //Left, right, bottom, top in grid terms. left = iLeft; right = iRight; tail = iTail; head = iHead; leading = iBaselineLeading; //Back size determines position of left margin line. leftX = iLeft; //Gutter size determines position of left margin line. rightX = width - iRight; //Head determines top margin location. topY = height - head; //Tail determines bottom margin location. bottomY = tail; //Determine column width, Swiss grid style. //There is a baselineLeading space between each column. colW = (width - left - right - (numCol-1)*leading)/(float)numCol; //Calculate baseline grid positions. //NOTE Baseline grid starts at top of page. So you are responsible for aligning grid with head and tail. numBaselines = (int)(height/(float)leading); baselines = new float[numBaselines]; for(int i=0; i < numBaselines; i++) baselines[i] = topY - (float)i*leading; isGridShown = false; isBaselineGridShown = false; buildLines(); //By default, start with lines hidden. showLines(false); }