com.steema.teechart.drawing
Class Graphics3D

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.drawing.Graphics3D
All Implemented Interfaces:
IGraphics3D, java.io.Serializable
Direct Known Subclasses:
Graphics3DAWT, Graphics3DVectorial

public abstract class Graphics3D
extends TeeBase
implements IGraphics3D

Title: Graphics3D class

Description: Access to central Chart drawing elements

Copyright (c) 2005-2006 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL

See Also:
Serialized Form

Field Summary
protected  Aspect aspect
           
protected  Rectangle bounds
           
protected  ChartBrush brush
           
static int DARKCOLORQUANTITY
           
static int DARKERCOLORQUANTITY
           
static Color[] DefaultPalette
           
protected  ChartFont font
           
 java.awt.Point[] fourPoints
           
protected  boolean metafiling
           
 boolean monochrome
           
protected  ChartPen pen
           
protected  boolean smoothingMode
           
protected  StringFormat stringFormat
           
protected  boolean textSmooth
           
 
Fields inherited from class com.steema.teechart.TeeBase
chart
 
Constructor Summary
Graphics3D(IBaseChart c)
           
 
Method Summary
static Color applyBright(Color c, int howMuch)
          Converts the Color parameter to a brighter color.
static Color applyDark(Color c, int howMuch)
          Converts the Color parameter to a darker color.
abstract  void arc(int x1, int y1, int x2, int y2, double startAngle, double sweepAngle)
           
abstract  void arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
          Use Arc to draw an elliptically curved line with the current Pen.
 void arc(Rectangle rect, double startAngle, double sweepAngle)
           
 void arc(Rectangle rect, java.awt.Point start, java.awt.Point end)
           
 void arrow(boolean filled, java.awt.Point fromPoint, java.awt.Point toPoint, int headWidth, int headHeight, int z)
          Draws a line with an arrow head of ArrowWidth and ArrowHeight dimensions in pixels.
 java.awt.Point calc3DPoint(int x, int y, int z)
           
 java.awt.Point calc3DPoint(Point3D p)
           
 java.awt.Point calc3DPoint(java.awt.Point p, int z)
           
 java.awt.Point calc3DPos(int x, int y, int z)
          Calculates and returns the XY position in pixels of the XYZ 3D coordinate.
 java.awt.Point calc3DPos(java.awt.Point source)
          Calculates and returns the XY position in pixels of the point p with Z = 0 3D coordinate.
 java.awt.Point calc3DPos(Point3D source)
          Calculates and returns the XY position in pixels of the point p Z 3D coordinate.
 java.awt.Point calc3DPos(java.awt.Point source, int z)
          Calculates and returns the XY position in pixels of the point p Z 3D coordinate.
 void calcPerspective(Rectangle r)
           
 Rectangle calcRect3D(Rectangle r, int z)
          Calculates and returns the position in pixels of the Rectangle 3D coordinates.
 void calcTrigValues()
           
 java.awt.Point calculate2DPosition(int x, int y, int z)
          Calculates and returns the XY position in pixels of the coordinate.
 java.awt.Point calculate2DPosition(java.awt.Point p, int z)
           
 void changed(java.lang.Object o)
           
 void clipCube(Rectangle rect, int minZ, int maxZ)
          Creates a cubic Windows GDI clipping region.
abstract  void clipEllipse(Rectangle r)
           
abstract  void clipPolygon(java.awt.Point[] p)
           
 void clipRectangle(int left, int top, int right, int bottom)
          Creates a Windows GDI clipping region and selects it into TChart.
abstract  void clipRectangle(Rectangle r)
           
 void cone(boolean vertical, int left, int top, int right, int bottom, int z0, int z1, boolean darkSides)
          Paints a cone.
 void cone(boolean vertical, int left, int top, int right, int bottom, int z0, int z1, boolean darkSides, int conePercent)
           
 void cone(boolean vertical, Rectangle r, int z0, int z1, boolean darkSides)
          Paints a cone.
 void cone(boolean vertical, Rectangle r, int z0, int z1, boolean darkSides, int conePercent)
          Paints a cone with Cone Percent.
 int convexHull(java.awt.Point[] p)
          Calculates the boundary points of the convex hull of a set of 2D xy points.
