Package org.web3d.x3d.jsail.Core
Class unitObject
java.lang.Object
org.web3d.x3d.jsail.X3DConcreteElement
org.web3d.x3d.jsail.X3DConcreteStatement
org.web3d.x3d.jsail.Core.unitObject
public class unitObject 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.
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 https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#Header
- Hint: X3D Scene Authoring Hints, Scale Factors and Unit Conversions https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale
- 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 https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/core.html#UNITStatement
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCATEGORY_ANGLETooltip: angle default is radians.static java.lang.StringCATEGORY_DEFAULT_VALUESFString field named category has default value equal to an empty string.static java.lang.StringCATEGORY_FORCETooltip: force default is newtons.static java.lang.StringCATEGORY_LENGTHTooltip: length default is meters.static java.lang.StringCATEGORY_MASSTooltip: mass default is kilograms.static java.lang.StringCOMPONENTString constant COMPONENT defines X3D component for the unit element: Corestatic doubleCONVERSIONFACTOR_ANGLES_toRadiansFromDegreesunit statement conversionFactor for converting scene values of angles to Radians from Degreesstatic doubleCONVERSIONFACTOR_ANGLES_toRadiansFromFullCircleunit statement conversionFactor for converting scene values of angles to Radians from FullCirclestatic doubleCONVERSIONFACTOR_ANGLES_toRadiansFromGradsunit statement conversionFactor for converting scene values of angles to Radians from Gradsstatic doubleCONVERSIONFACTOR_DEFAULT_VALUESFDouble field named conversionFactor has default value 1.0 (Java syntax) or 1.0 (XML syntax).static doubleCONVERSIONFACTOR_FORCE_toNewtonsFromDynesunit statement conversionFactor for converting scene values of force to Newtons from Dynesstatic doubleCONVERSIONFACTOR_FORCE_toNewtonsFromKilogramForceunit statement conversionFactor for converting scene values of force to Newtons from Kilogram-forcestatic doubleCONVERSIONFACTOR_FORCE_toNewtonsFromPoundalunit statement conversionFactor for converting scene values of force to Newtons from Poundalstatic doubleCONVERSIONFACTOR_FORCE_toNewtonsFromPoundsForceunit statement conversionFactor for converting scene values of force to Newtons from Pounds-forcestatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromCentimetersunit statement conversionFactor for converting scene values of length to Meters from Centimetersstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromFathomsunit statement conversionFactor for converting scene values of length to Meters from Fathomsstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromFeetunit statement conversionFactor for converting scene values of length to Meters from Feetstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromFurlongsunit statement conversionFactor for converting scene values of length to Meters from Furlongsstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromInchesunit statement conversionFactor for converting scene values of length to Meters from Inchesstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromKilometersunit statement conversionFactor for converting scene values of length to Meters from Kilometersstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromMicronsunit statement conversionFactor for converting scene values of length to Meters from Micronsstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromMilesunit statement conversionFactor for converting scene values of length to Meters from Milesstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromMillimetersunit statement conversionFactor for converting scene values of length to Meters from Millimetersstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromNauticalMilesunit statement conversionFactor for converting scene values of length to Meters from Nautical Milesstatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromPicaunit statement conversionFactor for converting scene values of length to Meters from Picastatic doubleCONVERSIONFACTOR_LENGTH_toMetersFromYardsunit statement conversionFactor for converting scene values of length to Meters from Yardsstatic doubleCONVERSIONFACTOR_MASS_toKilogramsFromunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Microgramsstatic doubleCONVERSIONFACTOR_MASS_toKilogramsFromCaratsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Caratsstatic doubleCONVERSIONFACTOR_MASS_toKilogramsFromCentigramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Centigramsstatic doubleCONVERSIONFACTOR_MASS_toKilogramsFromDekagramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Dekagramsstatic doubleCONVERSIONFACTOR_MASS_toKilogramsFromDramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Drams Avoirdupois (dr)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromGrainsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Grains Avoirdupois (gr)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromGramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Grams (g)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromMetricTonnesunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Metric Tonnes (t)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromMilligramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Milligramsstatic doubleCONVERSIONFACTOR_MASS_toKilogramsFromOuncesunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Ounces Avoirdupois (oz)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromPoundsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Pounds Avoirdupois (lb)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromStoneunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Stone, i.e. 14 Pounds Avoirdupois (lb)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromTonsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Tons (U.S. short)static doubleCONVERSIONFACTOR_MASS_toKilogramsFromTroyOuncesunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Troy Ounces (toz)static intLEVELInteger constant LEVEL provides default X3D Core component level for this element: 1static java.lang.StringNAMEString constant NAME provides name of this element: unit.static java.lang.StringNAME_DEFAULT_VALUESFString field named name has default value equal to an empty string. -
Constructor Summary
Constructors Constructor Description unitObject()Constructor for unitObject to initialize member variables with default values.unitObject(java.lang.String newName, java.lang.String newCategory, double newConversionFactor)Utility constructor that assigns name-category-conversionFactor triplet attributes.unitObject(java.lang.String newName, java.lang.String newCategory, float newConversionFactor)Utility constructor that assigns name-category-conversionFactor triplet attributes. -
Method Summary
Modifier and Type Method Description unitObjectaddComments(java.lang.String newComment)Add comment as String to contained commentsList.unitObjectaddComments(java.lang.String[] newComments)Add comments as String[] array to contained commentsList.unitObjectaddComments(CommentsBlock newCommentsBlock)Add CommentsBlock to contained commentsList.X3DConcreteElementfindElementByNameValue(java.lang.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.X3DConcreteElementfindElementByNameValue(java.lang.String nameValue, java.lang.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.X3DConcreteNodefindNodeByDEF(java.lang.String DEFvalue)Recursive method to provide object reference to node by DEF, if found as this node or in a contained node.java.lang.StringgetAccessType(java.lang.String fieldName)Indicate accessType corresponding to given fieldName.java.lang.StringgetCategory()Provide String enumeration value (baseType xs:NMTOKEN) ["angle" | "force" | "length" | "mass"] from initializeOnly SFString field named category.java.lang.StringgetComponent()Defines X3D component for the unit element: CoreintgetComponentLevel()Provides default X3D component level for this element: 1doublegetConversionFactor()Provide double value within allowed range of (0,infinity) from inputOutput SFDouble field named conversionFactor.java.lang.StringgetElementName()Provides name of this element: unitjava.lang.StringgetFieldType(java.lang.String fieldName)Indicate type corresponding to given fieldName.java.lang.StringgetName()Provide String value from inputOutput SFString field named name.booleanhasElementByNameValue(java.lang.String nameValue, java.lang.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.booleanhasNodeByDEF(java.lang.String DEFvalue)Recursive method to determine whether node with DEFvalue is found, meaning both objects are attached to same scene graph.voidinitialize()Initialize all member variables to default values.unitObjectsetCategory(java.lang.String newValue)Accessor method to assign String enumeration value ("angle" | "force" | "length" | "mass") to initializeOnly SFString field named category.unitObjectsetCategory(SFStringObject newValue)Assign typed object value to SFString category field, similar tosetCategory(String).unitObjectsetConversionFactor(double newValue)Accessor method to assign double value to inputOutput SFDouble field named conversionFactor.unitObjectsetConversionFactor(SFDoubleObject newValue)Assign typed object value to SFDouble conversionFactor field, similar tosetConversionFactor(double).unitObjectsetName(java.lang.String newValue)Accessor method to assign String value to inputOutput SFString field named name.unitObjectsetName(SFStringObject newValue)Assign typed object value to SFString name field, similar tosetName(String).java.lang.StringtoStringClassicVRML(int indentLevel)Recursive method to provide ClassicVRML string serialization.java.lang.StringtoStringVRML97(int indentLevel)Recursive method to provide VRML97 string serialization.java.lang.StringtoStringX3D(int indentLevel)Recursive method to provide X3D string serialization of this model subgraph, utilizing XML encoding and conforming to X3D Canonical Form.java.lang.Stringvalidate()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.Methods inherited from class org.web3d.x3d.jsail.X3DConcreteElement
clearParentObject, findAncestorElementByName, findAncestorProtoBody, findAncestorSceneObject, findAncestorX3DObject, getPackageName, getParentObject, getValidationResult, hasAncestorElementByName, hasAncestorProtoBody, hasAncestorSceneObject, hasAncestorX3DObject, hasParentObject, isValid, setParentObject, toStringClassicVRML, toStringVRML97, toStringX3D
-
Field Details
-
CONVERSIONFACTOR_ANGLES_toRadiansFromDegrees
public static final double CONVERSIONFACTOR_ANGLES_toRadiansFromDegreesunit statement conversionFactor for converting scene values of angles to Radians from Degrees- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_ANGLES_toRadiansFromFullCircle
public static final double CONVERSIONFACTOR_ANGLES_toRadiansFromFullCircleunit statement conversionFactor for converting scene values of angles to Radians from FullCircle- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_ANGLES_toRadiansFromGrads
public static final double CONVERSIONFACTOR_ANGLES_toRadiansFromGradsunit statement conversionFactor for converting scene values of angles to Radians from Grads- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromPica
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromPicaunit statement conversionFactor for converting scene values of length to Meters from Pica- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromInches
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromInchesunit statement conversionFactor for converting scene values of length to Meters from Inches- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromFeet
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromFeetunit statement conversionFactor for converting scene values of length to Meters from Feet- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromYards
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromYardsunit statement conversionFactor for converting scene values of length to Meters from Yards- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromFathoms
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromFathomsunit statement conversionFactor for converting scene values of length to Meters from Fathoms- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromFurlongs
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromFurlongsunit statement conversionFactor for converting scene values of length to Meters from Furlongs- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromMiles
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromMilesunit statement conversionFactor for converting scene values of length to Meters from Miles- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromNauticalMiles
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromNauticalMilesunit statement conversionFactor for converting scene values of length to Meters from Nautical Miles- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromMicrons
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromMicronsunit statement conversionFactor for converting scene values of length to Meters from Microns- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromMillimeters
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromMillimetersunit statement conversionFactor for converting scene values of length to Meters from Millimeters- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromCentimeters
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromCentimetersunit statement conversionFactor for converting scene values of length to Meters from Centimeters- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_LENGTH_toMetersFromKilometers
public static final double CONVERSIONFACTOR_LENGTH_toMetersFromKilometersunit statement conversionFactor for converting scene values of length to Meters from Kilometers- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_FORCE_toNewtonsFromDynes
public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromDynesunit statement conversionFactor for converting scene values of force to Newtons from Dynes- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_FORCE_toNewtonsFromKilogramForce
public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromKilogramForceunit statement conversionFactor for converting scene values of force to Newtons from Kilogram-force- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_FORCE_toNewtonsFromPoundsForce
public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromPoundsForceunit statement conversionFactor for converting scene values of force to Newtons from Pounds-force- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_FORCE_toNewtonsFromPoundal
public static final double CONVERSIONFACTOR_FORCE_toNewtonsFromPoundalunit statement conversionFactor for converting scene values of force to Newtons from Poundal- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromGrains
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromGrainsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Grains Avoirdupois (gr)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromDrams
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromDramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Drams Avoirdupois (dr)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromOunces
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromOuncesunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Ounces Avoirdupois (oz)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromTroyOunces
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromTroyOuncesunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Troy Ounces (toz)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromPounds
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromPoundsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Pounds Avoirdupois (lb)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromStone
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromStoneunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Stone, i.e. 14 Pounds Avoirdupois (lb)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromTons
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromTonsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Tons (U.S. short)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFrom
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Micrograms- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromMilligrams
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromMilligramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Milligrams- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromCentigrams
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromCentigramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Centigrams- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromCarats
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromCaratsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Carats- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromGrams
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromGramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Grams (g)- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromDekagrams
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromDekagramsunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Dekagrams- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_MASS_toKilogramsFromMetricTonnes
public static final double CONVERSIONFACTOR_MASS_toKilogramsFromMetricTonnesunit statement conversionFactor for converting scene values of mass to Kilograms (kg) from Metric Tonnes (t)- See Also:
- Constant Field Values
-
CATEGORY_ANGLE
public static final java.lang.String CATEGORY_ANGLETooltip: 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). -
CATEGORY_FORCE
public static final java.lang.String CATEGORY_FORCETooltip: 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). -
CATEGORY_LENGTH
public static final java.lang.String CATEGORY_LENGTHTooltip: 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). -
CATEGORY_MASS
public static final java.lang.String CATEGORY_MASSTooltip: 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). -
NAME
public static final java.lang.String NAMEString constant NAME provides name of this element: unit.- See Also:
- Constant Field Values
-
COMPONENT
public static final java.lang.String COMPONENTString constant COMPONENT defines X3D component for the unit element: Core- See Also:
- Constant Field Values
-
LEVEL
public static final int LEVELInteger constant LEVEL provides default X3D Core component level for this element: 1- See Also:
- Constant Field Values
-
CATEGORY_DEFAULT_VALUE
public static final java.lang.String CATEGORY_DEFAULT_VALUESFString field named category has default value equal to an empty string.- See Also:
- Constant Field Values
-
CONVERSIONFACTOR_DEFAULT_VALUE
public static final double CONVERSIONFACTOR_DEFAULT_VALUESFDouble field named conversionFactor has default value 1.0 (Java syntax) or 1.0 (XML syntax).- See Also:
- Constant Field Values
-
NAME_DEFAULT_VALUE
public static final java.lang.String NAME_DEFAULT_VALUESFString field named name has default value equal to an empty string.- See Also:
- Constant Field Values
-
-
Constructor Details
-
unitObject
public unitObject()Constructor for unitObject to initialize member variables with default values. -
unitObject
public unitObject(java.lang.String newName, java.lang.String newCategory, float newConversionFactor)Utility constructor that assigns name-category-conversionFactor triplet attributes.- Parameters:
newName- name for this unit statementnewCategory- category value for this unit statementnewConversionFactor- conversion factor for this unit statement- See Also:
- X3D Tooltips: meta, X3D Scene Authoring Hints: Scale Factors and Unit Conversions
-
unitObject
public unitObject(java.lang.String newName, java.lang.String newCategory, double newConversionFactor)Utility constructor that assigns name-category-conversionFactor triplet attributes.- Parameters:
newName- name for this unit statementnewCategory- category value for this unit statementnewConversionFactor- conversion factor for this unit statement- See Also:
- X3D Tooltips: meta, X3D Scene Authoring Hints: Scale Factors and Unit Conversions
-
-
Method Details
-
getElementName
public final java.lang.String getElementName()Provides name of this element: unit- Specified by:
getElementNamein classX3DConcreteElement- Returns:
- name of this element
-
getComponent
public final java.lang.String getComponent()Defines X3D component for the unit element: Core- Specified by:
getComponentin classX3DConcreteElement- Returns:
- X3D component for this element
-
getComponentLevel
public final int getComponentLevel()Provides default X3D component level for this element: 1- Specified by:
getComponentLevelin classX3DConcreteElement- Returns:
- default X3D component level for this element
-
getFieldType
public java.lang.String getFieldType(java.lang.String fieldName)Indicate type corresponding to given fieldName.- Specified by:
getFieldTypein classX3DConcreteElement- 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:
ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE
-
getAccessType
public java.lang.String getAccessType(java.lang.String fieldName)Indicate accessType corresponding to given fieldName.- Specified by:
getAccessTypein classX3DConcreteElement- 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:
ConfigurationProperties.ERROR_UNKNOWN_FIELD_ACCESSTYPE
-
initialize
public final void initialize()Initialize all member variables to default values.- Overrides:
initializein classX3DConcreteStatement
-
getCategory
public java.lang.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 https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#Standardunitscoordinates
Available enumeration values for string comparison:ANGLE,FORCE,LENGTH,MASS.- Returns:
- value of category field
-
setCategory
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 https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#Standardunitscoordinates
- Parameters:
newValue- is new value for the category field.- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
setCategory
Assign typed object value to SFString category field, similar tosetCategory(String).- Parameters:
newValue- is new value for the category field.- Returns:
unitObject- 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 https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale
- Returns:
- value of conversionFactor field
-
setConversionFactor
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 https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scale
- Parameters:
newValue- is new value for the conversionFactor field.- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
setConversionFactor
Assign typed object value to SFDouble conversionFactor field, similar tosetConversionFactor(double).- Parameters:
newValue- is new value for the conversionFactor field.- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getName
public java.lang.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 https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions
- Returns:
- value of name field
-
setName
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 https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions
@see X3D Scene Authoring Hints: Naming Conventions- Parameters:
newValue- is new value for the name field.- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
setName
Assign typed object value to SFString name field, similar tosetName(String).- Parameters:
newValue- is new value for the name field.- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
addComments
Add comment as String to contained commentsList.- Specified by:
addCommentsin classX3DConcreteElement- Parameters:
newComment- initial value- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
-
addComments
Add comments as String[] array to contained commentsList.- Specified by:
addCommentsin classX3DConcreteElement- Parameters:
newComments- array of comments- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
-
addComments
Add CommentsBlock to contained commentsList.- Specified by:
addCommentsin classX3DConcreteElement- Parameters:
newCommentsBlock- block of comments to add- Returns:
unitObject- namely this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
-
toStringX3D
public java.lang.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:
toStringX3Din classX3DConcreteElement- Parameters:
indentLevel- number of levels of indentation for this element- Returns:
- X3D string
- See Also:
X3DObject.FILE_EXTENSION_X3D,X3DObject.FILE_EXTENSION_XML,X3DObject.toStringXML(),X3DObject.toFileXML(String),X3DObject.toFileX3D(String), X3D XML Encoding, X3D Compressed Binary Encoding: X3D Canonical Form, X3D Canonicalization (C14N) Tool
-
toStringClassicVRML
public java.lang.String toStringClassicVRML(int indentLevel)Recursive method to provide ClassicVRML string serialization.- Specified by:
toStringClassicVRMLin classX3DConcreteElement- Parameters:
indentLevel- number of levels of indentation for this element- Returns:
- ClassicVRML string
- See Also:
X3DObject.FILE_EXTENSION_CLASSICVRML, X3D Resources: Virtual Reality Modeling Language (VRML) 97, Extensible 3D (X3D) encodings Part 2: Classic VRML encoding, Extensible 3D (X3D) encodings Part 2: Classic VRML encoding, Annex A: Grammar
-
toStringVRML97
public java.lang.String toStringVRML97(int indentLevel)Recursive method to provide VRML97 string serialization.- Specified by:
toStringVRML97in classX3DConcreteElement- Parameters:
indentLevel- number of levels of indentation for this element- Returns:
- VRML97 string
- See Also:
X3DObject.FILE_EXTENSION_VRML97, X3D Resources: Virtual Reality Modeling Language (VRML) 97, Virtual Reality Modeling Language (VRML) 97 specification, VRML 97 v2.1 Amendment
-
findElementByNameValue
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 findAncestorSceneObject() to check entire scene graph, or findAncestorX3DObject() 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:
findElementByNameValuein classX3DConcreteElement- 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:
findNodeByDEF(String),X3DConcreteElement.hasAncestorSceneObject(),X3DConcreteElement.findAncestorX3DObject()
-
findElementByNameValue
public X3DConcreteElement findElementByNameValue(java.lang.String nameValue, java.lang.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 findAncestorSceneObject() to check entire scene graph, or findAncestorX3DObject() 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:
findElementByNameValuein classX3DConcreteElement- 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:
findNodeByDEF(String),X3DConcreteElement.hasAncestorSceneObject(),X3DConcreteElement.findAncestorX3DObject()
-
hasElementByNameValue
public boolean hasElementByNameValue(java.lang.String nameValue, java.lang.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:
findElementByNameValue(String, String)
-
findNodeByDEF
Recursive method to provide object reference to node by DEF, if found as this node or in a contained node.
Warning: first start with findAncestorSceneObject() to check entire scene graph, or findAncestorX3DObject() 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:
findNodeByDEFin classX3DConcreteElement- 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:
findElementByNameValue(String),X3DConcreteElement.hasAncestorSceneObject(),X3DConcreteElement.findAncestorX3DObject()
-
hasNodeByDEF
public boolean hasNodeByDEF(java.lang.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:
findNodeByDEF(String)
-
validate
public java.lang.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:
validatein classX3DConcreteElement- Returns:
- validation results (if any)
-