Class AbstractPainter

    • Constructor Detail

      • AbstractPainter

        public AbstractPainter()
    • Method Detail

      • transform

        public void transform​(Transform transform,
                              boolean loadIdentity)
        Specified by:
        transform in interface IPainter
      • color

        public void color​(Color color)
        Description copied from interface: IPainter
        A convenient shortcut to glColor4f
        Specified by:
        color in interface IPainter
      • colorAlphaOverride

        public void colorAlphaOverride​(Color color,
                                       float alpha)
        Description copied from interface: IPainter
        A convenient shortcut to glColor4f which overrides the color's alpha channel
        Specified by:
        colorAlphaOverride in interface IPainter
      • colorAlphaFactor

        public void colorAlphaFactor​(Color color,
                                     float alpha)
        Description copied from interface: IPainter
        A convenient shortcut to glColor4f which multiplies the color's alpha channel by the given factor
        Specified by:
        colorAlphaFactor in interface IPainter
      • vertex

        public void vertex​(Coord3d coord,
                           SpaceTransformer transform)
        Description copied from interface: IPainter
        A convenient shortcut to glVertex3f, able to apply a space transform in case it is not null
        Specified by:
        vertex in interface IPainter
      • vertex

        public void vertex​(float x,
                           float y,
                           float z,
                           SpaceTransformer transform)
        Description copied from interface: IPainter
        A convenient shortcut to glVertex3f, able to apply a space transform in case it is not null
        Specified by:
        vertex in interface IPainter
      • vertex

        public void vertex​(Coord3d coord)
        Description copied from interface: IPainter
        A convenient shortcut to glVertex3f
        Specified by:
        vertex in interface IPainter
      • normal

        public void normal​(Coord3d norm)
        Description copied from interface: IPainter
        A convenient shortcut to glNormal3f
        Specified by:
        normal in interface IPainter
      • clip

        public void clip​(BoundingBox3d box)
        Description copied from interface: IPainter
        A 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 with IPainter.clipOn().
        Specified by:
        clip in interface IPainter
      • clipOn

        public void clipOn()
        Description copied from interface: IPainter
        Enable all clipping planes
        Specified by:
        clipOn in interface IPainter
      • clipOff

        public void clipOff()
        Description copied from interface: IPainter
        Disable all clipping planes
        Specified by:
        clipOff in interface IPainter
      • 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.
        Specified by:
        clip in interface IPainter
      • 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:
      • material

        public void material​(int face,
                             int pname,
                             Color color)
        Specified by:
        material in interface IPainter
      • modelToScreen

        public Coord3d modelToScreen​(Coord3d point)
        Transform a 3d point coordinate into its screen position.
        Specified by:
        modelToScreen in interface IPainter
      • isJVMScaleLargerThanNativeScale

        public boolean isJVMScaleLargerThanNativeScale()
        Description copied from interface: IPainter
        Verify if pixel scale of JVM is different than the one return by the canvas
        Specified by:
        isJVMScaleLargerThanNativeScale in interface IPainter