Class Wireframeable

    • Field Detail

      • wireframeColor

        protected Color wireframeColor
      • wireframeWidth

        protected float wireframeWidth
      • wireframeDisplayed

        protected boolean wireframeDisplayed
      • wireframeColorFromPolygonPoints

        protected boolean wireframeColorFromPolygonPoints
      • faceDisplayed

        protected boolean faceDisplayed
      • wireframeWithLineLoop

        protected boolean wireframeWithLineLoop
        if true, use line loop for rendering polygon border, otherwise use polygon mode + line mode.
      • depthFunctionChangeForWireframe

        protected boolean depthFunctionChangeForWireframe
        if true, may change depth function while rendering wireframe to avoid Z-fighting with polygon face.
      • polygonWireframeDepthTrick

        protected boolean polygonWireframeDepthTrick
        if true, may change the depth range to set lines and polygons in different spaces. Not accurate.
      • polygonOffsetFillEnable

        protected boolean polygonOffsetFillEnable
        if true, enable polygon offset fill, which is the most clean way of handling polygon fill / line Z fighting, but only available in native mode (not emulgl)
      • polygonOffsetFactor

        protected float polygonOffsetFactor
      • polygonOffsetUnit

        protected float polygonOffsetUnit
      • reflectLight

        protected boolean reflectLight
      • materialAmbiantReflection

        protected Color materialAmbiantReflection
      • materialDiffuseReflection

        protected Color materialDiffuseReflection
      • materialSpecularReflection

        protected Color materialSpecularReflection
      • materialEmission

        protected Color materialEmission
      • materialShininess

        protected float[] materialShininess
      • NO_OVERLAP_DEPTH_RATIO

        public static float NO_OVERLAP_DEPTH_RATIO
        The higher the value, the more the line are far from the faces and hence no z-fighting occurs between faces and lines. In case of higher value, line will be display more often, but also lines that should be behind the polygon
    • Constructor Detail

      • Wireframeable

        public Wireframeable()
        Initialize the wireframeable with a white color and width of 1 for wires, hidden wireframe, and displayed faces.
    • Method Detail

      • isWireframeColorFromPolygonPoints

        public boolean isWireframeColorFromPolygonPoints()
      • setWireframeColorFromPolygonPoints

        public void setWireframeColorFromPolygonPoints​(boolean wireframeColorFromPolygonPoints)
      • setWireframeColor

        public void setWireframeColor​(Color color)
        Set the wireframe color.
      • setWireframeDisplayed

        public void setWireframeDisplayed​(boolean status)
        Set the wireframe display status to on or off.
      • setWireframeWidth

        public void setWireframeWidth​(float width)
        Set the wireframe width.
      • setFaceDisplayed

        public void setFaceDisplayed​(boolean status)
        Set the face display status to on or off.
      • getWireframeColor

        public Color getWireframeColor()
        Get the wireframe color.
      • isWireframeDisplayed

        public boolean isWireframeDisplayed()
        Get the wireframe display status to on or off.
      • getWireframeWidth

        public float getWireframeWidth()
        Get the wireframe width.
      • isFaceDisplayed

        public boolean isFaceDisplayed()
        Get the face display status to on or off.
      • polygonOffsetFillEnable

        protected void polygonOffsetFillEnable​(IPainter painter)
      • polygonOffsetFillDisable

        protected void polygonOffsetFillDisable​(IPainter painter)
      • polygonOffsetLineEnable

        protected void polygonOffsetLineEnable​(IPainter painter)
      • polygonOffsetLineDisable

        protected void polygonOffsetLineDisable​(IPainter painter)
      • isPolygonOffsetFillEnable

        public boolean isPolygonOffsetFillEnable()
      • setPolygonOffsetFillEnable

        public void setPolygonOffsetFillEnable​(boolean polygonOffsetFillEnable)
        Enable offset fill, which let a polygon with a wireframe render cleanly without weird depth uncertainty between face polygon and wireframe polygon.
      • getPolygonOffsetFactor

        public float getPolygonOffsetFactor()
      • setPolygonOffsetFactor

        public void setPolygonOffsetFactor​(float polygonOffsetFactor)
      • getPolygonOffsetUnit

        public float getPolygonOffsetUnit()
      • setPolygonOffsetUnit

        public void setPolygonOffsetUnit​(float polygonOffsetUnit)
      • setPolygonWireframeDepthTrick

        public void setPolygonWireframeDepthTrick​(boolean polygonWireframeDepthTrick)
        May be used as alternative to setPolygonOffsetFillEnable(boolean) in case it is not supported by underlying OpenGL version (Polygon offset appears as off version 2).
      • isPolygonWireframeDepthTrick

        public boolean isPolygonWireframeDepthTrick()
      • applyDepthRangeForUnderlying

        protected void applyDepthRangeForUnderlying​(IPainter painter)
      • applyDepthRangeForOverlying

        protected void applyDepthRangeForOverlying​(IPainter painter)
      • applyDepthRangeDefault

        protected void applyDepthRangeDefault​(IPainter painter)
      • isReflectLight

        public boolean isReflectLight()
      • setReflectLight

        public void setReflectLight​(boolean reflectLight)
        If true, drawing this object will set ambient, diffuse, specular and shininess parameters. If the drawable has no normal defined, then the normal will be automatically processed.
        Parameters:
        reflectLight -
      • applyMaterial

        protected void applyMaterial​(IPainter painter)
        Applies material settings
      • getMaterialAmbiantReflection

        public Color getMaterialAmbiantReflection()
      • setMaterialAmbiantReflection

        public void setMaterialAmbiantReflection​(Color materialAmbiantReflection)
      • getMaterialDiffuseReflection

        public Color getMaterialDiffuseReflection()
      • setMaterialDiffuseReflection

        public void setMaterialDiffuseReflection​(Color materialDiffuseReflection)
      • getMaterialSpecularReflection

        public Color getMaterialSpecularReflection()
      • setMaterialSpecularReflection

        public void setMaterialSpecularReflection​(Color materialSpecularReflection)
      • getMaterialEmission

        public Color getMaterialEmission()
      • setMaterialEmission

        public void setMaterialEmission​(Color materialEmission)
      • getMaterialShininess

        public float getMaterialShininess()
      • setMaterialShininess

        public void setMaterialShininess​(float shininess)