/** * @return last construction step */ public int getLastConstructionStep() { return cons.steps() - 1; }
@Override public int getLastStepNumber() { return cons.steps(); }
/** * @param breakpoints * whether to return steps taking breakpoints into account * @return number of steps */ public double getConstructionSteps(boolean breakpoints) { if (breakpoints) { return kernel.getBreakpointSteps(); } // returns -1 for no objects // return kernel.getLastConstructionStep(); // returns 0 for no objects return kernel.getConstruction().steps(); }
/** * Returns the largest possible construction index for this object in its * construction. */ @Override final public int getMaxConstructionIndex() { if (algoParent == null) { // independent object: // index must be less than every dependent algorithm's index int min = cons.steps(); final int size = algorithmList == null ? 0 : algorithmList.size(); for (int i = 0; i < size; ++i) { final int index = (algorithmList.get(i)).getConstructionIndex(); if (index < min) { min = index; } } return min - 1; } // dependent object return algoParent.getMaxConstructionIndex(); }
/** * Returns the largest possible construction index for this object in its * construction. */ @Override public int getMaxConstructionIndex() { // index is less than minimum of all dependent algorithm's index of all // output ArrayList<AlgoElement> algoList; int size, index; int min = cons.steps(); for (int k = 0; k < getOutputLength(); ++k) { algoList = getOutput(k).getAlgorithmList(); size = algoList.size(); for (int i = 0; i < size; ++i) { index = algoList.get(i).getConstructionIndex(); if (index < min) { min = index; } } } return min - 1; }
for (int step = 0; step < construction.steps(); step++) { GeoElementND[] geos = construction.getConstructionElement(step) .getGeoElements();
@Override protected GeoElement[] perform(Command c) throws MyError { int n = c.getArgumentNumber(); GeoElement[] arg; arg = resArgs(c); switch (n) { case 1: double newStep = Math.round(arg[0].evaluateDouble() - 1); int maxStep = cons.steps(); // eg SetConstructionStep[infinity] to set to end if (newStep >= maxStep) { newStep = maxStep - 1; } cons.setStep((int) newStep); if (app.getGuiManager() != null) { app.getGuiManager().updateNavBars(); } return arg; default: throw argNumErr(c); } }
protected void drawAllElements() { boolean increment = (euclidianView.getShowGrid() || euclidianView.getShowXaxis() || euclidianView.getShowYaxis()); for (int step = 0; step < construction.steps(); step++) { if (increment) { beamerSlideNumber = step + 2; } else { beamerSlideNumber = step + 1; } GeoElementND[] geos = construction.getConstructionElement(step) .getGeoElements(); for (int j = 0; j < geos.length; j++) { GeoElement g = geos[j].toGeoElement(); drawGeoElement(g, false, false); } } }
protected void drawAllInDependentElements() { boolean increment = (euclidianView.getShowGrid() || euclidianView.getShowXaxis() || euclidianView.getShowYaxis()); for (int step = 0; step < construction.steps(); step++) { if (increment) { beamerSlideNumber = step + 2; } else { beamerSlideNumber = step + 1; } GeoElementND[] geos = construction.getConstructionElement(step) .getGeoElements(); for (int j = 0; j < geos.length; j++) { GeoElement g = geos[j].toGeoElement(); if (g.isIndependent()) { drawGeoElement(g, false, false); } } } }
kernel.getConstruction().steps());
kernel.getConstruction().steps());