public Joint() : base("joint", false)
        {
            Origin = new Origin("Joint", false);
            Parent = new ParentLink();
            Child  = new ChildLink();
            Axis   = new Axis();

            Limit       = new Limit();
            Calibration = new Calibration();
            Dynamics    = new Dynamics();
            Safety      = new SafetyController();
            Mimic       = new Mimic();

            NameAttribute = new URDFAttribute("name", true, "");
            TypeAttribute = new URDFAttribute("type", true, "");

            Attributes.Add(NameAttribute);
            Attributes.Add(TypeAttribute);

            ChildElements.Add(Origin);
            ChildElements.Add(Parent);
            ChildElements.Add(Child);
            ChildElements.Add(Axis);

            ChildElements.Add(Limit);
            ChildElements.Add(Calibration);
            ChildElements.Add(Dynamics);
            ChildElements.Add(Safety);
            ChildElements.Add(Mimic);
        }
        /// <summary>
        /// Used to add the Childs the element to current instance.
        /// </summary>
        /// <typeparam name="T">Model</typeparam>
        /// <returns></returns>
        public T ChildElement <T>() where T : HtmlTag, new()
        {
            var child = new T();

            ChildElements.Add(child);
            return(child);
        }
Example #3
0
        public Robot() : base("robot", true)
        {
            BaseLink      = new Link(null);
            NameAttribute = new URDFAttribute("name", true, "");

            ChildElements.Add(BaseLink);
            Attributes.Add(NameAttribute);
        }
Example #4
0
        public Collision() : base("collision", false)
        {
            Origin   = new Origin(false);
            Geometry = new Geometry();

            ChildElements.Add(Origin);
            ChildElements.Add(Geometry);
        }
Example #5
0
 public void AddChild(ListElement element)
 {
     if (ChildElements.Contains(element) == false)
     {
         element.ParentElement = this;
         ChildElements.Add(element);
     }
 }
        public Inertial() : base("inertial", false)
        {
            Origin  = new Origin("Inertia", false);
            Mass    = new Mass();
            Inertia = new Inertia();

            ChildElements.Add(Origin);
            ChildElements.Add(Mass);
            ChildElements.Add(Inertia);
        }
        public Material() : base("material", false)
        {
            Color         = new Color();
            Texture       = new Texture();
            NameAttribute = new URDFAttribute("name", true, "");

            Attributes.Add(NameAttribute);
            ChildElements.Add(Color);
            ChildElements.Add(Texture);
        }
        public Visual() : base("visual", false)
        {
            Origin   = new Origin(false);
            Geometry = new Geometry();
            Material = new Material();

            ChildElements.Add(Origin);
            ChildElements.Add(Geometry);
            ChildElements.Add(Material);
        }
 public GraphComponent(RectangleF Rect, Color color, int Spacing = 1, bool Dots = false) : base(Rect)
 {
     this.Dots    = Dots;
     this.spacing = Spacing;
     Color        = color;
     this.Rect    = Rect;
     Array        = new double[(int)Rect.Width / spacing];
     StartIndex   = Array.Length;
     TextRect     = new Rectangle((int)Rect.Width, 0, TextDisplayWidth, (int)Rect.Height);
     TextDisplay  = new TextDisplay(TextRect);
     ChildElements.Add(TextDisplay);
 }
        public ColorEditor(RectangleF Rect) : base(Rect)
        {
            float Padding = 10;
            float X       = Padding;

            ColorScaleSlider       = new Slider(new RectangleF(X, Padding, 30, Rect.Height - Padding * 2));
            ColorScaleSlider.Value = 0.5;
            ChildElements.Add(ColorScaleSlider);
            X += ColorScaleSlider.Rect.Width + Padding;
            MainCircleOuterRadius = Rect.Height / 2 - Padding;
            MainCirclePosition    = new Vector2(X + MainCircleOuterRadius, Padding + MainCircleOuterRadius);
            X += MainCircleOuterRadius * 2 + Padding;
            InnerCircleRadius     = MainCircleOuterRadius * 0.3f;
            MainCircleInnerRadius = MainCircleOuterRadius * 0.6f;

            ColorPalette[0]     = Color4.Orange;
            ColorPalette[1]     = Color4.DarkBlue;
            ColorPalette[2]     = Color4.Cyan;
            PalettePositions[0] = 0.0f;
            PalettePositions[1] = 0.33f;
            PalettePositions[2] = 0.66f;
            CurrentPaletteSize  = 3;
            InteriorColor       = Color.Black;
            DragEvent          += MainDrag;
            MouseDownEvent     += MouseDown;
            HoverEvent         += MouseHover;
            MouseUpEvent       += MouseUp;
            float SliderHeight = (Rect.Height - Padding * 4) / 3;

            Color[] Colors = new Color[] { Color.Red, Color.Lime, Color.Blue };
            for (int i = 0; i < 3; i++)
            {
                ColorSliders[i] = new Slider(new RectangleF(X, Padding + (SliderHeight + Padding) * i, 140, SliderHeight));
                ColorSliders[i].BackgroundColor = Colors[i];
                ChildElements.Add(ColorSliders[i]);
            }
            X += 140 + Padding;
            DotStrengthSlider       = new Slider(new RectangleF(X, Padding, 30, Rect.Height - Padding * 2));
            DotStrengthSlider.Value = 1;
            X += 30 + Padding;
            ChildElements.Add(DotStrengthSlider);
            ColorScaleSlider.SliderEvent += ScaleSliderChanged;
            DistanceColoringButton        = new FractalWindow(new RectangleF(X, Padding, 50, 50));
            DistanceColoringButton.Controller.CameraPos = new Complex(-0.037896351914748, 0.682660083979483);
            DistanceColoringButton.Controller.Zoom      = 0.005;
            DistanceColoringButton.EnableInteraction    = false;
            DistanceColoringButton.MouseDownEvent      += DistanceColorButtonClicked;
            DistanceColoringButton.Controller.DistanceEstimateEnabled = true;
            DistanceColoringButton.Controller.ColorScale = 5;
            ChildElements.Add(DistanceColoringButton);
        }
