Class SoPattern

    • Field Detail

      • category

        public final SoSFString category
        Specifies the name of a group of patterns. If the category name is invalid or not found, the default pattern is used.
      • name

        public final SoSFString name
        Specifies the name of a pattern within a category. If the pattern name is invalid or not found, the default pattern is used.
    • Constructor Detail

      • SoPattern

        public SoPattern()
        Constructor.
    • Method Detail

      • getPatternNames

        public static java.lang.String[] getPatternNames()
        Gets the list names of all loaded patterns.
      • getPatternNames

        public static java.lang.String[] getPatternNames​(java.lang.String category)
        Gets the list names of all loaded patterns in the specified category.
      • loadPatterns

        public static boolean loadPatterns​(java.lang.String fileName)
        Calls loadPatterns(fileName, (int)0, (java.lang.String[])null, SoPattern.FilterTypes.valueOf( SoPattern.FilterTypes.INCLUSIVE_FILTER.getValue() )).
      • loadPatterns

        public static boolean loadPatterns​(java.lang.String fileName,
                                           int numFilters,
                                           java.lang.String[] filterNames)
        Calls loadPatterns(fileName, numFilters, filterNames, SoPattern.FilterTypes.valueOf( SoPattern.FilterTypes.INCLUSIVE_FILTER.getValue() )).
      • loadPatterns

        public static boolean loadPatterns​(java.lang.String fileName,
                                           int numFilters)
        Calls loadPatterns(fileName, numFilters, (java.lang.String[])null, SoPattern.FilterTypes.valueOf( SoPattern.FilterTypes.INCLUSIVE_FILTER.getValue() )).
      • loadPatterns

        public static boolean loadPatterns​(java.lang.String fileName,
                                           java.lang.String[] filterNames)
        Calls loadPatterns(fileName, filterNames, SoPattern.FilterTypes.valueOf( SoPattern.FilterTypes.INCLUSIVE_FILTER.getValue() )).
      • loadPatterns

        public static boolean loadPatterns​(java.lang.String fileName,
                                           int numFilters,
                                           java.lang.String[] filterNames,
                                           SoPattern.FilterTypes filterType)
        Loads a pattern file, with optional filtering of patterns. You can specify the file name with or without a full path. If you specify the file name without the path, the file will be loaded from the directory $OIVHOME/data/patterns. If the file name is not found, a default pattern will be used.

        filterNames is an array of pattern names. This will be an array of patterns to include (or exclude) depending on the FilterType. The size of this array is numFilters.

      • addPattern

        public static void addPattern​(java.lang.String category,
                                      java.lang.String name,
                                      byte[] bytes)
        Adds a new pattern specified as an array of 128 bytes. A category and a name are specified for this pattern. If the category and name are already in the list of patterns, the new pattern will not be added. If either the category or the name is an empty string, no pattern is added.
      • loadPatterns

        public static boolean loadPatterns​(java.lang.String fileName,
                                           java.lang.String[] filterNames,
                                           SoPattern.FilterTypes filterType)
        Loads a pattern file, with optional filtering of patterns. You can specify the file name with or without a full path. If you specify the file name without the path, the file will be loaded from the directory $OIVHOME/data/patterns. If the file name is not found, a default pattern will be used.

        filterNames is an array of pattern names. This will be an array of patterns to include (or exclude) depending on the FilterType. The size of this array is numFilters.