예제 #1
0
        public rMindDeviceOutput(rMindBaseController parent) : base(parent)
        {
            m_element_type = rElementType.RET_DEVICE_OUTPUT;

            AddSetter();
            AddSetter();

            content = new Border
            {
                IsHitTestVisible = false,
                Margin           = new Windows.UI.Xaml.Thickness(4, 0, 0, 0),
                CornerRadius     = new Windows.UI.Xaml.CornerRadius(0, 4, 4, 0),
                Background       = ColorContainer.rMindColors.Current().GetSolidBrush((Color)ColorHelper.FromArgb(255, 51, 51, 51)),
                Child            = new FontIcon()
                {
                    Glyph      = "\uE964",
                    FontSize   = 32,
                    Foreground = ColorContainer.rMindColors.Current().GetSolidBrush(Colors.White)
                }
            };

            Grid.SetColumn(content, 1);
            Grid.SetColumnSpan(content, 2);
            Grid.SetRowSpan(content, 2);

            // #2E4DA0
            AccentColor = (Color)ColorHelper.FromArgb(255, 46, 77, 160);
            SetBorderRadius(new Windows.UI.Xaml.CornerRadius(4));

            Template.UseLayoutRounding = true;
            Template.Children.Add(content);
        }
예제 #2
0
        rMindBaseElement Create(rMindBaseController controller, double x, double y)
        {
            var container = new rMindBaseElement(controller);

            container.CreateNode();
            container.Translate(new rMind.Types.Vector2(x, y));
            return(container);
        }
예제 #3
0
        public void Back()
        {
            if (m_bread_crumbs.Count < 2)
            {
                return;
            }

            m_current_controller?.Unsubscribe();
            m_bread_crumbs.Remove(m_current_controller);

            m_current_controller = m_bread_crumbs.LastOrDefault();
            m_current_controller?.Subscribe(m_canvas, m_scroll);
        }
예제 #4
0
        public MathNodeBase(rMindBaseController parent) : base(parent)
        {
            Header = "A * B";

            nodeA = new Node(this)
            {
                HLSLValueBaseType = Values.HLSLValueBaseType.ADAPTIVE,
                Label             = "A",
                Stroke            = new SolidColorBrush(Colors.MediumVioletRed),
                UseAccentColor    = false,
                ConnectionType    = rMindNodeConnectionType.Container,
                NodeOrientation   = rMindNodeOriantation.Left,
            };

            output = new Node(this)
            {
                HLSLValueBaseType = Values.HLSLValueBaseType.ADAPTIVE,
                Label             = "OUT",
                Stroke            = new SolidColorBrush(Colors.MediumVioletRed),
                UseAccentColor    = false,
                ConnectionType    = rMindNodeConnectionType.Container,
                NodeOrientation   = rMindNodeOriantation.Right,
            };

            AddRow(new rMind.Content.Row.rMindRow
            {
                InputNode  = nodeA,
                OutputNode = output,
            });

            nodeB = new Node(this)
            {
                HLSLValueBaseType = Values.HLSLValueBaseType.ADAPTIVE,
                Label             = "B",
                Stroke            = new SolidColorBrush(Colors.MediumVioletRed),
                UseAccentColor    = false,
                ConnectionType    = rMindNodeConnectionType.Container,
                NodeOrientation   = rMindNodeOriantation.Left,
            };

            AddRow(new rMind.Content.Row.rMindRow
            {
                InputNode      = nodeB,
                OutputNodeType = rMindNodeConnectionType.None
            });

            CanExpand = false;
            CanEdit   = false;
        }
예제 #5
0
        public void SetController(rMindBaseController controller)
        {
            if (controller != null && controller.CanvasController == null)
            {
                controller.SetParent(this);
            }

            if (m_root_controller == null)
            {
                m_root_controller = controller;
            }

            if (m_bread_crumbs.Contains(controller))
            { // Переход по хлебным крошкам.
                var idx = m_bread_crumbs.IndexOf(controller);

                m_current_controller?.Unsubscribe();
                m_current_controller = controller;
                if (m_draw)
                {
                    m_current_controller.Subscribe(m_canvas, m_scroll);
                }

                var remove = m_bread_crumbs.Where(x => m_bread_crumbs.IndexOf(x) > idx).ToList();
                foreach (var item in remove)
                {
                    m_bread_crumbs.Remove(item);
                }

                return;
            }

            m_current_controller?.Unsubscribe();
            if (controller == null)
            {
                return;
            }

            m_current_controller = controller;
            if (m_draw)
            {
                m_current_controller.Subscribe(m_canvas, m_scroll);
            }
            m_bread_crumbs.Add(m_current_controller);
        }
