Class SoMaterialElement


  • public class SoMaterialElement
    extends SoReplacedElement
    Manages several properties that need to be lazily tracked for rendering. This element manages several properties such as colors, that need to be lazily tracked for rendering. Allows Open Inventor property nodes to set these properties without immediately making any rendering calls. Thus we avoid making redundant rendering calls to set, for example, the material color. Open Inventor rendering nodes then request that the values of any properties that are relevant to that shape and "out of date" (not current with rendering state) be sent to the rendering engine.

    Includes:
    Transparencies
    GLColorMaterial
    PolygonStipple
    Color index

    See Also:
    SoBaseColor, SoMaterial, SoPackedColor, SoVertexProperty
    • Method Detail

      • setShininess

        public static void setShininess​(SoState state,
                                        SoNode node,
                                        float value)
      • setColorMaterial

        public static void setColorMaterial​(SoState state,
                                            SoNode node,
                                            boolean value)
      • getTransparency

        public static float getTransparency​(SoState name_15478,
                                            int index)
        get() methods get value from Inventor state. The public methods are static, they get an instance of the element. If there is a cache, the appropriate virtual registerGetDependence is called.
      • push

        public void push​(SoState state)
        Copy current material into the pushed element.
        Overrides:
        push in class SoElement
      • getDiffuse

        public static SbColor getDiffuse​(SoState state,
                                         int index)
        get() methods get value from Inventor state. The public methods are static, they get an instance of the element.
      • pop

        public void pop​(SoState state,
                        SoElement prevTopElement)
        Unref buffer object of the popped element.
        Overrides:
        pop in class SoElement
      • getDefaultDiffuse

        public static SbColor getDefaultDiffuse()
        Specify Open Inventor defaults for colors, etc.
      • getDefaultEmissive

        public static SbColor getDefaultEmissive()
        Specify Open Inventor defaults for colors, etc.
      • getDefaultAmbient

        public static SbColor getDefaultAmbient()
        Specify Open Inventor defaults for colors, etc.
      • getDefaultSpecular

        public static SbColor getDefaultSpecular()
        Specify Open Inventor defaults for colors, etc.
      • getClassStackIndex

        @Deprecated
        public static int getClassStackIndex()
        Deprecated.
        As of Open Inventor 9300. replaced by SoElement.getClassStackIndex(Class)
        Returns the stack id for this element. ] *
      • setPacked

        public static void setPacked​(SoState state,
                                     SoNode node,
                                     int[] colors)
      • setColorIndices

        public static void setColorIndices​(SoState state,
                                           SoNode node,
                                           int[] indices)
        Static set method.
      • setDiffuse

        public static void setDiffuse​(SoState state,
                                      SoNode node,
                                      SbColor[] colors)
        Static set method.
      • setTransparency

        public static void setTransparency​(SoState state,
                                           SoNode node,
                                           float[] transp)
        Static set method.
      • isTransparent

        public static boolean isTransparent​(SoState state)
        Method to inquire about current colors.
      • getColorMaterial

        public static boolean getColorMaterial​(SoState name_15488)
      • getDefaultShininess

        public static float getDefaultShininess()
        Specify Open Inventor defaults for colors, etc.
      • getShininess

        public static float getShininess​(SoState name_15487)
      • getNumDiffuse

        public static long getNumDiffuse​(SoState state)
        Return number of diffuse colors.
      • getDefaultColorIndex

        public static int getDefaultColorIndex()
        Specify Open Inventor defaults for colors, etc.
      • getNumColorIndices

        public static long getNumColorIndices​(SoState state)
        Method to inquire about current colors.
      • getDefaultTransparency

        public static float getDefaultTransparency()
        Specify Open Inventor defaults for colors, etc.
      • getNumTransparencies

        public static int getNumTransparencies​(SoState state)
        Method to inquire about current colors.
      • getNumDiffuse

        public int getNumDiffuse()
        Method to inquire about current colors.
      • getColorIndices

        public static int[] getColorIndices​(SoState state)
      • getNumColorIndices

        public int getNumColorIndices()
        Method to inquire about current colors.
      • getDirectColorIndices

        public static java.nio.IntBuffer getDirectColorIndices​(SoState state)
      • getColorIndex

        public static int getColorIndex​(SoState name_15482,
                                        int num)
      • getDefaultAmbientIntensity

        public static float getDefaultAmbientIntensity()
        Specify Open Inventor defaults for colors, etc.
      • getSpecular

        public static SbColor getSpecular​(SoState name_15486)
      • getAmbient

        public static SbColor getAmbient​(SoState name_15484)
      • getEmissive

        public static SbColor getEmissive​(SoState name_15485)