Example #11
0
        public ConfigurationElementCollection GetCollection(string collectionName)
        {
            var child = ChildElements[collectionName];

            if (child != null)
            {
                return(child.GetCollection());
            }

            var schema = Schema.ChildElementSchemas[collectionName];

            if (schema == null)
            {
                return(null);
            }

            var result = new ConfigurationElementCollection(collectionName, schema, this, this.InnerEntity, null);

            ChildElements.Add(result);
            return(result.GetCollection());
        }
Example #12
0
        public Link() : base("link", true)
        {
            Parent          = null;
            Children        = new List <Link>();
            SWComponents    = new List <Component2>();
            SWComponentPIDs = new List <byte[]>();
            NameAttribute   = new URDFAttribute("name", true, "");

            Inertial  = new Inertial();
            Visual    = new Visual();
            Collision = new Collision();
            Joint     = new Joint();

            isFixedFrame = false;

            Attributes.Add(NameAttribute);
            ChildElements.Add(Inertial);
            ChildElements.Add(Visual);
            ChildElements.Add(Collision);
            ChildElements.Add(Joint);
        }
Example #13
0
        void AddVariable(char v)
        {
            Complex pv = 0;

            ParameterValues.Add(pv);
            var container = new ParameterContainer();

            container.variable        = v;
            container.variableDisplay = new TextDisplay(new RectangleF(10, 0, VariableDisplaySize, VariableDisplaySize));
            container.variableDisplay.PrepareWrite();
            container.variableDisplay.DrawCenteredText(v.ToString(), Brushes.Black, 10);
            container.variableDisplay.PrepareDraw();
            ChildElements.Add(container.variableDisplay);

            container.numberDisplay = new TextDisplay(new RectangleF(20 + VariableDisplaySize, 0, Rect.Width - VariableDisplaySize * 2 - 30, VariableDisplaySize));
            container.numberDisplay.PrepareWrite();
            container.numberDisplay.DrawCenteredText(pv.ToString(), Brushes.Black, 8);
            container.numberDisplay.PrepareDraw();
            container.numberDisplay.DrawFrame = false;
            ChildElements.Add(container.numberDisplay);

            parameterContainers.Add(container);
        }
