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