예제 #6
0
        public Material(rMindBaseController parent) : base(parent)
        {
            var row = new rMindRow
            {
                InputNode = new Node(this)
                {
                    HLSLValueBaseType = HLSLValueBaseType.FLOAT4,
                    IDS             = "color",
                    Label           = "Color",
                    ConnectionType  = rMindNodeConnectionType.Container,
                    NodeOrientation = rMindNodeOriantation.Left,
                    Stroke          = new SolidColorBrush(Colors.White)
                },
                OutputNodeType = rMindNodeConnectionType.None
            };

            AddRow(row);
        }
예제 #7
0
        public PSNormal(rMindBaseController parent) : base(parent)
        {
            AccentColor = Colors.LimeGreen;

            output = new Node(this)
            {
                HLSLValueBaseType = Values.HLSLValueBaseType.FLOAT3,
                Label             = "ps input :: normal",
                Stroke            = new SolidColorBrush(Colors.MediumVioletRed),
                UseAccentColor    = false,
                ConnectionType    = rMindNodeConnectionType.Container,
                NodeOrientation   = rMindNodeOriantation.Right,
            };

            AddRow(new rMind.Content.Row.rMindRow
            {
                OutputNode    = output,
                InputNodeType = rMind.Nodes.rMindNodeConnectionType.None
            });

            output.Column = 1;
        }
예제 #8
0
        public Luminosity(rMindBaseController parent) : base(parent)
        {
            AccentColor = Colors.DarkOrange;

            var output = new Node(this)
            {
                HLSLValueBaseType = Values.HLSLValueBaseType.FLOAT,
                HLSLValueSubType  = Values.HLSLValueSubType.NONE,
                Label             = "luminosity",
                Stroke            = new SolidColorBrush(Colors.DeepSkyBlue),
                UseAccentColor    = false,
                ConnectionType    = rMindNodeConnectionType.Container,
                NodeOrientation   = rMindNodeOriantation.Right,
            };

            AddRow(new rMind.Content.Row.rMindRow
            {
                OutputNode    = output,
                InputNodeType = rMind.Nodes.rMindNodeConnectionType.None
            });

            output.Column = 1;
        }
예제 #9
0
 public RowContainerBase(rMindBaseController parent) : base(parent)
 {
     AccentColor = Colors.Black;
 }
예제 #10
0
 public void SetController(rMindBaseController controller)
 {
     m_current_controller?.Unsubscribe();
 }
예제 #11
0
 public rMindDebugContainer(rMindBaseController parent) : base(parent)
 {
 }
예제 #12
0
 public rMindQuadContainer(rMindBaseController parent) : base(parent)
 {
     m_vertical_lines   = new List <rMindVerticalLine>();
     m_horizontal_lines = new List <rMindHorizontalLine>();
 }
