internal static float GetTiling(MaterialTiling tiling)
 {
     if (tiling.EnableTiling == false)
     {
         return(-1f);
     }
     return(tiling.TileFactor);
 }
Exemplo n.º 2
0
            public void Restore(object store)
            {
                var cat = (CategoryData)store;

                LineHoverPrefab  = cat.LineHoverPrefab;
                PointHoverPrefab = cat.PointHoverPrefab;
                LineMaterial     = cat.LineMaterial;
                LineTiling       = cat.LineTiling;
                LineThickness    = cat.LineThickness;
                FillMaterial     = cat.FillMaterial;
                StetchFill       = cat.StetchFill;
                PointMaterial    = cat.PointMaterial;
                PointSize        = cat.PointSize;
                LinePrefab       = cat.LinePrefab;
                FillPrefab       = cat.FillPrefab;
                DotPrefab        = cat.DotPrefab;
                Depth            = cat.Depth;
                IsBezierCurve    = cat.IsBezierCurve;
                SegmentsPerCurve = cat.SegmentsPerCurve;
            }
Exemplo n.º 3
0
        /// <summary>
        /// sets the line style for the category
        /// </summary>
        /// <param name="category"></param>
        /// <param name="lineMaterial"></param>
        /// <param name="lineThickness"></param>
        /// <param name="lineTiling"></param>
        public void SetCategoryLine(string category, Material lineMaterial, double lineThickness, MaterialTiling lineTiling)
        {
            if (mData.ContainsKey(category) == false)
            {
                Debug.LogWarning("Invalid category name. Make sure the category is present in the graph");
                return;
            }
            CategoryData data = (CategoryData)mData[category];

            data.LineMaterial  = lineMaterial;
            data.LineThickness = lineThickness;
            data.LineTiling    = lineTiling;
            //start of new line stuff
            //369 GraphChart.cs
            graphChart.InternalGenerateChart();

            //float widthRatio = trans.rect.width;
            //float heightRatio = trans.rect.height;
            //Rect viewRect = new Rect(0f, 0f, widthRatio, heightRatio);
            //GameObject mask = graphChart.CreateRectMask(viewRect);
            //CanvasLines lines = graphChart.CreateDataObject(data, mask);

            //float tiling = 1f;
            //if (data.LineTiling.EnableTiling == true && data.LineTiling.TileFactor > 0f)
            //{
            //    float length = 0f;
            //    for (int i = 1; i < mTransformed.Count; i++)
            //        length += (mTransformed[i - 1] - mTransformed[i]).magnitude;
            //    tiling = length / data.LineTiling.TileFactor;
            //}
            //if (tiling <= 0.0001f)
            //    tiling = 1f;
            //lines.SetViewRect(viewRect, uv);
            //lines.Thickness = (float)data.LineThickness;
            //lines.Tiling = tiling;
            //lines.SetRefrenceIndex(refrenceIndex);
            //lines.material = data.LineMaterial;
            //lines.SetHoverPrefab(data.LineHoverPrefab);
            //lines.SetLines(list);
            //categoryObj.mLines = lines;
            //end

            RaiseDataChanged();
        }
Exemplo n.º 4
0
        public void AddCategory3DGraph(string category, PathGenerator linePrefab, Material lineMaterial, double lineThickness, MaterialTiling lineTiling, FillPathGenerator fillPrefab, Material innerFill, bool strechFill, GameObject pointPrefab, Material pointMaterial, double pointSize, double depth, bool isCurve, int segmentsPerCurve)
        {
            if (mData.ContainsKey(category))
            {
                throw new ArgumentException(String.Format("A category named {0} already exists", category));
            }
            if (depth < 0f)
            {
                depth = 0f;
            }
            CategoryData data = new CategoryData();

            mData.Add(category, data);
            data.Name             = category;
            data.LineMaterial     = lineMaterial;
            data.FillMaterial     = innerFill;
            data.LineThickness    = lineThickness;
            data.LineTiling       = lineTiling;
            data.StetchFill       = strechFill;
            data.PointMaterial    = pointMaterial;
            data.PointSize        = pointSize;
            data.LinePrefab       = linePrefab;
            data.FillPrefab       = fillPrefab;
            data.DotPrefab        = pointPrefab;
            data.Depth            = depth;
            data.IsBezierCurve    = isCurve;
            data.SegmentsPerCurve = segmentsPerCurve;
            RaiseDataChanged();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Adds a new category to the graph chart. each category corrosponds to a graph line.
        /// </summary>
        /// <param name="category"></param>
        /// <param name="material"></param>
        /// <param name="innerFill"></param>
        public void AddCategory(string category, Material lineMaterial, double lineThickness, MaterialTiling lineTiling, Material innerFill, bool strechFill, Material pointMaterial, double pointSize)
        {
            if (mData.ContainsKey(category))
            {
                throw new ArgumentException(String.Format("A category named {0} already exists", category));
            }
            CategoryData data = new CategoryData();

            mData.Add(category, data);
            data.Name             = category;
            data.LineMaterial     = lineMaterial;
            data.LineHoverPrefab  = null;
            data.PointHoverPrefab = null;
            data.FillMaterial     = innerFill;
            data.LineThickness    = lineThickness;
            data.LineTiling       = lineTiling;
            data.StetchFill       = strechFill;
            data.PointMaterial    = pointMaterial;
            data.PointSize        = pointSize;
            RaiseDataChanged();
        }
Exemplo n.º 6
0
        /// <summary>
        /// sets the line style for the category
        /// </summary>
        /// <param name="category"></param>
        /// <param name="lineMaterial"></param>
        /// <param name="lineThickness"></param>
        /// <param name="lineTiling"></param>
        public void SetCategoryLine(string category, Material lineMaterial, double lineThickness, MaterialTiling lineTiling)
        {
            if (mData.ContainsKey(category) == false)
            {
                Debug.LogWarning("Invalid category name. Make sure the category is present in the graph");
                return;
            }
            CategoryData data = (CategoryData)mData[category];

            data.LineMaterial  = lineMaterial;
            data.LineThickness = lineThickness;
            data.LineTiling    = lineTiling;
            RaiseDataChanged();
        }
 public void AddCategory3DGraph(string category, PathGenerator linePrefab, Material lineMaterial, double lineThickness, MaterialTiling lineTiling, FillPathGenerator fillPrefab, Material innerFill, bool strechFill, GameObject pointPrefab, Material pointMaterial, double pointSize, double depth, bool isCurve, int segmentsPerCurve)
 {
     AddInnerCategoryGraph(category, linePrefab, lineMaterial, lineThickness, lineTiling, fillPrefab, innerFill, strechFill, pointPrefab, pointMaterial, pointSize, depth, isCurve, segmentsPerCurve);
 }