/** * add the algo to the construction (if disabled before by * Kernel.silentMode) */ public void addToConstructionList() { cons.addToConstructionList(this, false); }
/** * Creates new algorithm * * @param c * construction * @param addToConstructionList * true to add this to construction list */ protected AlgoElement(Construction c, boolean addToConstructionList) { super(c); if (addToConstructionList) { c.addToConstructionList(this, false); } }
/** * Sets whether the output of this command should be labeled. This setting * is used for getXML(). * * @param flag * whether the output of this command should be labeled */ public void setPrintedInXML(boolean flag) { isPrintedInXML = flag; if (flag) { cons.addToConstructionList(this, true); } else { cons.removeFromConstructionList(this); } }
/** * Adds the given Construction Element to this Construction at position * getStep() + 1. * * @param ce * Construction element to be added * @param checkContains * : true to first check if ce is already in list */ public void addToConstructionList(ConstructionElement ce, boolean checkContains) { if (supressLabelCreation) { return; } if (checkContains && ce.isInConstructionList()) { return; } /* * ++step; updateAllConstructionProtocolAlgorithms(); // Michael * Borcherds // 2008-05-15 * * ceList.add(step, ce); updateConstructionIndex(step); */ addToConstructionList(ce, step + 1); }
/*** * Adds the given GeoCasCell object to the construction list so that it * becomes the n-th GeoCasCell in the list. Other cas cells are shifted * right. * * @param casCell * CAS cell to be added to construction list * * @param n * number starting at 0 */ public void setCasCellRow(GeoCasCell casCell, int n) { GeoCasCell nthCasCell = getCasCell(n); if (nthCasCell == null) { addToConstructionList(casCell, false); } else { addToConstructionList(casCell, nthCasCell.getConstructionIndex()); } addToGeoSetWithCasCells(casCell); }
cons.addToConstructionList(algo, false);
/** * Create list of points from selected cells */ public void cmdListOfPoints() { GeoElement newGeo = cp.createPointGeoList(selectedCellRanges, false, true, true, true, true); app.getKernel().getConstruction() .addToConstructionList(newGeo.getParentAlgorithm(), true); newGeo.setLabel(null); }
/** * Create PolyLine object from selected cells */ public void cmdPolyLine() { GeoElement newGeo = cp.createPolyLine(selectedCellRanges, false, true); app.getKernel().getConstruction() .addToConstructionList(newGeo.getParentAlgorithm(), true); newGeo.setLabel(null); }
@Override public void compute() { if (!kernel.getGeoGebraCAS().getCurrentCAS().isLoaded()) { inputFingerprint = null; return; } String inputFingerprintPrev = inputFingerprint; setInputOutput(); /* * Not really sure if this is needed, but it cleans up the list of algos * and constructions: */ do { cons.removeFromAlgorithmList(this); } while (cons.getAlgoList().contains(this)); // Adding this again: cons.addToAlgorithmList(this); cons.removeFromConstructionList(this); // Adding this again: cons.addToConstructionList(this, true); // TODO: consider moving setInputOutput() out from compute() if (inputFingerprintPrev == null || !inputFingerprintPrev.equals(inputFingerprint)) { Log.trace(inputFingerprintPrev + " -> " + inputFingerprint); initialCompute(); } }
if (!constList.isEmpty()) { for (GeoNumeric geoNum : constList) { cons.addToConstructionList(geoNum, false); cons.putLabel(geoNum); this.arbconst.getConstList().add(geoNum);
/** * * @param c * construction * @param equ * equation */ public AlgoDependentImplicitSurface(Construction c, Equation equ) { super(c, false); equation = equ; c.addToConstructionList(this, false); switch (equ.preferredDegree()) { // linear equation -> LINE case 1: geoElem = new GeoPlane3D(c); break; // quadratic equation -> CONIC case 2: geoElem = new GeoQuadric3D(c); break; default: geoElem = new GeoImplicitSurface(c); } geoElem.setDefinition(equ.wrap()); setInputOutput(); // for AlgoElement compute(true); }
/** * @param cons * construction * @param fun * input function */ public AlgoDependentFunctionNVar(Construction cons, FunctionNVar fun) { super(cons, false); fun.initFunction(); cons.addToConstructionList(this, false); this.fun = fun; f = new GeoFunctionNVar(cons, false); f.setFunction(fun); expression = fun.getExpression(); expContainsFunctions = AlgoDependentFunction .containsFunctions(expression); if (expContainsFunctions) { expandedFun = new FunctionNVar(fun, kernel); } setInputOutput(); // for AlgoElement compute(); f.setConstructionDefaults(); }
kernel.getConstruction().addToConstructionList(cellValue, true); } else if (cellValue.isUseAsText()) { kernel.getConstruction().addToConstructionList(cellValue, true); kernel.notifyAdd(cellValue);
cons.addToConstructionList(this, false);
cons.addToConstructionList(this, false);
fun.initFunction(); if (addToConsList) { cons.addToConstructionList(this, false);
cons.addToConstructionList(this, false);
cons.addToConstructionList(this, false);
private void addNewGeoToConstruction() { if (getObjectType() == TYPE_LISTOFPOINTS || getObjectType() == TYPE_POLYLINE) { app.getKernel().getConstruction() .addToConstructionList(newGeo.getParentAlgorithm(), true); } newGeo.setEuclidianVisible(true); if (!newGeo.isGeoText()) { newGeo.setAuxiliaryObject(false); } if (getObjectType() == TYPE_LISTOFPOINTS) { GeoList gl = (GeoList) newGeo; for (int i = 0; i < gl.size(); i++) { gl.get(i).setEuclidianVisible(true); gl.get(i).setAuxiliaryObject(false); } } if (getObjectType() == TYPE_POLYLINE) { GeoPointND[] pts = ((AlgoPolyLine) newGeo.getParentAlgorithm()) .getPoints(); for (int i = 0; i < pts.length; i++) { pts[i].setEuclidianVisible(true); pts[i].setAuxiliaryObject(false); pts[i].updateRepaint(); } } newGeo.updateRepaint(); app.storeUndoInfo(); }
null, conic); kernel.getConstruction().addToConstructionList(algo, kernel.getConstruction().steps());