/** * Set output dependencies and add to cons list */ protected void doSetDependencies() { this.mayHaveRandomAncestors = true; setOutputDependencies(); cons.addToAlgorithmList(this); }
@Override protected void setInputOutput() { input = new GeoElement[2]; input[0] = inPoly0; input[1] = inPoly1; // set dependencies for (int i = 0; i < input.length; i++) { input[i].addAlgorithm(this); } cons.addToAlgorithmList(this); setDependencies(); }
@Override protected void setInputOutput() { input = new GeoElement[2]; input[0] = inPoly0; input[1] = inPoly1; // set dependencies for (int i = 0; i < input.length; i++) { input[i].addAlgorithm(this); } cons.addToAlgorithmList(this); setDependencies(); }
@Override protected void setInputOutput() { if (this.threeArgs) { input = new GeoElement[3]; input[0] = this.inPoly0; input[1] = this.inPoly1; input[2] = this.exclusive; } else { input = new GeoElement[2]; input[0] = inPoly0; input[1] = inPoly1; } // set dependencies for (int i = 0; i < input.length; i++) { input[i].addAlgorithm(this); } cons.addToAlgorithmList(this); setDependencies(); }
@Override protected void setInputOutput() { if (this.threeArgs) { input = new GeoElement[3]; input[0] = this.inPoly0; input[1] = this.inPoly1; input[2] = this.exclusive; } else { input = new GeoElement[2]; input[0] = inPoly0; input[1] = inPoly1; } // set dependencies for (int i = 0; i < input.length; i++) { input[i].addAlgorithm(this); } cons.addToAlgorithmList(this); setDependencies(); }
@Override protected void setInputOutput() { input = new GeoElement[2]; input[0] = getFirstInput(); input[1] = getSecondInput(); // set dependencies for (int i = 0; i < input.length; i++) { input[i].addAlgorithm(this); } cons.addToAlgorithmList(this); }
@Override protected void setInputOutput() { ArrayList<GeoElement> tempList = new ArrayList<>(); if (isCumulative != null) { tempList.add(isCumulative); } tempList.add(list1); tempList.add(list2); if (list3 != null) { tempList.add(list3); } if (useDensity != null) { tempList.add(useDensity); } if (density != null) { tempList.add(density); } input = new GeoElement[tempList.size()]; input = tempList.toArray(input); boolean suppressLabelCreation = cons.isSuppressLabelsActive(); cons.setSuppressLabelCreation(true); algoHistogram = new AlgoHistogram(cons, isCumulative, list1, list2, list3, useDensity, density, right); cons.setSuppressLabelCreation(suppressLabelCreation); setOutput(); // parent of output outputPolyLine.setParentAlgorithm(this); cons.addToAlgorithmList(this); setDependencies(); // done by AlgoElement }
@Override protected void setInputOutput() { input = new GeoElement[3]; input[0] = (GeoElement) A; input[1] = (GeoElement) B; input[2] = num.toGeoElement(); // set dependencies for (int i = 0; i < input.length; i++) { input[i].addAlgorithm(this); } cons.addToAlgorithmList(this); // setOutput(); done in compute // parent of output getPoly().setParentAlgorithm(this); }
@Override protected void setInputOutput() { input = new GeoElement[4]; input[0] = (GeoElement) A; input[1] = (GeoElement) B; input[2] = num.toGeoElement(); input[3] = (GeoElement) direction; // set dependencies for (int i = 0; i < input.length; i++) { input[i].addAlgorithm(this); } cons.addToAlgorithmList(this); // setOutput(); done in compute // parent of output getPoly().setParentAlgorithm(this); }
@Override protected void setInputOutput() { // efficient inputs are points or list GeoElement[] efficientInput = createEfficientInput(); // add polyhedron to inputs if (polyhedron == null) { input = efficientInput; } else { input = new GeoElement[efficientInput.length + 1]; for (int i = 0; i < efficientInput.length; i++) { input[i] = efficientInput[i]; } input[efficientInput.length] = polyhedron; } setEfficientDependencies(input, efficientInput); // set output after, to avoid segments to have this to parent algo setOutput(); // parent of output poly.setParentAlgorithm(this); cons.addToAlgorithmList(this); }
} while (c.getAlgoList().contains(this)); c.addToAlgorithmList(this);
} while (c.getAlgoList().contains(this)); c.addToAlgorithmList(this);
@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(); } }
/** * @param c * construction */ protected AlgoPolyhedron(Construction c) { super(c); cons.addToAlgorithmList(this); outputPolyhedron = new OutputHandler<>( new ElementFactory<GeoPolyhedron>() { @Override public GeoPolyhedron newElement() { GeoPolyhedron p = new GeoPolyhedron(cons); p.setParentAlgorithm(AlgoPolyhedron.this); return p; } }); outputPolyhedron.adjustOutputSize(1); polyhedron = getPolyhedron(); polyhedron.setChildrenLabelsSet(true); outputPoints = createOutputPointsHandler(); createOutputPolygons(); createOutputSegments(); }
cons.addToAlgorithmList(this);
cons.addToAlgorithmList(this);