Examples of Cylinder


Examples of com.sun.j3d.utils.geometry.Cylinder

    public static void checkTrunk3D(BasicTreeTrunk3D trunk3D, float expectedHeight, float expectedRadius,
            Point3d expectedLowerBottom, Point3d expectedUpperBottom, Point3d expectedMovedLowerBottom,
            Point3d expectedMovedUpperBottom, Point3d expectedLowerTop, Point3d expectedUpperTop,
            Point3d expectedMovedLowerTop, Point3d expectedMovedUpperTop) {

        Cylinder trunkCylinder = trunk3D.getTrunk();
        assertEquals(expectedHeight, trunkCylinder.getHeight());
        assertEquals(expectedRadius, trunkCylinder.getRadius());

        TransformGroup trunkTransformGroup = (TransformGroup) trunk3D.getGroup().getChild(0);
        Enumeration transformChilds = trunkTransformGroup.getAllChildren();
        // check at least one element
        assertTrue(transformChilds.hasMoreElements());
        SceneGraphObject child = (SceneGraphObject) transformChilds.nextElement();
        assertEquals(trunkCylinder, child);
        // check only one element
        assertFalse(transformChilds.hasMoreElements());

        // get transform object
        Transform3D transform3D = new Transform3D();
        trunkTransformGroup.getTransform(transform3D);

        // check bottom of trunk
        Shape3D bottom = trunkCylinder.getShape(Cylinder.BOTTOM);
        BoundingBox bottomBounds = (BoundingBox) bottom.getBounds();
        Point3d lowerBottom = new Point3d();
        bottomBounds.getLower(lowerBottom);
        Point3d movedLowerBottom = new Point3d();
        transform3D.transform(lowerBottom, movedLowerBottom);
        Point3d upperBottom = new Point3d();
        bottomBounds.getUpper(upperBottom);
        Point3d movedUpperBottom = new Point3d();
        transform3D.transform(upperBottom, movedUpperBottom);
        PointTestHelper.assertPointEquals(expectedLowerBottom, lowerBottom, 0.02, 0.0001, 0.02);
        PointTestHelper.assertPointEquals(expectedMovedLowerBottom, movedLowerBottom, 0.02, 0.0001, 0.02);
        PointTestHelper.assertPointEquals(expectedUpperBottom, upperBottom, 0.02, 0.0001, 0.02);
        PointTestHelper.assertPointEquals(expectedMovedUpperBottom, movedUpperBottom, 0.02, 0.0001, 0.02);

        // check top of trunk
        Shape3D top = trunkCylinder.getShape(Cylinder.TOP);
        BoundingBox topBounds = (BoundingBox) top.getBounds();
        Point3d lowerTop = new Point3d();
        topBounds.getLower(lowerTop);
        Point3d movedLowerTop = new Point3d();
        transform3D.transform(lowerTop, movedLowerTop);
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

  }
 

  public Node createCylinder( double radiusXZ, double heightY, double xCenter, double yCenter, double zCenter){
   
      Cylinder cylinder = new Cylinder((float) radiusXZ, (float) heightY, appearance);
      return transform(cylinder, defaultTransformationFactory.createTranslation(xCenter, yCenter, zCenter));
  }
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

    public static void checkTrunk3D(BasicTreeTrunk3D trunk3D, float expectedHeight, float expectedRadius,
            Point3d expectedLowerBottom, Point3d expectedUpperBottom, Point3d expectedMovedLowerBottom,
            Point3d expectedMovedUpperBottom, Point3d expectedLowerTop, Point3d expectedUpperTop,
            Point3d expectedMovedLowerTop, Point3d expectedMovedUpperTop) {

        Cylinder trunkCylinder = trunk3D.getTrunk();
        assertEquals(expectedHeight, trunkCylinder.getHeight());
        assertEquals(expectedRadius, trunkCylinder.getRadius());

        TransformGroup trunkTransformGroup = (TransformGroup) trunk3D.getGroup().getChild(0);
        Enumeration transformChilds = trunkTransformGroup.getAllChildren();
        // check at least one element
        assertTrue(transformChilds.hasMoreElements());
        SceneGraphObject child = (SceneGraphObject) transformChilds.nextElement();
        assertEquals(trunkCylinder, child);
        // check only one element
        assertFalse(transformChilds.hasMoreElements());

        // get transform object
        Transform3D transform3D = new Transform3D();
        trunkTransformGroup.getTransform(transform3D);

        // check bottom of trunk
        Shape3D bottom = trunkCylinder.getShape(Cylinder.BOTTOM);
        BoundingBox bottomBounds = (BoundingBox) bottom.getBounds();
        Point3d lowerBottom = new Point3d();
        bottomBounds.getLower(lowerBottom);
        Point3d movedLowerBottom = new Point3d();
        transform3D.transform(lowerBottom, movedLowerBottom);
        Point3d upperBottom = new Point3d();
        bottomBounds.getUpper(upperBottom);
        Point3d movedUpperBottom = new Point3d();
        transform3D.transform(upperBottom, movedUpperBottom);
        PointTestHelper.assertPointEquals(expectedLowerBottom, lowerBottom, 0.02, 0.0001, 0.02);
        PointTestHelper.assertPointEquals(expectedMovedLowerBottom, movedLowerBottom, 0.02, 0.0001, 0.02);
        PointTestHelper.assertPointEquals(expectedUpperBottom, upperBottom, 0.02, 0.0001, 0.02);
        PointTestHelper.assertPointEquals(expectedMovedUpperBottom, movedUpperBottom, 0.02, 0.0001, 0.02);

        // check top of trunk
        Shape3D top = trunkCylinder.getShape(Cylinder.TOP);
        BoundingBox topBounds = (BoundingBox) top.getBounds();
        Point3d lowerTop = new Point3d();
        topBounds.getLower(lowerTop);
        Point3d movedLowerTop = new Point3d();
        transform3D.transform(lowerTop, movedLowerTop);
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

        }
        this.state = state;
        Appearance trunkAppearance = new Appearance();
        AppearanceFactory.setColorWithMaterial(trunkAppearance, ColorConstants.brown, new Color3f(0.15f, 0.15f, 0.15f),
                new Color3f(0.05f, 0.05f, 0.05f));
        trunkCylinder = new Cylinder(trunk.getRadius(), trunk.getHeight(), trunkAppearance);
        Vector3d translationVector = new Vector3d();
        translationVector.setY(trunk.getHeight() / 2);
        TransformGroup transformGroup = TransformerHelper.getTranslationTransformGroup(translationVector);
        transformGroup.addChild(trunkCylinder);
        this.group = new Group();
