Пример #1
0
        protected override bool ValidateAttach(rMindBaseWireDot dot)
        {
            if (!base.ValidateAttach(dot))
            {
                return(false);
            }
            if (dot.ReverseDot.Node != null && dot.ReverseDot.Node is Node)
            {
                Node node = dot.ReverseDot.Node as Node;
                if (HLSLValueBaseType == node.HLSLValueBaseType)
                {
                    return(true);
                }

                if (HLSLValueBaseType == HLSLValueBaseType.ADAPTIVE || node.HLSLValueBaseType == HLSLValueBaseType.ADAPTIVE)
                {
                    return(true);
                }

                var conv = Converter.HLSLValueConverterContainer.Current();
                return(conv.CanConvert(HLSLValueBaseType, node.HLSLValueBaseType));
            }

            return(true);
        }
Пример #2
0
        protected virtual bool ValidateAttach(rMindBaseWireDot dot)
        {
            if (m_attach_mode == rMindNodeAttachMode.Single && m_attached_dots.Count > 0)
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
        /// <summary> Attach wire dot </summary>
        /// <param name="dot">rMindBaseWireDot</param>
        public void Attach(rMindBaseWireDot dot)
        {
            if (!ValidateAttach(dot))
            {
                dot.Wire.Delete();
                return;
            }

            m_attached_dots.Add(dot.SetNode(this));
            Update();
        }
Пример #4
0
        private void OnPointerPressed(object sender, PointerRoutedEventArgs e)
        {
            e.Handled = true;
            // Получаем зум фактор
            zoom = GetController()?.CanvasController?.Zoom ?? 1.0f;
            if (zoom == 0)
            {
                zoom = 1;
            }

            var wire = GetController()?.CreateWire();

            if (wire != null)
            {
                Attach(wire.A);

                GetController()?.SetDragWireDot(wire.B, e);
                dragDot = wire.B;
            }
        }
Пример #5
0
 /// <summary> Detach wire dot </summary>
 /// <param name="dot">rMindBaseWireDot</param>
 public void Detach(rMindBaseWireDot dot)
 {
     dot.Detach();
     m_attached_dots.Remove(dot);
 }