H3D API  2.4.1
Classes | Namespaces | Typedefs | Enumerations | Functions
SpiderMonkeyTypes.h File Reference

Header file for type definitions for SAI ECMAScript implementation using the SpiderMonkey javascript engine. More...

#include <iostream>
#include <H3D/SFMatrix3f.h>
#include <H3D/SFMatrix4f.h>
#include <H3D/SFFloat.h>
#include <H3D/SFDouble.h>
#include <H3D/SFTime.h>
#include <H3D/SFInt32.h>
#include <H3D/SFString.h>
#include <H3D/SFVec3f.h>
#include <H3D/SFVec3d.h>
#include <H3D/SFVec4f.h>
#include <H3D/SFVec4d.h>
#include <H3D/SFVec2f.h>
#include <H3D/SFVec2d.h>
#include <H3D/SFColor.h>
#include <H3D/SFRotation.h>
#include <H3D/SFNode.h>
#include <H3D/SFBool.h>
#include <H3D/X3DTexture2DNode.h>
#include <H3D/MFFloat.h>
#include <H3D/MFDouble.h>
#include <H3D/MFTime.h>
#include <H3D/MFInt32.h>
#include <H3D/MFString.h>
#include <H3D/MFVec3f.h>
#include <H3D/MFVec3d.h>
#include <H3D/MFVec2f.h>
#include <H3D/MFVec2d.h>
#include <H3D/MFVec4f.h>
#include <H3D/MFVec4d.h>
#include <H3D/MFColor.h>
#include <H3D/MFRotation.h>
#include <H3D/MFNode.h>
#include <H3D/MFBool.h>
#include <H3D/SAIFunctions.h>
#include <jsapi.h>

Go to the source code of this file.

Classes

class  H3D::SpiderMonkey::PointerPrivateData< PointerType >
 Class used as the private data in field JSObject classes. More...
 
class  H3D::SpiderMonkey::SFMatrix3fRow
 X3DMatrix3. More...
 
class  H3D::SpiderMonkey::SFMatrix4fRow
 X3DMatrix4. More...
 
struct  H3D::SpiderMonkey::JS_MField< MFieldType, ElementType >
 MField template. More...
 

Namespaces

 H3D
 H3D API namespace.
 

Typedefs

typedef X3DTexture2DNode::SFImage H3D::SpiderMonkey::SFImage
 SFImage.
 
typedef JS_MField< MFFloat, SFFloat > H3D::SpiderMonkey::JS_MFFloat
 The JSAPI type encapsulating an MFFloat object.
 
typedef JS_MField< MFDouble, SFDouble > H3D::SpiderMonkey::JS_MFDouble
 The JSAPI type encapsulating an MFDouble object.
 
typedef JS_MField< MFTime, SFTime > H3D::SpiderMonkey::JS_MFTime
 The JSAPI type encapsulating an MFTime object.
 
typedef JS_MField< MFInt32, SFInt32 > H3D::SpiderMonkey::JS_MFInt32
 The JSAPI type encapsulating an MFInt32 object.
 
typedef JS_MField< MFVec2f, SFVec2f > H3D::SpiderMonkey::JS_MFVec2f
 The JSAPI type encapsulating an MFVec2f object.
 
typedef JS_MField< MFVec2d, SFVec2d > H3D::SpiderMonkey::JS_MFVec2d
 The JSAPI type encapsulating an MFVec2d object.
 
typedef JS_MField< MFVec3f, SFVec3f > H3D::SpiderMonkey::JS_MFVec3f
 The JSAPI type encapsulating an MFVec3f object.
 
typedef JS_MField< MFVec3d, SFVec3d > H3D::SpiderMonkey::JS_MFVec3d
 The JSAPI type encapsulating an MFVec3f object.
 
typedef JS_MField< MFVec4f, SFVec4f > H3D::SpiderMonkey::JS_MFVec4f
 The JSAPI type encapsulating an MFVec4f object.
 
typedef JS_MField< MFVec4d, SFVec4d > H3D::SpiderMonkey::JS_MFVec4d
 The JSAPI type encapsulating an MFVec4d object.
 
typedef JS_MField< MFBool, SFBool > H3D::SpiderMonkey::JS_MFBool
 The JSAPI type encapsulating an MFBool object.
 
typedef JS_MField< MFString, SFString > H3D::SpiderMonkey::JS_MFString
 The JSAPI type encapsulating an MFString object.
 
typedef JS_MField< MFNode, SFNode > H3D::SpiderMonkey::JS_MFNode
 The JSAPI type encapsulating an MFNode object.
 