Example #14
0
 public void AddChild(IGuiElement element)
 {
     element.Parent = this;
     ChildElements.Add(element);
 }
 /// <summary>
 /// Used to Add the specified child to the current instance.
 /// </summary>
 /// <param name="child">The child.</param>
 /// <returns>Current HtmlTag instance</returns>
 public HtmlTag Add(HtmlTag child)
 {
     ChildElements.Add(child);
     return(this);
 }
Example #16
0
 internal virtual void AddChild(ConfigurationElement child)
 {
     ChildElements.Add(child);
 }
        public ExampleLocationComponent(float x, float y, AutoZoomController zoomController, Main M) : base(new RectangleF(x, y, Width, Height))
        {
            this.M = M;
            this.zoomController = zoomController;
            string Data = Resources.ExampleLocations;

            string[] lines = Data.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

            List <ExampleLocationStructs> locations = new List <ExampleLocationStructs>();

            for (int i = lines.Length - 1; i >= 0; i--)
            {
                string[] parts = lines[i].Split(':');
                if (parts[0] == "function")
                {
                    var exampleFunction = new ExampleFunctionStruct();
                    exampleFunction.exampleLocations = locations;
                    exampleFunction.functionString   = parts[1];
                    locations = new List <ExampleLocationStructs>();
                    Examples.Insert(0, exampleFunction);
                }
                else if (parts[0] == "location")
                {
                    var      exampleLocation = new ExampleLocationStructs();
                    string[] locationParts   = parts[1].Split('|');
                    exampleLocation.position = new Complex();
                    if (!double.TryParse(locationParts[0], out exampleLocation.position.real))
                    {
                        Console.WriteLine(locationParts[0] + " is not a valid double");
                        break;
                    }
                    if (!double.TryParse(locationParts[1], out exampleLocation.position.imag))
                    {
                        Console.WriteLine(locationParts[1] + " is not a valid double");
                        break;
                    }
                    if (!double.TryParse(locationParts[2], out exampleLocation.zoom))
                    {
                        Console.WriteLine(locationParts[2] + " is not a valid double");
                        break;
                    }
                    if (!int.TryParse(locationParts[3], out exampleLocation.iter))
                    {
                        Console.WriteLine(locationParts[3] + " is not a valid integer");
                        break;
                    }
                    locations.Add(exampleLocation);
                }
                else
                {
                    Console.WriteLine(parts[0] + " is not a valid modifier");
                    break;
                }
            }
            for (int i = 0; i < ExampleLocationWindows.Length; i++)
            {
                ExampleLocationWindows[i] = new FractalWindow(new RectangleF(10 + SideButtonWidth + (FractalWindowSize + 10) * i, FractalWindowSize + 32, FractalWindowSize, FractalWindowSize));
                ChildElements.Add(ExampleLocationWindows[i]);
                ExampleLocationWindows[i].EnableInteraction = false;
                ExampleLocationWindows[i].MouseDownEvent   += FractalWindowClick;
            }

            int X = (FractalWindowSize + 10) * (ExampleLocationWindows.Length - 1);

            FunctionFractalWindow = new FractalWindow(new RectangleF(10 + SideButtonWidth + X, 10, FractalWindowSize, FractalWindowSize));
            FunctionFractalWindow.EnableInteraction = false;
            FunctionFractalWindow.MouseDownEvent   += FractalWindowClick;
            ChildElements.Add(FunctionFractalWindow);
            polynomialDisplay = new TextDisplay(new RectangleF(10 + SideButtonWidth, 10, X - 10, FractalWindowSize));
            polynomialDisplay.PrepareDraw();
            ChildElements.Add(polynomialDisplay);
            currentExample  = Examples[0];
            MouseDownEvent += MainWindowClicked;
        }
Example #18
0
 public void SetBaseLink(Link link)
 {
     BaseLink = link;
     ChildElements.Clear();
     ChildElements.Add(link);
 }
Example #19
0
 /// <summary>
 /// Appends <paramref name="domElement"/> to the end of the list of child elements of
 /// this <see cref="DomElement"/>.
 /// </summary>
 /// <param name="domElement">Child element to be added.</param>
 public virtual void AppendChild(DomElement domElement)
 {
     ChildElements.Add(domElement);
 }
Example #20
0
 public Geometry() : base("geometry", true)
 {
     Mesh = new Mesh();
     ChildElements.Add(Mesh);
 }