ObjConstants.java

  1. /*
  2.  * Licensed to the Apache Software Foundation (ASF) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * The ASF licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *      http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.apache.commons.geometry.io.euclidean.threed.obj;

  18. import java.nio.charset.Charset;
  19. import java.nio.charset.StandardCharsets;

  20. /** Class containing constants for use with OBJ files.
  21.  */
  22. public final class ObjConstants {

  23.     /** Default OBJ charset. */
  24.     public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;

  25.     /** Character used to indicate the start of a comment line. */
  26.     public static final char COMMENT_CHAR = '#';

  27.     /** Character placed before new line sequences to indicate a line continuation. */
  28.     public static final char LINE_CONTINUATION_CHAR = '\\';

  29.     /** Keyword used to indicate a vertex definition line. */
  30.     public static final String VERTEX_KEYWORD = "v";

  31.     /** Keyword used to indicate a vertex normal definition line. */
  32.     public static final String VERTEX_NORMAL_KEYWORD = "vn";

  33.     /** Keyword used to indicate a texture coordinate definition line. */
  34.     public static final String TEXTURE_COORDINATE_KEYWORD = "vt";

  35.     /** Keyword used to indicate a face definition line. */
  36.     public static final String FACE_KEYWORD = "f";

  37.     /** Character used to separate face vertex attribute indices. */
  38.     public static final char FACE_VERTEX_ATTRIBUTE_SEP_CHAR = '/';

  39.     /** Keyword used to indicate a geometry group. */
  40.     public static final String GROUP_KEYWORD = "g";

  41.     /** Keyword used to indicate a geometry group. */
  42.     public static final String SMOOTHING_GROUP_KEYWORD = "s";

  43.     /** Keyword used to associate a name with the following geometry. */
  44.     public static final String OBJECT_KEYWORD = "o";

  45.     /** Keyword used to reference a material library file. */
  46.     public static final String MATERIAL_LIBRARY_KEYWORD = "mtllib";

  47.     /** Keyword used to apply a named material to subsequent geometry. */
  48.     public static final String USE_MATERIAL_KEYWORD = "usemtl";

  49.     /** Utility class; no instantiation. */
  50.     private ObjConstants() {}
  51. }