Difference between revisions of "DOMObjectExtended"

From Virtual World Web Wiki
Jump to: navigation, search
(Documentation for the DOMObjectExtended class)
(Documentation for the DOMObjectExtended class)
Line 6: Line 6:
  
 
===Properties===
 
===Properties===
:{{CSharp|Guid? BaseTypeID {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|Guid? BaseTypeID {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::The type ID of the root [[Object Type]] in a derived [[Object Type Reference]] chain
 
::The type ID of the root [[Object Type]] in a derived [[Object Type Reference]] chain
  
:{{CSharp|string Class {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|string Class {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::Much like the HTML concept of class, a space-separated list of class names which can be used by [[CSS Selectors]] to select this node
 
::Much like the HTML concept of class, a space-separated list of class names which can be used by [[CSS Selectors]] to select this node
Line 22: Line 22:
 
::A shortcut equivilant to DOMObject.Document.Title.
 
::A shortcut equivilant to DOMObject.Document.Title.
  
:{{CSharp|bool Enabled {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool Enabled {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
 
::When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
  
:{{CSharp|long ID {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|long ID {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::The unique ID of this object in the view. DOM node IDs can change if a node is moved between view documents or removed from a document in which case this property will return zero. DOM node IDs are allocated by the RootDocument in a view
 
::The unique ID of this object in the view. DOM node IDs can change if a node is moved between view documents or removed from a document in which case this property will return zero. DOM node IDs are allocated by the RootDocument in a view
  
:{{CSharp|Guid? InstanceTypeID {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|Guid? InstanceTypeID {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::The type ID of the next [[Object Type]] up the hierarchy in a derived [[Object Type Reference]] chain
 
::The type ID of the next [[Object Type]] up the hierarchy in a derived [[Object Type Reference]] chain
  
:{{CSharp|bool IsInstanceRoot {get;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool IsInstanceRoot {get;} // Via attribution on DOMObject }}
 
::
 
::
 
::True if this node is the root node in an [[Object Type Reference]]
 
::True if this node is the root node in an [[Object Type Reference]]
  
:{{CSharp|bool IsTemplateRoot {get;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool IsTemplateRoot {get;} // Via attribution on DOMObject }}
 
::
 
::
 
::True if this node represents the root node of an instance of an [[Object Template]]
 
::True if this node represents the root node of an instance of an [[Object Template]]
  
:{{CSharp|bool IsTypeRoot {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool IsTypeRoot {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::True if this node represents the root node of an [[Object Type]]
 
::True if this node represents the root node of an [[Object Type]]
Line 50: Line 50:
 
::Gets a DOMProperties object representing the properties of this object which are NOT send over the network.
 
::Gets a DOMProperties object representing the properties of this object which are NOT send over the network.
  
:{{CSharp|Guid NodeID {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|Guid NodeID {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::Unique ID set on first creation (not sure how this is different than RecordID)
 
::Unique ID set on first creation (not sure how this is different than RecordID)
Line 62: Line 62:
 
::Gets a DOMProperties object representing the properties of this object visible to all viewers of the DOM. Changes to these properties ARE sent over the network.
 
::Gets a DOMProperties object representing the properties of this object visible to all viewers of the DOM. Changes to these properties ARE sent over the network.
  
:{{CSharp|DOMProtectionFlags ProtectionFlags {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|DOMProtectionFlags ProtectionFlags {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::A set of flags representing protections enforced by the server. '''Delete''' object (1), '''Move''' object (2), '''Add''' child (4), '''Remove''' child (8), '''Change''' object (16) are some of the possible flags. This property can only be set on the server and is used to protect certain objects from accidental operations that could be harmful to the basic DOM structure, like deleting the root instance document for example.
 
::A set of flags representing protections enforced by the server. '''Delete''' object (1), '''Move''' object (2), '''Add''' child (4), '''Remove''' child (8), '''Change''' object (16) are some of the possible flags. This property can only be set on the server and is used to protect certain objects from accidental operations that could be harmful to the basic DOM structure, like deleting the root instance document for example.
  
:{{CSharp|Guid ReferenceLayoutHash {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|Guid ReferenceLayoutHash {get; set;} // Via attribution on DOMObject }}
  
:{{CSharp|Guid TemplateID {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|Guid TemplateID {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::If this node is part of an instaniated [[Object Template]] this property will contain the ID of the template
 
::If this node is part of an instaniated [[Object Template]] this property will contain the ID of the template
  
:{{CSharp|bool Temporary {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool Temporary {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::A node marked as Temporary will not be serialized for storage and will not be disturbed during a publish merge. They are considered "runtime nodes" not part of the saved layout or type.
 
::A node marked as Temporary will not be serialized for storage and will not be disturbed during a publish merge. They are considered "runtime nodes" not part of the saved layout or type.
  
:{{CSharp|string Title {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|string Title {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::The title of the object, usually used only for display in a server inspector, but sometimes has special meaning (eg. in [[DOMTitle]], [[DOMHookpoint]], and [[DOMCurveValue]] nodes
 
::The title of the object, usually used only for display in a server inspector, but sometimes has special meaning (eg. in [[DOMTitle]], [[DOMHookpoint]], and [[DOMCurveValue]] nodes
  
:{{CSharp|bool Transient {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool Transient {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::A transient node is meant to be removed from the DOM immediately after it is received. On the server side, when a node marked Transient is added to the DOM a ChildAdd packet is sent to the client, but the node is never added to the Children collection of the target parent.
 
::A transient node is meant to be removed from the DOM immediately after it is received. On the server side, when a node marked Transient is added to the DOM a ChildAdd packet is sent to the client, but the node is never added to the Children collection of the target parent.
Line 88: Line 88:
 
::A string version of this object’s type’s name, for derived objects, this will return the name of the derived object, so DOMRenderable.Type returns "DOMRenderable"
 
::A string version of this object’s type’s name, for derived objects, this will return the name of the derived object, so DOMRenderable.Type returns "DOMRenderable"
  
:{{CSharp|Guid TypeID {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|Guid TypeID {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::The ID of the [[Object Type]] (stored DOM snippet) that this node is a part of. If the Object Type is a derived reference or this node is part of a reference inside an Object Type this will indicate the first type in which this node was introduced
 
::The ID of the [[Object Type]] (stored DOM snippet) that this node is a part of. If the Object Type is a derived reference or this node is part of a reference inside an Object Type this will indicate the first type in which this node was introduced
  
:{{CSharp|int TypeNodeID {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|int TypeNodeID {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::When part of an [[Object Type]] this integer ID uniquely identifies the node within the type. Note that if an Object Type contains references those nodes could have conflicting TypeNodeIDs but their TypeID would appear different.
 
::When part of an [[Object Type]] this integer ID uniquely identifies the node within the type. Note that if an Object Type contains references those nodes could have conflicting TypeNodeIDs but their TypeID would appear different.
  
:{{CSharp|bool TypeReference {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool TypeReference {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::True if this node is the root of a type reference (as in, not locally defined, but here as the result of a [[DOMReference]] expansion, and will be serialized as a DOMReference)
 
::True if this node is the root of a type reference (as in, not locally defined, but here as the result of a [[DOMReference]] expansion, and will be serialized as a DOMReference)
  
:{{CSharp|bool[] TypeReferenceReload {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool[] TypeReferenceReload {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::A Dirkasaurus-Rex Boolean Factory
 
::A Dirkasaurus-Rex Boolean Factory
  
:{{CSharp|bool Validated {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool Validated {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::True if this object has a template ID and that [[Object Template]] was found in a container attached to the worldspace in which this view is running.
 
::True if this object has a template ID and that [[Object Template]] was found in a container attached to the worldspace in which this view is running.
  
:{{CSharp|bool Visible {get; set;} // Via attribution [[DOMObject]] }}
+
:{{CSharp|bool Visible {get; set;} // Via attribution on DOMObject }}
 
::
 
::
 
::Marks a node as visible or not visible to connected clients. When toggled, the server sends RemoveNode / AddNode packets, so from a client perspective it's as though the node is added or removed from the DOM. It can be useful to hide nodes that will be used or cloned by scripts. It can be useful to mark a node as not visible before making many changes to it's subtree to reduce network traffic, although BeginUpdate and EndUpdate are better suited for this.
 
::Marks a node as visible or not visible to connected clients. When toggled, the server sends RemoveNode / AddNode packets, so from a client perspective it's as though the node is added or removed from the DOM. It can be useful to hide nodes that will be used or cloned by scripts. It can be useful to mark a node as not visible before making many changes to it's subtree to reduce network traffic, although BeginUpdate and EndUpdate are better suited for this.

Revision as of 13:40, 24 October 2016

Represents a DOMObject in JavaScript

  • This is a JavaScript visible object

Remarks [edit]

Properties

Guid? BaseTypeID {get; set;} // Via attribution on DOMObject
The type ID of the root Object Type in a derived Object Type Reference chain
string Class {get; set;} // Via attribution on DOMObject
Much like the HTML concept of class, a space-separated list of class names which can be used by CSS Selectors to select this node
DOMObjectExtended Document {get;}
Gets a reference to the DOMDocument in which this DOMObject resides.
string DocumentTitle {get;}
A shortcut equivilant to DOMObject.Document.Title.
bool Enabled {get; set;} // Via attribution on DOMObject
When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
long ID {get; set;} // Via attribution on DOMObject
The unique ID of this object in the view. DOM node IDs can change if a node is moved between view documents or removed from a document in which case this property will return zero. DOM node IDs are allocated by the RootDocument in a view
Guid? InstanceTypeID {get; set;} // Via attribution on DOMObject
The type ID of the next Object Type up the hierarchy in a derived Object Type Reference chain
bool IsInstanceRoot {get;} // Via attribution on DOMObject
True if this node is the root node in an Object Type Reference
bool IsTemplateRoot {get;} // Via attribution on DOMObject
True if this node represents the root node of an instance of an Object Template
bool IsTypeRoot {get; set;} // Via attribution on DOMObject
True if this node represents the root node of an Object Type
DOMPropertiesExtended LocalProperties {get;}
Gets a DOMProperties object representing the properties of this object which are NOT send over the network.
Guid NodeID {get; set;} // Via attribution on DOMObject
Unique ID set on first creation (not sure how this is different than RecordID)
DOMObjectExtended Parent {get;}
Gets a reference to the DOMObject directly parenting this one.
DOMPropertiesExtended Properties {get;}
Gets a DOMProperties object representing the properties of this object visible to all viewers of the DOM. Changes to these properties ARE sent over the network.
DOMProtectionFlags ProtectionFlags {get; set;} // Via attribution on DOMObject
A set of flags representing protections enforced by the server. Delete object (1), Move object (2), Add child (4), Remove child (8), Change object (16) are some of the possible flags. This property can only be set on the server and is used to protect certain objects from accidental operations that could be harmful to the basic DOM structure, like deleting the root instance document for example.
Guid ReferenceLayoutHash {get; set;} // Via attribution on DOMObject
Guid TemplateID {get; set;} // Via attribution on DOMObject
If this node is part of an instaniated Object Template this property will contain the ID of the template
bool Temporary {get; set;} // Via attribution on DOMObject
A node marked as Temporary will not be serialized for storage and will not be disturbed during a publish merge. They are considered "runtime nodes" not part of the saved layout or type.
string Title {get; set;} // Via attribution on DOMObject
The title of the object, usually used only for display in a server inspector, but sometimes has special meaning (eg. in DOMTitle, DOMHookpoint, and DOMCurveValue nodes
bool Transient {get; set;} // Via attribution on DOMObject
A transient node is meant to be removed from the DOM immediately after it is received. On the server side, when a node marked Transient is added to the DOM a ChildAdd packet is sent to the client, but the node is never added to the Children collection of the target parent.
string Type {get;}
A string version of this object’s type’s name, for derived objects, this will return the name of the derived object, so DOMRenderable.Type returns "DOMRenderable"
Guid TypeID {get; set;} // Via attribution on DOMObject
The ID of the Object Type (stored DOM snippet) that this node is a part of. If the Object Type is a derived reference or this node is part of a reference inside an Object Type this will indicate the first type in which this node was introduced
int TypeNodeID {get; set;} // Via attribution on DOMObject
When part of an Object Type this integer ID uniquely identifies the node within the type. Note that if an Object Type contains references those nodes could have conflicting TypeNodeIDs but their TypeID would appear different.
bool TypeReference {get; set;} // Via attribution on DOMObject
True if this node is the root of a type reference (as in, not locally defined, but here as the result of a DOMReference expansion, and will be serialized as a DOMReference)
bool[] TypeReferenceReload {get; set;} // Via attribution on DOMObject
A Dirkasaurus-Rex Boolean Factory
bool Validated {get; set;} // Via attribution on DOMObject
True if this object has a template ID and that Object Template was found in a container attached to the worldspace in which this view is running.
bool Visible {get; set;} // Via attribution on DOMObject
Marks a node as visible or not visible to connected clients. When toggled, the server sends RemoveNode / AddNode packets, so from a client perspective it's as though the node is added or removed from the DOM. It can be useful to hide nodes that will be used or cloned by scripts. It can be useful to mark a node as not visible before making many changes to it's subtree to reduce network traffic, although BeginUpdate and EndUpdate are better suited for this.

Events

OnDeselect(EventHandler<FlexibleEventArgs>)
Fires when a user deselects an object in world. Who is Participant doing the deselecting.
OnSelect(EventHandler<FlexibleEventArgs>)
Fires when a user selects an object in world. Who is the Participant doing the selecting.
OnTarget(EventHandler<FlexibleEventArgs>)
Fires when a user targets an object in world. Who is the Participant doing the targeting.
OnUnTarget(EventHandler<FlexibleEventArgs>)
Fires when a user un-targets an object in world. Who is the Participant doing the un-targeting.

Methods

void AddClass(string className)
Adds a class name to the space separated list of class names found on the Class property of this DOMObject.
DOMObjectExtended Clone(DOMObjectExtended parentNode, bool forceEnable, bool forceVisible)
Clones this object and places it as a direct child of the specified parent object
DOMCurveExtended CreateCurve(string title, bool visible)
Creates a new DOMCurve object, optionally initially invisible, as a direct child of this object.
DOMCurveExtended CreateCurveFromJson(string json)
Creates a new DOMCurve object from the JSON Curve Definition, as a direct child of this object.
DOMObjectExtended CreateEmptyNode(bool visible)
Creates a simple DOMTransform object, optionally initially invisible, as a direct child of this object.
DOMObjectExtended CreateHookpoint(string title, bool visible)
Creates a simple DOMHookpoint object, optionally initially invisible, as a direct child of this object.
DOMObjectExtended CreateLight(int color, Single intensity, int shadowtype, Single shadowstrength, JSVector3 position, JSVector3 rotation)
Creates a DOMLight object as a direct child of this object with the specified properties already set.
DOMObjectExtended CreateNode(string templateIDText, bool visible)
Creates an instance of the specified ObjectTemplate given its GUID templateID, optionally initially invisible, as a direct child of this object.
DOMObjectExtended CreateTitleNode(string title, int index, bool visible)
Creates a simple DOMTitle object, optionally initially invisible, as a direct child of this object.
bool DeleteNode()
Removes this node from the DOM.
DOMControllerExtended FindController()
Returns the first child DOMController object found in the document in which this object is a member, as long as that document is a persona document (essentially finds the root of an avatar starting from some other object in the avatar’s document). Not so good for finding bot controllers.
DOMObjectExtended FindNode(string name)
Find the first child node (recursive, deep search) with the specified name;
ReturnType FindNodes(string name)
Finds child nodes (recursive, deep search) with the specified name;
ReturnType FindNodesWithProperty(string propertyName)
Searches up the tree for the first DOMController. Better for finding bot controllers.
DOMControllerExtended FindParentController()
Searches up the hierarchy for a DOMController
ReturnType GetAttributeValue(string attributeName)
Looks for an attribute with the given name and returns its value. Attributes are like special properties placed on the DOM nodes and properties when they appear in an ObjectType definition. An ObjectType is a container for a small snippet of DOM which can be re-used at runtime to create instances of that same layout and inject it into a running document. Attributes placed on these object or properties can later be accessed on any instance of these objects or properties. Think of these like metadata “about” an object or property, rather than data describing the object instance itself.
ReturnType GetChildren()
Gets all direct children.
bool HasAttribute(string attributeName)
Checks to see if a given attribute exists on this object.
bool HasClass(string className)
Tests if the specified class name is found in the space separated list of class names found on the Class property of this DOMObject.
bool ListenOnChannel(int channelID, JSFlexibleFunction func)
Starts listening for messages sent to this object from other scripts, or from client UI scripts. Callback will be called with (int channelID, string message, DOMObject source, DOMObject dest) describing the message. This is similar to System.ListenOnChannel but listens only for messages sent directly to this object.
bool MatchesSelector(string selector)
Parses the specified CSS-style selector string and then tests itself (the current node) for a match.
DOMObjectExtended QuerySelector(string selector)
Parses the specified CSS-style selector string and then queries the DOM from this node down, looking for objects that match. Returns the first found object.
DOMObjectExtended[] QuerySelectorAll(string selector)
Parses the specified CSS-style selector string and then queries the DOM from this node down, looking for objects that match. Returns an array of found objects.
void RemoveClass(string className)
Removes a class name from the space separated list of class names found on the Class property of this DOMObject.
bool SendMessage(int channel, string message, DOMObjectExtended source)
Sends a message on the specified script communication channel given another object as the source. Someone else having previously used ListenOnChannel could receive this message to their callback function.
void ToggleClass(string className)
Toggles a class name in the space separated list of class names found on the Class property of this DOMObject.