typedef JS_MField< MFColor, SFColor > H3D::SpiderMonkey::JS_MFColor
 The JSAPI type encapsulating an MFColor object.
 
typedef JS_MField< MFRotation, SFRotation > H3D::SpiderMonkey::JS_MFRotation
 The JSAPI type encapsulating an MFRotation object.
 

Enumerations

enum  H3D::SpiderMonkey::SFVec2fPropertyId
 SFVec2f.
 
enum  H3D::SpiderMonkey::SFVec2dPropertyId
 SFVec2d.
 
enum  H3D::SpiderMonkey::SFVec3fPropertyId
 SFVec3f.
 
enum  H3D::SpiderMonkey::SFVec3dPropertyId
 SFVec3d.
 
enum  H3D::SpiderMonkey::SFVec4fPropertyId
 SFVec4f.
 
enum  H3D::SpiderMonkey::SFVec4dPropertyId
 SFVec4d.
 
enum  H3D::SpiderMonkey::SFRotationPropertyId
 SFRotation.
 
enum  H3D::SpiderMonkey::SFColorPropertyId
 SFColor.
 
enum  H3D::SpiderMonkey::X3DExecutionContextPropertyId
 X3DExecutionContext.
 
enum  H3D::SpiderMonkey::X3DScenePropertyId
 X3DScene.
 

Functions

void H3D::SpiderMonkey::setJSException (JSContext *cx, const SAI::SAIError &e)
 Set a JS API exception based on the c++ SAIError exception.
 
bool H3D::SpiderMonkey::insertH3DTypes (JSContext *cx, JSObject *obj)
 Insert the H3D data types, such as SFFloat, MFInt32 etc into the context and object given.
 
jsval H3D::SpiderMonkey::jsvalFromField (JSContext *cx, Field *f, bool make_copy, int array_index=-1, X3DTypes::X3DType x3dt=X3DTypes::UNKNOWN_X3D_TYPE)
 Create a jsval object containing the value of the field(and possibly encapsulating the field). More...
 
JSBool H3D::SpiderMonkey::setFieldValueFromjsval (JSContext *cx, Field *f, jsval v)
 Sets the field value to the value of the jsval v. More...
 
JSBool H3D::SpiderMonkey::haveFunction (JSContext *cx, JSObject *obj, const char *name)
 Returns JS_TRUE if the name is a function in the given object.
 
template<class PointerType >
void H3D::SpiderMonkey::PrivatePointer_finalize (JSContext *cx, JSObject *obj)
 Destruct callback for JSObject with a private datamember. More...
 
