/// <summary> /// Raises the NodeSet event and performs custom processing</summary> protected override void OnNodeSet() { base.OnNodeSet(); Box boxValue = DomNodeUtil.GetBox(DomNode, Schema.meshType.boundingBoxAttribute); m_boundingBox = boxValue.IsEmpty ? new Cached <Box>(CalculateBoundingBox) : new Cached <Box>(CalculateBoundingBox, boxValue); }
/// <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(); Box boxValue = DomNodeUtil.GetBox(DomNode, Schema.meshType.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 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 } }