[x3d-public] JSweet translation of X3DJSAIL to JavaScript: need specific design goals first
John Carlson
yottzumm at gmail.com
Thu Apr 9 16:57:19 PDT 2020
Typescript Transform (part 1 of 2)
/* Generated from Java with JSweet 2.3.0-SNAPSHOT - http://www.jsweet.org */
namespace org.web3d.x3d.jsail.Grouping {
/**
* Utility constructor that assigns DEF label after initializing member
variables with default values.
* @param {string} DEFlabel unique DEF name for this X3D node
* @class
* @extends org.web3d.x3d.jsail.X3DConcreteNode
* @author Don Brutzman and Roy Walmsley
*/
export class TransformObject extends
org.web3d.x3d.jsail.X3DConcreteNode implements
org.web3d.x3d.sai.Grouping.Transform {
/*private*/ bboxCenter : number[];
/*private*/ bboxSize : number[];
/*private*/ center : number[];
/*private*/ children :
java.util.ArrayList<org.web3d.x3d.sai.Core.X3DNode>;
/*private*/ IS : org.web3d.x3d.jsail.Core.ISObject;
/*private*/ metadata : org.web3d.x3d.sai.Core.X3DMetadataObject;
/*private*/ metadataProtoInstance :
org.web3d.x3d.jsail.Core.ProtoInstanceObject;
/*private*/ rotation : number[];
/*private*/ scale : number[];
/*private*/ scaleOrientation : number[];
/*private*/ translation : number[];
/**
* String constant <i>NAME</i> provides name of this element:
<i>Transform</i>.
*/
public static NAME : string = "Transform";
/**
* Provides name of this element: <i>Transform</i>
* @return {string} name of this element
*/
public getElementName() : string {
return TransformObject.NAME;
}
/**
* String constant <i>COMPONENT</i> defines X3D component for the
<i>Transform</i> element: <i>Grouping</i>
*/
public static COMPONENT : string = "Grouping";
/**
* Defines X3D component for the <i>Transform</i> element:
<i>Grouping</i>
* @return {string} X3D component for this element
*/
public getComponent() : string {
return TransformObject.COMPONENT;
}
/**
* Integer constant <i>LEVEL</i> provides default X3D
<i>Grouping</i> component level for this element: <i>1</i>
*/
public static LEVEL : number = 1;
/**
* Provides default X3D component level for this element: <i>1</i>
* @return {number} default X3D component level for this element
*/
public getComponentLevel() : number {
return TransformObject.LEVEL;
}
/**
* SFVec3f field named <i>bboxCenter</i> has default value
<i>{0f,0f,0f}</i> (Java syntax) or <i>0 0 0</i> (XML syntax).
*/
public static BBOXCENTER_DEFAULT_VALUE : number[]; public static
BBOXCENTER_DEFAULT_VALUE_$LI$() : number[] {
if(TransformObject.BBOXCENTER_DEFAULT_VALUE == null)
TransformObject.BBOXCENTER_DEFAULT_VALUE = [0.0, 0.0, 0.0]; return
TransformObject.BBOXCENTER_DEFAULT_VALUE; };
/**
* SFVec3f field named <i>bboxSize</i> has default value
<i>{-1f,-1f,-1f}</i> (Java syntax) or <i>-1 -1 -1</i> (XML syntax).
*/
public static BBOXSIZE_DEFAULT_VALUE : number[]; public static
BBOXSIZE_DEFAULT_VALUE_$LI$() : number[] {
if(TransformObject.BBOXSIZE_DEFAULT_VALUE == null)
TransformObject.BBOXSIZE_DEFAULT_VALUE = [-1.0, -1.0, -1.0]; return
TransformObject.BBOXSIZE_DEFAULT_VALUE; };
/**
* SFVec3f field named <i>center</i> has default value
<i>{0f,0f,0f}</i> (Java syntax) or <i>0 0 0</i> (XML syntax).
*/
public static CENTER_DEFAULT_VALUE : number[]; public static
CENTER_DEFAULT_VALUE_$LI$() : number[] {
if(TransformObject.CENTER_DEFAULT_VALUE == null)
TransformObject.CENTER_DEFAULT_VALUE = [0.0, 0.0, 0.0]; return
TransformObject.CENTER_DEFAULT_VALUE; };
/**
* SFNode field named <i>IS</i> has default value <i>null</i> (Java
syntax) or <i>NULL</i> (XML syntax).
*/
public static IS_DEFAULT_VALUE : org.web3d.x3d.jsail.Core.ISObject
= null;
/**
* SFNode field named <i>metadata</i> has default value <i>null</i>
(Java syntax) or <i>NULL</i> (XML syntax).
*/
public static METADATA_DEFAULT_VALUE :
org.web3d.x3d.sai.Core.X3DMetadataObject = null;
/**
* SFRotation field named <i>rotation</i> has default value
<i>{0f,0f,1f,0f}</i> (Java syntax) or <i>0 0 1 0</i> (XML syntax).
*/
public static ROTATION_DEFAULT_VALUE : number[]; public static
ROTATION_DEFAULT_VALUE_$LI$() : number[] {
if(TransformObject.ROTATION_DEFAULT_VALUE == null)
TransformObject.ROTATION_DEFAULT_VALUE = [0.0, 0.0, 1.0, 0.0]; return
TransformObject.ROTATION_DEFAULT_VALUE; };
/**
* SFVec3f field named <i>scale</i> has default value
<i>{1f,1f,1f}</i> (Java syntax) or <i>1 1 1</i> (XML syntax).
*/
public static SCALE_DEFAULT_VALUE : number[]; public static
SCALE_DEFAULT_VALUE_$LI$() : number[] {
if(TransformObject.SCALE_DEFAULT_VALUE == null)
TransformObject.SCALE_DEFAULT_VALUE = [1.0, 1.0, 1.0]; return
TransformObject.SCALE_DEFAULT_VALUE; };
/**
* SFRotation field named <i>scaleOrientation</i> has default value
<i>{0f,0f,1f,0f}</i> (Java syntax) or <i>0 0 1 0</i> (XML syntax).
*/
public static SCALEORIENTATION_DEFAULT_VALUE : number[]; public
static SCALEORIENTATION_DEFAULT_VALUE_$LI$() : number[] {
if(TransformObject.SCALEORIENTATION_DEFAULT_VALUE == null)
TransformObject.SCALEORIENTATION_DEFAULT_VALUE = [0.0, 0.0, 1.0, 0.0];
return TransformObject.SCALEORIENTATION_DEFAULT_VALUE; };
/**
* SFVec3f field named <i>translation</i> has default value
<i>{0f,0f,0f}</i> (Java syntax) or <i>0 0 0</i> (XML syntax).
*/
public static TRANSLATION_DEFAULT_VALUE : number[]; public static
TRANSLATION_DEFAULT_VALUE_$LI$() : number[] {
if(TransformObject.TRANSLATION_DEFAULT_VALUE == null)
TransformObject.TRANSLATION_DEFAULT_VALUE = [0.0, 0.0, 0.0]; return
TransformObject.TRANSLATION_DEFAULT_VALUE; };
/**
* Indicate type corresponding to given fieldName.
* @param {string} fieldName name of field in this X3D node
* @see ConfigurationProperties#ERROR_UNKNOWN_FIELD_TYPE
* @return {string} X3D type (SFvec3f etc.), otherwise
ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE if not recognized
*/
public getFieldType(fieldName : string) : string {
let result : string;
switch((fieldName)) {
case "containerField":
result = "SFString";
break;
case "addChildren":
result = "MFNode";
break;
case "bboxCenter":
result = "SFVec3f";
break;
case "bboxSize":
result = "SFVec3f";
break;
case "center":
result = "SFVec3f";
break;
case "children":
result = "MFNode";
break;
case "IS":
result = "SFNode";
break;
case "metadata":
result = "SFNode";
break;
case "removeChildren":
result = "MFNode";
break;
case "rotation":
result = "SFRotation";
break;
case "scale":
result = "SFVec3f";
break;
case "scaleOrientation":
result = "SFRotation";
break;
case "translation":
result = "SFVec3f";
break;
case "DEF":
result = "SFString";
break;
case "USE":
result = "SFString";
break;
case "class":
result = "SFString";
break;
default:
{
if(/* startsWith */((str, searchString, position = 0)
=> str.substr(position, searchString.length) ===
searchString)(fieldName.trim(), "set_")) result =
this.getFieldType(fieldName.trim().substring(4)); else if(/* endsWith
*/((str, searchString) => { let pos = str.length - searchString.length; let
lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 &&
lastIndex === pos; })(fieldName.trim(), "_changed")) result =
this.getFieldType(fieldName.trim().substring(0, fieldName.length - 8));
else result =
org.web3d.x3d.jsail.ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE;
};
}
return result;
}
/**
* Indicate accessType corresponding to given fieldName.
* @param {string} fieldName name of field in this X3D node
* @see ConfigurationProperties#ERROR_UNKNOWN_FIELD_ACCESSTYPE
* @return {string} X3D accessType (inputOnly etc.), otherwise
ConfigurationProperties.ERROR_UNKNOWN_FIELD_ACCESSTYPE if not recognized
*/
public getAccessType(fieldName : string) : string {
let result : string;
switch((fieldName)) {
case "addChildren":
result = "inputOnly";
break;
case "bboxCenter":
result = "initializeOnly";
break;
case "bboxSize":
result = "initializeOnly";
break;
case "center":
result = "inputOutput";
break;
case "children":
result = "inputOutput";
break;
case "IS":
result = "inputOutput";
break;
case "metadata":
result = "inputOutput";
break;
case "removeChildren":
result = "inputOnly";
break;
case "rotation":
result = "inputOutput";
break;
case "scale":
result = "inputOutput";
break;
case "scaleOrientation":
result = "inputOutput";
break;
case "translation":
result = "inputOutput";
break;
case "DEF":
result = "inputOutput";
break;
case "USE":
result = "inputOutput";
break;
case "class":
result = "inputOutput";
break;
default:
{
if(/* startsWith */((str, searchString, position = 0)
=> str.substr(position, searchString.length) ===
searchString)(fieldName.trim(), "set_")) result =
this.getAccessType(fieldName.trim().substring(4)); else if(/* endsWith
*/((str, searchString) => { let pos = str.length - searchString.length; let
lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 &&
lastIndex === pos; })(fieldName.trim(), "_changed")) result =
this.getAccessType(fieldName.trim().substring(0, fieldName.length - 8));
else result =
org.web3d.x3d.jsail.ConfigurationProperties.ERROR_UNKNOWN_FIELD_ACCESSTYPE;
};
}
return result;
}
/**
* containerField describes typical field relationship of a node to
its parent.
* Usage is not ordinarily needed when using this API, default
value is provided for informational purposes.
* @see <a href="
https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField">X3D
Scene Authoring Hints: containerField</a>
* @see <a href="https://www.web3d.org/specifications/X3DUOM.html">X3D
Unified Object Model (X3DUOM)</a>
*/
public static containerField_DEFAULT_VALUE : string = "children";
/**
* containerField describes typical field relationship of a node to
its parent.
* Usage is not ordinarily needed when using this API, default
value is provided for informational purposes.
* @see <a href="
https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField">X3D
Scene Authoring Hints: containerField</a>
* @see <a href="https://www.web3d.org/specifications/X3DUOM.html">X3D
Unified Object Model (X3DUOM)</a>
* @return {string} default containerField value
*/
public getContainerFieldDefault() : string {
return TransformObject.containerField_DEFAULT_VALUE;
}
/**
* toField ROUTE name for MFNode field named <i>addChildren</i>.
*/
public static toField_ADDCHILDREN : string = "addChildren";
/**
* fromField ROUTE name for SFVec3f field named <i>center</i>.
*/
public static fromField_CENTER : string = "center";
/**
* toField ROUTE name for SFVec3f field named <i>center</i>.
*/
public static toField_CENTER : string = "center";
/**
* fromField ROUTE name for MFNode field named <i>children</i>.
*/
public static fromField_CHILDREN : string = "children";
/**
* toField ROUTE name for MFNode field named <i>children</i>.
*/
public static toField_CHILDREN : string = "children";
/**
* fromField ROUTE name for SFNode field named <i>IS</i>.
*/
public static fromField_IS : string = "IS";
/**
* fromField ROUTE name for SFNode field named <i>metadata</i>.
*/
public static fromField_METADATA : string = "metadata";
/**
* toField ROUTE name for SFNode field named <i>metadata</i>.
*/
public static toField_METADATA : string = "metadata";
/**
* toField ROUTE name for MFNode field named <i>removeChildren</i>.
*/
public static toField_REMOVECHILDREN : string = "removeChildren";
/**
* fromField ROUTE name for SFRotation field named <i>rotation</i>.
*/
public static fromField_ROTATION : string = "rotation";
/**
* toField ROUTE name for SFRotation field named <i>rotation</i>.
*/
public static toField_ROTATION : string = "rotation";
/**
* fromField ROUTE name for SFVec3f field named <i>scale</i>.
*/
public static fromField_SCALE : string = "scale";
/**
* toField ROUTE name for SFVec3f field named <i>scale</i>.
*/
public static toField_SCALE : string = "scale";
/**
* fromField ROUTE name for SFRotation field named
<i>scaleOrientation</i>.
*/
public static fromField_SCALEORIENTATION : string =
"scaleOrientation";
/**
* toField ROUTE name for SFRotation field named
<i>scaleOrientation</i>.
*/
public static toField_SCALEORIENTATION : string =
"scaleOrientation";
/**
* fromField ROUTE name for SFVec3f field named <i>translation</i>.
*/
public static fromField_TRANSLATION : string = "translation";
/**
* toField ROUTE name for SFVec3f field named <i>translation</i>.
*/
public static toField_TRANSLATION : string = "translation";
/**
* Initialize all member variables to default values.
*/
public initialize() {
super.initialize();
this.setContainerFieldOverride("");
this.containerField_ALTERNATE_VALUES = ["children", "proxy",
"shape"];
this.bboxCenter =
TransformObject.BBOXCENTER_DEFAULT_VALUE_$LI$();
this.bboxSize = TransformObject.BBOXSIZE_DEFAULT_VALUE_$LI$();
this.center = TransformObject.CENTER_DEFAULT_VALUE_$LI$();
this.children = <any>(new java.util.ArrayList<any>());
this.IS = null;
this.metadata = null;
this.metadataProtoInstance = null;
this.rotation = TransformObject.ROTATION_DEFAULT_VALUE_$LI$();
this.scale = TransformObject.SCALE_DEFAULT_VALUE_$LI$();
this.scaleOrientation =
TransformObject.SCALEORIENTATION_DEFAULT_VALUE_$LI$();
this.translation =
TransformObject.TRANSLATION_DEFAULT_VALUE_$LI$();
}
/**
* Provide array of 3-tuple float results from initializeOnly
SFVec3f field named <i>bboxCenter</i>.
* <br><br>
* <i>Tooltip:</i> Bounding box center accompanies bboxSize and
provides an optional hint for bounding box position offset from origin of
local coordinate system.
* <ul>
* <li> <i>Hint:</i> precomputation and inclusion of bounding box
information can speed up the initialization of large detailed models, with
a corresponding cost of increased file size. </li>
* <li> <i>Hint:</i> X3D Architecture, 10.2.2 Bounding boxes <a
href="
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#BoundingBoxes"
target="_blank">
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#BoundingBoxes</a>
</li>
* </ul>
* @return {Array} value of bboxCenter field
*/
public getBboxCenter() : number[] {
return this.bboxCenter;
}
public setBboxCenter$float_A(newValue : number[]) : TransformObject
{
if(newValue == null) newValue = [];
if(newValue.length !== 3) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform bboxCenter
newValue=" + org.web3d.x3d.jsail.fields.SFVec3fObject.toString(newValue) +
" has length=" + newValue.length + " instead of required length 3");
}
this.bboxCenter = newValue;
return this;
}
public
setBboxCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(newValue :
org.web3d.x3d.jsail.fields.SFVec3fObject) : TransformObject {
this.setBboxCenter$float_A(newValue.getPrimitiveValue());
return this;
}
public setBboxCenter$float$float$float(x : number, y : number, z :
number) : TransformObject {
this.setBboxCenter$float_A([x, y, z]);
return this;
}
/**
* Assign values to SFVec3f bboxCenter field, similar to {@link
#setBboxCenter(float[])}.
*
* @param {number} x first component
* @param {number} y second component
* @param {number} z third component
*
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setBboxCenter(x? : any, y? : any, z? : any) : any {
if(((typeof x === 'number') || x === null) && ((typeof y ===
'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setBboxCenter$float$float$float(x, y, z);
} else if(((typeof x === 'number') || x === null) && ((typeof y
=== 'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setBboxCenter$double$double$double(x, y,
z);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setBboxCenter$float_A(x);
} else if(((x != null && x instanceof
<any>org.web3d.x3d.jsail.fields.SFVec3fObject) || x === null) && y ===
undefined && z === undefined) {
return
<any>this.setBboxCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(x);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setBboxCenter$double_A(x);
} else throw new Error('invalid overload');
}
public setBboxCenter$double$double$double(x : number, y : number, z
: number) : TransformObject {
return
this.setBboxCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(x, y, z));
}
public setBboxCenter$double_A(newArray : number[]) :
TransformObject {
return
this.setBboxCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(newArray));
}
/**
* Provide array of 3-tuple float results within allowed range of
[0,infinity), or default value [-1 -1 -1], from initializeOnly SFVec3f
field named <i>bboxSize</i>.
* <br><br>
* <i>Tooltip:</i> Bounding box size is usually omitted, and can
easily be calculated automatically by an X3D player at scene-loading time
with minimal computational cost. Bounding box size can also be defined as
an optional authoring hint that suggests an optimization or constraint.
* <ul>
* <li> <i>Hint:</i> can be useful for collision computations or
inverse-kinematics (IK) engines. </li>
* <li> <i>Hint:</i> precomputation and inclusion of bounding box
information can speed up the initialization of large detailed models, with
a corresponding cost of increased file size. </li>
* <li> <i>Hint:</i> X3D Architecture, 10.2.2 Bounding boxes <a
href="
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#BoundingBoxes"
target="_blank">
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#BoundingBoxes</a>
</li>
* </ul>
* @return {Array} value of bboxSize field
*/
public getBboxSize() : number[] {
return this.bboxSize;
}
public setBboxSize$float_A(newValue : number[]) : TransformObject {
if(newValue == null) newValue = [];
if(newValue.length !== 3) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform bboxSize newValue="
+ org.web3d.x3d.jsail.fields.SFVec3fObject.toString(newValue) + " has
length=" + newValue.length + " instead of required length 3");
}
if(((newValue[0] < 0) || (newValue[1] < 0) || (newValue[2] <
0)) && !((newValue[0] === -1) && (newValue[1] === -1) && (newValue[2] ===
-1))) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform bboxSize newValue="
+ org.web3d.x3d.jsail.fields.SFVec3fObject.toString(newValue) + " has
negative value but is not equal to sentinel {-1,-1,-1} value.");
}
this.bboxSize = newValue;
return this;
}
public
setBboxSize$org_web3d_x3d_jsail_fields_SFVec3fObject(newValue :
org.web3d.x3d.jsail.fields.SFVec3fObject) : TransformObject {
this.setBboxSize$float_A(newValue.getPrimitiveValue());
return this;
}
public setBboxSize$float$float$float(x : number, y : number, z :
number) : TransformObject {
this.setBboxSize$float_A([x, y, z]);
return this;
}
/**
* Assign values to SFVec3f bboxSize field, similar to {@link
#setBboxSize(float[])}.
*
* @param {number} x first component
* @param {number} y second component
* @param {number} z third component
*
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setBboxSize(x? : any, y? : any, z? : any) : any {
if(((typeof x === 'number') || x === null) && ((typeof y ===
'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setBboxSize$float$float$float(x, y, z);
} else if(((typeof x === 'number') || x === null) && ((typeof y
=== 'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setBboxSize$double$double$double(x, y, z);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setBboxSize$float_A(x);
} else if(((x != null && x instanceof
<any>org.web3d.x3d.jsail.fields.SFVec3fObject) || x === null) && y ===
undefined && z === undefined) {
return
<any>this.setBboxSize$org_web3d_x3d_jsail_fields_SFVec3fObject(x);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setBboxSize$double_A(x);
} else throw new Error('invalid overload');
}
public setBboxSize$double$double$double(x : number, y : number, z :
number) : TransformObject {
return
this.setBboxSize$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(x, y, z));
}
public setBboxSize$double_A(newArray : number[]) : TransformObject {
return
this.setBboxSize$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(newArray));
}
/**
* Provide array of 3-tuple float results from inputOutput SFVec3f
field named <i>center</i>.
* <br><br>
* <i>Tooltip:</i> Translation offset from origin of local
coordinate system, applied prior to rotation or scaling.
* <ul>
* <li> <i> Hint:</i> The order of operation is first apply the
center offset, then scaleOrientation and scale, then rotation, then restore
the center offset, then translation. </li>
* </ul>
* @return {Array} value of center field
*/
public getCenter() : number[] {
return this.center;
}
public setCenter$float_A(newValue : number[]) : TransformObject {
if(newValue == null) newValue = [];
if(newValue.length !== 3) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform center newValue=" +
org.web3d.x3d.jsail.fields.SFVec3fObject.toString(newValue) + " has
length=" + newValue.length + " instead of required length 3");
}
this.center = newValue;
return this;
}
public setCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(newValue
: org.web3d.x3d.jsail.fields.SFVec3fObject) : TransformObject {
this.setCenter$float_A(newValue.getPrimitiveValue());
return this;
}
public setCenter$float$float$float(x : number, y : number, z :
number) : TransformObject {
this.setCenter$float_A([x, y, z]);
return this;
}
/**
* Assign values to SFVec3f center field, similar to {@link
#setCenter(float[])}.
*
* @param {number} x first component
* @param {number} y second component
* @param {number} z third component
*
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setCenter(x? : any, y? : any, z? : any) : any {
if(((typeof x === 'number') || x === null) && ((typeof y ===
'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setCenter$float$float$float(x, y, z);
} else if(((typeof x === 'number') || x === null) && ((typeof y
=== 'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setCenter$double$double$double(x, y, z);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setCenter$float_A(x);
} else if(((x != null && x instanceof
<any>org.web3d.x3d.jsail.fields.SFVec3fObject) || x === null) && y ===
undefined && z === undefined) {
return
<any>this.setCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(x);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setCenter$double_A(x);
} else throw new Error('invalid overload');
}
public setCenter$double$double$double(x : number, y : number, z :
number) : TransformObject {
return
this.setCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(x, y, z));
}
public setCenter$double_A(newArray : number[]) : TransformObject {
return
this.setCenter$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(newArray));
}
/**
* Provide array of X3DChildNode results (using an array consisting
of properly typed nodes or ProtoInstanceObjects) from inputOutput MFNode
field <i>children</i>.
* <br><br>
* <i>Tooltip:</i> [X3DChildNode] Grouping nodes contain an ordered
list of children nodes.
* <ul>
* <li> <i>Hint:</i> Each grouping node defines a coordinate space
for its children, relative to the coordinate space of its parent node. Thus
transformations accumulate down the scene graph hierarchy. </li>
* <li> <i>Hint:</i> inputOnly MFNode addChildren field can append
new X3DChildNode nodes via a ROUTE connection, duplicate input nodes (i.e.
matching DEF, USE values) are ignored. </li>
* <li> <i>Hint:</i> inputOnly MFNode removeChildren field can
remove nodes from the children list, unrecognized input nodes (i.e.
nonmatching DEF, USE values) are ignored. </li>
* <li> <i>Hint:</i> X3D Architecture 10.2.1 Grouping and children
node types, <a href="
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#GroupingAndChildrenNodes"
target="_blank">
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#GroupingAndChildrenNodes</a>
</li>
* </ul>
* <br><br>
* <i>Warning:</i> according to X3D Unified Object Model (X3DUOM),
acceptable node types are limited to X3DChildNode.
* @see org.web3d.x3d.sai.Core.X3DChildNode
* @return {Array} value of children field
*/
public getChildren() : org.web3d.x3d.sai.Core.X3DNode[] {
let valuesArray : org.web3d.x3d.sai.Core.X3DNode[] = (s => {
let a=[]; while(s-->0) a.push(null); return a; })(this.children.size());
let i : number = 0;
for(let
index3676=this.children.iterator();index3676.hasNext();) {
let arrayElement = index3676.next();
{
valuesArray[i++] = arrayElement;
}
}
return valuesArray;
}
/**
* Utility method to get ArrayList value of MFNode children field,
similar to {@link #getChildren()}.
* @return {java.util.ArrayList} value of children field
*/
public getChildrenList() :
java.util.ArrayList<org.web3d.x3d.sai.Core.X3DNode> {
return this.children;
}
public setChildren$org_web3d_x3d_sai_Core_X3DNode_A(newValue :
org.web3d.x3d.sai.Core.X3DNode[]) : TransformObject {
if(newValue == null) {
this.clearChildren();
return this;
}
this.clearChildren();
for(let i : number = 0; i < newValue.length; i++) {{
if((newValue[i] != null && (newValue[i]["__interfaces"] !=
null &&
newValue[i]["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode") >= 0
|| newValue[i].constructor != null &&
newValue[i].constructor["__interfaces"] != null &&
newValue[i].constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0)) || (newValue[i] != null && newValue[i] instanceof
<any>org.web3d.x3d.jsail.Core.ProtoInstanceObject)) {
this.children.add(newValue[i]);
(<org.web3d.x3d.jsail.X3DConcreteElement><any>newValue[i]).setParentObject(this);
} else throw new
org.web3d.x3d.sai.InvalidFieldValueException("X3DNode[] newValue[" + i + "]
is not instanceof X3DNode or ProtoInstanceObject; array newValue=" +
java.util.Arrays.toString(newValue));
};}
return this;
}
/**
* Accessor method to assign X3DChildNode array (using an array
consisting of properly typed nodes or ProtoInstanceObjects) to inputOutput
MFNode field <i>children</i>.
* <br><br>
* <i>Tooltip:</i> [X3DChildNode] Grouping nodes contain an ordered
list of children nodes.
* <ul>
* <li> <i>Hint:</i> Each grouping node defines a coordinate space
for its children, relative to the coordinate space of its parent node. Thus
transformations accumulate down the scene graph hierarchy. </li>
* <li> <i>Hint:</i> inputOnly MFNode addChildren field can append
new X3DChildNode nodes via a ROUTE connection, duplicate input nodes (i.e.
matching DEF, USE values) are ignored. </li>
* <li> <i>Hint:</i> inputOnly MFNode removeChildren field can
remove nodes from the children list, unrecognized input nodes (i.e.
nonmatching DEF, USE values) are ignored. </li>
* <li> <i>Hint:</i> X3D Architecture 10.2.1 Grouping and children
node types, <a href="
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#GroupingAndChildrenNodes"
target="_blank">
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/group.html#GroupingAndChildrenNodes</a>
</li>
* </ul>
* <br><br>
* <i>Note:</i> according to X3D Unified Object Model (X3DUOM),
acceptable node types are limited to X3DChildNode.
* @param {Array} newValue is new value for the children field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setChildren(newValue? : any) : any {
if(((newValue != null && newValue instanceof <any>Array &&
(newValue.length==0 || newValue[0] == null ||(newValue[0] != null &&
(newValue[0]["__interfaces"] != null &&
newValue[0]["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode") >= 0
|| newValue[0].constructor != null &&
newValue[0].constructor["__interfaces"] != null &&
newValue[0].constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0)))) || newValue === null)) {
return
<any>this.setChildren$org_web3d_x3d_sai_Core_X3DNode_A(newValue);
} else if(((newValue != null && newValue instanceof
<any>java.util.ArrayList) || newValue === null)) {
return <any>this.setChildren$java_util_ArrayList(newValue);
} else if(((newValue != null && (newValue["__interfaces"] !=
null && newValue["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0 || newValue.constructor != null &&
newValue.constructor["__interfaces"] != null &&
newValue.constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0)) || newValue === null)) {
return
<any>this.setChildren$org_web3d_x3d_sai_Core_X3DNode(newValue);
} else throw new Error('invalid overload');
}
public setChildren$java_util_ArrayList(newValue :
java.util.ArrayList<org.web3d.x3d.sai.Core.X3DChildNode>) : TransformObject
{
if(newValue == null) {
this.clearChildren();
return this;
}
if(newValue.isEmpty()) this.clearChildren(); else {
let newArray : org.web3d.x3d.sai.Core.X3DNode[] = (s => {
let a=[]; while(s-->0) a.push(null); return a; })(newValue.size());
for(let i : number = 0; i < newValue.size(); i++)
{newArray[i] = newValue.get(i);}
this.setChildren$org_web3d_x3d_sai_Core_X3DNode_A(newArray);
}
for(let index3677=newValue.iterator();index3677.hasNext();) {
let element = index3677.next();
{
this.children.add(<org.web3d.x3d.sai.Core.X3DNode><any>element);
(<org.web3d.x3d.jsail.X3DConcreteElement><any>element).setParentObject(this);
}
}
return this;
}
public addChildren$org_web3d_x3d_sai_Core_X3DNode(newValue :
org.web3d.x3d.sai.Core.X3DNode) {
if(newValue == null) return;
this.children.add(newValue);
(<org.web3d.x3d.jsail.X3DConcreteElement><any>newValue).setParentObject(this);
}
public
addChildren$org_web3d_x3d_jsail_Core_ProtoInstanceObject(newValue :
org.web3d.x3d.jsail.Core.ProtoInstanceObject) : TransformObject {
if(newValue == null) return this;
this.children.add(newValue);
(<org.web3d.x3d.jsail.X3DConcreteElement>newValue).setParentObject(this);
return this;
}
/**
* Add single ProtoInstanceObject (with appropriate node type and
containerField value) to MFNode array for children field.
* <br><br>
* <i>Note:</i> according to X3D Unified Object Model (X3DUOM),
acceptable node types are limited to ShaderPart and ProtoInstance.
* @param {org.web3d.x3d.jsail.Core.ProtoInstanceObject} newValue
is new value to be appended the parts field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public addChildren(newValue? : any) : any {
if(((newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.Core.ProtoInstanceObject) || newValue === null)) {
return
<any>this.addChildren$org_web3d_x3d_jsail_Core_ProtoInstanceObject(newValue);
} else if(((newValue != null && (newValue["__interfaces"] !=
null && newValue["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0 || newValue.constructor != null &&
newValue.constructor["__interfaces"] != null &&
newValue.constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0)) || newValue === null)) {
return
<any>this.addChildren$org_web3d_x3d_sai_Core_X3DNode(newValue);
} else if(((newValue != null && newValue instanceof <any>Array
&& (newValue.length==0 || newValue[0] == null ||(newValue[0] != null &&
(newValue[0]["__interfaces"] != null &&
newValue[0]["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode") >= 0
|| newValue[0].constructor != null &&
newValue[0].constructor["__interfaces"] != null &&
newValue[0].constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0)))) || newValue === null)) {
return
<any>this.addChildren$org_web3d_x3d_sai_Core_X3DNode_A(newValue);
} else throw new Error('invalid overload');
}
/**
* Utility method to add single child element to contained list of
existing children nodes (if any).
* @param {*} newValue is new node value to be appended the
children field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public addChild(newValue : org.web3d.x3d.sai.Core.X3DChildNode) :
TransformObject {
if(newValue == null) return this;
this.children.add(newValue);
(<org.web3d.x3d.jsail.X3DConcreteElement><any>newValue).setParentObject(this);
if(newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.Core.ProtoInstanceObject)
(<org.web3d.x3d.jsail.Core.ProtoInstanceObject><any>newValue).setContainerField("children");
return this;
}
public addChildren$org_web3d_x3d_sai_Core_X3DNode_A(newValue :
org.web3d.x3d.sai.Core.X3DNode[]) {
if(newValue == null) return;
for(let i : number = 0; i < newValue.length; i++) {{
if((newValue[i] != null && (newValue[i]["__interfaces"] !=
null &&
newValue[i]["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode") >= 0
|| newValue[i].constructor != null &&
newValue[i].constructor["__interfaces"] != null &&
newValue[i].constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0)) || (newValue[i] != null && newValue[i] instanceof
<any>org.web3d.x3d.jsail.Core.ProtoInstanceObject)) {
this.children.add(newValue[i]);
(<org.web3d.x3d.jsail.X3DConcreteElement><any>newValue[i]).setParentObject(this);
if(newValue[i] != null && newValue[i] instanceof
<any>org.web3d.x3d.jsail.Core.ProtoInstanceObject)
(<org.web3d.x3d.jsail.Core.ProtoInstanceObject><any>newValue[i]).setContainerField("children");
} else throw new
org.web3d.x3d.sai.InvalidFieldValueException("X3DNode[] newValue[" + i + "]
is not instanceof X3DNode or ProtoInstanceObject, array newValue=" +
java.util.Arrays.toString(newValue));
};}
}
public setChildren$org_web3d_x3d_sai_Core_X3DNode(newValue :
org.web3d.x3d.sai.Core.X3DNode) {
if(newValue == null) {
this.clearChildren();
return;
}
if(newValue != null && (newValue["__interfaces"] != null &&
newValue["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode") >= 0 ||
newValue.constructor != null && newValue.constructor["__interfaces"] !=
null &&
newValue.constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DNode")
>= 0)) {
for(let
index3678=this.children.iterator();index3678.hasNext();) {
let element = index3678.next();
(<org.web3d.x3d.jsail.X3DConcreteElement><any>element).clearParentObject()
}
this.clearChildren();
(<org.web3d.x3d.jsail.X3DConcreteElement><any>newValue).setParentObject(this);
this.children.add(newValue);
} else throw new
org.web3d.x3d.sai.InvalidFieldValueException("X3DNode newValue is not
instanceof X3DNode; newValue=" + newValue);
}
/**
* Utility method to clear MFNode value of children field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive
* setAttribute method invocations).
*/
public clearChildren() : TransformObject {
for(let
index3679=this.children.iterator();index3679.hasNext();) {
let element = index3679.next();
(<org.web3d.x3d.jsail.X3DConcreteElement><any>element).clearParentObject()
}
this.children.clear();
return this;
}
/**
* Indicate whether an object is available for inputOutput MFNode
field <i>children</i>.
* @return {boolean} whether a properly typed node or ProtoInstance
array or CommentsBlock is available.
* @see #getChildren()
*/
public hasChildren() : boolean {
return (!this.children.isEmpty());
}
public addComments$java_lang_String(newComment : string) :
TransformObject {
if(newComment == null) return this;
this.children.add(new
org.web3d.x3d.jsail.Core.CommentsBlock(newComment));
return this;
}
/**
* Add comment as CommentsBlock to children field
* @param {string} newComment initial value
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive
* setAttribute method invocations).
*/
public addComments(newComment? : any) : any {
if(((typeof newComment === 'string') || newComment === null)) {
return <any>this.addComments$java_lang_String(newComment);
} else if(((newComment != null && newComment instanceof
<any>Array && (newComment.length==0 || newComment[0] == null ||(typeof
newComment[0] === 'string'))) || newComment === null)) {
return <any>this.addComments$java_lang_String_A(newComment);
} else if(((newComment != null && newComment instanceof
<any>org.web3d.x3d.jsail.Core.CommentsBlock) || newComment === null)) {
return
<any>this.addComments$org_web3d_x3d_jsail_Core_CommentsBlock(newComment);
} else if(((typeof newComment === 'string') || newComment ===
null)) {
throw new Error('cannot invoke abstract overloaded
method... check your argument(s) type(s)');
} else if(((newComment != null && newComment instanceof
<any>Array && (newComment.length==0 || newComment[0] == null ||(typeof
newComment[0] === 'string'))) || newComment === null)) {
return <any>this.addComments$java_lang_String_A(newComment);
} else if(((newComment != null && newComment instanceof
<any>org.web3d.x3d.jsail.Core.CommentsBlock) || newComment === null)) {
return
<any>this.addComments$org_web3d_x3d_jsail_Core_CommentsBlock(newComment);
} else throw new Error('invalid overload');
}
public addComments$java_lang_String_A(newComments : string[]) :
TransformObject {
if(newComments == null) return this;
this.children.add(new
org.web3d.x3d.jsail.Core.CommentsBlock(newComments));
return this;
}
public
addComments$org_web3d_x3d_jsail_Core_CommentsBlock(newCommentsBlock :
org.web3d.x3d.jsail.Core.CommentsBlock) : TransformObject {
if(newCommentsBlock == null) return this;
this.children.add(newCommentsBlock);
return this;
}
/**
* Provide ISObject instance (using a properly typed node) from
inputOutput SFNode field <i>IS</i>.
* @return {org.web3d.x3d.jsail.Core.ISObject} value of IS field
*/
public getIS() : org.web3d.x3d.jsail.Core.ISObject {
return this.IS;
}
/**
* Accessor method to assign ISObject instance (using a properly
typed node) to inputOutput SFNode field <i>IS</i>.
* @param {org.web3d.x3d.jsail.Core.ISObject} newValue is new value
for the IS field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setIS(newValue : org.web3d.x3d.jsail.Core.ISObject) :
TransformObject {
this.IS = newValue;
if(newValue != null) {
(<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).setParentObject(this);
}
return this;
}
/**
* Utility method to clear SFNode value of IS field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive
* setAttribute method invocations).
*/
public clearIS() : TransformObject {
(<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).clearParentObject();
this.IS = null;
return this;
}
/**
* Indicate whether an object is available for inputOutput SFNode
field <i>IS</i>.
* @return {boolean} whether a concrete statement or CommentsBlock
is available.
* @see #getIS()
*/
public hasIS() : boolean {
return (this.IS != null);
}
/**
* Provide X3DMetadataObject instance (using a properly typed node)
from inputOutput SFNode field <i>metadata</i>.
* @see #getMetadataProtoInstance()
* @see <a href="
https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Metadata"
target="_blank">X3D Scene Authoring Hints: Metadata Nodes</a>
* @return {*} value of metadata field
*/
public getMetadata() : org.web3d.x3d.sai.Core.X3DMetadataObject {
return this.metadata;
}
public
setMetadata$org_web3d_x3d_sai_Core_X3DMetadataObject(newValue :
org.web3d.x3d.sai.Core.X3DMetadataObject) : TransformObject {
this.metadata = newValue;
if(newValue != null) {
(<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).setParentObject(this);
}
if(this.metadataProtoInstance != null) {
this.metadataProtoInstance.setParentObject(null);
this.metadataProtoInstance = null;
}
return this;
}
/**
* Accessor method to assign X3DMetadataObject instance (using a
properly typed node) to inputOutput SFNode field <i>metadata</i>.
* @see #setMetadata(ProtoInstanceObject)
* @see <a href="
https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Metadata"
target="_blank">X3D Scene Authoring Hints: Metadata Nodes</a>
* @param {*} newValue is new value for the metadata field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setMetadata(newValue? : any) : any {
if(((newValue != null && (newValue["__interfaces"] != null &&
newValue["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DMetadataObject")
>= 0 || newValue.constructor != null &&
newValue.constructor["__interfaces"] != null &&
newValue.constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DMetadataObject")
>= 0)) || newValue === null)) {
return
<any>this.setMetadata$org_web3d_x3d_sai_Core_X3DMetadataObject(newValue);
} else if(((newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.Core.ProtoInstanceObject) || newValue === null)) {
return
<any>this.setMetadata$org_web3d_x3d_jsail_Core_ProtoInstanceObject(newValue);
} else if(((newValue != null && (newValue["__interfaces"] !=
null &&
newValue["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DMetadataObject")
>= 0 || newValue.constructor != null &&
newValue.constructor["__interfaces"] != null &&
newValue.constructor["__interfaces"].indexOf("org.web3d.x3d.sai.Core.X3DMetadataObject")
>= 0)) || newValue === null)) {
throw new Error('cannot invoke abstract overloaded
method... check your argument(s) type(s)');
} else if(((newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.Core.ProtoInstanceObject) || newValue === null)) {
return
<any>this.setMetadata$org_web3d_x3d_jsail_Core_ProtoInstanceObject(newValue);
} else throw new Error('invalid overload');
}
/**
* Utility method to clear SFNode value of metadata field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive
* setAttribute method invocations).
*/
public clearMetadata() : TransformObject {
(<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).clearParentObject();
this.metadata = null;
return this;
}
public
setMetadata$org_web3d_x3d_jsail_Core_ProtoInstanceObject(newValue :
org.web3d.x3d.jsail.Core.ProtoInstanceObject) : TransformObject {
if(this.metadataProtoInstance != null) {
(<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).setParentObject(null);
}
this.metadataProtoInstance = newValue;
if(newValue != null) {
(<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).setParentObject(this);
this.metadataProtoInstance.setContainerField("metadata");
}
if(this.metadata != null) {
(<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).setParentObject(null);
this.metadata = null;
}
return this;
}
/**
* Private utility method to access SFNode ProtoInstance field
* @return {org.web3d.x3d.jsail.Core.ProtoInstanceObject}
* @private
*/
/*private*/ getMetadataProtoInstance() :
org.web3d.x3d.jsail.Core.ProtoInstanceObject {
return this.metadataProtoInstance;
}
/**
* Indicate whether an object is available for inputOutput SFNode
field <i>metadata</i>.
* @return {boolean} whether a properly typed node or ProtoInstance
or CommentsBlock is available.
* @see #getMetadata()
* @see #getMetadataProtoInstance()
* @see <a href="
https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Metadata"
target="_blank">X3D Scene Authoring Hints: Metadata Nodes</a>
*/
public hasMetadata() : boolean {
return (this.metadata != null) || (this.metadataProtoInstance
!= null);
}
/**
* Provide array of 4-tuple float results unit axis, angle (in
radians) from inputOutput SFRotation field named <i>rotation</i>.
* <br><br>
* <i>Tooltip:</i> Orientation (axis, angle in radians) of children
relative to local coordinate system.
* <ul>
* <li> <i> Hint:</i> The order of operation is first apply the
center offset, then scaleOrientation and scale, then rotation, then restore
the center offset, then translation. </li>
* </ul>
* @return {Array} value of rotation field
*/
public getRotation() : number[] {
return this.rotation;
}
public setRotation$float_A(newValue : number[]) : TransformObject {
if(newValue == null) newValue = [];
if(newValue.length !== 4) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform rotation newValue="
+ org.web3d.x3d.jsail.fields.SFRotationObject.toString(newValue) + " has
length=" + newValue.length + " instead of required length 4");
}
this.rotation = newValue;
return this;
}
public
setRotation$org_web3d_x3d_jsail_fields_SFRotationObject(newValue :
org.web3d.x3d.jsail.fields.SFRotationObject) : TransformObject {
this.setRotation$float_A(newValue.getPrimitiveValue());
return this;
}
public setRotation$float$float$float$float(x : number, y : number,
z : number, angleRadians : number) : TransformObject {
this.setRotation$float_A([x, y, z, angleRadians]);
return this;
}
/**
* Assign values to SFRotation rotation field, similar to {@link
#setRotation(float[])}.
*
* @param {number} x first component of axis
* @param {number} y second component of axis
* @param {number} z third component of axis
* @param {number} angleRadians fourth component of rotation around
axis
*
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setRotation(x? : any, y? : any, z? : any, angleRadians? :
any) : any {
if(((typeof x === 'number') || x === null) && ((typeof y ===
'number') || y === null) && ((typeof z === 'number') || z === null) &&
((typeof angleRadians === 'number') || angleRadians === null)) {
return <any>this.setRotation$float$float$float$float(x, y,
z, angleRadians);
} else if(((typeof x === 'number') || x === null) && ((typeof y
=== 'number') || y === null) && ((typeof z === 'number') || z === null) &&
((typeof angleRadians === 'number') || angleRadians === null)) {
return <any>this.setRotation$double$double$double$double(x,
y, z, angleRadians);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined && angleRadians === undefined) {
return <any>this.setRotation$float_A(x);
} else if(((x != null && x instanceof
<any>org.web3d.x3d.jsail.fields.SFRotationObject) || x === null) && y ===
undefined && z === undefined && angleRadians === undefined) {
return
<any>this.setRotation$org_web3d_x3d_jsail_fields_SFRotationObject(x);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined && angleRadians === undefined) {
return <any>this.setRotation$double_A(x);
} else throw new Error('invalid overload');
}
public setRotation$double$double$double$double(x : number, y :
number, z : number, angleRadians : number) : TransformObject {
return
this.setRotation$org_web3d_x3d_jsail_fields_SFRotationObject(new
org.web3d.x3d.jsail.fields.SFRotationObject(x, y, z, angleRadians));
}
public setRotation$double_A(newArray : number[]) : TransformObject {
return
this.setRotation$org_web3d_x3d_jsail_fields_SFRotationObject(new
org.web3d.x3d.jsail.fields.SFRotationObject(newArray));
}
/**
* Provide array of 3-tuple float results from inputOutput SFVec3f
field named <i>scale</i>.
* <br><br>
* <i>Tooltip:</i> Non-uniform x-y-z scale of child coordinate
system, adjusted by center and scaleOrientation.
* <ul>
* <li> <i> Hint:</i> The order of operation is first apply the
center offset, then scaleOrientation and scale, then rotation, then restore
the center offset, then translation. </li>
* </ul>
* @return {Array} value of scale field
*/
public getScale() : number[] {
return this.scale;
}
public setScale$float_A(newValue : number[]) : TransformObject {
if(newValue == null) newValue = [];
if(newValue.length !== 3) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform scale newValue=" +
org.web3d.x3d.jsail.fields.SFVec3fObject.toString(newValue) + " has
length=" + newValue.length + " instead of required length 3");
}
this.scale = newValue;
return this;
}
public setScale$org_web3d_x3d_jsail_fields_SFVec3fObject(newValue :
org.web3d.x3d.jsail.fields.SFVec3fObject) : TransformObject {
this.setScale$float_A(newValue.getPrimitiveValue());
return this;
}
public setScale$float$float$float(x : number, y : number, z :
number) : TransformObject {
this.setScale$float_A([x, y, z]);
return this;
}
/**
* Assign values to SFVec3f scale field, similar to {@link
#setScale(float[])}.
*
* @param {number} x first component
* @param {number} y second component
* @param {number} z third component
*
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setScale(x? : any, y? : any, z? : any) : any {
if(((typeof x === 'number') || x === null) && ((typeof y ===
'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setScale$float$float$float(x, y, z);
} else if(((typeof x === 'number') || x === null) && ((typeof y
=== 'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setScale$double$double$double(x, y, z);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setScale$float_A(x);
} else if(((x != null && x instanceof
<any>org.web3d.x3d.jsail.fields.SFVec3fObject) || x === null) && y ===
undefined && z === undefined) {
return
<any>this.setScale$org_web3d_x3d_jsail_fields_SFVec3fObject(x);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setScale$double_A(x);
} else throw new Error('invalid overload');
}
public setScale$double$double$double(x : number, y : number, z :
number) : TransformObject {
return
this.setScale$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(x, y, z));
}
public setScale$double_A(newArray : number[]) : TransformObject {
return
this.setScale$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(newArray));
}
/**
* Provide array of 4-tuple float results unit axis, angle (in
radians) from inputOutput SFRotation field named <i>scaleOrientation</i>.
* <br><br>
* <i>Tooltip:</i> Preliminary rotation of coordinate system before
scaling (to allow scaling around arbitrary orientations).
* <ul>
* <li> <i> Hint:</i> The order of operation is first apply the
center offset, then scaleOrientation and scale, then rotation, then restore
the center offset, then translation. </li>
* </ul>
* @return {Array} value of scaleOrientation field
*/
public getScaleOrientation() : number[] {
return this.scaleOrientation;
}
public setScaleOrientation$float_A(newValue : number[]) :
TransformObject {
if(newValue == null) newValue = [];
if(newValue.length !== 4) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform scaleOrientation
newValue=" + org.web3d.x3d.jsail.fields.SFRotationObject.toString(newValue)
+ " has length=" + newValue.length + " instead of required length 4");
}
this.scaleOrientation = newValue;
return this;
}
public
setScaleOrientation$org_web3d_x3d_jsail_fields_SFRotationObject(newValue :
org.web3d.x3d.jsail.fields.SFRotationObject) : TransformObject {
this.setScaleOrientation$float_A(newValue.getPrimitiveValue());
return this;
}
public setScaleOrientation$float$float$float$float(x : number, y :
number, z : number, angleRadians : number) : TransformObject {
this.setScaleOrientation$float_A([x, y, z, angleRadians]);
return this;
}
/**
* Assign values to SFRotation scaleOrientation field, similar to
{@link #setScaleOrientation(float[])}.
*
* @param {number} x first component of axis
* @param {number} y second component of axis
* @param {number} z third component of axis
* @param {number} angleRadians fourth component of rotation around
axis
*
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setScaleOrientation(x? : any, y? : any, z? : any,
angleRadians? : any) : any {
if(((typeof x === 'number') || x === null) && ((typeof y ===
'number') || y === null) && ((typeof z === 'number') || z === null) &&
((typeof angleRadians === 'number') || angleRadians === null)) {
return
<any>this.setScaleOrientation$float$float$float$float(x, y, z,
angleRadians);
} else if(((typeof x === 'number') || x === null) && ((typeof y
=== 'number') || y === null) && ((typeof z === 'number') || z === null) &&
((typeof angleRadians === 'number') || angleRadians === null)) {
return
<any>this.setScaleOrientation$double$double$double$double(x, y, z,
angleRadians);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined && angleRadians === undefined) {
return <any>this.setScaleOrientation$float_A(x);
} else if(((x != null && x instanceof
<any>org.web3d.x3d.jsail.fields.SFRotationObject) || x === null) && y ===
undefined && z === undefined && angleRadians === undefined) {
return
<any>this.setScaleOrientation$org_web3d_x3d_jsail_fields_SFRotationObject(x);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined && angleRadians === undefined) {
return <any>this.setScaleOrientation$double_A(x);
} else throw new Error('invalid overload');
}
public setScaleOrientation$double$double$double$double(x : number,
y : number, z : number, angleRadians : number) : TransformObject {
return
this.setScaleOrientation$org_web3d_x3d_jsail_fields_SFRotationObject(new
org.web3d.x3d.jsail.fields.SFRotationObject(x, y, z, angleRadians));
}
public setScaleOrientation$double_A(newArray : number[]) :
TransformObject {
return
this.setScaleOrientation$org_web3d_x3d_jsail_fields_SFRotationObject(new
org.web3d.x3d.jsail.fields.SFRotationObject(newArray));
}
/**
* Provide array of 3-tuple float results from inputOutput SFVec3f
field named <i>translation</i>.
* <br><br>
* <i>Tooltip:</i> Position (x, y, z in meters) of children
relative to local coordinate system.
* <ul>
* <li> <i> Hint:</i> The order of operation is first apply the
center offset, then scaleOrientation and scale, then rotation, then restore
the center offset, then translation. </li>
* </ul>
* @return {Array} value of translation field
*/
public getTranslation() : number[] {
return this.translation;
}
public setTranslation$float_A(newValue : number[]) :
TransformObject {
if(newValue == null) newValue = [];
if(newValue.length !== 3) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform translation
newValue=" + org.web3d.x3d.jsail.fields.SFVec3fObject.toString(newValue) +
" has length=" + newValue.length + " instead of required length 3");
}
this.translation = newValue;
return this;
}
public
setTranslation$org_web3d_x3d_jsail_fields_SFVec3fObject(newValue :
org.web3d.x3d.jsail.fields.SFVec3fObject) : TransformObject {
this.setTranslation$float_A(newValue.getPrimitiveValue());
return this;
}
public setTranslation$float$float$float(x : number, y : number, z :
number) : TransformObject {
this.setTranslation$float_A([x, y, z]);
return this;
}
/**
* Assign values to SFVec3f translation field, similar to {@link
#setTranslation(float[])}.
*
* @param {number} x first component
* @param {number} y second component
* @param {number} z third component
*
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setTranslation(x? : any, y? : any, z? : any) : any {
if(((typeof x === 'number') || x === null) && ((typeof y ===
'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setTranslation$float$float$float(x, y, z);
} else if(((typeof x === 'number') || x === null) && ((typeof y
=== 'number') || y === null) && ((typeof z === 'number') || z === null)) {
return <any>this.setTranslation$double$double$double(x, y,
z);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setTranslation$float_A(x);
} else if(((x != null && x instanceof
<any>org.web3d.x3d.jsail.fields.SFVec3fObject) || x === null) && y ===
undefined && z === undefined) {
return
<any>this.setTranslation$org_web3d_x3d_jsail_fields_SFVec3fObject(x);
} else if(((x != null && x instanceof <any>Array &&
(x.length==0 || x[0] == null ||(typeof x[0] === 'number'))) || x === null)
&& y === undefined && z === undefined) {
return <any>this.setTranslation$double_A(x);
} else throw new Error('invalid overload');
}
public setTranslation$double$double$double(x : number, y : number,
z : number) : TransformObject {
return
this.setTranslation$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(x, y, z));
}
public setTranslation$double_A(newArray : number[]) :
TransformObject {
return
this.setTranslation$org_web3d_x3d_jsail_fields_SFVec3fObject(new
org.web3d.x3d.jsail.fields.SFVec3fObject(newArray));
}
/**
* Provide String value from inputOutput SFString field named
<i>DEF</i>.
* <br><br>
* <i>Tooltip:</i> DEF defines a unique ID name for this node,
referenceable by other nodes.
* <ul>
* <li> <i>Hint:</i> descriptive DEF names improve clarity and help
document a model. </li>
* <li> <i>Hint:</i> well-defined names can simplify design and
debugging through improved author understanding. </li>
* <li> <i>Hint:</i> 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>
</li>
* </ul>
* @return {string} value of DEF field
*/
public getDEF() : string {
return super.getDEF();
}
public setDEF$java_lang_String(newValue : string) : TransformObject
{
if(newValue == null) newValue = <string>new String();
if(!/* isEmpty */(newValue.length === 0) &&
!org.web3d.x3d.jsail.fields.SFStringObject.isNMTOKEN(newValue)) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform DEF newValue=\'" +
newValue + "\' has illegal name value, cannot be empty and must be defined
with valid NMTOKEN name string (with legal characters and no embedded
whitespace).");
}
this.setConcreteUSE("");
this.setConcreteDEF(newValue);
return this;
}
/**
* Accessor method to assign String value to inputOutput SFString
field named <i>DEF</i>.
* <br><br>
* <i>Tooltip:</i> DEF defines a unique ID name for this node,
referenceable by other nodes.
* <ul>
* <li> <i>Hint:</i> descriptive DEF names improve clarity and help
document a model. </li>
* <li> <i>Hint:</i> well-defined names can simplify design and
debugging through improved author understanding. </li>
* <li> <i>Hint:</i> 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>
</li>
* </ul>
* <br><br>
* Note that setting the DEF value clears the USE value.
* @param {string} newValue is new value for the DEF field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setDEF(newValue? : any) : any {
if(((typeof newValue === 'string') || newValue === null)) {
return <any>this.setDEF$java_lang_String(newValue);
} else if(((newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.fields.SFStringObject) || newValue === null)) {
return
<any>this.setDEF$org_web3d_x3d_jsail_fields_SFStringObject(newValue);
} else if(((typeof newValue === 'string') || newValue ===
null)) {
throw new Error('cannot invoke abstract overloaded
method... check your argument(s) type(s)');
} else throw new Error('invalid overload');
}
public setDEF$org_web3d_x3d_jsail_fields_SFStringObject(newValue :
org.web3d.x3d.jsail.fields.SFStringObject) : TransformObject {
this.setDEF$java_lang_String(newValue.getPrimitiveValue());
return this;
}
/**
* Provide String value from inputOutput SFString field named
<i>USE</i>.
* <br><br>
* <i>Tooltip:</i> USE means reuse an already DEF-ed node ID,
excluding all child nodes and all other attributes (except for
containerField, which can have a different value).
* <ul>
* <li> <i>Hint:</i> USE references to previously defined DEF
geometry (instead of duplicating nodes) can improve performance. </li>
* <li> <i>Warning:</i> do NOT include any child nodes, a DEF
attribute, or any other attribute values (except for containerField) when
defining a USE attribute. </li>
* <li> <i>Warning:</i> each USE value must match a corresponding
DEF value that is defined earlier in the scene. </li>
* </ul>
* @return {string} value of USE field
*/
public getUSE() : string {
return super.getUSE();
}
public setUSE$java_lang_String(newValue : string) : TransformObject
{
if(newValue == null) newValue = <string>new String();
if(!/* isEmpty */(newValue.length === 0) &&
!org.web3d.x3d.jsail.fields.SFStringObject.isNMTOKEN(newValue)) {
throw new
org.web3d.x3d.sai.InvalidFieldValueException("Transform USE newValue=\'" +
newValue + "\' has illegal name value, cannot be empty and must be defined
with valid NMTOKEN name string (with legal characters and no embedded
whitespace).");
}
this.setConcreteDEF("");
this.setConcreteUSE(newValue);
return this;
}
/**
* Accessor method to assign String value to inputOutput SFString
field named <i>USE</i>.
* <br><br>
* <i>Tooltip:</i> USE means reuse an already DEF-ed node ID,
excluding all child nodes and all other attributes (except for
containerField, which can have a different value).
* <ul>
* <li> <i>Hint:</i> USE references to previously defined DEF
geometry (instead of duplicating nodes) can improve performance. </li>
* <li> <i>Warning:</i> do NOT include any child nodes, a DEF
attribute, or any other attribute values (except for containerField) when
defining a USE attribute. </li>
* <li> <i>Warning:</i> each USE value must match a corresponding
DEF value that is defined earlier in the scene. </li>
* </ul>
* <br><br>
* <i>Note:</i> each <code>USE</code> node is still an independent
object, with the <code>USE</code> value matching the <code>DEF</code> value
in the preceding object.
* <br><br>
* <i>Warning:</i> invoking the <code>setUSE()</code> method on
this node resets all other fields to their default values (except for
containerField) and also releases all child nodes.<br><br>
* <i>Warning:</i> no other operations can be performed to modify a
USE node other than setting an alternate containerField value.
* @param {string} newValue is new value for the USE field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setUSE(newValue? : any) : any {
if(((typeof newValue === 'string') || newValue === null)) {
return <any>this.setUSE$java_lang_String(newValue);
} else if(((newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.fields.SFStringObject) || newValue === null)) {
return
<any>this.setUSE$org_web3d_x3d_jsail_fields_SFStringObject(newValue);
} else if(((newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.Grouping.TransformObject) || newValue === null)) {
return
<any>this.setUSE$org_web3d_x3d_jsail_Grouping_TransformObject(newValue);
} else if(((typeof newValue === 'string') || newValue ===
null)) {
throw new Error('cannot invoke abstract overloaded
method... check your argument(s) type(s)');
} else throw new Error('invalid overload');
}
public setUSE$org_web3d_x3d_jsail_fields_SFStringObject(newValue :
org.web3d.x3d.jsail.fields.SFStringObject) : TransformObject {
this.setUSE$java_lang_String(newValue.getPrimitiveValue());
return this;
}
/**
* Provide String value from inputOutput SFString field named
<i>class</i>.
* <br><br>
* <i>Tooltip:</i> The class attribute is a space-separated list of
classes, reserved for use by CSS cascading stylesheets.
* <ul>
* <li> <i>Warning:</i> currently the class attribute is only
supported in XML encoding of X3D scenes. </li>
* <li> <i>Hint:</i> W3C Cascading Style Sheets <a href="
https://www.w3.org/Style/CSS" target="_blank">https://www.w3.org/Style/CSS</a>
</li>
* </ul>
* @return {string} value of class field
*/
public getCssClass() : string {
return super.getCssClass();
}
public setCssClass$java_lang_String(newValue : string) :
TransformObject {
if(newValue == null) newValue = <string>new String();
this.setConcreteCssClass(newValue);
return this;
}
/**
* Accessor method to assign String value to inputOutput SFString
field named <i>class</i>.
* <br><br>
* <i>Tooltip:</i> The class attribute is a space-separated list of
classes, reserved for use by CSS cascading stylesheets.
* <ul>
* <li> <i>Warning:</i> currently the class attribute is only
supported in XML encoding of X3D scenes. </li>
* <li> <i>Hint:</i> W3C Cascading Style Sheets <a href="
https://www.w3.org/Style/CSS" target="_blank">https://www.w3.org/Style/CSS</a>
</li>
* </ul>
* @param {string} newValue is new value for the class field.
* @return {org.web3d.x3d.jsail.Grouping.TransformObject} {@link
TransformObject} - namely <i>this</i> same object to allow sequential
method pipelining (i.e. consecutive method invocations on the same object).
*/
public setCssClass(newValue? : any) : any {
if(((typeof newValue === 'string') || newValue === null)) {
return <any>this.setCssClass$java_lang_String(newValue);
} else if(((newValue != null && newValue instanceof
<any>org.web3d.x3d.jsail.fields.SFStringObject) || newValue === null)) {
return
<any>this.setCssClass$org_web3d_x3d_jsail_fields_SFStringObject(newValue);
} else if(((typeof newValue === 'string') || newValue ===
null)) {
throw new Error('cannot invoke abstract overloaded
method... check your argument(s) type(s)');
} else throw new Error('invalid overload');
}
public
setCssClass$org_web3d_x3d_jsail_fields_SFStringObject(newValue :
org.web3d.x3d.jsail.fields.SFStringObject) : TransformObject {
this.setCssClass$java_lang_String(newValue.getPrimitiveValue());
return this;
}
public setUSE$org_web3d_x3d_jsail_Grouping_TransformObject(DEFnode
: TransformObject) : TransformObject {
if(/* isEmpty */(DEFnode.getDEF().length === 0)) {
let errorNotice : string = "setUSE(DEFnode) invoked on
TransformObject that has no DEF name defined, thus a copy cannot be
referenced as a USE node";
this.validationResult.append(errorNotice).append("\n");
throw new
org.web3d.x3d.sai.InvalidFieldValueException(errorNotice);
}
this.setUSE$java_lang_String(DEFnode.getDEF());
return this;
}
public constructor(DEFlabel? : any) {
if(((typeof DEFlabel === 'string') || DEFlabel === null)) {
let __args = arguments;
super();
if(this.bboxCenter===undefined) this.bboxCenter = null;
if(this.bboxSize===undefined) this.bboxSize = null;
if(this.center===undefined) this.center = null;
if(this.IS===undefined) this.IS = null;
if(this.metadata===undefined) this.metadata = null;
if(this.metadataProtoInstance===undefined)
this.metadataProtoInstance = null;
if(this.rotation===undefined) this.rotation = null;
if(this.scale===undefined) this.scale = null;
if(this.scaleOrientation===undefined) this.scaleOrientation
= null;
if(this.translation===undefined) this.translation = null;
this.children = <any>(new java.util.ArrayList<any>());
if(this.bboxCenter===undefined) this.bboxCenter = null;
if(this.bboxSize===undefined) this.bboxSize = null;
if(this.center===undefined) this.center = null;
if(this.IS===undefined) this.IS = null;
if(this.metadata===undefined) this.metadata = null;
if(this.metadataProtoInstance===undefined)
this.metadataProtoInstance = null;
if(this.rotation===undefined) this.rotation = null;
if(this.scale===undefined) this.scale = null;
if(this.scaleOrientation===undefined) this.scaleOrientation
= null;
if(this.translation===undefined) this.translation = null;
(() => {
this.initialize();
this.setDEF$java_lang_String(DEFlabel);
})();
} else if(DEFlabel === undefined) {
let __args = arguments;
super();
if(this.bboxCenter===undefined) this.bboxCenter = null;
if(this.bboxSize===undefined) this.bboxSize = null;
if(this.center===undefined) this.center = null;
if(this.IS===undefined) this.IS = null;
if(this.metadata===undefined) this.metadata = null;
if(this.metadataProtoInstance===undefined)
this.metadataProtoInstance = null;
if(this.rotation===undefined) this.rotation = null;
if(this.scale===undefined) this.scale = null;
if(this.scaleOrientation===undefined) this.scaleOrientation
= null;
if(this.translation===undefined) this.translation = null;
this.children = <any>(new java.util.ArrayList<any>());
if(this.bboxCenter===undefined) this.bboxCenter = null;
if(this.bboxSize===undefined) this.bboxSize = null;
if(this.center===undefined) this.center = null;
if(this.IS===undefined) this.IS = null;
if(this.metadata===undefined) this.metadata = null;
if(this.metadataProtoInstance===undefined)
this.metadataProtoInstance = null;
if(this.rotation===undefined) this.rotation = null;
if(this.scale===undefined) this.scale = null;
if(this.scaleOrientation===undefined) this.scaleOrientation
= null;
if(this.translation===undefined) this.translation = null;
(() => {
this.initialize();
})();
} else throw new Error('invalid overload');
}
public toStringX3D$int(indentLevel : number) : string {
let hasAttributes : boolean = true;
let hasChild : boolean = (this.IS != null) ||
(!this.children.isEmpty()) || (this.IS != null) || (this.metadata != null)
|| (this.metadataProtoInstance != null);
if(this.isUSE()) hasChild = false;
let indent : java.lang.StringBuilder = new
java.lang.StringBuilder();
let indentIncrement : number =
org.web3d.x3d.jsail.ConfigurationProperties.getIndentIncrement();
let indentCharacter : string =
org.web3d.x3d.jsail.ConfigurationProperties.getIndentCharacter();
for(let i : number = 0; i < indentLevel; i++)
{indent.append(indentCharacter);}
let stringX3D : java.lang.StringBuilder = new
java.lang.StringBuilder();
stringX3D.append(indent).append("<Transform");
if(hasAttributes) {
if(!/* equals */(<any>((o1: any, o2: any) => { if(o1 &&
o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(this.getDEF(),org.web3d.x3d.jsail.X3DConcreteNode.DEF_DEFAULT_VALUE)) &&
!this.isUSE()) {
stringX3D.append("
DEF=\'").append(org.web3d.x3d.jsail.fields.SFStringObject.toString(this.getDEF())).append("\'");
}
if(!/* equals */(<any>((o1: any, o2: any) => { if(o1 &&
o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(this.getUSE(),org.web3d.x3d.jsail.X3DConcreteNode.USE_DEFAULT_VALUE))) {
stringX3D.append("
USE=\'").append(org.web3d.x3d.jsail.fields.SFStringObject.toString(this.getUSE())).append("\'");
}
if(!/* isEmpty */(this.getContainerFieldOverride().length
=== 0) && !/* equals */(<any>((o1: any, o2: any) => { if(o1 && o1.equals) {
return o1.equals(o2); } else { return o1 === o2; }
})(this.getContainerFieldOverride(),this.getContainerFieldDefault()))) {
stringX3D.append("
containerField=\'").append(this.getContainerFieldOverride()).append("\'");
}
if((!java.util.Arrays.equals(this.getBboxCenter(),
TransformObject.BBOXCENTER_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) &&
!this.isUSE()) {
stringX3D.append("
bboxCenter=\'").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getBboxCenter())).append("\'");
}
if((!java.util.Arrays.equals(this.getBboxSize(),
TransformObject.BBOXSIZE_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) &&
!this.isUSE()) {
stringX3D.append("
bboxSize=\'").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getBboxSize())).append("\'");
}
if((!java.util.Arrays.equals(this.getCenter(),
TransformObject.CENTER_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) &&
!this.isUSE()) {
stringX3D.append("
center=\'").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getCenter())).append("\'");
}
if((!/* equals */(<any>((o1: any, o2: any) => { if(o1 &&
o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(this.getCssClass(),org.web3d.x3d.jsail.X3DConcreteNode.CLASS_DEFAULT_VALUE))
|| org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes())
&& !this.isUSE()) {
stringX3D.append(" class=\'").append(new
org.web3d.x3d.jsail.fields.SFStringObject(this.getCssClass()).toStringX3D()).append("\'");
}
if((!java.util.Arrays.equals(this.getRotation(),
TransformObject.ROTATION_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) &&
!this.isUSE()) {
stringX3D.append("
rotation=\'").append(org.web3d.x3d.jsail.fields.SFRotationObject.toString(this.getRotation())).append("\'");
}
if((!java.util.Arrays.equals(this.getScale(),
TransformObject.SCALE_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) &&
!this.isUSE()) {
stringX3D.append("
scale=\'").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getScale())).append("\'");
}
if((!java.util.Arrays.equals(this.getScaleOrientation(),
TransformObject.SCALEORIENTATION_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) &&
!this.isUSE()) {
stringX3D.append("
scaleOrientation=\'").append(org.web3d.x3d.jsail.fields.SFRotationObject.toString(this.getScaleOrientation())).append("\'");
}
if((!java.util.Arrays.equals(this.getTranslation(),
TransformObject.TRANSLATION_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) &&
!this.isUSE()) {
stringX3D.append("
translation=\'").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getTranslation())).append("\'");
}
}
if((hasChild) && !this.isUSE()) {
stringX3D.append(">").append("\n");
if(this.metadata != null) {
stringX3D.append((<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).toStringX3D$int(indentLevel
+ indentIncrement));
} else if(this.metadataProtoInstance != null) {
stringX3D.append((<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).toStringX3D$int(indentLevel
+ indentIncrement));
}
if(this.IS != null) {
stringX3D.append((<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).toStringX3D$int(indentLevel
+ indentIncrement));
}
for(let
index3680=this.children.iterator();index3680.hasNext();) {
let element = index3680.next();
{
stringX3D.append((<org.web3d.x3d.jsail.X3DConcreteElement><any>element).toStringX3D$int(indentLevel
+ indentIncrement));
}
}
stringX3D.append(indent).append("</Transform>").append("\n");
} else {
stringX3D.append("/>").append("\n");
}
return stringX3D.toString();
}
/**
* Recursive method to provide X3D string serialization of this
model subgraph, utilizing XML encoding and conforming to X3D Canonical Form.
* @param {number} indentLevel number of levels of indentation for
this element
* @see X3DObject#FILE_EXTENSION_X3D
* @see X3DObject#FILE_EXTENSION_XML
* @see X3DObject#toStringXML()
* @see X3DObject#toFileXML(String)
* @see X3DObject#toFileX3D(String)
* @see <a href="
https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/X3D_XML.html">X3D
XML Encoding</a>
* @see <a href="
https://www.web3d.org/documents/specifications/19776-3/V3.3/Part03/concepts.html#X3DCanonicalForm"
target="blank">X3D Compressed Binary Encoding: X3D Canonical Form</a>
* @see <a href="
https://www.web3d.org/x3d/tools/canonical/doc/x3dTools.htm">X3D
Canonicalization (C14N) Tool</a>
* @return {string} X3D string
*/
public toStringX3D(indentLevel? : any) : any {
if(((typeof indentLevel === 'number') || indentLevel === null))
{
return <any>this.toStringX3D$int(indentLevel);
} else if(indentLevel === undefined) {
return <any>this.toStringX3D$();
} else throw new Error('invalid overload');
}
public toStringClassicVRML$int(indentLevel : number) : string {
let stringClassicVRML : java.lang.StringBuilder = new
java.lang.StringBuilder();
let hasAttributes : boolean = true;
let hasChild : boolean = (this.IS != null) ||
(!this.children.isEmpty()) || (this.IS != null) || (this.metadata != null)
|| (this.metadataProtoInstance != null);
if(this.isUSE()) {
hasAttributes = false;
hasChild = false;
}
let indent : java.lang.StringBuilder = new
java.lang.StringBuilder();
let indentCharacter : string =
org.web3d.x3d.jsail.ConfigurationProperties.getIndentCharacter();
let indentIncrement : number =
org.web3d.x3d.jsail.ConfigurationProperties.getIndentIncrement();
for(let i : number = 0; i < indentLevel; i++)
{indent.append(indentCharacter);}
if(!/* equals */(<any>((o1: any, o2: any) => { if(o1 &&
o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(this.getDEF(),org.web3d.x3d.jsail.X3DConcreteNode.DEF_DEFAULT_VALUE))) {
stringClassicVRML.append("DEF
").append(org.web3d.x3d.jsail.fields.SFStringObject.toString(this.getDEF())).append("
");
}
if(!/* equals */(<any>((o1: any, o2: any) => { if(o1 &&
o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(this.getUSE(),org.web3d.x3d.jsail.X3DConcreteNode.USE_DEFAULT_VALUE))) {
stringClassicVRML.append("USE
").append(org.web3d.x3d.jsail.fields.SFStringObject.toString(this.getUSE())).append("\n");
} else {
stringClassicVRML.append("Transform").append(" { ");
if(hasAttributes || hasChild) {
stringClassicVRML.append("\n").append(indent).append(indentCharacter);
}
if(hasAttributes) {
let hasISconnect : boolean = (this.getIS() != null) &&
!this.getIS().getConnectList().isEmpty();
if(hasISconnect) {
for(let
index3681=this.getIS().getConnectList().iterator();index3681.hasNext();) {
let element = index3681.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"bboxCenter"))) {
stringClassicVRML.append(indentCharacter).append("bboxCenter").append(" IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else
if(!java.util.Arrays.equals(this.getBboxCenter(),
TransformObject.BBOXCENTER_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("bboxCenter
").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getBboxCenter())).append("\n").append(indent).append(indentCharacter);
}
if(hasISconnect) {
for(let
index3682=this.getIS().getConnectList().iterator();index3682.hasNext();) {
let element = index3682.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"bboxSize"))) {
stringClassicVRML.append(indentCharacter).append("bboxSize").append(" IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else if(!java.util.Arrays.equals(this.getBboxSize(),
TransformObject.BBOXSIZE_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("bboxSize
").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getBboxSize())).append("\n").append(indent).append(indentCharacter);
}
if(hasISconnect) {
for(let
index3683=this.getIS().getConnectList().iterator();index3683.hasNext();) {
let element = index3683.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"center"))) {
stringClassicVRML.append(indentCharacter).append("center").append(" IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else if(!java.util.Arrays.equals(this.getCenter(),
TransformObject.CENTER_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("center
").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getCenter())).append("\n").append(indent).append(indentCharacter);
}
if(hasISconnect) {
for(let
index3684=this.getIS().getConnectList().iterator();index3684.hasNext();) {
let element = index3684.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"class"))) {
stringClassicVRML.append(indentCharacter).append("class").append(" IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else if(!/* equals */(<any>((o1: any, o2: any) => {
if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(this.getCssClass(),org.web3d.x3d.jsail.X3DConcreteNode.CLASS_DEFAULT_VALUE))
|| org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("# class
").append("\"").append(org.web3d.x3d.jsail.fields.SFStringObject.toString(this.getCssClass())).append("\"").append("\n").append(indent).append(indentCharacter);
}
if(hasISconnect) {
for(let
index3685=this.getIS().getConnectList().iterator();index3685.hasNext();) {
let element = index3685.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"rotation"))) {
stringClassicVRML.append(indentCharacter).append("rotation").append(" IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else if(!java.util.Arrays.equals(this.getRotation(),
TransformObject.ROTATION_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("rotation
").append(org.web3d.x3d.jsail.fields.SFRotationObject.toString(this.getRotation())).append("\n").append(indent).append(indentCharacter);
}
if(hasISconnect) {
for(let
index3686=this.getIS().getConnectList().iterator();index3686.hasNext();) {
let element = index3686.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"scale"))) {
stringClassicVRML.append(indentCharacter).append("scale").append(" IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else if(!java.util.Arrays.equals(this.getScale(),
TransformObject.SCALE_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("scale
").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getScale())).append("\n").append(indent).append(indentCharacter);
}
if(hasISconnect) {
for(let
index3687=this.getIS().getConnectList().iterator();index3687.hasNext();) {
let element = index3687.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"scaleOrientation"))) {
stringClassicVRML.append(indentCharacter).append("scaleOrientation").append("
IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else
if(!java.util.Arrays.equals(this.getScaleOrientation(),
TransformObject.SCALEORIENTATION_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("scaleOrientation
").append(org.web3d.x3d.jsail.fields.SFRotationObject.toString(this.getScaleOrientation())).append("\n").append(indent).append(indentCharacter);
}
if(hasISconnect) {
for(let
index3688=this.getIS().getConnectList().iterator();index3688.hasNext();) {
let element = index3688.next();
{
if(/* equals */(<any>((o1: any, o2: any) =>
{ if(o1 && o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(element.getNodeField(),"translation"))) {
stringClassicVRML.append(indentCharacter).append("translation").append(" IS
").append(element.getProtoField()).append("\n").append(indent).append(indentCharacter);
}
}
}
} else
if(!java.util.Arrays.equals(this.getTranslation(),
TransformObject.TRANSLATION_DEFAULT_VALUE_$LI$()) ||
org.web3d.x3d.jsail.ConfigurationProperties.isShowDefaultAttributes()) {
stringClassicVRML.append("translation
").append(org.web3d.x3d.jsail.fields.SFVec3fObject.toString(this.getTranslation())).append("\n").append(indent).append(indentCharacter);
}
}
}
if(hasChild) {
if(this.metadata != null) {
stringClassicVRML.append(indentCharacter).append("metadata").append(" ");
stringClassicVRML.append((<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).toStringClassicVRML$int(indentLevel
+ indentIncrement));
stringClassicVRML.append(indent);
} else if(this.metadataProtoInstance != null) {
stringClassicVRML.append(indentCharacter).append("metadata").append(" ");
stringClassicVRML.append((<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).toStringClassicVRML$int(indentLevel
+ indentIncrement));
stringClassicVRML.append(indent);
}
if(this.IS != null) {
stringClassicVRML.append((<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).toStringClassicVRML$int(indentLevel));
}
if(this.children.size() > 0) {
stringClassicVRML.append(indentCharacter).append(indentCharacter).append("children").append("
[").append("\n").append(indent).append(indentCharacter).append(indentCharacter);
for(let
index3689=this.children.iterator();index3689.hasNext();) {
let element = index3689.next();
{
stringClassicVRML.append((<org.web3d.x3d.jsail.X3DConcreteElement><any>element).toStringClassicVRML$int(indentLevel
+ indentIncrement + indentIncrement));
}
}
stringClassicVRML.append(indent).append(indentCharacter).append(indentCharacter).append("]").append("\n").append(indent);
}
}
if(hasAttributes || hasChild) {
stringClassicVRML.append("}").append("\n");
}
return stringClassicVRML.toString();
}
/**
* Recursive method to provide ClassicVRML string serialization.
* @param {number} indentLevel number of levels of indentation for
this element
* @see X3DObject#FILE_EXTENSION_CLASSICVRML
* @see <a href="
https://www.web3d.org/x3d/content/examples/X3dResources.html#VRML">X3D
Resources: Virtual Reality Modeling Language (VRML) 97</a>
* @see <a href="
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/X3D_ClassicVRML.html">Extensible
3D (X3D) encodings Part 2: Classic VRML encoding</a>
* @see <a href="
https://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.html">Extensible
3D (X3D) encodings Part 2: Classic VRML encoding, Annex A: Grammar</a>
* @return {string} ClassicVRML string
*/
public toStringClassicVRML(indentLevel? : any) : any {
if(((typeof indentLevel === 'number') || indentLevel === null))
{
return <any>this.toStringClassicVRML$int(indentLevel);
} else if(indentLevel === undefined) {
return <any>this.toStringClassicVRML$();
} else throw new Error('invalid overload');
}
public toStringVRML97$int(indentLevel : number) : string {
return this.toStringClassicVRML$int(indentLevel);
}
/**
* Recursive method to provide VRML97 string serialization.
* @param {number} indentLevel number of levels of indentation for
this element
* @see X3DObject#FILE_EXTENSION_VRML97
* @see <a href="
https://www.web3d.org/x3d/content/examples/X3dResources.html#VRML">X3D
Resources: Virtual Reality Modeling Language (VRML) 97</a>
* @see <a href="
https://www.web3d.org/documents/specifications/14772/V2.0/index.html">Virtual
Reality Modeling Language (VRML) 97 specification</a>
* @see <a href="
https://www.web3d.org/documents/specifications/14772-1/V2.1/index.html">VRML
97 v2.1 Amendment</a>
* @return {string} VRML97 string
*/
public toStringVRML97(indentLevel? : any) : any {
if(((typeof indentLevel === 'number') || indentLevel === null))
{
return <any>this.toStringVRML97$int(indentLevel);
} else if(indentLevel === undefined) {
return <any>this.toStringVRML97$();
} else throw new Error('invalid overload');
}
public findElementByNameValue$java_lang_String(nameValue : string)
: org.web3d.x3d.jsail.X3DConcreteElement {
return
this.findElementByNameValue$java_lang_String$java_lang_String(nameValue,
"");
}
public
findElementByNameValue$java_lang_String$java_lang_String(nameValue :
string, elementName : string) : org.web3d.x3d.jsail.X3DConcreteElement {
if((nameValue == null) || /* isEmpty */(nameValue.length ===
0)) {
let errorNotice : string = "findElementByNameValue(\"\", "
+ elementName + ") cannot use empty string to find a name attribute";
this.validationResult.append(errorNotice).append("\n");
throw new
org.web3d.x3d.sai.InvalidFieldValueException(errorNotice);
}
let referenceElement : org.web3d.x3d.jsail.X3DConcreteElement;
for(let
index3690=this.children.iterator();index3690.hasNext();) {
let element = index3690.next();
{
if(element != null && element instanceof
<any>org.web3d.x3d.jsail.X3DConcreteElement) {
referenceElement =
(<org.web3d.x3d.jsail.X3DConcreteElement><any>element).findElementByNameValue$java_lang_String$java_lang_String(nameValue,
elementName);
if(referenceElement != null) return
referenceElement;
}
}
}
if(this.IS != null) {
referenceElement =
(<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).findElementByNameValue$java_lang_String$java_lang_String(nameValue,
elementName);
if(referenceElement != null) return referenceElement;
}
if(this.metadata != null) {
referenceElement =
(<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).findElementByNameValue$java_lang_String$java_lang_String(nameValue,
elementName);
if(referenceElement != null) return referenceElement;
}
if(this.metadataProtoInstance != null) {
referenceElement =
(<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).findElementByNameValue$java_lang_String$java_lang_String(nameValue,
elementName);
if(referenceElement != null) return referenceElement;
}
return null;
}
/**
* 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.
* <br ><br >
* <i>Warning:</i> first start with findAncestorSceneObject() to
check entire scene graph, or findAncestorX3DObject() to check entire model
document.
* <br ><br >
* <i>Warning:</i> more than one element may be found that has the
same name, this method does not handle that case.
* @see #findNodeByDEF(String)
* @see X3DConcreteElement#hasAncestorSceneObject()
* @see
org.web3d.x3d.jsail.X3DConcreteElement#findAncestorX3DObject()
* @param {string} nameValue is value of the name field being
searched for in this element and child elements(if any)
* @param {string} elementName identifies the element of interest
(meta MetadataString ProtoDeclare CADassembly ProtoInstance HAnimHumanoid
etc.)
* @return {org.web3d.x3d.jsail.X3DConcreteElement} object
reference to found element, null otherwise
*/
public findElementByNameValue(nameValue? : any, elementName? : any)
: any {
if(((typeof nameValue === 'string') || nameValue === null) &&
((typeof elementName === 'string') || elementName === null)) {
return
<any>this.findElementByNameValue$java_lang_String$java_lang_String(nameValue,
elementName);
} else if(((typeof nameValue === 'string') || nameValue ===
null) && elementName === undefined) {
return
<any>this.findElementByNameValue$java_lang_String(nameValue);
} else throw new Error('invalid overload');
}
/**
* Recursive method to determine whether node or statement with
given name attribute is found, meaning both objects are attached to same
scene graph.
* @param {string} nameValue is value of the name field being
searched for in this element and child elements(if any)
* @param {string} elementName identifies the element of interest
(meta MetadataString ProtoDeclare CADassembly ProtoInstance HAnimHumanoid
etc.)
* @see #findElementByNameValue(String, String)
* @return {boolean} whether node is found
*/
public hasElementByNameValue(nameValue : string, elementName :
string) : boolean {
return
(this.findElementByNameValue$java_lang_String$java_lang_String(nameValue,
elementName) != null);
}
/**
* Recursive method to provide object reference to node by DEF, if
found as this node or in a contained node.
* <br ><br >
* <i>Warning:</i> first start with findAncestorSceneObject() to
check entire scene graph, or findAncestorX3DObject() to check entire model
document.
* <br ><br >
* <i>Warning:</i> more than one element may be found that has the
same DEF, this method does not handle that case.
* @see #findElementByNameValue(String)
* @see X3DConcreteElement#hasAncestorSceneObject()
* @see
org.web3d.x3d.jsail.X3DConcreteElement#findAncestorX3DObject()
* @param {string} DEFvalue is value of the name field being
searched for in this element and child elements(if any)
* @return {org.web3d.x3d.jsail.X3DConcreteNode} object reference
to found node, null otherwise
*/
public findNodeByDEF(DEFvalue : string) :
org.web3d.x3d.jsail.X3DConcreteNode {
if((DEFvalue == null) || /* isEmpty */(DEFvalue.length === 0)) {
let errorNotice : string = "findNodeByDEF(\"\") cannot use
empty string to find a name";
this.validationResult.append(errorNotice).append("\n");
throw new
org.web3d.x3d.sai.InvalidFieldValueException(errorNotice);
}
if(/* equals */(<any>((o1: any, o2: any) => { if(o1 &&
o1.equals) { return o1.equals(o2); } else { return o1 === o2; }
})(this.getDEF(),DEFvalue))) return this;
let referenceNode : org.web3d.x3d.jsail.X3DConcreteNode;
for(let
index3691=this.children.iterator();index3691.hasNext();) {
let element = index3691.next();
{
if(element != null && element instanceof
<any>org.web3d.x3d.jsail.X3DConcreteNode) {
referenceNode =
(<org.web3d.x3d.jsail.X3DConcreteElement><any>element).findNodeByDEF(DEFvalue);
if(referenceNode != null) return referenceNode;
}
}
}
if(this.IS != null) {
referenceNode =
(<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).findNodeByDEF(DEFvalue);
if(referenceNode != null) return referenceNode;
}
if(this.metadata != null) {
referenceNode =
(<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).findNodeByDEF(DEFvalue);
if(referenceNode != null) return referenceNode;
}
if(this.metadataProtoInstance != null) {
referenceNode =
(<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).findNodeByDEF(DEFvalue);
if(referenceNode != null) return referenceNode;
}
return null;
}
/**
* Recursive method to determine whether node with DEFvalue is
found, meaning both objects are attached to same scene graph.
* @param {string} DEFvalue is value of the name field being
searched for in this element and child elements(if any)
* @see #findNodeByDEF(String)
* @return {boolean} whether node is found
*/
public hasNodeByDEF(DEFvalue : string) : boolean {
return (this.findNodeByDEF(DEFvalue) != null);
}
/**
* 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.
* @return {string} validation results (if any)
*/
public validate() : string {
this.validationResult = new java.lang.StringBuilder();
this.setBboxCenter$float_A(this.getBboxCenter());
this.setBboxSize$float_A(this.getBboxSize());
this.setCenter$float_A(this.getCenter());
this.setRotation$float_A(this.getRotation());
this.setScale$float_A(this.getScale());
this.setScaleOrientation$float_A(this.getScaleOrientation());
this.setTranslation$float_A(this.getTranslation());
if(!this.isUSE()) this.setDEF$java_lang_String(this.getDEF());
if(this.isUSE()) this.setUSE$java_lang_String(this.getUSE());
this.setCssClass$java_lang_String(this.getCssClass());
for(let
index3692=this.children.iterator();index3692.hasNext();) {
let element = index3692.next();
{
(<org.web3d.x3d.jsail.X3DConcreteElement><any>element).validate();
this.validationResult.append((<org.web3d.x3d.jsail.X3DConcreteElement><any>element).getValidationResult());
}
}
this.setChildren$org_web3d_x3d_sai_Core_X3DNode_A(this.getChildren());
if(this.isUSE() && this.hasChildren()) {
let errorNotice : string = "Transform USE=\'" +
this.getUSE() + "\' is not allowed to have contained MFNode children";
this.validationResult.append(errorNotice);
throw new
org.web3d.x3d.sai.InvalidFieldValueException(errorNotice);
}
if(this.IS != null) {
this.setIS(this.getIS());
(<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).validate();
this.validationResult.append((<org.web3d.x3d.jsail.X3DConcreteElement>this.IS).getValidationResult());
}
if(this.isUSE() && this.hasIS()) {
let errorNotice : string = "Transform USE=\'" +
this.getUSE() + "\' is not allowed to have contained SFNode IS";
this.validationResult.append(errorNotice);
throw new
org.web3d.x3d.sai.InvalidFieldValueException(errorNotice);
}
if(this.metadata != null) {
this.setMetadata$org_web3d_x3d_sai_Core_X3DMetadataObject(this.getMetadata());
(<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).validate();
this.validationResult.append((<org.web3d.x3d.jsail.X3DConcreteElement><any>this.metadata).getValidationResult());
}
if(this.metadataProtoInstance != null) {
this.setMetadata$org_web3d_x3d_jsail_Core_ProtoInstanceObject(this.getMetadataProtoInstance());
(<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).validate();
this.validationResult.append((<org.web3d.x3d.jsail.X3DConcreteElement>this.metadataProtoInstance).getValidationResult());
}
if((this.metadata != null) && (this.metadataProtoInstance !=
null)) {
let errorNotice : string = "Internal X3DJSAIL error:
incorrect handling of contained SFNode field, both metadata and
metadataProtoInstance are set simultaneously";
this.validationResult.append(errorNotice);
throw new
org.web3d.x3d.sai.InvalidProtoException(errorNotice);
}
if(this.isUSE() && this.hasMetadata()) {
let errorNotice : string = "Transform USE=\'" +
this.getUSE() + "\' is not allowed to have contained SFNode metadata";
this.validationResult.append(errorNotice);
throw new
org.web3d.x3d.sai.InvalidFieldValueException(errorNotice);
}
if(this.getIS() != null) {
if(this.getIS().getConnectList().isEmpty()) {
let errorNotice : string = "IS statement present, but
contains no connect statements";
this.validationResult.append(errorNotice).append("\n");
throw new
org.web3d.x3d.sai.InvalidProtoException(errorNotice);
}
}
if(!/* isEmpty */(this.getContainerFieldOverride().length ===
0) &&
!java.util.Arrays.asList<any>(this.containerField_ALTERNATE_VALUES).contains(this.getContainerFieldOverride()))
{
let errorNotice : string =
org.web3d.x3d.jsail.ConfigurationProperties.ERROR_ILLEGAL_VALUE + ":
illegal value encountered, containerField=\'" +
this.getContainerFieldOverride() + "\' but allowed values are
containerField_ALTERNATE_VALUES=\'" + new
org.web3d.x3d.jsail.fields.MFStringObject(this.containerField_ALTERNATE_VALUES).toStringX3D()
+ "\'.";
this.validationResult.append(errorNotice).append("\n");
throw new
org.web3d.x3d.sai.InvalidFieldException(errorNotice);
}
if(this.findAncestorX3DObject() != null) {
let modelProfile : string =
this.findAncestorX3DObject().getProfile();
let hasSatisfactorySupport : boolean =
this.findAncestorX3DObject().supportsX3dComponent(TransformObject.COMPONENT,
TransformObject.LEVEL);
if(!hasSatisfactorySupport) {
let errorNotice : string =
org.web3d.x3d.jsail.ConfigurationProperties.ERROR_ILLEGAL_VALUE + "
insufficient X3D profile=\'" + modelProfile + "\' for parent X3D model
containing \'Transform\' node, add head statement <component
name=\'Grouping\' level=\'1\'/>\nor Java source-code assignment:
findAncestorX3DObject().getHead().addComponent(\"Grouping\").setLevel(1);";
this.validationResult.append(errorNotice).append("\n");
throw new
org.web3d.x3d.sai.InvalidFieldException(errorNotice);
}
}
return this.validationResult.toString();
}
}
TransformObject["__class"] =
"org.web3d.x3d.jsail.Grouping.TransformObject";
TransformObject["__interfaces"] =
["org.web3d.x3d.sai.Grouping.Transform","org.web3d.x3d.sai.Core.X3DNode","org.web3d.x3d.sai.Grouping.X3DBoundedObject","org.web3d.x3d.sai.Grouping.X3DGroupingNode","org.web3d.x3d.sai.Core.X3DChildNode"];
}
org.web3d.x3d.jsail.Grouping.TransformObject.TRANSLATION_DEFAULT_VALUE_$LI$();
org.web3d.x3d.jsail.Grouping.TransformObject.SCALEORIENTATION_DEFAULT_VALUE_$LI$();
org.web3d.x3d.jsail.Grouping.TransformObject.SCALE_DEFAULT_VALUE_$LI$();
org.web3d.x3d.jsail.Grouping.TransformObject.ROTATION_DEFAULT_VALUE_$LI$();
org.web3d.x3d.jsail.Grouping.TransformObject.CENTER_DEFAULT_VALUE_$LI$();
org.web3d.x3d.jsail.Grouping.TransformObject.BBOXSIZE_DEFAULT_VALUE_$LI$();
org.web3d.x3d.jsail.Grouping.TransformObject.BBOXCENTER_DEFAULT_VALUE_$LI$();
On Thu, Apr 9, 2020 at 6:52 PM John Carlson <yottzumm at gmail.com> wrote:
> Matrix transform class implementation in different toolkits:
>
> X3DOM:
> https://github.com/x3dom/x3dom/blob/master/src/nodes/Grouping/Transform.js
>
> X_ITE:
> https://github.com/create3000/x_ite/blob/master/src/x_ite/Components/Grouping/Transform.js
>
> Three.js:
> https://threejs.org/docs/#manual/en/introduction/Matrix-transformations
>
> TypeScript: TBD, not checked in. Cannot unpack zip on my server.
>
>
> On Thu, Apr 9, 2020 at 12:07 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Trying to understand why SAI is so difficult to take out of X_ITE and put
>> in X3DOM.
>>
>> Under x3dom, there's:
>>
>> ~/x3dom/src/nodes (master)
>> $ ls
>> BVHRefiner/ Geometry3D/ Navigation/ Sound/
>> CADGeometry/ Geometry3DExt/ Networking/ Text/
>> Core/ Geospatial/ NURBS/ Texturing/
>> CubeMapTexturing/ Grouping/ PointingDeviceSensor/ Texturing3D/
>> EnvironmentalEffects/ H-Anim/ Rendering/ Time/
>> EventUtilities/ Interpolation/ RigidBodyPhysics/
>> VolumeRendering/
>> Followers/ Layout/ Shaders/
>> Geometry2D/ Lighting/ Shape/
>>
>> Under X_ITE, there's:
>>
>> ~/x_ite/src/x_ite (master)
>> $ ls Browser/ Components
>> Browser/:
>> Core/ Navigation/ Sound/
>> EnvironmentalEffects/ Networking/ Text/
>> Followers/ NURBS/ Texturing/
>> Geometry2D/ ParticleSystems/ Texturing3D/
>> Geometry3D/ Picking/ Time/
>> Geospatial/ PointingDeviceSensor/ VERSION.js
>> Interpolation/ Rendering/ VolumeRendering/
>> KeyDeviceSensor/ RigidBodyPhysics/ X3DBrowser.js
>> Layering/ Scripting/ X3DBrowserContext.js
>> Layout/ Shaders/
>> Lighting/ Shape/
>>
>> Components:
>> Annotation/ H-Anim/ Rendering/
>> CADGeometry/ Interpolation/ Rendering.js
>> Core/ Interpolation.js RigidBodyPhysics/
>> Core.js KeyDeviceSensor/ Scripting/
>> CubeMapTexturing/ Layering/ Shaders/
>> DIS/ Layering.js Shaders.js
>> EnvironmentalEffects/ Layout/ Shape/
>> EnvironmentalEffects.js Lighting/ Shape.js
>> EnvironmentalSensor/ Lighting.js Sound/
>> EnvironmentalSensor.js Navigation/ Sound.js
>> EventUtilities/ Navigation.js Text/
>> Followers/ Networking/ Text.js
>> Followers.js Networking.js Texturing/
>> Geometry2D/ NURBS/ Texturing.js
>> Geometry3D/ ParticleSystems/ Texturing3D/
>> Geometry3D.js Picking/ Time/
>> Geospatial/ PointingDeviceSensor/ Time.js
>> Grouping/ PointingDeviceSensor.js VolumeRendering/
>> Grouping.js ProjectiveTextureMapping/ X_ITE/
>>
>>
>> Suggestion: We create test cases with X3dToES5.xslt (or similar)
>> targeting X_ITE's SAI. Once we have that working satisfactorily, we go
>> ahead and write either an XSLT file or Python file to generate additional
>> classes not currently covered by X_ITE.
>>
>> I think that Holger would appreciate the additional help on testing and
>> fleshing out the X_ITE SAI.
>>
>> This seems like a good thing to do, and I am accepting of it.
>>
>> John
>>
>>
>>
>> On Wed, Mar 25, 2020 at 8:47 AM Andreas Plesch <andreasplesch at gmail.com>
>> wrote:
>>
>>> Hi John, Don,
>>>
>>> I am trying to follow the discussion somewhat but have quite limited
>>> availability now.
>>>
>>> Here are some considerations, unfortunately quite unconnected.
>>>
>>> Ecmascript best practices
>>>
>>> It is not clear that there are commonly accepted standards since the
>>> language is forgiving having evolved so much. But here are perhaps
>>> some guides. An often encountered viewpoint is that the language is
>>> not very OO oriented but rather functional in nature. So OO principles
>>> do not necessarily apply but could be used anyways. There are now
>>> classes in Ecmascript although my understanding is that they are
>>> largely considered syntactical sugar. Another principle is that since
>>> it is a largely interpreted language which relies on garbage
>>> collection, object reuse is favored over object creation and
>>> destruction. Three.js, for example, is very strict about this, and
>>> part of the reason why it is performing well. x3dom is not very strict
>>> about this on the other hand, and still does ok. As node.js is a
>>> target one needs to be careful to distinguish between DOM/browser
>>> features and language features. Node.js natively does not have DOM
>>> methods but a DOM and methods can be added with a library. Also, keep
>>> in mind that currently there is no X3D runtime for node.js.
>>> x3dom/x_ite cannot be run in node.js. So one, expensive, experiment
>>> would be to try to extract a node compatible runtime by separating the
>>> rendering and input controls out of these engines.
>>>
>>> Scene Authoring/Construction versus Scene Access
>>>
>>> Ecmascript differs from Python or Java in that it is the primary
>>> language for X3D scripts used internally in scenes, and externally to
>>> access scenes in running browsers. This is what the current SAI spec.
>>> defines, and what I understand to be Scene Access. This includes but
>>> is not limited to constructing new nodes and entire scenes
>>> programmatically. In addition to construction, SAI also allows for
>>> controling a browser, and modifying a running scene. In contrast,
>>> X3DJ/PSAIL is limited to constructing and authoring a scene which can
>>> eventually be serialized as xml or json, and be used to load into X3D
>>> browser. It seems perhaps prudent for now to parallel X3DJSAIL and
>>> just focus on scene authoring, and not be concerned about live scene
>>> control and modification.
>>>
>>> JSON
>>>
>>> Since the X3D JSON encoding now exists, a useful and specific question
>>> is if the Ecmascript JSON.parse() function
>>> (
>>> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
>>> )
>>> should return a value which can be immediately used by the envisioned
>>> library given a JSON encoded string. Conversely, should the Ecmascript
>>> JSON.stringify() function generate directly X3D JSON encoding if given
>>> a library generated object ?
>>>
>>> -Andreas
>>>
>>>
>>>
>>> On Tue, Mar 24, 2020 at 9:20 AM Don Brutzman <brutzman at nps.edu> wrote:
>>> >
>>> > John, certainly we need to pay attention to "how" a library conversion
>>> is performed. JSweet is promising, and we have a number of conversion
>>> approached demonstrated already.
>>> >
>>> > But that is distracting and confusing way to solve a problem and leads
>>> to "fire, ready, aim!" implementation pathologies.
>>> >
>>> > A further risk might be that JSweet might carry through unnecessary
>>> Java programming idioms, but presumably they have sorted through that well
>>> already.
>>> >
>>> > First things first, please. Let's begin with defining design goals.
>>> That's how we accomplished creating Java and Python programming-language
>>> bindings for X3D.
>>> >
>>> > What we really need to understand is "what" a sharable X3D JavaScript
>>> library looks like, and how JavaScript programmers might then use it to
>>> author interactive X3D models.
>>> >
>>> > Authoring use-case environments are
>>> > 1. Script inside X3D scene graph,
>>> > 2. Script in outer HTML5 web page,
>>> > 3. Standalone programmatic use in node.js
>>> >
>>> > Now get specific. Recommend listing pseudocode and design patterns
>>> for JavaScript Transform class and JavaScript X3D types, comparing:
>>> >
>>> > a. X3D ECMAScript specification,
>>> > b. X3D Script code fields (class variables) and methods,
>>> > c. good general-practice OO design pattern(s) in common use,
>>> > d. current X3D JSON approach, is it OK or improvable further?
>>> > e. compare/contrast Transform approach with X3DJSONLD,
>>> > f. compare/contrast Transform approach with X_ITE,
>>> > g. compare/contrast Transform approach with X3DOM,
>>> > h. compare/contrast Transform approach with three.js,
>>> > j. compare/contrast Transform approach with any other javascript
>>> libraries of interest,
>>> > i. compatibility of Transform approach with Angular, React, jquery,
>>> other common JavaScript frameworks for HTML.
>>> >
>>> > We did this kind of comparison for X3D JSON design and it helped make
>>> a confusing understandable, eventually leading to good design decisions.
>>> >
>>> > If interested parties prepare this kind of comparison, and understand
>>> "what" we want that has general appeal, then progress refinement will be
>>> straightforward.
>>> >
>>> > Many people use JavaScript these days, especially with node.js - check
>>> whether they like the result.
>>> >
>>> > When you have solid patterns then we convert 4,000 X3D example scenes
>>> (from .x3d -> .js) to match, providing unit tests. Lather, rinse, repeat...
>>> >
>>> > Hope this outline helps. Good luck out there! 8)
>>> >
>>> > all the best, Don
>>> > --
>>> > Don Brutzman Naval Postgraduate School, Code USW/Br
>>> brutzman at nps.edu
>>> > Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA
>>> +1.831.656.2149
>>> > X3D graphics, virtual worlds, navy robotics
>>> http://faculty.nps.edu/brutzman
>>>
>>>
>>>
>>> --
>>> Andreas Plesch
>>> Waltham, MA 02453
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200409/dd1edb4a/attachment-0001.html>
More information about the x3d-public
mailing list