/// <summary> /// Performs initialization when the adapter's node is set. /// This method is called each time the adapter is connected to its underlying node. /// Typically overridden by creators of DOM adapters.</summary> protected override void OnNodeSet() { base.OnNodeSet(); // Initialize scale to (1, 1, 1) if missing DomNode.SetAttributeIfDefault(Schema.poseType_element.scaleAttribute, new Vec3F(1, 1, 1)); }
/// <summary> /// Performs custom processing after adapter successfully attaches to the Interval's DOM object</summary> protected override void OnNodeSet() { // initialize defaulted attributes DomNode.SetAttributeIfDefault(Schema.intervalType.nameAttribute, "Interval"); DomNode.SetAttributeIfDefault(Schema.intervalType.lengthAttribute, 5.0f); DomNode.SetAttributeIfDefault(Schema.intervalType.colorAttribute, Color.Blue.ToArgb()); }
/// <summary> /// Performs custom actions on NodeSet events. /// Called after successfully attaching to internal DOM object.</summary> protected override void OnNodeSet() { base.OnNodeSet(); // Initialize scale to (1, 1, 1) if missing DomNode.SetAttributeIfDefault(Schema.nodeType.scaleAttribute, new Vec3F(1, 1, 1)); m_rotation = DomNode.GetChild(Schema.nodeType.rotEulChild); m_rotationAxis = DomNode.GetChild(Schema.nodeType.rotAxisEulChild); Transform = TransformUtils.CalcTransform(this); Box boxValue = DomNodeUtil.GetBox(DomNode, Schema.nodeType.boundingBoxAttribute); if (boxValue.IsEmpty) { m_boundingBox = new Cached <Box>(CalculateBoundingBox); // don't set value and force to compute } else { m_boundingBox = new Cached <Box>(CalculateBoundingBox, boxValue); // non-default value found, use it } }
/// <summary> /// Performs custom processing after adapter successfully attaches to the Marker's DOM object: /// sets Marker attributes</summary> protected override void OnNodeSet() { // initialize defaulted attributes DomNode.SetAttributeIfDefault(Schema.markerType.nameAttribute, "Marker"); DomNode.SetAttributeIfDefault(Schema.markerType.colorAttribute, Color.MediumBlue.ToArgb()); }