[]
        
(Showing Draft Content)

IThreeDFormat

Interface IThreeDFormat


public interface IThreeDFormat
Represents a shape's three-dimensional formatting.

This interface provides access to 3-D effect properties such as extrusion depth, rotation, perspective, visibility, and Z position for a drawing object. You can obtain an IThreeDFormat instance from APIs such as IShape#getThreeD() or IChartFormat#getThreeD().


 IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
 IThreeDFormat threeDFormat = shape.getThreeD();
 threeDFormat.setVisible(true);
 threeDFormat.setDepth(24);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the depth of the shape's extrusion.
    int
    Gets whether the extrusion appears in perspective.
    double
    Gets the rotation of the extruded shape around the x-axis in degrees.
    double
    Gets the rotation of the extruded shape around the y-axis in degrees.
    double
    Gets the rotation of the extruded shape around the z-axis in degrees.
    boolean
    Gets whether the object is visible.
    double
    Returns the 3-D Z position of the specified IThreeDFormat object.
    void
    Resets the extrusion rotation around the x-axis and the y-axis to 0 (zero) so that the front of the extrusion faces forward.
    void
    setDepth(double value)
    Sets the depth of the shape's extrusion.
    void
    setPerspective(int value)
    Sets whether the extrusion appears in perspective.
    void
    setRotationX(double value)
    Sets the rotation of the extruded shape around the x-axis in degrees.
    void
    setRotationY(double value)
    Sets the rotation of the extruded shape around the y-axis in degrees.
    void
    setRotationZ(double value)
    Sets the rotation of the extruded shape around the z-axis in degrees.
    void
    setVisible(boolean value)
    Sets whether the object is visible.
    void
    setZ(double value)
    Sets the 3-D Z position of the specified IThreeDFormat object.
  • Method Details

    • getDepth

      double getDepth()
      Gets the depth of the shape's extrusion.

      Use this property to determine how far the shape is extruded in three-dimensional formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       double depth = shape.getThreeD().getDepth();
       
      Returns:
      The depth of the shape's extrusion.
    • setDepth

      void setDepth(double value)
      Sets the depth of the shape's extrusion.

      Use this property to set how far the shape is extruded in three-dimensional formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setDepth(100.0);
       
      Parameters:
      value - The depth of the shape's extrusion.
    • getPerspective

      int getPerspective()
      Gets whether the extrusion appears in perspective.

      Use this method to retrieve the perspective setting for a shape's 3-D formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setPerspective(1);
       int perspective = shape.getThreeD().getPerspective();
       
      Returns:
      The value that specifies whether the extrusion appears in perspective.
    • setPerspective

      void setPerspective(int value)
      Sets whether the extrusion appears in perspective.

      Use this method to set whether the extrusion appears in perspective for a shape's 3-D formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setPerspective(1);
       shape.getThreeD().setPerspective(0);
       
      Parameters:
      value - The value that specifies whether the extrusion appears in perspective.
    • getRotationX

      double getRotationX()
      Gets the rotation of the extruded shape around the x-axis in degrees.

      Use this method to read the current x-axis rotation applied to a shape's three-dimensional formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setRotationX(20);
       double rotationX = shape.getThreeD().getRotationX();
       
      Returns:
      The rotation angle around the x-axis, in degrees.
    • setRotationX

      void setRotationX(double value)
      Sets the rotation of the extruded shape around the x-axis in degrees.

      Use this method to set the x-axis rotation applied to a shape's three-dimensional formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setRotationX(20);
       shape.getThreeD().setRotationX(100.0);
       
      Parameters:
      value - The rotation angle around the x-axis, in degrees.
    • getRotationY

      double getRotationY()
      Gets the rotation of the extruded shape around the y-axis in degrees.

      Use this method to read the current y-axis rotation applied to a shape's 3-D formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setRotationY(20);
       double rotationY = shape.getThreeD().getRotationY();
       
      Returns:
      The rotation of the extruded shape around the y-axis, in degrees.
    • setRotationY

      void setRotationY(double value)
      Sets the rotation of the extruded shape around the y-axis in degrees.

      Use this method to set the y-axis rotation applied to a shape's 3-D formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setRotationY(20);
       shape.getThreeD().setRotationY(100.0);
       
      Parameters:
      value - The rotation of the extruded shape around the y-axis, in degrees.
    • getRotationZ

      double getRotationZ()
      Gets the rotation of the extruded shape around the z-axis in degrees.

      Use this method to retrieve the current z-axis rotation that is applied to a shape's three-dimensional formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setRotationZ(30);
       double rotationZ = shape.getThreeD().getRotationZ();
       
      Returns:
      The rotation of the extruded shape around the z-axis, in degrees.
    • setRotationZ

      void setRotationZ(double value)
      Sets the rotation of the extruded shape around the z-axis in degrees.

      Use this method to set the z-axis rotation applied to a shape's three-dimensional formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setRotationZ(30);
       shape.getThreeD().setRotationZ(100.0);
       
      Parameters:
      value - The rotation of the extruded shape around the z-axis, in degrees.
    • getVisible

      boolean getVisible()
      Gets whether the object is visible.

      Use this method to check whether the shape's three-dimensional formatting is currently displayed.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setVisible(false);
       boolean visible = shape.getThreeD().getVisible();
       
      Returns:
      true if the object is visible; otherwise, false.
    • setVisible

      void setVisible(boolean value)
      Sets whether the object is visible.

      Use this method to show or hide the shape's three-dimensional formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setVisible(false);
       shape.getThreeD().setVisible(true);
       
      Parameters:
      value - true if the object is visible; otherwise, false.
    • getZ

      double getZ()
      Returns the 3-D Z position of the specified IThreeDFormat object.

      Use this method to get the depth position of a shape's 3-D formatting. This value is not the stacking order used to layer shapes. The IThreeDFormat instance is typically obtained from IShape.getThreeD().

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setZ(20);
       double z = shape.getThreeD().getZ();
       
      Returns:
      The 3-D Z/depth position value of the 3-D format.
    • setZ

      void setZ(double value)
      Sets the 3-D Z position of the specified IThreeDFormat object.

      Use this method to set the depth position of a shape's 3-D formatting. This value is not the stacking order used to layer shapes.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setZ(20);
       shape.getThreeD().setZ(100.0);
       
      Parameters:
      value - The 3-D Z/depth position value of the 3-D format.
    • resetRotation

      void resetRotation()
      Resets the extrusion rotation around the x-axis and the y-axis to 0 (zero) so that the front of the extrusion faces forward.

      This method resets only the x-axis and y-axis rotation values of the shape's 3-D formatting.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
       shape.getThreeD().setDepth(7);
       shape.getThreeD().setRotationX(20);
       shape.getThreeD().setRotationY(30);
       shape.getThreeD().resetRotation();