protected  Rectangle correctRectangle(Rectangle r)
           
static LineCross crossingLines(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
          Returns true if two lines cross.
 void cube(int left, int top, int right, int bottom, int z0, int z1, boolean darkSides)
          Draws a Cube with Dark Sides.
 void cube(Rectangle r, int z0, int z1)
          Draws a Cube.
 void cube(Rectangle r, int z0, int z1, boolean darkSides)
          Draws a Cube with Dark Sides.
static boolean cull(java.awt.Point[] p)
           
static boolean cull(java.awt.Point p0, java.awt.Point p1, java.awt.Point p2)
           
 void cylinder(boolean vertical, Rectangle r, int z0, int z1, boolean darkSides)
          Draws cylinder toggle Boolean for vertical or horizontal cylinder.
 void donut(int xCenter, int yCenter, int xRadius, int yRadius, double startAngle, double endAngle, int holePercent)
          Draws a Donut slice.
abstract  void draw(Rectangle r, java.awt.Image image, boolean transparent)
           
 void draw(Rectangle r, java.awt.Image image, ImageMode mode, boolean transparent)
          Paints the image in rectangle r.
 void drawBeziers(int z, java.awt.Point[] p)
          Draws Bezier splines for the Point array p at displacement z
 void drawBeziers(java.awt.Point[] p)
          Draws Bezier splines for the Point array p
protected abstract  void drawString(int x, int y, java.lang.String text, ChartBrush brush)
           
abstract  void ellipse(int x1, int y1, int x2, int y2)
           
 void ellipse(int x1, int y1, int x2, int y2, boolean enhanced)
           
 void ellipse(int x1, int y1, int x2, int y2, int z)
          Ellipse bounding Rect (X1,Y1,X2,Y2) at Z position.
 void ellipse(int x1, int y1, int x2, int y2, int z, boolean enhanced)
          Enhanced Ellipse bounding Rect (X1,Y1,X2,Y2) at Z position.
 void ellipse(int left, int top, int right, int bottom, int z, double angle)
          Ellipse bounding rectangle (Left, Top, Right, Bottom) with Z offset at angle.
 void ellipse(java.awt.Point p0, java.awt.Point p1)
           
 void ellipse(Rectangle r)
          Draws an Ellipse bounding Rectangle r.
 void ellipse(Rectangle r, int z)
          Ellipse bounding Rectangle r at z depth.
 void ellipse(Rectangle r, int z, double angle)
          Ellipse bounding rectangle r with Z offset at angle.
 void ellipseEnh(int x1, int y1, int x2, int y2)
          Internal use.
abstract  void eraseBackground(int left, int top, int right, int bottom)
           
abstract  void fillRectangle(ChartBrush brush, int x, int y, int width, int height)
           
 void fillRectangle(Rectangle rect)
           
 int fontTextHeight(ChartFont f)
          Determines the Font Height to be used for outputted text when using the Drawing.
 java.awt.Point[] fourPointsFromRect(Rectangle r, int z)
          Returns a TFourPoints structure (array of four TPoint records)
 Aspect getAspect()
           
 Color getBackColor()
          Sets / returns the color used to fill spaces when displaying text or filling with brushes of different style other than bsSolid.
 ChartBrush getBrush()
          Determines the kind of brush used to fill the Canvas draw rectangle background.
 java.awt.Shape getChartPolygon(Rectangle rect, int minZ, int maxZ)
           
 int getChartXCenter()
          Returns the centre Horizontal co-ordinate of the Chart.
 int getChartYCenter()
          Returns the middle Vertical coordinate of the Chart.
 int getColorPaletteLength()
           
 Color getDefaultColor(int index)
          Returns a color from global ColorPalette array variable.
static HatchStyle getDefaultPattern(int index)
          Returns a valid Windows Brush Style from anpalette of many possible Brush styles.
 boolean getDirty()
           
 ChartFont getFont()
          Determines the Font for outputted text when using the Drawing Canvas.
 int getFontHeight()
          Defines the Height of the Font in pixels.
 Gradient getGradient()
          Determines the Brush.
protected  double getIZoomfactor()
           
 boolean getMetafiling()
           
 boolean getMonochrome()
           
 ChartPen getPen()
          Indicates the kind of pen used to draw Canvas lines.
protected  java.awt.Polygon getPolygon(java.awt.Point[] p)
           
 Point3D getRotationCenter()
          Sets the Pixel location (using X,Y,Z) of the centre of rotation for use with the Aspect Rotation and Elevation properties.
static int getScreenHeight()
          Returns the height, in pixels, of the Chart Panel.
static int getScreenWidth()
          Returns the width, in pixels, of the Chart Panel.
 boolean getSmoothingMode()
          The anti-alias mode for the Graphics Pen when Custom drawing.
 boolean getSupports3DText()
          Returns if Canvas supports 3D Text or not.
 boolean getSupportsFullRotation()
          Returns if Canvas can do rotation and elevation of more than 90 degree.
 StringAlignment getTextAlign()
          The alignment used when displaying text using TextOut or TextOut3D.
 boolean getTextSmooth()
          Chooses between speed or display quality for Text rendering.
 boolean getUseBuffer()
          Draws items to ancanvas to prevent flickering on screen.
 int getXCenter()
          The X coordinate of the pixel location of the center of the 3D Canvas.
 int getYCenter()
          The Y coordinate of the pixel location of the center of the 3D Canvas.
abstract  void horizontalLine(int left, int right, int y)
           
 void horizontalLine(int left, int right, int y, int z)
          Draws a Horizontal at z depth position.
 void initWindow(Aspect a, Rectangle r, int maxDepth)
           
protected abstract  void line(ChartPen p, java.awt.Point a, java.awt.Point b)
           
abstract  void line(int x0, int y0, int x1, int y1)
           
 void line(int x0, int y0, int x1, int y1, int z)
          Draws a Line between co-ordinates with z depth offset.
 void line(int x0, int y0, int z0, int x1, int y1, int z1)
          Draws a Line between co-ordinates with different start/end z depth offset.
 void line(java.awt.Point p0, java.awt.Point p1)
          Draws a Line between point p0 and point p1.
 void line(java.awt.Point p0, java.awt.Point p1, int z)
          Draws a Line between point p0 and point p1 with Z offset.
abstract  void lineTo(int x, int y)
           
 void lineTo(int x, int y, int z)
          Draws line from present position to end co-ordinates with z depth offset.
 void lineTo(java.awt.Point p)
          Draws a line to Point with z = 0 depth offset.
 void lineTo(Point3D p)
          Draws a Line to 3D Point.
 void lineTo(java.awt.Point p, int z)
          Draws a line to Point with z depth offset.
 void lineWithZ(int x, int y, int x1, int y1, int z)
          Obsolete.
abstract  java.awt.Dimension measureString(ChartFont f, java.lang.String text)
           
abstract  void moveTo(int x, int y)
          Sets the value of PenPos to x and y co-ordinates before calling LineTo.
 void moveTo(int x, int y, int z)
          Sets the value of PenPos to x, y and z co-ordinates before calling LineTo.
 void moveTo(java.awt.Point p)
          Sets the value of PenPos to Point p before calling LineTo.
 void moveTo(Point3D p)
          Sets the value of PenPos to 3D Point p before calling LineTo.
 void moveTo(java.awt.Point p, int z)
          Sets the value of PenPos to Point p with z depth offset before calling LineTo.
 void paintBevel(BevelStyle bevel, Rectangle rect, int width, Color one, Color two)
           
 void paintImageBevel(Rectangle rect, int width, ChartPen pen, ChartBrush brush, int borderRound)
           
abstract  void pie(int x1, int y1, int x2, int y2, double startAngle, double endAngle)
           
 void pie(int xCenter, int yCenter, int xRadius, int yRadius, int z0, int z1, double startAngle, double endAngle, boolean darkSides, boolean drawSides)
          Draws a pie slice using startAngle and endAngle with dark sides.
 void pie(int xCenter, int yCenter, int xRadius, int yRadius, int z0, int z1, double startAngle, double endAngle, boolean darkSides, boolean drawSides, int donutPercent)
          Draws a 3D Pie slice using start Angle and end Angle and donut percent.
 void pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
          Draws a Pie slice.
abstract  void pixel(int x, int y, int z, Color color)
           
 void plane(int z0, int z1, java.awt.Point[] p)
          Draws a polygon using points array p with different start/end z depth offset.
 void plane(java.awt.Point p1, java.awt.Point p2, int z0, int z1)
          Draws a polygon (Point p1, Point p2) at Z depth offset.
 void plane(java.awt.Point p1, java.awt.Point p2, java.awt.Point p3, java.awt.Point p4, int z)
          Draws a polygon (Point p1, Point p2, Point p3, Point p4) at Z depth offset.
 void planeFour3D(int z0, int z1, java.awt.Point[] p)
          Draws a polygon of four points.
static boolean pointInEllipse(java.awt.Point p, int left, int top, int right, int bottom)
          Returns true if point P is inside the ellipse bounded by Left, Top, Right, Bottom.
static boolean pointInEllipse(java.awt.Point p, Rectangle rect)
          Returns true if point P is inside the ellipse bounded by Rect.
static boolean pointInHorizTriangle(java.awt.Point p, int y0, int y1, int x0, int x1)
          Returns true if point P is inside the horizontal triangle.
static boolean pointInLineTolerance(java.awt.Point p, int px, int py, int qx, int qy, int tolerance)
          Determines if point p is "near" line segment between px,py point and qx,qy point.
static boolean pointInLineTolerance(java.awt.Point p, java.awt.Point p0, java.awt.Point p1, int tolerancePixels)
          Determines if point p is "near" line segment between p0 and p1.
static boolean pointInPolygon(java.awt.Point p, java.awt.Point[] poly)
          Returns true if point P is inside Poly polygon.
static boolean pointInRect(Rectangle rect, int x, int y)
          Obsolete.
static boolean pointInTriangle(java.awt.Point p, int x0, int x1, int y0, int y1)
          Returns true if point P is inside the vert triangle of x0y0, midxY1, x1y0.
 void polygon(int z, java.awt.Point[] p)
          Draws a polygon with z position offset.
abstract  void polygon(java.awt.Point[] p)
           
 void polygon(java.awt.Point p0, java.awt.Point p1, java.awt.Point p2)
           
static Rectangle polygonRect(java.awt.Point[] p)
          Returns bounding rectangle for point array p
 void polyLine(int z, java.awt.Point[] p)
          Draws a series of line segments to join point array p at z displacement.
abstract  void polyLine(java.awt.Point[] p)
           
abstract  void prepareDrawImage()
           
 void projection(int maxDepth, Rectangle r)
          Internal use.
 void pyramid(boolean vertical, int left, int top, int right, int bottom, int z0, int z1, boolean darkSides)
          Draws a vertical or horizontal Pyramid with optional dark shaded sides.
 void pyramid(boolean vertical, Rectangle r, int z0, int z1, boolean darkSides)
          Draws a vertical or horizontal Pyramid with optional dark shaded sides.
 void pyramidTrunc(Rectangle r, int startZ, int endZ, int truncX, int truncZ)
          Draws a pyramid with a truncated apex of variable thickness.
protected static double rad2Deg(double radian)
           
 void rectangle(ChartBrush b, int x, int y, int right, int bottom)
           
abstract  void rectangle(ChartBrush b, Rectangle r)
           
 void rectangle(int left, int top, int right, int bottom)
          Draws a rectangle between the defined co-ordinates.
 void rectangle(int left, int top, int right, int bottom, int z)
          Draws a rectangle between the defined co-ordinates with z depth.
abstract  void rectangle(Rectangle r)
           
 void rectangle(Rectangle r, int z)
          Draws a Rectangle (Rectangle r) at z depth.
 void rectangleWithZ(Rectangle r, int z)
          Obsolete.
 void rectangleY(int left, int top, int right, int z0, int z1)
          Horizontal Rectangle from Left to Right, from Z0 to Z1 position, at Top Y.
 void rectangleZ(int left, int top, int bottom, int z0, int z1)
          Horizontal Rectangle from Left to Right, from Z0 to Z1 position, at Top Y.
 Rectangle rectFromPolygon(int num, java.awt.Point[] p)
          Returns the bounding rectangle for a given array of XY points.
 Rectangle rectFromRectZ(Rectangle r, int z)
          Returns the smallest bounding rectangle containing the four corners of the "R" rectangle after calculating their 3D position.
 void reset()
           
 void rotateLabel(int x, int y, int z, java.lang.String text, double rotDegree)
          Draws a rotated text String at the specified x,y and z coordinates with the RotDegree rotation angle.
abstract  void rotateLabel(int x, int y, java.lang.String text, double rotDegree)
           
 void rotateLabel(java.awt.Point p, java.lang.String text, double rotDegree)
          Draws a rotated text String at the specified Point x,y coordinates with the RotDegree rotation angle.
 java.awt.Point[] rotateRectangle(Rectangle r, double angle)
           
 void roundRectangle(Rectangle r)
          Draws a rectangle with rounded corners of personalized curvature and size.
abstract  void roundRectangle(Rectangle r, int roundWidth, int roundHeight)
           
 void setBackColor(Color value)
           
 void setBrush(ChartBrush value)
          Determines the kind of brush used to fill the Canvas draw rectangle background.
abstract  void setClip(java.awt.Shape region)
           
 void setColorPalette(Color[] palette)
          Specifies a color from global ColorPalette array variable.
 void setDirty(boolean value)
           
 void setFont(ChartFont value)
          Determines the Font for outputted text when using the Drawing Canvas.
 void setGradient(Gradient value)
          Determines the Brush.
abstract  void setGraphics(java.lang.Object value)
           
protected  void setIZoomfactor(double value)
           
 void setMetafiling(boolean value)
           
 void setPen(ChartPen value)
          Determines the kind of pen used to draw Canvas lines.
abstract  void setPixel(int x, int y, int z, Color color)
           
 void setRotationCenter(Point3D value)
           
 void setSmoothingMode(boolean value)
          Sets the anti-alias mode for the Graphics Pen when Custom drawing.
 void setTextAlign(StringAlignment value)
          Sets the alignment used when displaying text using TextOut or TextOut3D.
 void setTextSmooth(boolean value)
           
 void setUseBuffer(boolean value)
           
 void setXCenter(int value)
          Specifies the X coordinate of the pixel location of the center of the 3D Canvas.
 void setYCenter(int value)
          Specifies the Y coordinate of the pixel location of the center of the 3D Canvas.
static java.awt.Point[] sliceArray(java.awt.Point[] source, int length)
           
 void sphere(int x, int y, int z, double radius)
           
 void sphere(int x0, int y0, int x1, int y1)
           
 void sphere(int x, int y, int z, int radius, boolean enhanced)
           
 void sphere(int x1, int y1, int x2, int y2, int z, boolean enhanced)
           
 void sphere(Rectangle rect, int z, boolean enhanced)
           
 int textHeight(ChartFont f, java.lang.String text)
          Returns the vertical text size in pixels of ChartFont f.
 int textHeight(java.lang.String text)
          Returns the vertical size in pixels of the text String.
 void textOut(int x, int y, int z, java.lang.String text)
          Displays 2D non-rotated label at the specified x,y and z screen coordinates.
 void textOut(int x, int y, java.lang.String text)
          Displays the 2D non-rotated label at the specified X Y screen coordinates.
 void textOut(java.awt.Point p, java.lang.String text)
           
 int textWidth(ChartFont f, java.lang.String text)
          Returns the horizontal text size in pixels of ChartFont f.
 int textWidth(java.lang.String text)
          Returns the horizontal size in pixels of the text String.
static int transparency(Color color)
          Returns percentage based on Color "A" value.
static Color transparentColor(int transparency, Color color)
          Returns Color parameter after changing its "A" value.
protected abstract  void transparentEllipse(int x1, int y1, int x2, int y2)
           
 void transparentEllipse(int x1, int y1, int x2, int y2, int z)
           
protected  void transparentEllipse(java.awt.Point p0, java.awt.Point p1)
           
 void triangle(java.awt.Point p0, java.awt.Point p1, java.awt.Point p2, int z)
          Draws a triangle (point p0, pointp1, pointp2) at Z position.
 void triangle(Triangle3D p)
          Draws a triangle (Triangle3D p).
abstract  void unClip()
           
 void unClipRectangle()
          Obsolete.
 boolean validState()
           
abstract  void verticalLine(int x, int top, int bottom)
           
 void verticalLine(int x, int top, int bottom, int z)
          Draws a Vertical Line from (X,Top) to (X,Bottom) at z depth position.
 void zLine(int x, int y, int z0, int z1)
          Draws a Line from (X,Y,Z0) to (X,Y,Z1).
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setChart, setColorProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.steema.teechart.drawing.IGraphics3D
bufferedFrom, draw, getGraphics, getImagePixels, polygon, resetState, showImage
 

Field Detail

DARKCOLORQUANTITY

public static final int DARKCOLORQUANTITY
See Also:
Constant Field Values

DARKERCOLORQUANTITY

public static final int DARKERCOLORQUANTITY
See Also:
Constant Field Values

fourPoints

public java.awt.Point[] fourPoints

smoothingMode

protected boolean smoothingMode

textSmooth

protected boolean textSmooth

bounds

protected Rectangle bounds

stringFormat

protected StringFormat stringFormat

pen

protected ChartPen pen

brush

protected ChartBrush brush

font

protected ChartFont font

aspect

protected Aspect aspect

metafiling

protected boolean metafiling

monochrome

public boolean monochrome

DefaultPalette

public static final Color[] DefaultPalette
Constructor Detail

Graphics3D

public Graphics3D(IBaseChart c)
Method Detail

reset

public void reset()

getAspect

public Aspect getAspect()
Specified by:
getAspect in interface IGraphics3D

getPen

public ChartPen getPen()
Indicates the kind of pen used to draw Canvas lines.

Specified by:
getPen in interface IGraphics3D
Returns:
ChartPen

setPen

public void setPen(ChartPen value)
Determines the kind of pen used to draw Canvas lines.

Specified by:
setPen in interface IGraphics3D
Parameters:
value - ChartPen

getBrush

public ChartBrush getBrush()
Determines the kind of brush used to fill the Canvas draw rectangle background.
The Brush.Visible method must be set to true.

Specified by:
getBrush in interface IGraphics3D
Returns:
ChartBrush

setBrush

public void setBrush(ChartBrush value)
Determines the kind of brush used to fill the Canvas draw rectangle background.
The Brush.Visible method must be set to true.

Specified by:
setBrush in interface IGraphics3D
Parameters:
value - ChartBrush

changed

public void changed(java.lang.Object o)
Specified by:
changed in interface IGraphics3D

getGradient

public Gradient getGradient()
Determines the Brush.Gradient properties of the Canvas.

Specified by:
getGradient in interface IGraphics3D
Returns:
Gradient

setGradient

public void setGradient(Gradient value)
Determines the Brush.Gradient properties of the Canvas.

Parameters:
value - Gradient

getDirty

public boolean getDirty()
Specified by:
getDirty in interface IGraphics3D

getFont

public ChartFont getFont()
Determines the Font for outputted text when using the Drawing Canvas.

Specified by:
getFont in interface IGraphics3D
Returns:
ChartFont

setFont

public void setFont(