Examples of Curve


Examples of com.cburch.draw.shapes.Curve

        repaintArea(canvas);
    }

    @Override
    public void mouseReleased(Canvas canvas, MouseEvent e) {
        Curve c = updateMouse(canvas, e.getX(), e.getY(), e.getModifiersEx());
        mouseDown = false;
        if (state == CONTROL_DRAG) {
            if (c != null) {
                attrs.applyTo(c);
                CanvasModel model = canvas.getModel();
View Full Code Here

Examples of com.cburch.draw.shapes.Curve

        lastMouseY = my;

        boolean shiftDown = (mods & InputEvent.SHIFT_DOWN_MASK) != 0;
        boolean ctrlDown = (mods & InputEvent.CTRL_DOWN_MASK) != 0;
        boolean altDown = (mods & InputEvent.ALT_DOWN_MASK) != 0;
        Curve ret = null;
        switch (state) {
        case ENDPOINT_DRAG:
            if (mouseDown) {
                if (shiftDown) {
                    Location p = LineUtil.snapTo8Cardinals(end0, mx, my);
                    mx = p.getX();
                    my = p.getY();
                }
                if (ctrlDown) {
                    mx = canvas.snapX(mx);
                    my = canvas.snapY(my);
                }
                end1 = Location.create(mx, my);
            }
            break;
        case CONTROL_DRAG:
            if (mouseDown) {
                int cx = mx;
                int cy = my;
                if (ctrlDown) {
                    cx = canvas.snapX(cx);
                    cy = canvas.snapY(cy);
                }
                if (shiftDown) {
                    double x0 = end0.getX();
                    double y0 = end0.getY();
                    double x1 = end1.getX();
                    double y1 = end1.getY();
                    double midx = (x0 + x1) / 2;
                    double midy = (y0 + y1) / 2;
                    double dx = x1 - x0;
                    double dy = y1 - y0;
                    double[] p = LineUtil.nearestPointInfinite(cx, cy,
                            midx, midy, midx - dy, midy + dx);
                    cx = (int) Math.round(p[0]);
                    cy = (int) Math.round(p[1]);
                }
                if (altDown) {
                    double[] e0 = { end0.getX(), end0.getY() };
                    double[] e1 = { end1.getX(), end1.getY() };
                    double[] mid = { cx, cy };
                    double[] ct = CurveUtil.interpolate(e0, e1, mid);
                    cx = (int) Math.round(ct[0]);
                    cy = (int) Math.round(ct[1]);
                }
                ret = new Curve(end0, end1, Location.create(cx, cy));
                curCurve = ret;
            }
            break;
        default:
          break;
View Full Code Here

Examples of com.jme3.scene.shape.Curve

                conrtolPoints.add(new Vector3f(-bevelDepth, 0, handlerLength + extrude));
                conrtolPoints.add(new Vector3f(-bevelDepth, 0, extrude));

                Spline bevelSpline = new Spline(SplineType.Bezier, conrtolPoints, 0, false);
                Curve bevelCurve = new Curve(bevelSpline, bevResol);
                bevelObject = new ArrayList<Geometry>(1);
                bevelObject.add(new Geometry("", bevelCurve));
            } else if (extrude > 0.0f) {
                Spline bevelSpline = new Spline(SplineType.Linear, new Vector3f[] { new Vector3f(0, 0, -extrude), new Vector3f(0, 0, extrude) }, 1, false);
                Curve bevelCurve = new Curve(bevelSpline, bevResol);
                bevelObject = new ArrayList<Geometry>(1);
                bevelObject.add(new Geometry("", bevelCurve));
            }
        }
View Full Code Here

Examples of com.jme3.scene.shape.Curve

            controlPoints.remove(0);
            controlPoints.remove(controlPoints.size() - 1);

            // creating curve
            Spline spline = new Spline(SplineType.Bezier, controlPoints, 0, false);
            Curve curve = new Curve(spline, resolution);
            if (bevelObject == null) {// creating a normal curve
                Geometry curveGeometry = new Geometry(null, curve);
                result.add(curveGeometry);
                // TODO: use front and back flags; surface excluding algorithm for bezier circles should be added
            } else {// creating curve with bevel and taper shape
View Full Code Here

Examples of com.jme3.scene.shape.Curve

        int resolu = ((Number) nurb.getFieldValue("resolu")).intValue() + 1;
        List<Geometry> result;
        if (knots[1] == null) {// creating the curve
            Spline nurbSpline = new Spline(controlPoints.get(0), knots[0]);
            Curve nurbCurve = new Curve(nurbSpline, resolu);
            if (bevelObject != null) {
                result = this.applyBevelAndTaper(nurbCurve, bevelObject, taperObject, true, blenderContext);// TODO: smooth
            } else {
                result = new ArrayList<Geometry>(1);
                Geometry nurbGeometry = new Geometry("", nurbCurve);
View Full Code Here

Examples of com.jme3.scene.shape.Curve

    private Geometry CreateLinearPath() {

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.getAdditionalRenderState().setWireframe(true);
        mat.setColor("Color", ColorRGBA.Blue);
        Geometry lineGeometry = new Geometry("line", new Curve(spline, 0));
        lineGeometry.setMaterial(mat);
        return lineGeometry;
    }
View Full Code Here

Examples of com.jme3.scene.shape.Curve

    private Geometry CreateCatmullRomPath() {

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.getAdditionalRenderState().setWireframe(true);
        mat.setColor("Color", ColorRGBA.Blue);
        Geometry lineGeometry = new Geometry("line", new Curve(spline, 10));
        lineGeometry.setMaterial(mat);
        return lineGeometry;
    }
View Full Code Here

Examples of org.ff4j.audit.graph.Curve

        // (1) Loop over expected queues
        for (String name : featNameSet) {
            Queue<Event> myQueue = mapOfEvents.get(name);
            if (myQueue != null) {
                // Current curve
                Curve curve = new Curve(name, startTime, endTime, nbslot);
                for (Iterator<Event> itEvt = myQueue.iterator(); itEvt.hasNext();) {
                    Event evt = itEvt.next();
                    long t = evt.getTimestamp();
                    // Is in target window
                    if (startTime < t && t < endTime) {
                        if (EventType.HIT_FLIPPED.equals(evt.getType())) {
                            long slot = (t - startTime) / curve.getInterval();
                            curve.incrCount((int) slot);
                        }
                    }
                }
                maps.put(name, curve);
            }
View Full Code Here

Examples of org.fonteditor.elements.curves.Curve

    for (int i = 0; i < number_of_curves; i++) {
      FEPoint p1;
      FEPoint p2;
      FEPoint p3;
      FEPoint p4;
      Curve pe;

      pe = curve[i];
      p1 = pe.returnStartPoint();
      p2 = pe.returnStartControlPoint();
      p3 = pe.returnEndControlPoint();
      p4 = pe.returnEndPoint();

      if (p3 != null) {
        plotControlPoint(g, p3, DARK_BLUE, Color.cyan, c);
      }
View Full Code Here

Examples of org.fonteditor.elements.curves.Curve

    for (int i = 0; i < number_of_curves; i++) {
      FEPoint p1;
      FEPoint p2;
      FEPoint p3;
      FEPoint p4;
      Curve pe;

      pe = curve[i];
      p1 = pe.returnStartPoint();
      p2 = pe.returnStartControlPoint();
      p3 = pe.returnEndControlPoint();
      p4 = pe.returnEndPoint();
      if (p3 != null) {
        g.setColor(Color.gray);
        drawWideLine(g, p3, p4, LINE_WIDTH_THIN, c);
      }
      if (p2 != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.