Package org.jzy3d.painters
Class AbstractPainter
- java.lang.Object
-
- org.jzy3d.painters.AbstractPainter
-
- All Implemented Interfaces:
IPainter
- Direct Known Subclasses:
EmulGLPainter,NativeDesktopPainter,NativeEmbeddedPainter
public abstract class AbstractPainter extends Object implements IPainter
-
-
Constructor Summary
Constructors Constructor Description AbstractPainter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbox(BoundingBox3d box, Color color, float width, SpaceTransformer spaceTransformer)A helper to draw a bounding box.voidclearColor(Color color)voidclip(int plane, ClipEq equation, double value)A convenient shortcut to invoke a clipping plane using an ID in [0;5] instead of the original OpenGL ID value.voidclip(BoundingBox3d box)A convenient shortcut to glClipPlane that defines the 6 clipping planes according to the min/max values of the bounding box.voidclipOff()Disable all clipping planesvoidclipOn()Enable all clipping planesvoidcolor(Color color)A convenient shortcut to glColor4fvoidcolorAlphaFactor(Color color, float alpha)A convenient shortcut to glColor4f which multiplies the color's alpha channel by the given factorvoidcolorAlphaOverride(Color color, float alpha)A convenient shortcut to glColor4f which overrides the color's alpha channelprotected double[]equation(ClipEq eq, double value)The four coefs of the plane equation that are returned by this method are : Nx, Ny, Nz, D The solve the formula : Nx*x + Ny*y + Nz*z + D = 0 where Nx, Ny and Nz are the 3 components of the normal to the plane.CameragetCamera()ICanvasgetCanvas()OperatingSystemgetOS()QualitygetQuality()Return the Quality setting of the chart, which may be different from the one given at theIPainter.configureGL(Quality)step.ViewgetView()WindowingToolkitgetWindowingToolkit()booleanisJVMScaleLargerThanNativeScale()Verify if pixel scale of JVM is different than the one return by the canvasbooleanisJVMScaleLargerThanNativeScale(Coord2d scaleHardware, Coord2d scaleJVM)voidmaterial(int face, int pname, Color color)ArrayList<ArrayList<Coord3d>>modelToScreen(ArrayList<ArrayList<Coord3d>> polygons)List<Coord3d>modelToScreen(List<Coord3d> points)Coord3dmodelToScreen(Coord3d point)Transform a 3d point coordinate into its screen position.Coord3d[]modelToScreen(Coord3d[] points)Coord3d[][]modelToScreen(Coord3d[][] points)PolygonArraymodelToScreen(PolygonArray polygon)PolygonArray[][]modelToScreen(PolygonArray[][] polygons)voidnormal(Coord3d norm)A convenient shortcut to glNormal3fvoidraster(Coord3d coord, SpaceTransformer transform)Coord3dscreenToModel(Coord3d screen)voidsetCamera(Camera camera)voidsetCanvas(ICanvas canvas)voidsetView(View view)voidtransform(Transform transform, boolean loadIdentity)voidvertex(float x, float y, float z, SpaceTransformer transform)A convenient shortcut to glVertex3f, able to apply a space transform in case it is not nullvoidvertex(Coord3d coord)A convenient shortcut to glVertex3fvoidvertex(Coord3d coord, SpaceTransformer transform)A convenient shortcut to glVertex3f, able to apply a space transform in case it is not null-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jzy3d.painters.IPainter
acquireGL, clipPlaneId, configureGL, drawImage, drawText, getModelViewAsDouble, getModelViewAsFloat, getProjectionAsDouble, getProjectionAsFloat, getTextLengthInPixels, getTextLengthInPixels, getViewPortAsInt, glBegin, glBegin_Line, glBegin_LineLoop, glBegin_LineStrip, glBegin_Point, glBegin_Polygon, glBegin_Quad, glBegin_Triangle, glBitmap, glBlendFunc, glCallList, glClear, glClearColor, glClearColorAndDepthBuffers, glClearDepth, glClearStencil, glClipPlane, glColor3f, glColor4f, glCullFace, glCullFace_Front, glDeleteLists, glDepthFunc, glDepthFunc, glDepthRangef, glDisable, glDisable_Blend, glDisable_ClipPlane, glDisable_CullFace, glDisable_DepthTest, glDisable_Light, glDisable_Lighting, glDisable_LineStipple, glDisable_PolygonOffsetFill, glDisable_PolygonOffsetLine, glDisable_Stencil, glDrawPixels, glEnable, glEnable_Blend, glEnable_ClipPlane, glEnable_ColorMaterial, glEnable_CullFace, glEnable_DepthTest, glEnable_Light, glEnable_Lighting, glEnable_LineStipple, glEnable_PointSmooth, glEnable_PolygonOffsetFill, glEnable_PolygonOffsetLine, glEnable_Stencil, glEnd, glEndList, glEvalCoord2f, glFeedbackBuffer, glFlush, glFrontFace, glFrontFace_ClockWise, glFrustum, glGenLists, glGetDoublev, glGetFloatv, glGetIntegerv, glHint, glHint_PointSmooth_Nicest, glInitNames, glIsList, glLight_Ambiant, glLight_Diffuse, glLight_Position, glLight_Shininess, glLight_Specular, glLightf, glLightf, glLightfv, glLightModel, glLightModel, glLightModelfv, glLightModeli, glLineStipple, glLineWidth, glLoadIdentity, glLoadName, glMap2f, glMaterial, glMaterial, glMaterialfv, glMatrixMode, glMatrixMode_ModelView, glMatrixMode_Projection, glNewList, glNewList, glNormal3f, glOrtho, glPassThrough, glPixelStore, glPixelStorei, glPixelZoom, glPointSize, glPolygonMode, glPolygonMode, glPolygonOffset, glPopMatrix, glPopName, glPushMatrix, glPushName, glRasterPos3f, glRenderMode, glRenderMode, glRotatef, glScalef, glSelectBuffer, glShadeModel, glShadeModel, glShadeModel_Flat, glShadeModel_Smooth, glStencilFunc, glStencilMask, glStencilMask_False, glStencilMask_True, glStencilOp, glTexCoord2f, glTexEnvf, glTexEnvi, glTranslatef, gluCylinder, gluDisk, gluLookAt, gluOrtho2D, gluPerspective, gluPickMatrix, gluProject, gluSphere, glutBitmapLength, glutBitmapString, glutBitmapString, glutSolidCube, glutSolidSphere, glutSolidTeapot, glutWireTeapot, gluUnProject, glVertex3d, glVertex3f, glViewport, releaseGL
-
-
-
-
Field Detail
-
camera
protected Camera camera
-
view
protected View view
-
canvas
protected ICanvas canvas
-
os
protected OperatingSystem os
-
-
Method Detail
-
getOS
public OperatingSystem getOS()
-
getWindowingToolkit
public WindowingToolkit getWindowingToolkit()
- Specified by:
getWindowingToolkitin interfaceIPainter
-
getQuality
public Quality getQuality()
Description copied from interface:IPainterReturn the Quality setting of the chart, which may be different from the one given at theIPainter.configureGL(Quality)step.- Specified by:
getQualityin interfaceIPainter
-
transform
public void transform(Transform transform, boolean loadIdentity)
-
color
public void color(Color color)
Description copied from interface:IPainterA convenient shortcut to glColor4f
-
colorAlphaOverride
public void colorAlphaOverride(Color color, float alpha)
Description copied from interface:IPainterA convenient shortcut to glColor4f which overrides the color's alpha channel- Specified by:
colorAlphaOverridein interfaceIPainter
-
colorAlphaFactor
public void colorAlphaFactor(Color color, float alpha)
Description copied from interface:IPainterA convenient shortcut to glColor4f which multiplies the color's alpha channel by the given factor- Specified by:
colorAlphaFactorin interfaceIPainter
-
clearColor
public void clearColor(Color color)
- Specified by:
clearColorin interfaceIPainter
-
vertex
public void vertex(Coord3d coord, SpaceTransformer transform)
Description copied from interface:IPainterA convenient shortcut to glVertex3f, able to apply a space transform in case it is not null
-
vertex
public void vertex(float x, float y, float z, SpaceTransformer transform)Description copied from interface:IPainterA convenient shortcut to glVertex3f, able to apply a space transform in case it is not null
-
box
public void box(BoundingBox3d box, Color color, float width, SpaceTransformer spaceTransformer)
Description copied from interface:IPainterA helper to draw a bounding box.
-
vertex
public void vertex(Coord3d coord)
Description copied from interface:IPainterA convenient shortcut to glVertex3f
-
normal
public void normal(Coord3d norm)
Description copied from interface:IPainterA convenient shortcut to glNormal3f
-
clip
public void clip(BoundingBox3d box)
Description copied from interface:IPainterA convenient shortcut to glClipPlane that defines the 6 clipping planes according to the min/max values of the bounding box. Then requires to enable clipping withIPainter.clipOn().
-
clipOn
public void clipOn()
Description copied from interface:IPainterEnable all clipping planes
-
clipOff
public void clipOff()
Description copied from interface:IPainterDisable all clipping planes
-
clip
public void clip(int plane, ClipEq equation, double value)A convenient shortcut to invoke a clipping plane using an ID in [0;5] instead of the original OpenGL ID value.
-
equation
protected double[] equation(ClipEq eq, double value)
The four coefs of the plane equation that are returned by this method are : Nx, Ny, Nz, D The solve the formula : Nx*x + Ny*y + Nz*z + D = 0 where Nx, Ny and Nz are the 3 components of the normal to the plane. The x, y and z in the equation are the coordinates of any point on the plane. The variable D is the distance of the plane from the origin. A point that is being tested can give three results based on where it is with respect to the plane :- The point is in front of the plane - In this case, the result obtained will be positive. The value obtained is the distance of the point from the plane being tested.
- The point is behind the plane - In this case, the result will be negative. The value obtained is the distance of the point from the plane being tested.
- The point is on the plane - The result will, quite obviously, be zero.
- Parameters:
eq-value-- Returns:
-
raster
public void raster(Coord3d coord, SpaceTransformer transform)
-
material
public void material(int face, int pname, Color color)
-
screenToModel
public Coord3d screenToModel(Coord3d screen)
- Specified by:
screenToModelin interfaceIPainter
-
modelToScreen
public Coord3d modelToScreen(Coord3d point)
Transform a 3d point coordinate into its screen position.- Specified by:
modelToScreenin interfaceIPainter
-
modelToScreen
public Coord3d[] modelToScreen(Coord3d[] points)
- Specified by:
modelToScreenin interfaceIPainter
-
modelToScreen
public Coord3d[][] modelToScreen(Coord3d[][] points)
- Specified by:
modelToScreenin interfaceIPainter
-
modelToScreen
public List<Coord3d> modelToScreen(List<Coord3d> points)
- Specified by:
modelToScreenin interfaceIPainter
-
modelToScreen
public ArrayList<ArrayList<Coord3d>> modelToScreen(ArrayList<ArrayList<Coord3d>> polygons)
- Specified by:
modelToScreenin interfaceIPainter
-
modelToScreen
public PolygonArray modelToScreen(PolygonArray polygon)
- Specified by:
modelToScreenin interfaceIPainter
-
modelToScreen
public PolygonArray[][] modelToScreen(PolygonArray[][] polygons)
- Specified by:
modelToScreenin interfaceIPainter
-
isJVMScaleLargerThanNativeScale
public boolean isJVMScaleLargerThanNativeScale(Coord2d scaleHardware, Coord2d scaleJVM)
- Specified by:
isJVMScaleLargerThanNativeScalein interfaceIPainter
-
isJVMScaleLargerThanNativeScale
public boolean isJVMScaleLargerThanNativeScale()
Description copied from interface:IPainterVerify if pixel scale of JVM is different than the one return by the canvas- Specified by:
isJVMScaleLargerThanNativeScalein interfaceIPainter
-
-