add property types include Opacity & CreateFromObject() types added
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / VisualMaps.cs
1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15
16 namespace Tizen.NUI
17 {
18     using System;
19     using System.Runtime.InteropServices;
20
21     /// <summary>
22     /// A class encapsulating the transform map of visual.
23     /// </summary>
24     public class VisualMap
25     {
26         private Vector2 _visualSize = null;
27         private Vector2 _visualOffset = null;
28         private Vector2 _visualOffsetPolicy = null;
29         private Vector2 _visualSizePolicy = null;
30         private Visual.AlignType? _visualOrigin = null;
31         private Visual.AlignType? _visualAnchorPoint = null;
32
33         private PropertyMap _visualTransformMap = null;
34
35         private float _depthIndex = 0.0f;
36         protected PropertyMap _outputVisualMap = null;
37
38
39         internal string Name
40         {
41             set;
42             get;
43         }
44         internal int VisualIndex
45         {
46             set;
47             get;
48         }
49         internal VisualView Parent
50         {
51             set;
52             get;
53         }
54
55         public VisualMap()
56         {
57         }
58
59         /// <summary>
60         /// Get or set size of the visual.<br>
61         /// It can be either relative (percentage of the parent)
62         /// or absolute (in world units).<br>
63         /// </summary>
64         public Vector2 Size
65         {
66             get
67             {
68                 return _visualSize;
69             }
70             set
71             {
72                 _visualSize = value;
73                 UpdateVisual();
74             }
75         }
76
77         /// <summary>
78         /// Get or set offset of the visual.<br>
79         /// It can be either relative (percentage of the parent)
80         /// or absolute (in world units).<br>
81         /// </summary>
82         public Vector2 Position
83         {
84             get
85             {
86                 return _visualOffset;
87             }
88             set
89             {
90                 _visualOffset = value;
91                 UpdateVisual();
92             }
93         }
94
95         /// <summary>
96         /// Get or set offset policy of the visual.<br>
97         /// Indicates which components of the offset are relative
98         /// (percentage of the parent) or absolute (in world units).<br>
99         /// 0 indicates the component is relative, and 1 absolute.<br>
100         /// </summary>
101         public Vector2 PositionPolicy
102         {
103             get
104             {
105                 return _visualOffsetPolicy;
106             }
107             set
108             {
109                 _visualOffsetPolicy = value;
110                 UpdateVisual();
111             }
112         }
113
114         /// <summary>
115         /// Get or set size policy of the visual.<br>
116         /// Indicates which components of the size are relative
117         /// (percentage of the parent) or absolute (in world units).<br>
118         /// 0 indicates the component is relative, and 1 absolute.<br>
119         /// </summary>
120         public Vector2 SizePolicy
121         {
122             get
123             {
124                 return _visualSizePolicy;
125             }
126             set
127             {
128                 _visualSizePolicy = value;
129                 UpdateVisual();
130             }
131         }
132
133         /// <summary>
134         /// Get or set the origin of the visual within its control area.
135         /// </summary>
136         public Visual.AlignType Origin
137         {
138             get
139             {
140                 return _visualOrigin ?? (Visual.AlignType)(-1);
141             }
142             set
143             {
144                 _visualOrigin = value;
145                 UpdateVisual();
146             }
147         }
148
149         /// <summary>
150         /// Get or set the anchor-point of the visual.
151         /// </summary>
152         public Visual.AlignType AnchorPoint
153         {
154             get
155             {
156                 return _visualAnchorPoint ?? (Visual.AlignType)(-1);
157             }
158             set
159             {
160                 _visualAnchorPoint = value;
161                 UpdateVisual();
162             }
163         }
164
165         /// <summary>
166         /// Get or set the depth index of the visual.
167         /// </summary>
168         public float DepthIndex
169         {
170             get
171             {
172                 return _depthIndex;
173             }
174             set
175             {
176                 _depthIndex = value;
177             }
178         }
179
180         private void ComposingTransformMap()
181         {
182             _visualTransformMap = new PropertyMap();
183             if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); }
184             if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); }
185             if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); }
186             if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); }
187             if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); }
188             if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); }
189         }
190
191         /// <summary>
192         /// Get the transform map used by the visual.
193         /// </summary>
194         public PropertyMap OutputTransformMap
195         {
196             get
197             {
198                 ComposingTransformMap();
199                 return _visualTransformMap;
200             }
201         }
202
203         protected virtual void ComposingPropertyMap()
204         {
205             _outputVisualMap = new PropertyMap();
206         }
207
208         /// <summary>
209         /// Get the property map to create the visual.
210         /// </summary>
211         public PropertyMap OutputVisualMap
212         {
213             get
214             {
215                 ComposingPropertyMap();
216                 return _outputVisualMap;
217             }
218         }
219
220         internal void UpdateVisual()
221         {
222             if (VisualIndex > 0)
223             {
224                 Tizen.Log.Debug("NUI", "UpdateVisual()! VisualIndex=" + VisualIndex);
225                 Parent.UpdateVisual(VisualIndex, Name, this);
226             }
227             else
228             {
229                 Tizen.Log.Debug("NUI", "VisualIndex was not set");
230             }
231         }
232
233         protected PropertyMap _shader = null;
234         //private PropertyMap _transform = null;
235         protected bool? _premultipliedAlpha = null;
236         protected Color _mixColor = null;
237         protected float? _opacity = null;
238         protected PropertyMap _commonlyUsedMap = null;
239
240         /// <summary>
241         /// The shader to use in the visual.
242         /// </summary>
243         public PropertyMap Shader
244         {
245             get
246             {
247                 return _shader;
248             }
249             set
250             {
251                 _shader = value;
252                 UpdateVisual();
253             }
254         }
255         /// <summary>
256         /// Enables/disables premultiplied alpha. <br>
257         /// The premultiplied alpha is false by default unless this behaviour is modified by the derived Visual type.
258         /// </summary>
259         public bool PremultipliedAlpha
260         {
261             get
262             {
263                 return _premultipliedAlpha??false;
264             }
265             set
266             {
267                 _premultipliedAlpha = value;
268                 UpdateVisual();
269             }
270         }
271         /// <summary>
272         /// Mix color is a blend color for any visual.
273         /// </summary>
274         public Color MixColor
275         {
276             get
277             {
278                 return _mixColor;
279             }
280             set
281             {
282                 _mixColor = value;
283                 UpdateVisual();
284             }
285         }
286         /// <summary>
287         /// Opacity is the alpha component of the mixColor, above.
288         /// </summary>
289         public float Opacity
290         {
291             get
292             {
293                 return _opacity??(-1.0f);
294             }
295             set
296             {
297                 _opacity = value;
298                 UpdateVisual();
299             }
300         }
301
302     }
303
304     /// <summary>
305     /// A class encapsulating the property map of a image visual.
306     /// </summary>
307     public class ImageVisual : VisualMap
308     {
309         public ImageVisual() : base()
310         {
311         }
312
313         private string _url = null;
314         private FittingModeType? _fittingMode = null;
315         private SamplingModeType? _samplingMode = null;
316         private int? _desiredWidth = null;
317         private int? _desiredHeight = null;
318         private bool? _synchronousLoading = false;
319         private bool? _borderOnly = null;
320         private Vector4 _pixelArea = null;
321         private WrapModeType? _wrapModeU = null;
322         private WrapModeType? _wrapModeV = null;
323
324         /// <summary>
325         /// Get or set the URL of the image.
326         /// </summary>
327         public string URL
328         {
329             get
330             {
331                 return _url;
332             }
333             set
334             {
335                 _url = value;
336                 UpdateVisual();
337             }
338         }
339
340         /// <summary>
341         /// Get or set fitting options, used when resizing images to fit desired dimensions.<br>
342         /// If not supplied, default is FittingMode::SHRINK_TO_FIT.<br>
343         /// For Normal Quad images only.<br>
344         /// </summary>
345         public FittingModeType FittingMode
346         {
347             get
348             {
349                 return _fittingMode ?? (FittingModeType)(-1);
350             }
351             set
352             {
353                 _fittingMode = value;
354                 UpdateVisual();
355             }
356         }
357
358         /// <summary>
359         /// Get or set filtering options, used when resizing images to sample original pixels.<br>
360         /// If not supplied, default is SamplingMode::BOX.<br>
361         /// For Normal Quad images only.<br>
362         /// </summary>
363         public SamplingModeType SamplingMode
364         {
365             get
366             {
367                 return _samplingMode ?? (SamplingModeType)(-1);
368             }
369             set
370             {
371                 _samplingMode = value;
372                 UpdateVisual();
373             }
374         }
375
376         /// <summary>
377         /// Get or set the desired image width.<br>
378         /// If not specified, the actual image width is used.<br>
379         /// For Normal Quad images only.<br>
380         /// </summary>
381         public int DesiredWidth
382         {
383             get
384             {
385                 return _desiredWidth ?? (-1);
386             }
387             set
388             {
389                 _desiredWidth = value;
390                 UpdateVisual();
391             }
392         }
393
394         /// <summary>
395         /// Get or set the desired image height.<br>
396         /// If not specified, the actual image height is used.<br>
397         /// For Normal Quad images only.<br>
398         /// </summary>
399         public int DesiredHeight
400         {
401             get
402             {
403                 return _desiredHeight ?? (-1);
404             }
405             set
406             {
407                 _desiredHeight = value;
408                 UpdateVisual();
409             }
410         }
411
412         /// <summary>
413         /// Get or set whether to load the image synchronously.<br>
414         /// If not specified, the default is false, i.e. the image is loaded asynchronously.<br>
415         /// For Normal Quad images only.<br>
416         /// </summary>
417         public bool SynchronousLoading
418         {
419             get
420             {
421                 return _synchronousLoading ?? false;
422             }
423             set
424             {
425                 _synchronousLoading = value;
426                 UpdateVisual();
427             }
428         }
429
430         /// <summary>
431         /// Get or set whether to draws the borders only(If true).<br>
432         /// If not specified, the default is false.<br>
433         /// For N-Patch images only.<br>
434         /// </summary>
435         public bool BorderOnly
436         {
437             get
438             {
439                 return _borderOnly ?? false;
440             }
441             set
442             {
443                 _borderOnly = value;
444                 UpdateVisual();
445             }
446         }
447
448         /// <summary>
449         /// Get or set the image area to be displayed.<br>
450         /// It is a rectangular area.<br>
451         /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
452         /// If not specified, the default value is [0.0, 0.0, 1.0, 1.0], i.e. the entire area of the image.<br>
453         /// For For Normal QUAD image only.<br>
454         /// </summary>
455         public Vector4 PixelArea
456         {
457             get
458             {
459                 return _pixelArea;
460             }
461             set
462             {
463                 _pixelArea = value;
464                 UpdateVisual();
465             }
466         }
467
468         /// <summary>
469         /// Get or set the wrap mode for u coordinate.<br>
470         /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br>
471         /// If not specified, the default is CLAMP.<br>
472         /// For Normal QUAD image only.<br>
473         /// </summary>
474         public WrapModeType WrapModeU
475         {
476             get
477             {
478                 return _wrapModeU ?? (WrapModeType)(-1);
479             }
480             set
481             {
482                 _wrapModeU = value;
483                 UpdateVisual();
484             }
485         }
486
487         /// <summary>
488         /// Get or set the wrap mode for v coordinate.<br>
489         /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br>
490         /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
491         /// If not specified, the default is CLAMP.<br>
492         /// For Normal QUAD image only.
493         /// </summary>
494         public WrapModeType WrapModeV
495         {
496             get
497             {
498                 return _wrapModeV ?? (WrapModeType)(-1);
499             }
500             set
501             {
502                 _wrapModeV = value;
503                 UpdateVisual();
504             }
505         }
506
507         protected override void ComposingPropertyMap()
508         {
509             _outputVisualMap = new PropertyMap();
510             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
511             if (_url != null) { _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url)); }
512             if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
513             if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
514             if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
515             if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
516             if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
517             if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
518             if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
519             if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
520             if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
521             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
522             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
523             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
524             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
525         }
526     }
527
528     /// <summary>
529     /// A class encapsulating the property map of a text visual.
530     /// </summary>
531     public class TextVisual : VisualMap
532     {
533         public TextVisual() : base()
534         {
535         }
536
537         private string _text = null;
538         private string _fontFamily = null;
539         private PropertyMap _fontStyle = null;
540         private float? _pointSize = null;
541         private bool? _multiLine = null;
542         private string _horizontalAlignment = null;
543         private string _verticalAlignment = null;
544         private Color _textColor = null;
545         private bool? _enableMarkup = null;
546
547         /// <summary>
548         /// Get or set the text to display in UTF-8 format.
549         /// </summary>
550         public string Text
551         {
552             get
553             {
554                 return _text;
555             }
556             set
557             {
558                 _text = value;
559                 UpdateVisual();
560             }
561         }
562
563         /// <summary>
564         /// Get or set the requested font family to use.
565         /// </summary>
566         public string FontFamily
567         {
568             get
569             {
570                 return _fontFamily;
571             }
572             set
573             {
574                 _fontFamily = value;
575                 UpdateVisual();
576             }
577         }
578
579         /// <summary>
580         /// Get or set the requested font style to use.
581         /// </summary>
582         public PropertyMap FontStyle
583         {
584             get
585             {
586                 return _fontStyle;
587             }
588             set
589             {
590                 _fontStyle = value;
591                 UpdateVisual();
592             }
593         }
594
595         /// <summary>
596         /// Get or set the size of font in points.
597         /// </summary>
598         public float PointSize
599         {
600             get
601             {
602                 return _pointSize ?? (-1.0f);
603             }
604             set
605             {
606                 _pointSize = value;
607                 UpdateVisual();
608             }
609         }
610
611         /// <summary>
612         /// Get or set the single-line or multi-line layout option.
613         /// </summary>
614         public bool MultiLine
615         {
616             get
617             {
618                 return _multiLine ?? false;
619             }
620             set
621             {
622                 _multiLine = value;
623                 UpdateVisual();
624             }
625         }
626
627         /// <summary>
628         /// Get or set the line horizontal alignment.<br>
629         /// If not specified, the default is BEGIN.<br>
630         /// </summary>
631         public string HorizontalAlignment
632         {
633             get
634             {
635                 return _horizontalAlignment;
636             }
637             set
638             {
639                 _horizontalAlignment = value;
640                 UpdateVisual();
641             }
642         }
643
644         /// <summary>
645         /// Get or set the line vertical alignment.<br>
646         /// If not specified, the default is TOP.<br>
647         /// </summary>
648         public string VerticalAlignment
649         {
650             get
651             {
652                 return _verticalAlignment;
653             }
654             set
655             {
656                 _verticalAlignment = value;
657                 UpdateVisual();
658             }
659         }
660
661         /// <summary>
662         /// Get or set the color of the text.
663         /// </summary>
664         public Color TextColor
665         {
666             get
667             {
668                 return _textColor;
669             }
670             set
671             {
672                 _textColor = value;
673                 UpdateVisual();
674             }
675         }
676
677         /// <summary>
678         /// Get or set whether the mark-up processing is enabled.
679         /// </summary>
680         public bool EnableMarkup
681         {
682             get
683             {
684                 return _enableMarkup ?? false;
685             }
686             set
687             {
688                 _enableMarkup = value;
689                 UpdateVisual();
690             }
691         }
692
693         protected override void ComposingPropertyMap()
694         {
695             _outputVisualMap = new PropertyMap();
696             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
697             if (_text != null) { _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text)); }
698             if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
699             if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
700             if (_pointSize != null) { _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize)); }
701             if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
702             if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
703             if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
704             if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
705             if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
706             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
707             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
708             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
709             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
710         }
711     }
712
713     /// <summary>
714     /// A class encapsulating the property map of a border visual.
715     /// </summary>
716     public class BorderVisual : VisualMap
717     {
718         public BorderVisual() : base()
719         {
720         }
721
722         private Color _color = null;
723         private float? _size = null;
724         private bool? _antiAliasing = null;
725
726         /// <summary>
727         /// Get or set the color of the border.
728         /// </summary>
729         public Color Color
730         {
731             get
732             {
733                 return _color;
734             }
735             set
736             {
737                 _color = value;
738                 UpdateVisual();
739             }
740         }
741
742         /// <summary>
743         /// Get or set the width of the border (in pixels).
744         /// </summary>
745         public float BorderSize
746         {
747             get
748             {
749                 return _size ?? (-1.0f);
750             }
751             set
752             {
753                 _size = value;
754                 UpdateVisual();
755             }
756         }
757
758         /// <summary>
759         /// Get or set whether anti-aliasing of the border is required.<br>
760         /// If not supplied, default is false.<br>
761         /// </summary>
762         public bool AntiAliasing
763         {
764             get
765             {
766                 return _antiAliasing ?? false;
767             }
768             set
769             {
770                 _antiAliasing = value;
771                 UpdateVisual();
772             }
773         }
774
775         protected override void ComposingPropertyMap()
776         {
777             _outputVisualMap = new PropertyMap();
778             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
779             if (_color != null) { _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color)); }
780             if (_size != null) { _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size)); }
781             if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
782             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
783             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
784             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
785             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
786         }
787     }
788
789     /// <summary>
790     /// A class encapsulating the property map of a color visual.
791     /// </summary>
792     public class ColorVisual : VisualMap
793     {
794         public ColorVisual() : base()
795         {
796         }
797
798         private Color _mixColorForColorVisual = null;
799
800         /// <summary>
801         /// Get or set the solid color required.
802         /// </summary>
803         public Color Color
804         {
805             get
806             {
807                 return _mixColorForColorVisual;
808             }
809             set
810             {
811                 _mixColorForColorVisual = value;
812                 UpdateVisual();
813             }
814         }
815
816         protected override void ComposingPropertyMap()
817         {
818             _outputVisualMap = new PropertyMap();
819             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
820             if (_mixColorForColorVisual != null) { _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual)); }
821             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
822             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
823             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
824         }
825     }
826
827     /// <summary>
828     /// A class encapsulating the property map of a gradient visual.
829     /// </summary>
830     public class GradientVisual : VisualMap
831     {
832         public GradientVisual() : base()
833         {
834         }
835
836         private Vector2 _startPosition = null;
837         private Vector2 _endPosition = null;
838         private Vector2 _center = null;
839         private float? _radius = null;
840         private PropertyArray _stopOffset = null;
841         private PropertyArray _stopColor = null;
842         private GradientVisualUnitsType? _units = null;
843         private GradientVisualSpreadMethodType? _spreadMethod = null;
844
845         /// <summary>
846         /// Get or set the start position of a linear gradient.<br>
847         /// Mandatory for Linear.<br>
848         /// </summary>
849         public Vector2 StartPosition
850         {
851             get
852             {
853                 return _startPosition;
854             }
855             set
856             {
857                 _startPosition = value;
858                 UpdateVisual();
859             }
860         }
861
862         /// <summary>
863         /// Get or set the end position of a linear gradient.<br>
864         /// Mandatory for Linear.<br>
865         /// </summary>
866         public Vector2 EndPosition
867         {
868             get
869             {
870                 return _endPosition;
871             }
872             set
873             {
874                 _endPosition = value;
875                 UpdateVisual();
876             }
877         }
878
879         /// <summary>
880         /// Get or set the center point of a radial gradient.<br>
881         /// Mandatory for Radial.<br>
882         /// </summary>
883         public Vector2 Center
884         {
885             get
886             {
887                 return _center;
888             }
889             set
890             {
891                 _center = value;
892                 UpdateVisual();
893             }
894         }
895
896         /// <summary>
897         /// Get or set the size of the radius of a radial gradient.<br>
898         /// Mandatory for Radial.<br>
899         /// </summary>
900         public float Radius
901         {
902             get
903             {
904                 return _radius ?? (-1.0f);
905             }
906             set
907             {
908                 _radius = value;
909                 UpdateVisual();
910             }
911         }
912
913         /// <summary>
914         /// Get or set all the stop offsets.<br>
915         /// A PropertyArray of float.<br>
916         /// If not supplied, default is 0.0f and 1.0f.<br>
917         /// </summary>
918         public PropertyArray StopOffset
919         {
920             get
921             {
922                 return _stopOffset;
923             }
924             set
925             {
926                 _stopOffset = value;
927                 UpdateVisual();
928             }
929         }
930
931         /// <summary>
932         /// Get or set the color at the stop offsets.<br>
933         /// A PropertyArray of Color.<br>
934         /// At least 2 values required to show a gradient.<br>
935         /// </summary>
936         public PropertyArray StopColor
937         {
938             get
939             {
940                 return _stopColor;
941             }
942             set
943             {
944                 _stopColor = value;
945                 UpdateVisual();
946             }
947         }
948
949         /// <summary>
950         /// Get or set defines the coordinate system for certain attributes of the points in a gradient.<br>
951         /// If not supplied, default is GradientVisualUnitsType.OBJECT_BOUNDING_BOX.<br>
952         /// </summary>
953         public GradientVisualUnitsType Units
954         {
955             get
956             {
957                 return _units ?? (GradientVisualUnitsType)(-1);
958             }
959             set
960             {
961                 _units = value;
962                 UpdateVisual();
963             }
964         }
965
966         /// <summary>
967         /// Get or set indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.<br>
968         /// If not supplied, default is GradientVisualSpreadMethodType.PAD.<br>
969         /// </summary>
970         public GradientVisualSpreadMethodType SpreadMethod
971         {
972             get
973             {
974                 return _spreadMethod ?? (GradientVisualSpreadMethodType)(-1);
975             }
976             set
977             {
978                 _spreadMethod = value;
979                 UpdateVisual();
980             }
981         }
982
983         protected override void ComposingPropertyMap()
984         {
985             _outputVisualMap = new PropertyMap();
986             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
987             if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
988             if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
989             if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
990             if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
991             if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
992             if (_stopColor != null) { _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor)); }
993             if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
994             if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
995             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
996             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
997             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
998             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
999         }
1000     }
1001
1002     /// <summary>
1003     /// A class encapsulating the property map of a mesh visual.
1004     /// </summary>
1005     public class MeshVisual : VisualMap
1006     {
1007         public MeshVisual() : base()
1008         {
1009         }
1010
1011         private string _objectURL = null;
1012         private string _materialtURL = null;
1013         private string _texturesPath = null;
1014         private MeshVisualShadingModeValue? _shadingMode = null;
1015         private bool? _useMipmapping = null;
1016         private bool? _useSoftNormals = null;
1017         private Vector3 _lightPosition = null;
1018
1019         /// <summary>
1020         /// Get or set the location of the ".obj" file.
1021         /// </summary>
1022         public string ObjectURL
1023         {
1024             get
1025             {
1026                 return _objectURL;
1027             }
1028             set
1029             {
1030                 _objectURL = value;
1031                 UpdateVisual();
1032             }
1033         }
1034
1035         /// <summary>
1036         /// Get or set the location of the ".mtl" file.<br>
1037         /// If not specified, then a textureless object is assumed.<br>
1038         /// </summary>
1039         public string MaterialtURL
1040         {
1041             get
1042             {
1043                 return _materialtURL;
1044             }
1045             set
1046             {
1047                 _materialtURL = value;
1048                 UpdateVisual();
1049             }
1050         }
1051
1052         /// <summary>
1053         /// Get or set path to the directory the textures (including gloss and normal) are stored in.<br>
1054         /// Mandatory if using material.<br>
1055         /// </summary>
1056         public string TexturesPath
1057         {
1058             get
1059             {
1060                 return _texturesPath;
1061             }
1062             set
1063             {
1064                 _texturesPath = value;
1065                 UpdateVisual();
1066             }
1067         }
1068
1069         /// <summary>
1070         /// Get or set the type of shading mode that the mesh will use.<br>
1071         /// If anything the specified shading mode requires is missing, a simpler mode that can be handled with what has been supplied will be used instead.<br>
1072         /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TEXTURED_WITH_DETAILED_SPECULAR_LIGHTING first).<br>
1073         /// </summary>
1074         public MeshVisualShadingModeValue ShadingMode
1075         {
1076             get
1077             {
1078                 return _shadingMode??(MeshVisualShadingModeValue)(-1);
1079             }
1080             set
1081             {
1082                 _shadingMode = value;
1083                 UpdateVisual();
1084             }
1085         }
1086
1087         /// <summary>
1088         /// Get or set whether to use mipmaps for textures or not.<br>
1089         /// If not specified, the default is true.<br>
1090         /// </summary>
1091         public bool UseMipmapping
1092         {
1093             get
1094             {
1095                 return _useMipmapping??false;
1096             }
1097             set
1098             {
1099                 _useMipmapping = value;
1100                 UpdateVisual();
1101             }
1102         }
1103
1104         /// <summary>
1105         /// Get or set whether to average normals at each point to smooth textures or not.<br>
1106         /// If not specified, the default is true.<br>
1107         /// </summary>
1108         public bool UseSoftNormals
1109         {
1110             get
1111             {
1112                 return _useSoftNormals??false;
1113             }
1114             set
1115             {
1116                 _useSoftNormals = value;
1117                 UpdateVisual();
1118             }
1119         }
1120
1121         /// <summary>
1122         /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1123         /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1124         /// and using all zeroes will place the light at the top left corner.<br>
1125         /// If not specified, the default is an offset outwards from the center of the screen.<br>
1126         /// </summary>
1127         public Vector3 LightPosition
1128         {
1129             get
1130             {
1131                 return _lightPosition;
1132             }
1133             set
1134             {
1135                 _lightPosition = value;
1136                 UpdateVisual();
1137             }
1138         }
1139
1140         protected override void ComposingPropertyMap()
1141         {
1142             _outputVisualMap = new PropertyMap();
1143             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1144             if (_objectURL != null) { _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL)); }
1145             if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1146             if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1147             if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1148             if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1149             if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1150             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1151             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1152             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1153             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1154
1155         }
1156     }
1157
1158     /// <summary>
1159     /// A class encapsulating the property map of a primetive visual.
1160     /// </summary>
1161     public class PrimitiveVisual : VisualMap
1162     {
1163         public PrimitiveVisual() : base()
1164         {
1165         }
1166
1167         private PrimitiveVisualShapeType? _shape = null;
1168         private Color _mixColorForPrimitiveVisual = null;
1169         private int? _slices = null;
1170         private int? _stacks = null;
1171         private float? _scaleTopRadius = null;
1172         private float? _scaleBottomRadius = null;
1173         private float? _scaleHeight = null;
1174         private float? _scaleRadius = null;
1175         private Vector3 _scaleDimensions = null;
1176         private float? _bevelPercentage = null;
1177         private float? _bevelSmoothness = null;
1178         private Vector3 _lightPosition = null;
1179
1180         /// <summary>
1181         /// Get or set the specific shape to render.<br>
1182         /// If not specified, the default is PrimitiveVisualShapeType.SPHERE.<br>
1183         /// </summary>
1184         public PrimitiveVisualShapeType Shape
1185         {
1186             get
1187             {
1188                 return _shape??(PrimitiveVisualShapeType)(-1);
1189             }
1190             set
1191             {
1192                 _shape = value;
1193                 UpdateVisual();
1194             }
1195         }
1196
1197         /// <summary>
1198         /// Get or set the color of the shape.<br>
1199         /// If not specified, the default is Color(0.5, 0.5, 0.5, 1.0).<br>
1200         /// Applies to ALL shapes.<br>
1201         /// </summary>
1202         public Color MixColor
1203         {
1204             get
1205             {
1206                 return _mixColorForPrimitiveVisual;
1207             }
1208             set
1209             {
1210                 _mixColorForPrimitiveVisual = value;
1211                 UpdateVisual();
1212             }
1213         }
1214
1215         /// <summary>
1216         /// Get or set the number of slices as you go around the shape.<br>
1217         /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br>
1218         /// If not specified, the default is 128.<br>
1219         /// The range is from 1 to 255.<br>
1220         /// </summary>
1221         public int Slices
1222         {
1223             get
1224             {
1225                 return _slices??(-1);
1226             }
1227             set
1228             {
1229                 _slices = value;
1230                 UpdateVisual();
1231             }
1232         }
1233
1234         /// <summary>
1235         /// Get or set the number of stacks as you go down the shape.<br>
1236         /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br>
1237         /// If not specified, the default is 128.<br>
1238         /// The range is from 1 to 255.<br>
1239         /// </summary>
1240         public int Stacks
1241         {
1242             get
1243             {
1244                 return _stacks??(-1);
1245             }
1246             set
1247             {
1248                 _stacks = value;
1249                 UpdateVisual();
1250             }
1251         }
1252
1253         /// <summary>
1254         /// Get or set the scale of the radius of the top circle of a conical frustrum.<br>
1255         /// If not specified, the default is 1.0f.<br>
1256         /// Applies to: - PrimitiveVisualShapeType.CONICAL_FRUSTRUM<br>
1257         /// Only values greater than or equal to 0.0f are accepted.<br>
1258         /// </summary>
1259         public float ScaleTopRadius
1260         {
1261             get
1262             {
1263                 return _scaleTopRadius ?? (-1.0f);
1264             }
1265             set
1266             {
1267                 _scaleTopRadius = value;
1268                 UpdateVisual();
1269             }
1270         }
1271
1272         /// <summary>
1273         /// Get or set the scale of the radius of the bottom circle of a conical frustrum.<br>
1274         /// If not specified, the default is 1.5f.<br>
1275         /// Applies to:  - PrimitiveVisualShapeType.CONICAL_FRUSTRUM<br>
1276         ///              - PrimitiveVisualShapeType.CONE<br>
1277         /// Only values greater than or equal to 0.0f are accepted.<br>
1278         /// </summary>
1279         public float ScaleBottomRadius
1280         {
1281             get
1282             {
1283                 return _scaleBottomRadius ?? (-1.0f);
1284             }
1285             set
1286             {
1287                 _scaleBottomRadius = value;
1288                 UpdateVisual();
1289             }
1290         }
1291
1292         /// <summary>
1293         /// Get or set the scale of the height of a conic.<br>
1294         /// If not specified, the default is 3.0f.<br>
1295         /// Applies to:<br>
1296         ///      - Shape::CONICAL_FRUSTRUM<br>
1297         ///      - Shape::CONE<br>
1298         ///      - Shape::CYLINDER<br>
1299         /// Only values greater than or equal to 0.0f are accepted.<br>
1300         /// </summary>
1301         public float ScaleHeight
1302         {
1303             get
1304             {
1305                 return _scaleHeight??(-1.0f);
1306             }
1307             set
1308             {
1309                 _scaleHeight = value;
1310                 UpdateVisual();
1311             }
1312         }
1313
1314         /// <summary>
1315         /// Get or set the scale of the radius of a cylinder.<br>
1316         /// If not specified, the default is 1.0f.<br>
1317         /// Applies to:<br>
1318         ///      - Shape::CYLINDER<br>
1319         /// Only values greater than or equal to 0.0f are accepted.<br>
1320         /// </summary>
1321         public float ScaleRadius
1322         {
1323             get
1324             {
1325                 return _scaleRadius ?? (-1.0f);
1326             }
1327             set
1328             {
1329                 _scaleRadius = value;
1330                 UpdateVisual();
1331             }
1332         }
1333
1334         /// <summary>
1335         /// Get or set the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br>
1336         /// If not specified, the default is Vector3.One.<br>
1337         /// Applies to:<br>
1338         ///      - Shape::CUBE<br>
1339         ///      - Shape::OCTAHEDRON<br>
1340         ///      - Shape::BEVELLED_CUBE<br>
1341         /// Each vector3 parameter should be greater than or equal to 0.0f.<br>
1342         /// </summary>
1343         public Vector3 ScaleDimensions
1344         {
1345             get
1346             {
1347                 return _scaleDimensions;
1348             }
1349             set
1350             {
1351                 _scaleDimensions = value;
1352                 UpdateVisual();
1353             }
1354         }
1355
1356         /// <summary>
1357         /// Get or set determines how bevelled the cuboid should be, based off the smallest dimension.<br>
1358         /// Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.<br>
1359         /// If not specified, the default is 0.0f (no bevel).<br>
1360         /// Applies to:<br>
1361         ///      - Shape::BEVELLED_CUBE<br>
1362         /// The range is from 0.0f to 1.0f.<br>
1363         /// </summary>
1364         public float BevelPercentage
1365         {
1366             get
1367             {
1368                 return _bevelPercentage ?? (-1.0f);
1369             }
1370             set
1371             {
1372                 _bevelPercentage = value;
1373                 UpdateVisual();
1374             }
1375         }
1376
1377         /// <summary>
1378         /// Get or set defines how smooth the bevelled edges should be.<br>
1379         /// If not specified, the default is 0.0f (sharp edges).<br>
1380         /// Applies to:<br>
1381         ///      - Shape::BEVELLED_CUBE<br>
1382         /// The range is from 0.0f to 1.0f.<br>
1383         /// </summary>
1384         public float BevelSmoothness
1385         {
1386             get
1387             {
1388                 return _bevelSmoothness ?? (-1.0f);
1389             }
1390             set
1391             {
1392                 _bevelSmoothness = value;
1393                 UpdateVisual();
1394             }
1395         }
1396
1397         /// <summary>
1398         /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1399         /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1400         /// and using all zeroes will place the light at the top left corner.<br>
1401         /// If not specified, the default is an offset outwards from the center of the screen.<br>
1402         /// Applies to ALL shapes.
1403         /// </summary>
1404         public Vector3 LightPosition
1405         {
1406             get
1407             {
1408                 return _lightPosition;
1409             }
1410             set
1411             {
1412                 _lightPosition = value;
1413                 UpdateVisual();
1414             }
1415         }
1416
1417         protected override void ComposingPropertyMap()
1418         {
1419             _outputVisualMap = new PropertyMap(); ;
1420             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
1421             if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
1422             if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
1423             if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
1424             if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
1425             if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
1426             if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
1427             if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
1428             if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
1429             if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
1430             if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
1431             if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
1432             if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
1433             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1434             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1435             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1436         }
1437     }
1438
1439     /// <summary>
1440     /// A class encapsulating the property map of a n-patch image visual.
1441     /// </summary>
1442     public class NPatchVisual : VisualMap
1443     {
1444         public NPatchVisual() : base()
1445         {
1446         }
1447
1448         private string _url = null;
1449         private bool? _borderOnly = null;
1450         private Rectangle _border = null;
1451
1452         /// <summary>
1453         /// Get or set the URL of the image.
1454         /// </summary>
1455         public string URL
1456         {
1457             get
1458             {
1459                 return _url;
1460             }
1461             set
1462             {
1463                 _url = value;
1464                 UpdateVisual();
1465             }
1466         }
1467
1468         /// <summary>
1469         /// Get or set whether to draws the borders only(If true).<br>
1470         /// If not specified, the default is false.<br>
1471         /// For N-Patch images only.<br>
1472         /// </summary>
1473         public bool BorderOnly
1474         {
1475             get
1476             {
1477                 return _borderOnly ?? false;
1478             }
1479             set
1480             {
1481                 _borderOnly = value;
1482                 UpdateVisual();
1483             }
1484         }
1485
1486         /// <summary>
1487         ///  The border of the image in the order: left, right, bottom, top.
1488         /// </summary>
1489         public Rectangle Border
1490         {
1491             get
1492             {
1493                 return _border;
1494             }
1495             set
1496             {
1497                 _border = value;
1498                 UpdateVisual();
1499             }
1500         }
1501
1502         protected override void ComposingPropertyMap()
1503         {
1504             _outputVisualMap = new PropertyMap();
1505             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
1506             if (_url != null) { _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url)); }
1507             if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
1508             if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
1509             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1510             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1511             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1512             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1513
1514         }
1515     }
1516
1517
1518     /// <summary>
1519     /// This specifies wrap mode types <br>
1520     /// WrapModeU and WrapModeV separately decide how the texture should be sampled when the u and v coordinate exceeds the range of 0.0 to 1.0.
1521     /// </summary>
1522     public enum WrapModeType
1523     {
1524         /// <summary>
1525         /// Defualt value
1526         /// </summary>
1527         Default = 0,
1528         /// <summary>
1529         /// Clamp to edge
1530         /// </summary>
1531         ClampToEdge,
1532         /// <summary>
1533         /// Repeat
1534         /// </summary>
1535         Repeat,
1536         /// <summary>
1537         /// Mirrored repeat
1538         /// </summary>
1539         MirroredRepeat
1540     }
1541
1542     /// <summary>
1543     /// The type of coordinate system for certain attributes of the points in a gradient.
1544     /// </summary>
1545     public enum GradientVisualUnitsType
1546     {
1547         /// <summary>
1548         /// Uses the normals for the start, end & center points, i.e. top-left is (-0.5, -0.5) and bottom-right is (0.5, 0.5).
1549         /// </summary>
1550         ObjectBoundingBox,
1551         /// <summary>
1552         /// Uses the user coordinates for the start, end & center points, i.e. in a 200 by 200 control, top-left is (0, 0) and bottom-right is (200, 200).
1553         /// </summary>
1554         UserSpace
1555     }
1556
1557     /// <summary>
1558     /// This specifies SpreadMethod types.<br>
1559     /// SpreadMethod defines what happens if the gradient starts or ends inside the bounds of the target rectangle.<br>
1560     /// </summary>
1561     public enum GradientVisualSpreadMethodType
1562     {
1563         /// <summary>
1564         /// Uses the terminal colors of the gradient to fill the remainder of the quad.
1565         /// </summary>
1566         Pad,
1567         /// <summary>
1568         /// Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc. until the quad is filled.
1569         /// </summary>
1570         Reflect,
1571         /// <summary>
1572         /// Repeat the gradient pattern start-to-end, start-to-end, start-to-end etc. until the quad is filled.
1573         /// </summary>
1574         Repeat
1575     }
1576
1577     /// <summary>
1578     /// The shading mode used by MeshVisual.
1579     /// </summary>
1580     public enum MeshVisualShadingModeValue
1581     {
1582         /// <summary>
1583         /// *Simplest*. One color that is lit by ambient and diffuse lighting.
1584         /// </summary>
1585         TexturelessWithDiffuseLighting,
1586         /// <summary>
1587         /// Uses only the visual image textures provided with specular lighting in addition to ambient and diffuse lighting.
1588         /// </summary>
1589         TexturedWithSpecularLighting,
1590         /// <summary>
1591         /// Uses all textures provided including a gloss, normal and texture map along with specular, ambient and diffuse lighting.
1592         /// </summary>
1593         TexturedWithDetailedSpecularLighting
1594     }
1595
1596     /// <summary>
1597     /// The primitive shape to render as a PrimitiveVisual.
1598     /// </summary>
1599     public enum PrimitiveVisualShapeType
1600     {
1601         /// <summary>
1602         /// A perfectly round geometrical object in three-dimensional space.
1603         /// </summary>
1604         Sphere,
1605         /// <summary>
1606         /// The area bound between two circles, i.e. a cone with the tip removed.
1607         /// </summary>
1608         ConicalFrustrum,
1609         /// <summary>
1610         /// Equivalent to a conical frustrum with top radius of zero.
1611         /// </summary>Equivalent to a conical frustrum with top radius of zero.
1612         Cone,
1613         /// <summary>
1614         /// Equivalent to a conical frustrum with top radius of zero.
1615         /// </summary>
1616         Cylinder,
1617         /// <summary>
1618         /// Equivalent to a conical frustrum with equal radii for the top and bottom circles.
1619         /// </summary>
1620         Cube,
1621         /// <summary>
1622         /// Equivalent to a bevelled cube with a bevel percentage of zero.
1623         /// </summary>
1624         Octahedron,
1625         /// <summary>
1626         /// Equivalent to a bevelled cube with a bevel percentage of one.
1627         /// </summary>
1628         BevelledCube
1629     }
1630
1631     /// <summary>
1632     /// This specifies fitting mode types. Fitting options, used when resizing images to fit desired dimensions.<br>
1633     /// A fitting mode controls the region of a loaded image to be mapped to the desired image rectangle.<br>
1634     /// All fitting modes preserve the aspect ratio of the image contents.<br>
1635     /// </summary>
1636     public enum FittingModeType
1637     {
1638         /// <summary>
1639         /// Full-screen image display: Limit loaded image resolution to device resolution using ShrinkToFit mode.
1640         /// </summary>
1641         ShrinkToFit,
1642         /// <summary>
1643         /// Thumbnail gallery grid: Limit loaded image resolution to screen tile using ScaleToFill mode.
1644         /// </summary>
1645         ScaleToFill,
1646         /// <summary>
1647         /// Image columns: Limit loaded image resolution to column width using FitWidth mode.
1648         /// </summary>
1649         FitWidth,
1650         /// <summary>
1651         /// Image rows: Limit loaded image resolution to row height using FitHeight mode.
1652         /// </summary>
1653         FitHeight
1654     }
1655
1656     /// <summary>
1657     /// This specifies sampling mode types. Filtering options, used when resizing images to sample original pixels.<br>
1658     /// A SamplingMode controls how pixels in an input image are sampled and combined to generate each pixel of a destination image during a scaling.<br>
1659     /// NoFilter and Box modes do not guarantee that the output pixel array exactly matches the rectangle specified by the desired dimensions and FittingMode,<br>
1660     /// but all other filter modes do if the desired dimensions are `<=` the raw dimensions of the input image file.<br>
1661     /// </summary>
1662     public enum SamplingModeType
1663     {
1664         /// <summary>
1665         /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8, etc width and height and approximately the desired size. <br>
1666         /// This is the default.
1667         /// </summary>
1668         Box,
1669         /// <summary>
1670         /// For each output pixel, read one input pixel.
1671         /// </summary>
1672         Nearest,
1673         /// <summary>
1674         /// For each output pixel, read a quad of four input pixels and write a weighted average of them.
1675         /// </summary>
1676         Linear,
1677         /// <summary>
1678         /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8 etc width and height and approximately the desired size, <br>
1679         /// then for each output pixel, read one pixel from the last level of box filtering.<br>
1680         /// </summary>
1681         BoxThenNearest,
1682         /// <summary>
1683         /// Iteratively box filter to almost the right size, then for each output pixel, read four pixels from the last level of box filtering and write their weighted average.
1684         /// </summary>
1685         BoxThenLinear,
1686         /// <summary>
1687         /// No filtering is performed. If the SCALE_TO_FILL scaling mode is enabled, the borders of the image may be trimmed to match the aspect ratio of the desired dimensions.
1688         /// </summary>
1689         NoFilter,
1690         /// <summary>
1691         /// For caching algorithms where a client strongly prefers a cache-hit to reuse a cached image.
1692         /// </summary>
1693         DontCare
1694     }
1695
1696     /// <summary>
1697     /// This specifies policy types that could be used by the transform for the offset or size.
1698     /// </summary>
1699     public enum VisualTransformPolicyType
1700     {
1701         /// <summary>
1702         /// Relative to the control (percentage [0.0f to 1.0f] of the control).
1703         /// </summary>
1704         Relative = 0,
1705         /// <summary>
1706         /// Absolute value in world units.
1707         /// </summary>
1708         Absolute = 1
1709     }
1710
1711     /// <summary>
1712     /// This specifies all the transform property types.
1713     /// </summary>
1714     public enum VisualTransformPropertyType
1715     {
1716         /// <summary>
1717         /// Offset of the visual, which can be either relative (percentage [0.0f to 1.0f] of the parent) or absolute (in world units).
1718         /// </summary>
1719         Offset,
1720         /// <summary>
1721         /// Size of the visual, which can be either relative (percentage [0.0f to 1.0f] of the parent) or absolute (in world units).
1722         /// </summary>
1723         Size,
1724         /// <summary>
1725         /// The origin of the visual within its control area.
1726         /// </summary>
1727         Origin,
1728         /// <summary>
1729         /// The anchor-point of the visual
1730         /// </summary>
1731         AnchorPoint,
1732         /// <summary>
1733         /// Whether the x or y OFFSET values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
1734         /// </summary>
1735         OffsetPolicy,
1736         /// <summary>
1737         /// Whether the width or height SIZE values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
1738         /// </summary>
1739         SizePolicy
1740     }
1741
1742     /// <summary>
1743     /// This specifies visual types.
1744     /// </summary>
1745     public struct Visual
1746     {
1747         /// <summary>
1748         /// The index for the visual type.
1749         /// </summary>
1750         public enum Type
1751         {
1752             /// <summary>
1753             /// Renders a solid color as an internal border to the control's quad.
1754             /// </summary>
1755             Border,
1756             /// <summary>
1757             /// Renders a solid color to the control's quad.
1758             /// </summary>
1759             Color,
1760             /// <summary>
1761             /// Renders a smooth transition of colors to the control's quad.
1762             /// </summary>
1763             Gradient,
1764             /// <summary>
1765             /// Renders an image into the control's quad.
1766             /// </summary>
1767             Image,
1768             /// <summary>
1769             /// Renders a mesh using an "obj" file, optionally with textures provided by an "mtl" file.
1770             /// </summary>
1771             Mesh,
1772             /// <summary>
1773             /// Renders a simple 3D shape, such as a cube or sphere.
1774             /// </summary>
1775             Primitive,
1776             /// <summary>
1777             /// Renders a simple wire-frame outlining a quad.
1778             /// </summary>
1779             Wireframe,
1780             /// <summary>
1781             /// Renders text.
1782             /// </summary>
1783             Text,
1784             /// <summary>
1785             /// Renders an n-patch image.
1786             /// </summary>
1787             NPatch,
1788             /// <summary>
1789             /// Renders an SVG image.
1790             /// </summary>
1791             SVG,
1792             /// <summary>
1793             /// Renders a animated image. (Animated GIF)
1794             /// </summary>
1795             AnimatedImage
1796         }
1797
1798         /// <summary>
1799         /// This specifies visual properties.
1800         /// </summary>
1801         public struct Property
1802         {
1803             public static readonly int Type = NDalic.VISUAL_PROPERTY_TYPE;
1804             public static readonly int Shader = NDalic.VISUAL_PROPERTY_SHADER;
1805             public static readonly int Transform = NDalic.VISUAL_PROPERTY_TRANSFORM;
1806             public static readonly int PremultipliedAlpha = NDalic.VISUAL_PROPERTY_PREMULTIPLIED_ALPHA;
1807             public static readonly int MixColor = NDalic.VISUAL_PROPERTY_MIX_COLOR;
1808             public static readonly int Opacity = NDalic.VISUAL_PROPERTY_MIX_COLOR + 1;
1809         }
1810
1811         /// <summary>
1812         /// This specifies shader properties.
1813         /// </summary>
1814         public struct ShaderProperty
1815         {
1816             public static readonly int VertexShader = NDalic.VISUAL_SHADER_VERTEX;
1817             public static readonly int FragmentShader = NDalic.VISUAL_SHADER_FRAGMENT;
1818             public static readonly int ShaderSubdivideGridX = NDalic.VISUAL_SHADER_SUBDIVIDE_GRID_X;
1819             public static readonly int ShaderSubdivideGridY = NDalic.VISUAL_SHADER_SUBDIVIDE_GRID_Y;
1820             public static readonly int ShaderHints = NDalic.VISUAL_SHADER_HINTS;
1821         }
1822
1823         /// <summary>
1824         /// This specifies Visaul align types.
1825         /// </summary>
1826         public enum AlignType
1827         {
1828             TopBegin = 0,
1829             TopCenter,
1830             TopEnd,
1831             CenterBegin,
1832             Center,
1833             CenterEnd,
1834             BottomBegin,
1835             BottomCenter,
1836             BottomEnd
1837         }
1838     }
1839
1840     /// <summary>
1841     /// This specifies properties of BorderVisual.
1842     /// </summary>
1843     public struct BorderVisualProperty
1844     {
1845         public static readonly int Color = NDalic.BORDER_VISUAL_COLOR;
1846         public static readonly int Size = NDalic.BORDER_VISUAL_SIZE;
1847         public static readonly int AntiAliasing = NDalic.BORDER_VISUAL_ANTI_ALIASING;
1848     }
1849
1850     /// <summary>
1851     /// This specifies properties of ColorVisual.
1852     /// </summary>
1853     public struct ColorVisualProperty
1854     {
1855         public static readonly int MixColor = NDalic.COLOR_VISUAL_MIX_COLOR;
1856     }
1857
1858     /// <summary>
1859     /// This specifies properties of GradientVisual.
1860     /// </summary>
1861     public struct GradientVisualProperty
1862     {
1863         public static readonly int StartPosition = NDalic.GRADIENT_VISUAL_START_POSITION;
1864         public static readonly int EndPosition = NDalic.GRADIENT_VISUAL_END_POSITION;
1865         public static readonly int Center = NDalic.GRADIENT_VISUAL_CENTER;
1866         public static readonly int Radius = NDalic.GRADIENT_VISUAL_RADIUS;
1867         public static readonly int StopOffset = NDalic.GRADIENT_VISUAL_STOP_OFFSET;
1868         public static readonly int StopColor = NDalic.GRADIENT_VISUAL_STOP_COLOR;
1869         public static readonly int Units = NDalic.GRADIENT_VISUAL_UNITS;
1870         public static readonly int SpreadMethod = NDalic.GRADIENT_VISUAL_SPREAD_METHOD;
1871     }
1872
1873     /// <summary>
1874     /// This specifies properties of ImageVisual.
1875     /// </summary>
1876     public struct ImageVisualProperty
1877     {
1878         public static readonly int URL = NDalic.IMAGE_VISUAL_URL;
1879         public static readonly int FittingMode = NDalic.IMAGE_VISUAL_FITTING_MODE;
1880         public static readonly int SamplingMode = NDalic.IMAGE_VISUAL_SAMPLING_MODE;
1881         public static readonly int DesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH;
1882         public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT;
1883         public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING;
1884         public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY;
1885         public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA;
1886         public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U;
1887         public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V;
1888         public static readonly int Border = NDalic.IMAGE_VISUAL_BORDER;
1889     }
1890
1891     /// <summary>
1892     /// This specifies properties of MeshVisual.
1893     /// </summary>
1894     public struct MeshVisualProperty
1895     {
1896         public static readonly int ObjectURL = NDalic.MESH_VISUAL_OBJECT_URL;
1897         public static readonly int MaterialtURL = NDalic.MESH_VISUAL_MATERIAL_URL;
1898         public static readonly int TexturesPath = NDalic.MESH_VISUAL_TEXTURES_PATH;
1899         public static readonly int ShadingMode = NDalic.MESH_VISUAL_SHADING_MODE;
1900         public static readonly int UseMipmapping = NDalic.MESH_VISUAL_USE_MIPMAPPING;
1901         public static readonly int UseSoftNormals = NDalic.MESH_VISUAL_USE_SOFT_NORMALS;
1902         public static readonly int LightPosition = NDalic.MESH_VISUAL_LIGHT_POSITION;
1903     }
1904
1905     /// <summary>
1906     /// This specifies properties of PrimitiveVisual.
1907     /// </summary>
1908     public struct PrimitiveVisualProperty
1909     {
1910         public static readonly int Shape = NDalic.PRIMITIVE_VISUAL_SHAPE;
1911         public static readonly int MixColor = NDalic.PRIMITIVE_VISUAL_MIX_COLOR;
1912         public static readonly int Slices = NDalic.PRIMITIVE_VISUAL_SLICES;
1913         public static readonly int Stacks = NDalic.PRIMITIVE_VISUAL_STACKS;
1914         public static readonly int ScaleTopRadius = NDalic.PRIMITIVE_VISUAL_SCALE_TOP_RADIUS;
1915         public static readonly int ScaleBottomRadius = NDalic.PRIMITIVE_VISUAL_SCALE_BOTTOM_RADIUS;
1916         public static readonly int ScaleHeight = NDalic.PRIMITIVE_VISUAL_SCALE_HEIGHT;
1917         public static readonly int ScaleRadius = NDalic.PRIMITIVE_VISUAL_SCALE_RADIUS;
1918         public static readonly int ScaleDimensions = NDalic.PRIMITIVE_VISUAL_SCALE_DIMENSIONS;
1919         public static readonly int BevelPercentage = NDalic.PRIMITIVE_VISUAL_BEVEL_PERCENTAGE;
1920         public static readonly int BevelSmoothness = NDalic.PRIMITIVE_VISUAL_BEVEL_SMOOTHNESS;
1921         public static readonly int LightPosition = NDalic.PRIMITIVE_VISUAL_LIGHT_POSITION;
1922     }
1923
1924     /// <summary>
1925     /// This specifies properties of TextVisual.
1926     /// </summary>
1927     public struct TextVisualProperty
1928     {
1929         public static readonly int Text = NDalic.TEXT_VISUAL_TEXT;
1930         public static readonly int FontFamily = NDalic.TEXT_VISUAL_FONT_FAMILY;
1931         public static readonly int FontStyle = NDalic.TEXT_VISUAL_FONT_STYLE;
1932         public static readonly int PointSize = NDalic.TEXT_VISUAL_POINT_SIZE;
1933         public static readonly int MultiLine = NDalic.TEXT_VISUAL_MULTI_LINE;
1934         public static readonly int HorizontalAlignment = NDalic.TEXT_VISUAL_HORIZONTAL_ALIGNMENT;
1935         public static readonly int VerticalAlignment = NDalic.TEXT_VISUAL_VERTICAL_ALIGNMENT;
1936         public static readonly int TextColor = NDalic.TEXT_VISUAL_TEXT_COLOR;
1937         public static readonly int EnableMarkup = NDalic.TEXT_VISUAL_ENABLE_MARKUP;
1938     }
1939
1940     /// <summary>
1941     /// This specifies properties of NpatchImageVisual.
1942     /// </summary>
1943     public struct NpatchImageVisualProperty
1944     {
1945         public static readonly int URL = NDalic.IMAGE_VISUAL_URL;
1946         public static readonly int FittingMode = NDalic.IMAGE_VISUAL_FITTING_MODE;
1947         public static readonly int SamplingMode = NDalic.IMAGE_VISUAL_SAMPLING_MODE;
1948         public static readonly int DesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH;
1949         public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT;
1950         public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING;
1951         public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY;
1952         public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA;
1953         public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U;
1954         public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V;
1955         public static readonly int Border = NDalic.IMAGE_VISUAL_WRAP_MODE_V + 1;
1956     }
1957
1958     /// <summary>
1959     /// A class encapsulating the property map of a SVG visual. 
1960     /// </summary>
1961     public class SVGVisual : VisualMap
1962     {
1963         public SVGVisual() : base()
1964         {
1965         }
1966
1967         private string _url = null;
1968
1969         public string URL
1970         {
1971             get
1972             {
1973                 return _url;
1974             }
1975             set
1976             {
1977                 _url = value;
1978                 UpdateVisual();
1979             }
1980         }
1981
1982         protected override void ComposingPropertyMap()
1983         {
1984             _outputVisualMap = new PropertyMap();
1985             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
1986             if (_url != null) { _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url)); }
1987             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1988             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1989             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1990             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1991         }
1992     }
1993
1994     /// <summary>
1995     /// A class encapsulating the property map of a Animated Image(AGIF) visual.
1996     /// </summary>
1997     public class AnimatedImageVisual : VisualMap
1998     {
1999         public AnimatedImageVisual() : base()
2000         {
2001         }
2002
2003         private string _url = null;
2004
2005         public string URL
2006         {
2007             get
2008             {
2009                 return _url;
2010             }
2011             set
2012             {
2013                 _url = value;
2014                 UpdateVisual();
2015             }
2016         }
2017
2018         protected override void ComposingPropertyMap()
2019         {
2020             _outputVisualMap = new PropertyMap();
2021             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2022             if (_url != null) { _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url)); }
2023             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2024             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2025             if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2026             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2027         }
2028     }
2029
2030     /// <summary>
2031     /// A class encapsulating the property map of a visual transition(Animator).
2032     /// </summary>
2033     public class AnimatorVisual : VisualMap
2034     {
2035         public AnimatorVisual() : base()
2036         {
2037         }
2038
2039         private string _alphaFunction = null;
2040         private int _startTime = 0;
2041         private int _endTime = 0;
2042         private string _target = null;
2043         private string _propertyIndex = null;
2044         private object _destinationValue = null;
2045
2046         public string AlphaFunction
2047         {
2048             get
2049             {
2050                 return _alphaFunction;
2051             }
2052             set
2053             {
2054                 _alphaFunction = value;
2055             }
2056         }
2057
2058         public int StartTime
2059         {
2060             get
2061             {
2062                 return _startTime;
2063             }
2064             set
2065             {
2066                 _startTime = value;
2067             }
2068         }
2069
2070         public int EndTime
2071         {
2072             get
2073             {
2074                 return _endTime;
2075             }
2076             set
2077             {
2078                 _endTime = value;
2079             }
2080         }
2081
2082         public string Target
2083         {
2084             get
2085             {
2086                 return _target;
2087             }
2088             set
2089             {
2090                 _target = value;
2091             }
2092         }
2093
2094         public string PropertyIndex
2095         {
2096             get
2097             {
2098                 return _propertyIndex;
2099             }
2100             set
2101             {
2102                 _propertyIndex = value;
2103             }
2104         }
2105
2106         public object DestinationValue
2107         {
2108             get
2109             {
2110                 return _destinationValue;
2111             }
2112             set
2113             {
2114                 _destinationValue = value;
2115             }
2116         }
2117
2118         protected override void ComposingPropertyMap()
2119         {
2120             PropertyMap _animator = new PropertyMap();
2121             _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2122
2123             PropertyMap _timePeriod = new PropertyMap();
2124             _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2125             _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2126             _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2127
2128             string _str1 = _propertyIndex.Substring(0, 1);
2129             string _str2 = _propertyIndex.Substring(1);
2130             string _str = _str1.ToLower() + _str2;
2131
2132             PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2133
2134             PropertyMap _transition = new PropertyMap();
2135             _transition.Add("target", new PropertyValue(_target));
2136             _transition.Add("property", new PropertyValue(_str));
2137             _transition.Add("targetValue", val);
2138             _transition.Add("animator", new PropertyValue(_animator));
2139
2140             _outputVisualMap = _transition;
2141         }
2142     }
2143
2144 }