예제 #13
0
        public ColorNode(rMindBaseController parent) : base(parent)
        {
            var cp = new ColorPicker();

            cp.ColorChanged += (s, e) => {
                r = e.NewColor.R / 255.0M;
                g = e.NewColor.G / 255.0M;
                b = e.NewColor.B / 255.0M;
            };

            picker = new Flyout
            {
                Placement = FlyoutPlacementMode.Bottom,
                Content   = cp
            };

            AddRow(new rMindRow
            {
                InputNodeType = rMindNodeConnectionType.None,
                OutputNode    = new Node(this)
                {
                    HLSLValueBaseType = HLSLValueBaseType.FLOAT4,
                    UseAccentColor    = false,
                    IDS             = "color",
                    Label           = "Color",
                    ConnectionType  = rMindNodeConnectionType.Container,
                    NodeOrientation = rMindNodeOriantation.Right,
                    Stroke          = new SolidColorBrush(Colors.White)
                }
            });

            AddSeparator();

            // Red
            AddRow(new rMindRow
            {
                InputNodeType = rMindNodeConnectionType.None,
                OutputNode    = new Node(this)
                {
                    HLSLValueBaseType = HLSLValueBaseType.FLOAT,
                    HLSLValueSubType  = HLSLValueSubType.X_R,
                    UseAccentColor    = false,
                    IDS             = "R",
                    Label           = "R",
                    ConnectionType  = rMindNodeConnectionType.Container,
                    NodeOrientation = rMindNodeOriantation.Right,
                    Stroke          = new SolidColorBrush(Colors.IndianRed)
                }
            });

            // Green
            AddRow(new rMindRow
            {
                InputNodeType = rMindNodeConnectionType.None,
                OutputNode    = new Node(this)
                {
                    HLSLValueBaseType = HLSLValueBaseType.FLOAT,
                    HLSLValueSubType  = HLSLValueSubType.Y_G,
                    UseAccentColor    = false,
                    IDS             = "G",
                    Label           = "G",
                    ConnectionType  = rMindNodeConnectionType.Container,
                    NodeOrientation = rMindNodeOriantation.Right,
                    Stroke          = new SolidColorBrush(Colors.Green)
                }
            });

            // Blue
            AddRow(new rMindRow
            {
                InputNodeType = rMindNodeConnectionType.None,
                OutputNode    = new Node(this)
                {
                    HLSLValueBaseType = HLSLValueBaseType.FLOAT,
                    HLSLValueSubType  = HLSLValueSubType.Z_B,
                    UseAccentColor    = false,
                    IDS             = "B",
                    Label           = "B",
                    ConnectionType  = rMindNodeConnectionType.Container,
                    NodeOrientation = rMindNodeOriantation.Right,
                    Stroke          = new SolidColorBrush(Colors.DeepSkyBlue)
                }
            });
        }
예제 #14
0
 public rMindRowContainer(rMindBaseController parent) : base(parent)
 {
     m_rows = new List <IRow>();
 }
예제 #15
0
 public rMindHeaderRowContainer(rMindBaseController parent) : base(parent)
 {
     CanExpand = true;
     CanEdit   = true;
 }
예제 #16
0
 public MultipleNode(rMindBaseController parent) : base(parent)
 {
 }
예제 #17
0
 public Vector3Node(rMindBaseController parent) : base(parent)
 {
     AccentColor = Colors.DarkBlue;
     // Green
     AddRow(new rMindRow
     {
         InputNodeType = rMindNodeConnectionType.None,
         OutputNode    = new Node(this)
         {
             HLSLValueBaseType = HLSLValueBaseType.FLOAT3,
             UseAccentColor    = false,
             IDS             = "vector",
             Label           = "vector3",
             ConnectionType  = rMindNodeConnectionType.Container,
             NodeOrientation = rMindNodeOriantation.Right,
             Stroke          = new SolidColorBrush(Colors.Green)
         }
     });
     AddSeparator();
     // x | r
     AddRow(new rMindRow
     {
         InputNodeType = rMindNodeConnectionType.None,
         OutputNode    = new Node(this)
         {
             HLSLValueBaseType = HLSLValueBaseType.FLOAT,
             HLSLValueSubType  = HLSLValueSubType.X_R,
             UseAccentColor    = false,
             IDS             = "X",
             Label           = "X",
             ConnectionType  = rMindNodeConnectionType.Container,
             NodeOrientation = rMindNodeOriantation.Right,
             Stroke          = new SolidColorBrush(Colors.IndianRed)
         }
     });
     // y | g
     AddRow(new rMindRow
     {
         InputNodeType = rMindNodeConnectionType.None,
         OutputNode    = new Node(this)
         {
             HLSLValueBaseType = HLSLValueBaseType.FLOAT,
             HLSLValueSubType  = HLSLValueSubType.Y_G,
             UseAccentColor    = false,
             IDS             = "Y",
             Label           = "Y",
             ConnectionType  = rMindNodeConnectionType.Container,
             NodeOrientation = rMindNodeOriantation.Right,
             Stroke          = new SolidColorBrush(Colors.Green)
         }
     });
     // z | b
     AddRow(new rMindRow
     {
         InputNodeType = rMindNodeConnectionType.None,
         OutputNode    = new Node(this)
         {
             HLSLValueBaseType = HLSLValueBaseType.FLOAT,
             HLSLValueSubType  = HLSLValueSubType.Z_B,
             UseAccentColor    = false,
             IDS             = "Z",
             Label           = "Z",
             ConnectionType  = rMindNodeConnectionType.Container,
             NodeOrientation = rMindNodeOriantation.Right,
             Stroke          = new SolidColorBrush(Colors.DeepSkyBlue)
         }
     });
 }