Class unit


public class unit extends X3DConcreteStatement
Functional summary: unit statement defines data-conversion factors for typed values defined in a scene. This concrete class represents an X3D unit statement.

X3D statement tooltip: (X3D version 3.3 or later) [X3D statement] A unit statement defines data-conversion factors for typed values defined within a scene. Hint: unit statements are optional secondary children of head statement (add a head statement and optionally any component elements first). Hint: unit conversionFactor scale values only affect node definitions in the current Scene, leaving Inline and ExternProtoDeclare content subject to their own independent unit statements. Hint: a good practice is to always include unit statements in CAD scenes in order to ensure correct model composition. Hint: X3D XML Encoding <a href="https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#Header" target="_blank">https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#Header</a> Warning: the UNIT statement is capitalized in the X3D Architecture specification and in the X3D ClassicVRML Encoding. Hint: X3D Architecture 7.2.5.5 UNIT statement <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/components/core.html#UNITStatement" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/components/core.html#UNITStatement</a> Hint: International System of Units (SI), i.e. metric system <a href="https://en.wikipedia.org/wiki/International_System_of_Units" target="_blank">https://en.wikipedia.org/wiki/International_System_of_Units</a> Hint: International System of Quantities (ISQ) <a href="https://en.wikipedia.org/wiki/International_System_of_Quantities" target="_blank">https://en.wikipedia.org/wiki/International_System_of_Quantities</a> Hint: SI base unit <a href="https://en.wikipedia.org/wiki/SI_base_unit" target="_blank">https://en.wikipedia.org/wiki/SI_base_unit</a> Hint: SI derived unit <a href="https://en.wikipedia.org/wiki/SI_derived_unit" target="_blank">https://en.wikipedia.org/wiki/SI_derived_unit</a> Hint: Metrology <a href="https://en.wikipedia.org/wiki/Metrology" target="_blank">https://en.wikipedia.org/wiki/Metrology</a> Hint: X3D Scene Authoring Hints, Scale Factors and Unit Conversions <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale</a> *

