Ejemplo n.º 1
0
 public void FindDrawers(List <IShaderFieldDrawer> drawers, IShaderFieldGroup group)
 {
     foreach (var child in group.Children)
     {
         if (child is ShaderField)
         {
             var field = (ShaderField)child;
             drawers.Add(new FieldDrawer(field));
         }
         else if (child is ShaderKeyword)
         {
             var field = (ShaderKeyword)child;
             drawers.Add(new KeywordDrawer(field));
         }
         else if (child is ShaderEnumKeyword)
         {
             var field = (ShaderEnumKeyword)child;
             drawers.Add(new EnumKeywordDrawer(field));
         }
         else if (child is ShaderFieldGroup)
         {
             var field  = (ShaderFieldGroup)child;
             var drawer = new GroupDrawer(field);
             drawers.Add(drawer);
             FindDrawers(drawer.Drawers, field);
         }
     }
 }
Ejemplo n.º 2
0
 static void DrawGizmoFor(Game target, GizmoType gizmoType)
 {
     foreach (var g in target.shufflingList)
     {
         GroupDrawer.DrawGroup(g, Color.yellow);
     }
 }
    static void DrawGroupAndGroupLinks(Group nowSelectGroup, List <Group> groups, List <GroupRelation> groupLinks, GetColor getColorFunc)
    {
        foreach (var g in groups)
        {
            GroupDrawer.DrawGroup(g, getColorFunc());
        }

        if (nowSelectGroup != null)
        {
            GroupDrawer.DrawGroup(nowSelectGroup, SelectGroupColor);
        }

        foreach (var link in groupLinks)
        {
            DrawElementLink(link.GetElementRelation(), GroupRelationColor, Vector3.up);
        }
    }
Ejemplo n.º 4
0
 public void FindDrawers(List <ISerializedPropertyDrawer> drawers, IShaderFieldGroup group, SerializedProperty property)
 {
     foreach (var child in group.Children)
     {
         if (child is ShaderField)
         {
             var field  = (ShaderField)child;
             var target = property.FindPropertyRelative(field.ReflectiveField.Name);
             if (target != null)
             {
                 var drawer = new ShaderFieldDrawer(target, field);
                 drawers.Add(drawer);
             }
         }
         else if (child is ShaderKeyword)
         {
             var field  = (ShaderKeyword)child;
             var target = property.FindPropertyRelative(field.ReflectiveField.Name);
             if (target != null)
             {
                 var drawer = new KeywordDrawer(target, field);
                 drawers.Add(drawer);
             }
         }
         else if (child is ShaderEnumKeyword)
         {
             var field  = (ShaderEnumKeyword)child;
             var target = property.FindPropertyRelative(field.ReflectiveField.Name);
             if (target != null)
             {
                 var drawer = new EnumKeywordDrawer(target, field);
                 drawers.Add(drawer);
             }
         }
         else if (child is ShaderFieldMark)
         {
             var field  = (ShaderFieldMark)child;
             var target = property.FindPropertyRelative(field.ReflectiveField.Name);
             if (target != null)
             {
                 var drawer = new Drawer(target);
                 drawers.Add(drawer);
             }
         }
         else if (child is ShaderCustomField)
         {
             var field  = (ShaderCustomField)child;
             var target = property.FindPropertyRelative(field.ReflectiveField.Name);
             if (target != null)
             {
                 var drawer = new Drawer(target);
                 drawers.Add(drawer);
             }
         }
         else if (child is ShaderFieldGroup)
         {
             var field  = (ShaderFieldGroup)child;
             var target = property.FindPropertyRelative(field.ReflectiveField.Name);
             if (target != null)
             {
                 var drawer = new GroupDrawer(target, field);
                 drawers.Add(drawer);
                 FindDrawers(drawer.Drawers, field, target);
             }
         }
         else
         {
             throw new NotImplementedException();
         }
     }
 }
Ejemplo n.º 5
0
        TransferToGraphDrawer
        (
            GraphDrawer graphDrawer
        )
        {
            Debug.Assert(graphDrawer != null);
            AssertValid();

            System.Windows.Media.Typeface oTypeface;
            Double dFontSize;

            //***********
            //  Vertex
            //***********

            VertexDrawer oVertexDrawer = graphDrawer.VertexDrawer;

            FontToTypefaceAndFontSize(this.VertexFont,
                                      out oTypeface, out dFontSize);

            oVertexDrawer.SetFont(oTypeface, dFontSize);

            oVertexDrawer.LabelFillColor =
                WpfGraphicsUtil.ColorToWpfColor(this.VertexLabelFillColor);

            oVertexDrawer.LabelPosition      = this.VertexLabelPosition;
            oVertexDrawer.MaximumLabelLength = this.VertexLabelMaximumLength;
            oVertexDrawer.LabelWrapText      = this.VertexLabelWrapText;

            oVertexDrawer.LabelWrapMaxTextWidth =
                this.VertexLabelWrapMaxTextWidth;

            //***********
            //  Edge
            //***********

            EdgeDrawer oEdgeDrawer = graphDrawer.EdgeDrawer;

            FontToTypefaceAndFontSize(this.EdgeFont, out oTypeface, out dFontSize);

            oEdgeDrawer.SetFont(oTypeface, dFontSize);

            oEdgeDrawer.LabelTextColor =
                WpfGraphicsUtil.ColorToWpfColor(this.EdgeLabelTextColor);

            oEdgeDrawer.MaximumLabelLength = this.EdgeLabelMaximumLength;

            //***********
            //  Group
            //***********

            GroupDrawer oGroupDrawer = graphDrawer.GroupDrawer;

            FontToTypefaceAndFontSize(this.GroupFont,
                                      out oTypeface, out dFontSize);

            oGroupDrawer.SetFont(oTypeface, dFontSize);

            oGroupDrawer.LabelTextColor = WpfGraphicsUtil.ColorToWpfColor(

                Color.FromArgb((new AlphaConverter()).WorkbookToGraphAsByte(
                                   this.GroupLabelTextAlpha),

                               this.GroupLabelTextColor)
                );

            oGroupDrawer.LabelPosition = this.GroupLabelPosition;
        }