/** * @param otherKernel * other kernel */ public void setConstructionDefaults(Kernel otherKernel) { getConstruction().getConstructionDefaults().setConstructionDefaults( otherKernel.getConstruction().getConstructionDefaults()); }
/** * @return next color in sequence */ public GColor getNextColor() { GColor color = getColorSequence()[colorIndex]; if (!cons.getKernel().isSilentMode()) { colorIndex = (colorIndex + 1) % getColorSequence().length; } return color; }
/** * inform listener that undo - action happened */ private void informListener() { for (UndoPossibleListener listener : mListener) { listener.undoPossible(undoPossible()); listener.redoPossible(redoPossible()); } }
@Override protected GeoElement[] polyLine(String label, GeoPointND[] points, boolean is3D) { if (is3D) { return kernel.getManager3D().polyLine3D(label, points); } return kernel.polyLine(label, points); }
/** * @param isAngle * whether to return angle * @return construction default for number or angle */ public GeoNumeric getDefaultNumber(boolean isAngle) { return (GeoNumeric) cons.getConstructionDefaults() .getDefaultGeo(isAngle ? ConstructionDefaults.DEFAULT_ANGLE : ConstructionDefaults.DEFAULT_NUMBER); }
final private GeoElement[] stretch(String label, GeoElement Q, GeoVec3D l, GeoNumeric num) { Transform t = new TransformShearOrStretch(cons, l, num, false); return t.transform(Q, label); } }
/** * Stores undo info * * @param refresh * true to restore current */ final public void storeUndoInfo(final boolean refresh) { storeUndoInfo(construction.getCurrentUndoXML(true), refresh); storeUndoInfoNeededForProperties = false; }
@Override public GeoElement createGeo(Kernel kernel, GeoNumberValue num) { return kernel.getManager3D().cylinderLimited(null, point1, point2, num)[0]; } }
@Override public GeoElement createGeo(Kernel kernel, GeoNumberValue num) { return kernel.getManager3D().circle3D(null, point, num, forAxis); } }
@Override protected GeoElement[] tangent(String[] labels, GeoConicND c1, GeoConicND c2) { return kernel.getManager3D().commonTangents3D(labels, c1, c2); }
static private final GeoElement intersectPlaneQuadricLimited(Kernel kernelA, String label, GeoPlaneND plane, GeoQuadric3DLimited quadric) { return kernelA.getManager3D().intersectQuadricLimited(label, plane, quadric); }
/** * rotate geoRot by angle phi around Q */ public GeoElement[] rotate(String label, GeoElement geoRot, GeoNumberValue phi, GeoPointND Q) { Transform t = new TransformRotate(cons, phi, Q); return t.transform(geoRot, label); }
/** * * @return new kernel */ public Kernel newKernel() { return new Kernel(app, new GeoFactory()); }
/** * Clears the undo info list of this construction and adds the current * construction state to the undo info list. */ public void initUndoInfo() { ensureUndoManagerExists(); undoManager.initUndoInfo(); }
@Override public ExpressionValue getUndefinedCopy(Kernel kernel1) { return kernel1.getManager3D().newGeo3DVec(Double.NaN, Double.NaN, Double.NaN); }
@Override protected GeoElement tangentToCurve(String label, GeoPointND point, GeoCurveCartesianND curve) { return kernel.getManager3D().tangent3D(label, point, curve); }
/** * Set macro mode. * * @param mode1 * app mode */ public void setMode(int mode1) { int macroID = mode1 - EuclidianConstants.MACRO_MODE_ID_OFFSET; macro = kernel.getMacro(macroID); macroInput = macro.getInputTypes(); } }
/** * dilate geoRot by r from S */ final public GeoElement[] dilate(String label, GeoElement geoDil, GeoNumberValue r, GeoPoint S) { Transform t = new TransformDilate(cons, r, S); return t.transform(geoDil, label); }
@Override protected void updateUndoActions() { super.updateUndoActions(); informListener(); }
/** * shear */ final private GeoElement[] shear(String label, GeoElement Q, GeoVec3D l, GeoNumeric num) { Transform t = new TransformShearOrStretch(cons, l, num, true); return t.transform(Q, label); } }