1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.Runtime.InteropServices;
22 /// A class encapsulating the transform map of visual.
24 public class VisualMap
26 private Vector2 _visualSize = Vector2.Zero;
27 private Vector2 _visualOffset = Vector2.Zero;
28 private Vector4 _visualOffsetSizeMode = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); // default absolute
29 private AlignType _visualOrigin = AlignType.TOP_BEGIN;
30 private AlignType _visualAnchorPoint = AlignType.TOP_BEGIN;
32 private PropertyMap _visualTransformMap = null;
34 private float _depthIndex = 0.0f;
35 protected PropertyMap _outputVisualMap = null;
42 /// Get or set size of the visual.
43 /// It can be either relative (percentage of the parent)
44 /// or absolute (in world units).
46 public Vector2 VisualSize
59 /// Get or set offset of the visual.
60 /// It can be either relative (percentage of the parent)
61 /// or absolute (in world units).
71 _visualOffset = value;
76 /// Get or set offset/size mode of the visual.
77 /// Indicates which components of the offset and size are relative
78 /// (percentage of the parent) or absolute (in world units).
79 /// 0 indicates the component is relative, and 1 absolute.
81 public Vector4 OffsetSizeMode
85 return _visualOffsetSizeMode;
89 _visualOffsetSizeMode = value;
94 /// Get or set the origin of the visual within its control area.
96 public AlignType Origin
100 return _visualOrigin;
104 _visualOrigin = value;
109 /// Get or set the anchor-point of the visual.
111 public AlignType AnchorPoint
115 return _visualAnchorPoint;
119 _visualAnchorPoint = value;
124 /// Get or set the depth index of the visual.
126 public float DepthIndex
138 private void ComposingTransformMap()
140 if (_visualSize != Vector2.Zero)
142 _visualTransformMap = new PropertyMap();
143 _visualTransformMap.Add((int)VisualTransformPropertyType.SIZE, new PropertyValue(_visualSize));
144 _visualTransformMap.Add((int)VisualTransformPropertyType.OFFSET, new PropertyValue(_visualOffset));
145 _visualTransformMap.Add((int)VisualTransformPropertyType.OFFSET_SIZE_MODE, new PropertyValue(_visualOffsetSizeMode));
146 _visualTransformMap.Add((int)VisualTransformPropertyType.ORIGIN, new PropertyValue((int)_visualOrigin));
147 _visualTransformMap.Add((int)VisualTransformPropertyType.ANCHOR_POINT, new PropertyValue((int)_visualAnchorPoint));
152 /// Get the transform map used by the visual.
154 public PropertyMap OutputTransformMap
158 ComposingTransformMap();
159 return _visualTransformMap;
163 protected virtual void ComposingPropertyMap()
165 _outputVisualMap = new PropertyMap();
169 /// Get the property map to create the visual.
171 public PropertyMap OutputVisualMap
175 ComposingPropertyMap();
176 return _outputVisualMap;
182 /// A class encapsulating the property map of a image visual.
184 public class ImageVisualMap : VisualMap
186 public ImageVisualMap() : base()
190 private string _url = "";
191 private FittingModeType _fittingMode = FittingModeType.ShrinkToFit;
192 private SamplingModeType _samplingMode = SamplingModeType.Box;
193 private int _desiredWidth = 0;
194 private int _desiredHeight = 0;
195 private bool _synchronousLoading = false;
196 private bool _borderOnly = false;
197 private Vector4 _pixelArea = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
198 private WrapModeType _wrapModeU = WrapModeType.ClampToEdge;
199 private WrapModeType _wrapModeV = WrapModeType.ClampToEdge;
202 /// Get or set the URL of the image.
217 /// Get or set fitting options, used when resizing images to fit desired dimensions.
218 /// If not supplied, default is FittingMode::SHRINK_TO_FIT.
219 /// For Normal Quad images only.
221 public FittingModeType FittingMode
229 _fittingMode = value;
234 /// Get or set filtering options, used when resizing images to sample original pixels.
235 /// If not supplied, default is SamplingMode::BOX.
236 /// For Normal Quad images only.
238 public SamplingModeType SamplingMode
242 return _samplingMode;
246 _samplingMode = value;
251 /// Get or set the desired image width.
252 /// If not specified, the actual image width is used.
253 /// For Normal Quad images only.
255 public int DesiredWidth
259 return _desiredWidth;
263 _desiredWidth = value;
268 /// Get or set the desired image height.
269 /// If not specified, the actual image height is used.
270 /// For Normal Quad images only.
272 public int DesiredHeight
276 return _desiredHeight;
280 _desiredHeight = value;
285 /// Get or set whether to load the image synchronously.
286 /// If not specified, the default is false, i.e. the image is loaded asynchronously.
287 /// For Normal Quad images only.
289 public bool SynchronousLoading
293 return _synchronousLoading;
297 _synchronousLoading = value;
302 /// Get or set whether to draws the borders only(If true).
303 /// If not specified, the default is false.
304 /// For N-Patch images only.
306 public bool BorderOnly
319 /// Get or set the image area to be displayed.
320 /// It is a rectangular area.
321 /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.
322 /// If not specified, the default value is [0.0, 0.0, 1.0, 1.0], i.e. the entire area of the image.
323 /// For For Normal QUAD image only.
325 public Vector4 PixelArea
338 /// Get or set the wrap mode for u coordinate.
339 /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.
340 /// If not specified, the default is CLAMP.
341 /// For Normal QUAD image only.
343 public WrapModeType WrapModeU
356 /// Get or set the wrap mode for v coordinate.
357 /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.
358 /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.
359 /// If not specified, the default is CLAMP.
360 /// For Normal QUAD image only.
362 public WrapModeType WrapModeV
374 protected override void ComposingPropertyMap()
378 _outputVisualMap = new PropertyMap();
379 _outputVisualMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Image));
380 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.URL, new PropertyValue(_url));
381 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode));
382 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode));
384 if (_desiredWidth != 0)
386 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.DesiredWidth, new PropertyValue(_desiredWidth));
389 if (_desiredHeight != 0)
391 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.DesiredHeight, new PropertyValue(_desiredHeight));
394 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.SynchronousLoading, new PropertyValue(_synchronousLoading));
395 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.BorderOnly, new PropertyValue(_borderOnly));
396 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea));
397 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU));
398 _outputVisualMap.Add(Tizen.NUI.Constants.ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV));
404 /// A class encapsulating the property map of a text visual.
406 public class TextVisualMap : VisualMap
408 public TextVisualMap() : base()
412 private string _text = "";
413 private string _fontFamily = "";
414 private PropertyMap _fontStyle = null;
415 private float _pointSize = 0.0f;
416 private bool _multiLine = false;
417 private string _horizontalAlignment = "BEGIN";
418 private string _verticalAlignment = "TOP";
419 private Color _textColor = Color.Black;
420 private bool _enableMarkup = false;
423 /// Get or set the text to display in UTF-8 format.
438 /// Get or set the requested font family to use.
440 public string FontFamily
453 /// Get or set the requested font style to use.
455 public PropertyMap FontStyle
468 /// Get or set the size of font in points.
470 public float PointSize
483 /// Get or set the single-line or multi-line layout option.
485 public bool MultiLine
498 /// Get or set the line horizontal alignment.
499 /// If not specified, the default is BEGIN.
501 public string HorizontalAlignment
505 return _horizontalAlignment;
509 _horizontalAlignment = value;
514 /// Get or set the line vertical alignment.
515 /// If not specified, the default is TOP.
517 public string VerticalAlignment
521 return _verticalAlignment;
525 _verticalAlignment = value;
530 /// Get or set the color of the text.
532 public Color TextColor
545 /// Get or set whether the mark-up processing is enabled.
547 public bool EnableMarkup
551 return _enableMarkup;
555 _enableMarkup = value;
559 protected override void ComposingPropertyMap()
563 _outputVisualMap = new PropertyMap();
564 _outputVisualMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Text));
565 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.Text, new PropertyValue(_text));
567 if (_fontFamily != "")
569 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.FontFamily, new PropertyValue(_fontFamily));
572 if (_fontStyle != null)
574 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.FontStyle, new PropertyValue(_fontStyle));
579 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.PointSize, new PropertyValue(_pointSize));
582 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.MultiLine, new PropertyValue(_multiLine));
583 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment));
584 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment));
585 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.TextColor, new PropertyValue(_textColor));
586 _outputVisualMap.Add(Tizen.NUI.Constants.TextVisualProperty.EnableMarkup, new PropertyValue(_enableMarkup));
592 /// A class encapsulating the property map of a border visual.
594 public class BorderVisualMap : VisualMap
596 public BorderVisualMap() : base()
600 private Color _color = Color.Black;
601 private float _size = 0.000001f;
602 private bool _antiAliasing = false;
605 /// Get or set the color of the border.
620 /// Get or set the width of the border (in pixels).
635 /// Get or set whether anti-aliasing of the border is required.
636 /// If not supplied, default is false.
638 public bool AntiAliasing
642 return _antiAliasing;
646 _antiAliasing = value;
650 protected override void ComposingPropertyMap()
652 if (_size > 0.000001f)
654 _outputVisualMap = new PropertyMap();
655 _outputVisualMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Border));
656 _outputVisualMap.Add(Tizen.NUI.Constants.BorderVisualProperty.Color, new PropertyValue(_color));
657 _outputVisualMap.Add(Tizen.NUI.Constants.BorderVisualProperty.Size, new PropertyValue(_size));
658 _outputVisualMap.Add(Tizen.NUI.Constants.BorderVisualProperty.AntiAliasing, new PropertyValue(_antiAliasing));
664 /// A class encapsulating the property map of a color visual.
666 public class ColorVisualMap : VisualMap
668 public ColorVisualMap() : base()
672 private Color _mixColor = Color.Black;
675 /// Get or set the solid color required.
677 public Color MixColor
689 protected override void ComposingPropertyMap()
691 _outputVisualMap = new PropertyMap();
692 _outputVisualMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Color));
693 _outputVisualMap.Add(Tizen.NUI.Constants.ColorVisualProperty.MixColor, new PropertyValue(_mixColor));
698 /// A class encapsulating the property map of a gradient visual.
700 public class GradientVisualMap : VisualMap
702 public GradientVisualMap() : base()
706 private Vector2 _startPosition = Vector2.Zero;
707 private Vector2 _endPosition = Vector2.Zero;
708 private Vector2 _center = Vector2.Zero;
709 private float _radius = 0.000001f;
710 private PropertyArray _stopOffset = null; //0.0, 1.0
711 private PropertyArray _stopColor = null; // Color.Black, Color.Blue
712 private GradientVisualUnitsType _units = GradientVisualUnitsType.ObjectBoundingBox;
713 private GradientVisualSpreadMethodType _spreadMethod = GradientVisualSpreadMethodType.Pad;
716 /// Get or set the start position of a linear gradient.
717 /// Mandatory for Linear.
719 public Vector2 StartPosition
723 return _startPosition;
727 _startPosition = value;
732 /// Get or set the end position of a linear gradient.
733 /// Mandatory for Linear.
735 public Vector2 EndPosition
743 _endPosition = value;
748 /// Get or set the center point of a radial gradient.
749 /// Mandatory for Radial.
751 public Vector2 Center
764 /// Get or set the size of the radius of a radial gradient.
765 /// Mandatory for Radial.
780 /// Get or set all the stop offsets.
781 /// A PropertyArray of float.
782 /// If not supplied, default is 0.0f and 1.0f.
784 public PropertyArray StopOffset
797 /// Get or set the color at the stop offsets.
798 /// A PropertyArray of Color.
799 /// At least 2 values required to show a gradient.
801 public PropertyArray StopColor
814 /// Get or set defines the coordinate system for certain attributes of the points in a gradient.
815 /// If not supplied, default is GradientVisualUnitsType.OBJECT_BOUNDING_BOX.
817 public GradientVisualUnitsType Units
830 /// Get or set indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.
831 /// If not supplied, default is GradientVisualSpreadMethodType.PAD.
833 public GradientVisualSpreadMethodType SpreadMethod
837 return _spreadMethod;
841 _spreadMethod = value;
845 protected override void ComposingPropertyMap()
847 if (_startPosition != Vector2.Zero && _endPosition != Vector2.Zero && _center != Vector2.Zero
848 && _radius > 0.000001f && _stopColor != null)
850 _outputVisualMap = new PropertyMap();
851 _outputVisualMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Gradient));
852 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.StartPosition, new PropertyValue(_startPosition));
853 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.EndPosition, new PropertyValue(_endPosition));
854 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.Center, new PropertyValue(_center));
855 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.Radius, new PropertyValue(_radius));
857 if (_stopOffset != null)
859 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset));
862 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
863 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.Units, new PropertyValue((int)_units));
864 _outputVisualMap.Add(Tizen.NUI.Constants.GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod));
870 /// A class encapsulating the property map of a mesh visual.
872 public class MeshVisualMap : VisualMap
874 public MeshVisualMap() : base()
878 private string _objectURL = "";
879 private string _materialtURL = "";
880 private string _texturesPath = "";
881 private MeshVisualShadingModeValue _shadingMode = MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting;
882 private bool _useMipmapping = true;
883 private bool _useSoftNormals = true;
884 private Vector3 _lightPosition = null; //default center of screen
887 /// Get or set the location of the ".obj" file.
889 public string ObjectURL
902 /// Get or set the location of the ".mtl" file.
903 /// If not specified, then a textureless object is assumed.
905 public string MaterialtURL
909 return _materialtURL;
913 _materialtURL = value;
918 /// Get or set path to the directory the textures (including gloss and normal) are stored in.
919 /// Mandatory if using material.
921 public string TexturesPath
925 return _texturesPath;
929 _texturesPath = value;
934 /// Get or set the type of shading mode that the mesh will use.
935 /// 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.
936 /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TEXTURED_WITH_DETAILED_SPECULAR_LIGHTING first).
938 public MeshVisualShadingModeValue ShadingMode
946 _shadingMode = value;
951 /// Get or set whether to use mipmaps for textures or not.
952 /// If not specified, the default is true.
954 public bool UseMipmapping
958 return _useMipmapping;
962 _useMipmapping = value;
967 /// Get or set whether to average normals at each point to smooth textures or not.
968 /// If not specified, the default is true.
970 public bool UseSoftNormals
974 return _useSoftNormals;
978 _useSoftNormals = value;
983 /// Get or set the position, in stage space, of the point light that applies lighting to the model.
984 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
985 /// and using all zeroes will place the light at the top left corner.
986 /// If not specified, the default is an offset outwards from the center of the screen.
988 public Vector3 LightPosition
992 return _lightPosition;
996 _lightPosition = value;
1000 protected override void ComposingPropertyMap()
1002 if (_objectURL != "")
1004 _outputVisualMap = new PropertyMap();
1005 _outputVisualMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Mesh));
1006 _outputVisualMap.Add(Tizen.NUI.Constants.MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1008 if (_materialtURL != "" && _texturesPath != "")
1010 _outputVisualMap.Add(Tizen.NUI.Constants.MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL));
1011 _outputVisualMap.Add(Tizen.NUI.Constants.MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath));
1014 _outputVisualMap.Add(Tizen.NUI.Constants.MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode));
1015 _outputVisualMap.Add(Tizen.NUI.Constants.MeshVisualProperty.UseMipmapping, new PropertyValue(_useMipmapping));
1016 _outputVisualMap.Add(Tizen.NUI.Constants.MeshVisualProperty.UseSoftNormals, new PropertyValue(_useSoftNormals));
1018 if (_lightPosition != null)
1020 _outputVisualMap.Add(Tizen.NUI.Constants.MeshVisualProperty.LightPosition, new PropertyValue(_lightPosition));
1027 /// A class encapsulating the property map of a primetive visual.
1029 public class PrimitiveVisualMap : VisualMap
1031 public PrimitiveVisualMap() : base()
1035 private PrimitiveVisualShapeType _shape = PrimitiveVisualShapeType.Sphere;
1036 private Color _mixColor = new Color(0.5f, 0.5f, 0.5f, 1.0f);
1037 private int _slices = 128;
1038 private int _stacks = 128;
1039 private float _scaleTopRadius = 1.0f;
1040 private float _scaleBottomRadius = 1.5f;
1041 private float _scaleHeight = 3.0f;
1042 private float _scaleRadius = 1.0f;
1043 private Vector3 _scaleDimensions = Vector3.One;
1044 private float _bevelPercentage = 0.0f;
1045 private float _bevelSmoothness = 0.0f;
1046 private Vector3 _lightPosition = null; // default ?? center of screen
1049 /// Get or set the specific shape to render.
1050 /// If not specified, the default is PrimitiveVisualShapeType.SPHERE.
1052 public PrimitiveVisualShapeType Shape
1065 /// Get or set the color of the shape.
1066 /// If not specified, the default is Color(0.5, 0.5, 0.5, 1.0).
1067 /// Applies to ALL shapes.
1069 public Color MixColor
1082 /// Get or set the number of slices as you go around the shape.
1083 /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.
1084 /// If not specified, the default is 128.
1085 /// The range is from 1 to 255.
1100 /// Get or set the number of stacks as you go down the shape.
1101 /// For spheres, 'stacks' determines how many layers there are as you go down the object.
1102 /// If not specified, the default is 128.
1103 /// The range is from 1 to 255.
1118 /// Get or set the scale of the radius of the top circle of a conical frustrum.
1119 /// If not specified, the default is 1.0f.
1120 /// Applies to: - PrimitiveVisualShapeType.CONICAL_FRUSTRUM
1121 /// Only values greater than or equal to 0.0f are accepted.
1123 public float ScaleTopRadius
1127 return _scaleTopRadius;
1131 _scaleTopRadius = value;
1136 /// Get or set the scale of the radius of the bottom circle of a conical frustrum.
1137 /// If not specified, the default is 1.5f.
1138 /// Applies to: - PrimitiveVisualShapeType.CONICAL_FRUSTRUM
1139 /// - PrimitiveVisualShapeType.CONE
1140 /// Only values greater than or equal to 0.0f are accepted.
1142 public float ScaleBottomRadius
1146 return _scaleBottomRadius;
1150 _scaleBottomRadius = value;
1155 /// Get or set the scale of the height of a conic.
1156 /// If not specified, the default is 3.0f.
1158 /// - Shape::CONICAL_FRUSTRUM
1160 /// - Shape::CYLINDER
1161 /// Only values greater than or equal to 0.0f are accepted.
1163 public float ScaleHeight
1167 return _scaleHeight;
1171 _scaleHeight = value;
1176 /// Get or set the scale of the radius of a cylinder.
1177 /// If not specified, the default is 1.0f.
1179 /// - Shape::CYLINDER
1180 /// Only values greater than or equal to 0.0f are accepted.
1182 public float ScaleRadius
1186 return _scaleRadius;
1190 _scaleRadius = value;
1195 /// Get or set the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.
1196 /// If not specified, the default is Vector3.One.
1199 /// - Shape::OCTAHEDRON
1200 /// - Shape::BEVELLED_CUBE
1201 /// Each vector3 parameter should be greater than or equal to 0.0f.
1203 public Vector3 ScaleDimensions
1207 return _scaleDimensions;
1211 _scaleDimensions = value;
1216 /// Get or set determines how bevelled the cuboid should be, based off the smallest dimension.
1217 /// 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.
1218 /// If not specified, the default is 0.0f (no bevel).
1220 /// - Shape::BEVELLED_CUBE
1221 /// The range is from 0.0f to 1.0f.
1223 public float BevelPercentage
1227 return _bevelPercentage;
1231 _bevelPercentage = value;
1236 /// Get or set defines how smooth the bevelled edges should be.
1237 /// If not specified, the default is 0.0f (sharp edges).
1239 /// - Shape::BEVELLED_CUBE
1240 /// The range is from 0.0f to 1.0f.
1242 public float BevelSmoothness
1246 return _bevelSmoothness;
1250 _bevelSmoothness = value;
1255 /// Get or set the position, in stage space, of the point light that applies lighting to the model.
1256 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1257 /// and using all zeroes will place the light at the top left corner.
1258 /// If not specified, the default is an offset outwards from the center of the screen.
1259 /// Applies to ALL shapes.
1261 public Vector3 LightPosition
1265 return _lightPosition;
1269 _lightPosition = value;
1273 protected override void ComposingPropertyMap()
1275 _outputVisualMap = new PropertyMap(); ;
1276 _outputVisualMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Primitive));
1277 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape));
1278 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColor));
1279 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.Slices, new PropertyValue(_slices));
1280 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.Stacks, new PropertyValue(_stacks));
1281 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue(_scaleTopRadius));
1282 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue(_scaleBottomRadius));
1283 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.ScaleHeight, new PropertyValue(_scaleHeight));
1284 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.ScaleRadius, new PropertyValue(_scaleRadius));
1285 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions));
1286 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.BevelPercentage, new PropertyValue(_bevelPercentage));
1287 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.BevelSmoothness, new PropertyValue(_bevelSmoothness));
1289 if (_lightPosition != null)
1291 _outputVisualMap.Add(Tizen.NUI.Constants.PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition));
1297 public enum WrapModeType
1305 public enum GradientVisualUnitsType
1311 public enum GradientVisualSpreadMethodType
1318 public enum MeshVisualShadingModeValue
1320 TexturelessWithDiffuseLighting,
1321 TexturedWithSpecularLighting,
1322 TexturedWithDetailedSpecularLighting
1325 public enum PrimitiveVisualShapeType
1336 public enum FittingModeType
1344 public enum SamplingModeType