JSBool H3D::SpiderMonkey::FieldObject_toString (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Callback function for converting a JSObject with a FieldObjectPrivate private data member to a JSString. More...
 
JSObject * H3D::SpiderMonkey::SFVec2f_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFVec2f object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFVec2f_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFVec2f object.
 
JSBool H3D::SpiderMonkey::SFVec2f_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFVec2f object.
 
JSBool H3D::SpiderMonkey::SFVec2f_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFVec2f.
 
JSObject * H3D::SpiderMonkey::SFVec2d_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFVec2d object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFVec2d_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFVec2d object.
 
JSBool H3D::SpiderMonkey::SFVec2d_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFVec2d object.
 
JSBool H3D::SpiderMonkey::SFVec2d_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFVec2d.
 
JSObject * H3D::SpiderMonkey::SFImage_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFImage object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFImage_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFImage object.
 
JSBool H3D::SpiderMonkey::SFImage_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFImage object.
 
JSBool H3D::SpiderMonkey::SFImage_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFImage.
 
JSObject * H3D::SpiderMonkey::SFVec3f_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFVec3f object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFVec3f_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFVec3f object.
 
JSBool H3D::SpiderMonkey::SFVec3f_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFVec3f object.
 
JSBool H3D::SpiderMonkey::SFVec3f_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFVec3f.
 
JSBool H3D::SpiderMonkey::X3DMatrix3_getTransform (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 X3DMATRIX3.
 
JSBool H3D::SpiderMonkey::X3DMatrix4_setTransform (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 
JSBool H3D::SpiderMonkey::X3DMatrix4_getTransform (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 X3DMatrix4.
 
JSObject * H3D::SpiderMonkey::SFVec3d_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFVec3d object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFVec3d_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFVec3d object.
 
JSBool H3D::SpiderMonkey::SFVec3d_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFVec3d object.
 
JSBool H3D::SpiderMonkey::SFVec3d_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFVec3d.
 
JSObject * H3D::SpiderMonkey::SFVec4f_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFVec4f object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFVec4f_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFVec4f object.
 
JSBool H3D::SpiderMonkey::SFVec4f_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFVec4f object.
 
JSBool H3D::SpiderMonkey::SFVec4f_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFVec4f.
 
JSObject * H3D::SpiderMonkey::SFVec4d_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFVec4d object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFVec4d_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFVec4d object.
 
JSBool H3D::SpiderMonkey::SFVec4d_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFVec4d object.
 
JSBool H3D::SpiderMonkey::SFVec4d_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFVec4d.
 
JSObject * H3D::SpiderMonkey::SFRotation_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFRotation object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFRotation_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFRotation object.
 
JSBool H3D::SpiderMonkey::SFRotation_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFRotation object.
 
JSBool H3D::SpiderMonkey::SFRotation_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFRotation.
 
JSObject * H3D::SpiderMonkey::SFNode_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 SFNode. More...
 
JSBool H3D::SpiderMonkey::SFNode_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFNode object.
 
JSBool H3D::SpiderMonkey::SFNode_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFNode object.
 
JSBool H3D::SpiderMonkey::SFNode_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFNode.
 
JSObject * H3D::SpiderMonkey::SFColor_newInstance (JSContext *cx, Field *field, bool internal_field, int array_index=-1)
 Returns a new SFColor object encapsulating a field. More...
 
JSBool H3D::SpiderMonkey::SFColor_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a SFColor object.
 
JSBool H3D::SpiderMonkey::SFColor_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a SFColor object.
 
JSBool H3D::SpiderMonkey::SFColor_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of SFColor.
 
JSObject * H3D::SpiderMonkey::X3DExecutionContext_newInstance (JSContext *cx, SAI::ExecutionContext *field, bool internal_field)
 Returns a new X3DExecutionContext object encapsulating a SAI::ExecutionContext object. More...
 
JSBool H3D::SpiderMonkey::X3DExecutionContext_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a X3DExecutionContext object.
 
JSBool H3D::SpiderMonkey::X3DExecutionContext_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a X3DExecutionContext object.
 
JSBool H3D::SpiderMonkey::X3DExecutionContext_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of X3DExecutionContext.
 
JSObject * H3D::SpiderMonkey::X3DScene_newInstance (JSContext *cx, SAI::SAIScene *field, bool internal_field)
 Returns a new X3DScene object encapsulating a SAI::ExecutionContext object. More...
 
JSBool H3D::SpiderMonkey::X3DScene_setProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback setter function for properties of a X3DScene object.
 
JSBool H3D::SpiderMonkey::X3DScene_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Callback getter function for properties of a X3DScene object.
 
JSBool H3D::SpiderMonkey::X3DScene_construct (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 Construct callback function for creating a new instance of X3DScene.
 
JSBool H3D::SpiderMonkey::Browser_getProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 Browser.
 

Detailed Description

Header file for type definitions for SAI ECMAScript implementation using the SpiderMonkey javascript engine.

This file defines the SpiderMonkey types for all field types such as SFInt32, SFVec3f, MFBool and so on and other types defined in the SAI Ecmascript specification. This makes it possible to use these types in the scripts that are used. To add the X3D field types to a JS API object use the insertH::DTypes method.

Implementation nodes: All field types that map to an JSObject type have an encapsulated Field pointer. The field type in the spec. also represents the field value itself, allowing access to individual properties and functions of the field value through the field type. We distiguish between internal fields and external fields where internal fields are encapsulated fields which are not a field part of any node, but just a temporary holder of a field value, such as the return value of an addition between two SFVec3f types.

Field types that map directly to a simple Ecmascript type such as SFBool and SFFloat do not have an encapsulated field pointer. Instead setting and getting the value of these types are handled by the setter/getter function of SFNodeClass.

Function Documentation

◆ FieldObject_toString()

JSBool H3D::SpiderMonkey::FieldObject_toString ( JSContext *  cx,
JSObject *  obj,
uintN  argc,
jsval *  argv,
jsval *  rval 
)

Callback function for converting a JSObject with a FieldObjectPrivate private data member to a JSString.

Only works for fields where the encapsulated field is a ParsableField.

References H3D::SpiderMonkey::PointerPrivateData< PointerType >::getArrayIndex(), H3D::SpiderMonkey::PointerPrivateData< PointerType >::getPointer(), and H3D::ParsableField::getValueAsString().

◆ jsvalFromField()

jsval H3D::SpiderMonkey::jsvalFromField ( JSContext *  cx,
Field f,
bool  make_copy,
int  array_index = -1,
X3DTypes::X3DType  x3dt = X3DTypes::UNKNOWN_X3D_TYPE 
)

Create a jsval object containing the value of the field(and possibly encapsulating the field).

If the field is of a type that matches a simple type such as Boolean or Numberic in the X3D Ecmascript specification a new such value is returned. If it is more complicated type that uses a JSObject the value is represented by the field inside this object. In this case make_copy dtermines if the encapsulated field should be the field given to the function or a copy of it. The new hsval is returned. JSVAL_VOID is returned on failure.

References H3D::Field::getX3DType().

Referenced by H3D::SpiderMonkey::SFNode_getProperty().

◆ PrivatePointer_finalize()

template<class PointerType >
void H3D::SpiderMonkey::PrivatePointer_finalize ( JSContext *  cx,
JSObject *  obj 
)

Destruct callback for JSObject with a private datamember.

It converts the pointer in JS_GetPrivate to PointerType and deletes it.

References H3D::SpiderMonkey::PrivatePointer_finalize().

Referenced by H3D::SpiderMonkey::PrivatePointer_finalize().

◆ setFieldValueFromjsval()

JSBool H3D::SpiderMonkey::setFieldValueFromjsval ( JSContext *  cx,
Field f,
jsval  v 
)

Sets the field value to the value of the jsval v.

Returns JS_TRUE on success, JS_FALSE otherwise.

References H3D::Field::getX3DType().

Referenced by H3D::SpiderMonkey::JS_MField< MFieldType, ElementType >::construct(), and H3D::SpiderMonkey::SFNode_setProperty().

◆ SFColor_newInstance()

JSObject * H3D::SpiderMonkey::SFColor_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFColor object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFColor_construct().

◆ SFImage_newInstance()

JSObject * H3D::SpiderMonkey::SFImage_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFImage object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFImage_construct().

◆ SFNode_newInstance()

JSObject * H3D::SpiderMonkey::SFNode_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

SFNode.

Returns a new SFNode object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFNode_construct().

◆ SFRotation_newInstance()

JSObject * H3D::SpiderMonkey::SFRotation_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFRotation object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

◆ SFVec2d_newInstance()

JSObject * H3D::SpiderMonkey::SFVec2d_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFVec2d object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFVec2d_construct().

◆ SFVec2f_newInstance()

JSObject * H3D::SpiderMonkey::SFVec2f_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFVec2f object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFVec2f_construct().

◆ SFVec3d_newInstance()

JSObject * H3D::SpiderMonkey::SFVec3d_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFVec3d object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFVec3d_construct().

◆ SFVec3f_newInstance()

JSObject * H3D::SpiderMonkey::SFVec3f_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFVec3f object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFVec3f_construct().

◆ SFVec4d_newInstance()

JSObject * H3D::SpiderMonkey::SFVec4d_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFVec4d object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFVec4d_construct().

◆ SFVec4f_newInstance()

JSObject * H3D::SpiderMonkey::SFVec4f_newInstance ( JSContext *  cx,
Field field,
bool  internal_field,
int  array_index = -1 
)

Returns a new SFVec4f object encapsulating a field.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.
array_indexIndex into array if MF object.

Referenced by H3D::SpiderMonkey::SFVec4f_construct().

◆ X3DExecutionContext_newInstance()

JSObject * H3D::SpiderMonkey::X3DExecutionContext_newInstance ( JSContext *  cx,
SAI::ExecutionContext *  field,
bool  internal_field 
)

Returns a new X3DExecutionContext object encapsulating a SAI::ExecutionContext object.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.

◆ X3DMatrix4_setTransform()

JSBool H3D::SpiderMonkey::X3DMatrix4_setTransform ( JSContext *  cx,
JSObject *  obj,
uintN  argc,
jsval *  argv,
jsval *  rval 
)

routes_in[0] center field

routes_in[1] rotation field routes_in[2] scale field routes_in[3] scaleOrientation field routes_in[4] translation field

References H3D::SField< Type >::getValue(), Rotation(), and H3D::SField< Type >::setValue().

◆ X3DScene_newInstance()

JSObject * H3D::SpiderMonkey::X3DScene_newInstance ( JSContext *  cx,
SAI::SAIScene *  field,
bool  internal_field 
)

Returns a new X3DScene object encapsulating a SAI::ExecutionContext object.

Parameters
cxThe context in which to create the object.
fieldThe field to encapsulate.
internal_fieldIf true, the encapsulated field will be deleted upon destruction of the JSObject encapsulating it.