` X3D specification: 4.3.6 Standard units and coordinate system defines how scale factors can modify an entire scene. Scale-conversion constants provide correct names and values for common conversion factors. References:
See Also:
  • Field Details

    • CONVERSIONFACTOR_ANGLES_toRadiansFromDegrees

      public static final double CONVERSIONFACTOR_ANGLES_toRadiansFromDegrees
      unit statement conversionFactor for converting scene values of angles to Radians from Degrees
      See Also:
    • CONVERSIONFACTOR_ANGLES_toRadiansFromFullCircle

      public static final double CONVERSIONFACTOR_ANGLES_toRadiansFromFullCircle
      unit statement conversionFactor for converting scene values of angles to Radians from FullCircle
      See Also:
    • CONVERSIONFACTOR_ANGLES_toRadiansFromGrads

      public static final double CONVERSIONFACTOR_ANGLES_toRadiansFromGrads
      unit statement conversionFactor for converting scene values of angles to Radians from Grads
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromPica

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromPica
      unit statement conversionFactor for converting scene values of length to Meters from Pica
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromInches

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromInches
      unit statement conversionFactor for converting scene values of length to Meters from Inches
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromFeet

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromFeet
      unit statement conversionFactor for converting scene values of length to Meters from Feet
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromYards

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromYards
      unit statement conversionFactor for converting scene values of length to Meters from Yards
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromFathoms

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromFathoms
      unit statement conversionFactor for converting scene values of length to Meters from Fathoms
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromFurlongs

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromFurlongs
      unit statement conversionFactor for converting scene values of length to Meters from Furlongs
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromMiles

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromMiles
      unit statement conversionFactor for converting scene values of length to Meters from Miles
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromNauticalMiles

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromNauticalMiles
      unit statement conversionFactor for converting scene values of length to Meters from Nautical Miles
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromMicrons

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromMicrons
      unit statement conversionFactor for converting scene values of length to Meters from Microns
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromMillimeters

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromMillimeters
      unit statement conversionFactor for converting scene values of length to Meters from Millimeters
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromCentimeters

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromCentimeters
      unit statement conversionFactor for converting scene values of length to Meters from Centimeters
      See Also:
    • CONVERSIONFACTOR_LENGTH_toMetersFromKilometers

      public static final double CONVERSIONFACTOR_LENGTH_toMetersFromKilometers
      unit statement conversionFactor for converting scene values of length to Meters from Kilometers
      See Also:
    • CONVERSIONFACTOR_FORCE_toNewtonsFromDynes

      public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromDynes
      unit statement conversionFactor for converting scene values of force to Newtons from Dynes
      See Also:
    • CONVERSIONFACTOR_FORCE_toNewtonsFromKilogramForce

      public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromKilogramForce
      unit statement conversionFactor for converting scene values of force to Newtons from Kilogram-force
      See Also:
    • CONVERSIONFACTOR_FORCE_toNewtonsFromPoundsForce

      public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromPoundsForce
      unit statement conversionFactor for converting scene values of force to Newtons from Pounds-force
      See Also:
    • CONVERSIONFACTOR_FORCE_toNewtonsFromPoundal

      public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromPoundal
      unit statement conversionFactor for converting scene values of force to Newtons from Poundal
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromGrains

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromGrains
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Grains Avoirdupois (gr)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromDrams

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromDrams
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Drams Avoirdupois (dr)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromOunces

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromOunces
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Ounces Avoirdupois (oz)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromTroyOunces

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromTroyOunces
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Troy Ounces (toz)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromPounds

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromPounds
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Pounds Avoirdupois (lb)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromStone

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromStone
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Stone, i.e. 14 Pounds Avoirdupois (lb)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromTons

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromTons
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Tons (U.S. short)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFrom

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFrom
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Micrograms
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromMilligrams

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromMilligrams
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Milligrams
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromCentigrams

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromCentigrams
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Centigrams
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromCarats

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromCarats
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Carats
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromGrams

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromGrams
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Grams (g)
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromDekagrams

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromDekagrams
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Dekagrams
      See Also:
    • CONVERSIONFACTOR_MASS_toKilogramsFromMetricTonnes

      public static final double CONVERSIONFACTOR_MASS_toKilogramsFromMetricTonnes
      unit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Metric Tonnes (t)
      See Also:
    • CATEGORY_ANGLE

      public static final String CATEGORY_ANGLE
      Tooltip: angle default is radians. SFString field named category with X3DUOM simpleType unitCategoryChoices and with X3DUOM baseType xs:NMTOKEN can equal this value "angle" (Java syntax) or angle (XML syntax).
      See Also:
    • CATEGORY_FORCE

      public static final String CATEGORY_FORCE
      Tooltip: force default is newtons. SFString field named category with X3DUOM simpleType unitCategoryChoices and with X3DUOM baseType xs:NMTOKEN can equal this value "force" (Java syntax) or force (XML syntax).
      See Also:
    • CATEGORY_LENGTH

      public static final String CATEGORY_LENGTH
      Tooltip: length default is meters. SFString field named category with X3DUOM simpleType unitCategoryChoices and with X3DUOM baseType xs:NMTOKEN can equal this value "length" (Java syntax) or length (XML syntax).
      See Also:
    • CATEGORY_MASS

      public static final String CATEGORY_MASS
      Tooltip: mass default is kilograms. SFString field named category with X3DUOM simpleType unitCategoryChoices and with X3DUOM baseType xs:NMTOKEN can equal this value "mass" (Java syntax) or mass (XML syntax).
      See Also:
    • NAME

      public static final String NAME
      String constant NAME provides name of this element: unit.
      See Also:
    • COMPONENT

      public static final String COMPONENT
      String constant COMPONENT defines X3D component for the unit element: Core
      See Also:
    • LEVEL

      public static final int LEVEL
      Integer constant LEVEL provides default X3D Core component level for this element: 1
      See Also:
    • CATEGORY_DEFAULT_VALUE

      public static final String CATEGORY_DEFAULT_VALUE
      SFString field named category has default value equal to an empty string.
      See Also:
    • CONVERSIONFACTOR_DEFAULT_VALUE

      public static final double CONVERSIONFACTOR_DEFAULT_VALUE
      SFDouble field named conversionFactor has default value 1.0 (Java syntax) or 1.0 (XML syntax).
      See Also:
    • NAME_DEFAULT_VALUE

      public static final String NAME_DEFAULT_VALUE
      SFString field named name has default value equal to an empty string.
      See Also:
  • Constructor Details

    • unit

      public unit()
      Constructor for unit to initialize member variables with default values.
    • unit

      public unit(String newName, String newCategory, float newConversionFactor)
      Utility constructor that assigns name-category-conversionFactor triplet attributes.
      Parameters:
      newName - name for this unit statement
      newCategory - category value for this unit statement
      newConversionFactor - conversion factor for this unit statement
      See Also:
    • unit

      public unit(String newName, String newCategory, double newConversionFactor)
      Utility constructor that assigns name-category-conversionFactor triplet attributes.
      Parameters:
      newName - name for this unit statement
      newCategory - category value for this unit statement
      newConversionFactor - conversion factor for this unit statement
      See Also:
  • Method Details

    • getElementName

      public final String getElementName()
      Provides name of this element: unit
      Specified by:
      getElementName in class X3DConcreteElement
      Returns:
      name of this element
    • getComponent

      public final String getComponent()
      Defines X3D component for the unit element: Core
      Specified by:
      getComponent in class X3DConcreteElement
      Returns:
      X3D component for this element
    • getComponentLevel

      public final int getComponentLevel()
      Provides default X3D component level for this element: 1
      Specified by:
      getComponentLevel in class X3DConcreteElement
      Returns:
      default X3D component level for this element
    • getFieldType

      public String getFieldType(String fieldName)
      Indicate type corresponding to given fieldName.
      Specified by:
      getFieldType in class X3DConcreteElement
      Parameters:
      fieldName - name of field in this X3D statement
      Returns:
      X3D type (SFvec3f etc.), otherwise ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE if not recognized
      See Also:
    • getAccessType

      public String getAccessType(String fieldName)
      Indicate accessType corresponding to given fieldName.
      Specified by:
      getAccessType in class X3DConcreteElement
      Parameters:
      fieldName - name of field in this X3D statement
      Returns:
      X3D accessType (inputOnly etc.), otherwise ConfigurationProperties.ERROR_UNKNOWN_FIELD_ACCESSTYPE if not recognized
      See Also:
    • initialize

      public final void initialize()
      Initialize all member variables to default values.
      Overrides:
      initialize in class X3DConcreteStatement
    • getCategory

      public String getCategory()
      Provide String enumeration value (baseType xs:NMTOKEN) ["angle" | "force" | "length" | "mass"] from initializeOnly SFString field named category.

      Tooltip: Base-unit category as defined in X3D Specification. Hint: unit category defaults are angle (radian), force (newton), length (meter), mass (kilogram). Hint: X3D Specification 4.3.6 Standard units and coordinate system <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/concepts.html#Standardunitscoordinates" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/concepts.html#Standardunitscoordinates</a> *


      Available enumeration values for string comparison: ANGLE, FORCE, LENGTH, MASS.
      Returns:
      value of category field
    • setCategory

      public unit setCategory(String newValue)
      Accessor method to assign String enumeration value ("angle" | "force" | "length" | "mass") to initializeOnly SFString field named category.

      Warning: authors can only choose from a strict list of enumeration values (ANGLE, FORCE, LENGTH, MASS).

      Tooltip: Base-unit category as defined in X3D Specification. Hint: unit category defaults are angle (radian), force (newton), length (meter), mass (kilogram). Hint: X3D Specification 4.3.6 Standard units and coordinate system <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/concepts.html#Standardunitscoordinates" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof//Part01/concepts.html#Standardunitscoordinates</a> *
      Parameters:
      newValue - is new value for the category field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • setCategory

      public unit setCategory(SFString newValue)
      Assign typed object value to SFString category field, similar to setCategory(String). // #0.e
      Parameters:
      newValue - is new value for the category field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getCssClass

      public String getCssClass()
      Provide String value from inputOutput SFString field named class.
      Overrides:
      getCssClass in class X3DConcreteElement
      Returns:
      value of class field
      See Also:
    • setCssClass

      public final unit setCssClass(String newValue)
      Accessor method to assign String value to inputOutput SFString field named class.
      Parameters:
      newValue - is new value for the class field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • setCssClass

      public unit setCssClass(SFString newValue)
      Assign typed object value to SFString cssClass field, similar to setCssClass(String). // #0.e
      Parameters:
      newValue - is new value for the class field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getConversionFactor

      public double getConversionFactor()
      Provide double value within allowed range of (0,infinity) from inputOutput SFDouble field named conversionFactor.

      Tooltip: [0,+infinity) Positive double-precision factor that converts new base unit to default base unit. Hint: X3D Scene Authoring Hints, Scale Factors and Unit Conversions <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale</a> *
      Returns:
      value of conversionFactor field
    • setConversionFactor

      public unit setConversionFactor(double newValue)
      Accessor method to assign double value to inputOutput SFDouble field named conversionFactor.

      Tooltip: [0,+infinity) Positive double-precision factor that converts new base unit to default base unit. Hint: X3D Scene Authoring Hints, Scale Factors and Unit Conversions <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale</a> *
      Parameters:
      newValue - is new value for the conversionFactor field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • setConversionFactor

      public unit setConversionFactor(SFDouble newValue)
      Assign typed object value to SFDouble conversionFactor field, similar to setConversionFactor(double). // #0.e
      Parameters:
      newValue - is new value for the conversionFactor field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getHtmlID

      public String getHtmlID()
      Provide String value from inputOutput SFString field named id.
      Overrides:
      getHtmlID in class X3DConcreteElement
      Returns:
      value of id field
      See Also:
    • setHtmlID

      public final unit setHtmlID(String newValue)
      Accessor method to assign String value to inputOutput SFString field named id.
      Parameters:
      newValue - is new value for the id field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • setHtmlID

      public unit setHtmlID(SFString newValue)
      Assign typed object value to SFString HtmlID field, similar to setHtmlID(String). // #0.e
      Parameters:
      newValue - is new value for the id field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getName

      public String getName()
      Provide String value from inputOutput SFString field named name.

      Tooltip: Author-defined name for this unit conversionFactor value (for example, FeetToMeters). Hint: well-defined names can simplify design and debugging through improved author understanding. Hint: X3D Scene Authoring Hints, Naming Conventions <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions</a> *
      Returns:
      value of name field
    • setName

      public final unit setName(String newValue)
      Accessor method to assign String value to inputOutput SFString field named name.

      Tooltip: Author-defined name for this unit conversionFactor value (for example, FeetToMeters). Hint: well-defined names can simplify design and debugging through improved author understanding. Hint: X3D Scene Authoring Hints, Naming Conventions <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions</a> *


      @see X3D Scene Authoring Hints: Naming Conventions
      Parameters:
      newValue - is new value for the name field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • setName

      public unit setName(SFString newValue)
      Assign typed object value to SFString name field, similar to setName(String). // #0.e
      Parameters:
      newValue - is new value for the name field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getCssStyle

      public String getCssStyle()
      Provide String value from inputOutput SFString field named style.
      Overrides:
      getCssStyle in class X3DConcreteElement
      Returns:
      value of style field
      See Also:
    • setCssStyle

      public final unit setCssStyle(String newValue)
      Accessor method to assign String value to inputOutput SFString field named style.
      Parameters:
      newValue - is new value for the style field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • setCssStyle

      public unit setCssStyle(SFString newValue)
      Assign typed object value to SFString cssClass field, similar to setCssStyle(String). // #0.e
      Parameters:
      newValue - is new value for the style field.
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • addComments

      public unit addComments(String newComment)
      Add comment as String to contained commentsList.
      Specified by:
      addComments in class X3DConcreteElement
      Parameters:
      newComment - initial value
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      See Also:
    • addComments

      public unit addComments(String[] newComments)
      Add comments as String[] array to contained commentsList.
      Specified by:
      addComments in class X3DConcreteElement
      Parameters:
      newComments - array of comments
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
    • addComments

      public unit addComments(CommentsBlock newCommentsBlock)
      Add CommentsBlock to contained commentsList.
      Specified by:
      addComments in class X3DConcreteElement
      Parameters:
      newCommentsBlock - block of comments to add
      Returns:
      unit - namely this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
    • toStringX3D

      public String toStringX3D(int indentLevel)
      Recursive method to provide X3D string serialization of this model subgraph, utilizing XML encoding and conforming to X3D Canonical Form.
      Specified by:
      toStringX3D in class X3DConcreteElement
      Parameters:
      indentLevel - number of levels of indentation for this element
      Returns:
      X3D string
      See Also:
    • toStringClassicVRML

      public String toStringClassicVRML(int indentLevel)
      Recursive method to provide ClassicVRML string serialization.
      Specified by:
      toStringClassicVRML in class X3DConcreteElement
      Parameters:
      indentLevel - number of levels of indentation for this element
      Returns:
      ClassicVRML string
      See Also:
    • toStringVRML97

      public String toStringVRML97(int indentLevel)
      Recursive method to provide VRML97 string serialization.
      Specified by:
      toStringVRML97 in class X3DConcreteElement
      Parameters:
      indentLevel - number of levels of indentation for this element
      Returns:
      VRML97 string
      See Also:
    • findElementByNameValue

      public X3DConcreteElement findElementByNameValue(String nameValue)
      Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element. Elements with name fields include meta, Metadata* nodes, field/fieldValue, ProtoDeclare/ExternProtoDeclare/ProtoInstance, CAD and HAnim nodes.

      Warning: first start with findAncestorScene() to check entire scene graph, or findAncestorX3D() to check entire model document.

      Warning: more than one element may be found that has the same name, this method does not handle that case.
      Specified by:
      findElementByNameValue in class X3DConcreteElement
      Parameters:
      nameValue - is value of the name field being searched for in this element and child elements(if any)
      Returns:
      object reference to found element, null otherwise
      See Also:
    • findElementByNameValue

      public X3DConcreteElement findElementByNameValue(String nameValue, String elementName)
      Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element. Elements with name fields include meta, Metadata* nodes, field/fieldValue, ProtoDeclare/ExternProtoDeclare/ProtoInstance, CAD and HAnim nodes.

      Warning: first start with findAncestorScene() to check entire scene graph, or findAncestorX3D() to check entire model document.

      Warning: more than one element may be found that has the same name, this method does not handle that case.
      Specified by:
      findElementByNameValue in class X3DConcreteElement
      Parameters:
      nameValue - is value of the name field being searched for in this element and child elements(if any)
      elementName - identifies the element of interest (meta MetadataString ProtoDeclare CADassembly ProtoInstance HAnimHumanoid etc.)
      Returns:
      object reference to found element, null otherwise
      See Also:
    • hasElementByNameValue

      public boolean hasElementByNameValue(String nameValue, String elementName)
      Recursive method to determine whether node or statement with given name attribute is found, meaning both objects are attached to same scene graph.
      Parameters:
      nameValue - is value of the name field being searched for in this element and child elements(if any)
      elementName - identifies the element of interest (meta MetadataString ProtoDeclare CADassembly ProtoInstance HAnimHumanoid etc.)
      Returns:
      whether node is found
      See Also:
    • findNodeByDEF

      public X3DConcreteNode findNodeByDEF(String DEFvalue)
      Recursive method to provide object reference to node by DEF, if found as this node or in a contained node.

      Warning: first start with findAncestorScene() to check entire scene graph, or findAncestorX3D() to check entire model document.

      Warning: more than one element may be found that has the same DEF, this method does not handle that case.
      Specified by:
      findNodeByDEF in class X3DConcreteElement
      Parameters:
      DEFvalue - is value of the name field being searched for in this element and child elements(if any)
      Returns:
      object reference to found node, null otherwise
      See Also:
    • hasNodeByDEF

      public boolean hasNodeByDEF(String DEFvalue)
      Recursive method to determine whether node with DEFvalue is found, meaning both objects are attached to same scene graph.
      Parameters:
      DEFvalue - is value of the name field being searched for in this element and child elements(if any)
      Returns:
      whether node is found
      See Also:
    • validate

      public String validate()
      Recursive method to validate this element plus all contained nodes and statements, using both datatype-specification value checks and regular expression (regex) checking of corresponding string values.
      Specified by:
      validate in class X3DConcreteElement
      Returns:
      validation results (if any)