View Full Code Here

Examples of gov.nasa.worldwind.geom.Cylinder

      Vec4 ptC = this.computePoint(dc, posC, true);
      if (f.contains(ptC))
         return true;

      double r = Line.distanceToSegment(ptA, ptB, ptC);
      Cylinder cyl = new Cylinder(ptA, ptB, r == 0 ? 1 : r);
      return cyl.intersects(dc.getView().getFrustumInModelCoordinates());
   }
View Full Code Here

Examples of gov.nasa.worldwind.render.Cylinder

        {
        }

        public RigidShape createShape(WorldWindow wwd, boolean fitShapeToViewport)
        {
            RigidShape shape = new Cylinder();
            shape.setAttributes(getDefaultAttributes());
            shape.setValue(AVKey.DISPLAY_NAME, getNextName(toString()));
            this.initializeShape(wwd, shape, fitShapeToViewport);

            return shape;
        }
View Full Code Here

Examples of javafx.scene.shape.Cylinder

        Sphere hydrogen2Sphere = new Sphere(30.0);
        hydrogen2Sphere.setMaterial(whiteMaterial);
        hydrogen2Sphere.setTranslateZ(0.0);

        Cylinder bond1Cylinder = new Cylinder(5, 100);
        bond1Cylinder.setMaterial(greyMaterial);
        bond1Cylinder.setTranslateX(50.0);
        bond1Cylinder.setRotationAxis(Rotate.Z_AXIS);
        bond1Cylinder.setRotate(90.0);

        Cylinder bond2Cylinder = new Cylinder(5, 100);
        bond2Cylinder.setMaterial(greyMaterial);
        bond2Cylinder.setTranslateX(50.0);
        bond2Cylinder.setRotationAxis(Rotate.Z_AXIS);
        bond2Cylinder.setRotate(90.0);

        moleculeXform.getChildren().add(oxygenXform);
        moleculeXform.getChildren().add(hydrogen1SideXform);
        moleculeXform.getChildren().add(hydrogen2SideXform);
        oxygenXform.getChildren().add(oxygenSphere);
View Full Code Here

Examples of libnoiseforjava.model.Cylinder

      // Resize the destination noise map so that it can store the new output
      // values from the source model.
      destNoiseMap.setSize (destWidth, destHeight);

      // Create the cylinder model.
      Cylinder cylinderModel = new Cylinder();
      cylinderModel.setModule (sourceModule);

      double angleExtent  = upperAngleBound  - lowerAngleBound ;
      double heightExtent = upperHeightBound - lowerHeightBound;
      double xDelta = angleExtent  / (double)destWidth ;
      double yDelta = heightExtent / (double)destHeight;
      double curAngle  = lowerAngleBound ;
      double curHeight = lowerHeightBound;

      // Fill every point in the noise map with the output values from the model.
      for (int y = 0; y < destHeight; y++)
      {
         curAngle = lowerAngleBound;
         for (int x = 0; x < destWidth; x++)
         {
            float curValue = (float)cylinderModel.getValue (curAngle, curHeight);
            destNoiseMap.setValue(x, y, curValue);
            curAngle += xDelta;
         }
         curHeight += yDelta;
         setCallback (y);
View Full Code Here

Examples of org.gephi.visualization.selection.Cylinder

        } else if (vizConfig.isRectangleSelection()) {
            currentSelectionArea = new Rectangle();
            rectangleSelection = true;
            customSelection = false;
        } else {
            currentSelectionArea = new Cylinder();
            rectangleSelection = false;
            customSelection = false;
        }
    }
View Full Code Here

Examples of org.gephi.visualization.selection.Cylinder

        } else if (vizConfig.isRectangleSelection()) {
            currentSelectionArea = new Rectangle();
            rectangleSelection = true;
            customSelection = false;
        } else {
            currentSelectionArea = new Cylinder();
            rectangleSelection = false;
            customSelection = false;
        }
    }
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.