2 * Copyright(c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.ComponentModel;
22 /// A class encapsulating the property map of the arc visual.
24 [EditorBrowsable(EditorBrowsableState.Never)]
25 public class ArcVisual : VisualMap
29 private float thickness;
30 private float startAngle;
31 private float sweepAngle;
42 [EditorBrowsable(EditorBrowsableState.Never)]
43 public ArcVisual() : base()
47 #endregion Constructors
53 /// Enumeration for the cap style of the arc line.
55 [EditorBrowsable(EditorBrowsableState.Never)]
59 /// The arc does not extend beyond its two endpoints.
61 [EditorBrowsable(EditorBrowsableState.Never)]
65 /// The arc will be extended by a half circle with the center at the end.
67 [EditorBrowsable(EditorBrowsableState.Never)]
77 /// The thickness of the arc.
79 [EditorBrowsable(EditorBrowsableState.Never)]
80 public float Thickness
91 /// The start angle where the arc begins in degrees.
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public float StartAngle
105 /// The sweep angle of the arc in degrees.
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 public float SweepAngle
119 /// The cap style of the arc.
121 [EditorBrowsable(EditorBrowsableState.Never)]
132 #endregion Properties
138 [EditorBrowsable(EditorBrowsableState.Never)]
139 protected override void ComposingPropertyMap()
141 _outputVisualMap = null;
143 base.ComposingPropertyMap();
145 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Arc));
146 _outputVisualMap.Add(ArcVisualProperty.Thickness, new PropertyValue(Thickness < 0.0f ? 0.0f : Thickness));
147 _outputVisualMap.Add(ArcVisualProperty.StartAngle, new PropertyValue(StartAngle));
148 _outputVisualMap.Add(ArcVisualProperty.SweepAngle, new PropertyValue(SweepAngle));
149 _outputVisualMap.Add(ArcVisualProperty.Cap, new PropertyValue((int)Cap));