コード例 #1
0
    protected virtual AxisTick[] GenerateCategorical(DataDimension dim, int start, int end)
    {
        int length = end - start;

        if (length < 0)
        {
            Debug.LogError(start + " and " + end + "are no valid number range");
            return(null);
        }
        var   ticks = new AxisTick[length];
        float step  = 1.0f / length;

        for (int i = 0; i < length; i++)
        {
            // i+1 because we wont exclude zero but include values exactly at 1
            float  pos   = (i + 1) * step - (0.5f * step);
            string label = null;
            // again i+1 to check if we need a label
            if ((i + 1) % _labelTickIntervall == 0)
            {
                if (dim != null)
                {
                    label = dim.GetStringValue(i + start);
                }
                else
                {
                    label = (i + start).ToString();
                }
            }
            ticks[i] = new AxisTick(pos, label);
        }
        return(ticks);
    }
コード例 #2
0
 public DataFormat(
     IOType ioType,
     DataDimension dimension,
     Type elemType,
     string name,
     bool isTimeSeries,
     long[] itemSize
     )
 {
     this.ioType       = ioType;
     this.dimension    = dimension;
     this.dataType     = elemType;
     this.name         = name;
     this.isTimeSeries = isTimeSeries;
     this.lengthArray  = itemSize;
     this.formatIndex  = -1;
 }
コード例 #3
0
ファイル: DataFormat.cs プロジェクト: rollend/LevelUp
 public DataFormat(
     IOType ioType,
     DataDimension dimension,
     Type elemType,
     string name,
     bool isTimeSeries,
     long[] itemSize
     )
 {
     this.ioType = ioType;
     this.dimension = dimension;
     this.dataType = elemType;
     this.name = name;
     this.isTimeSeries = isTimeSeries;
     this.lengthArray = itemSize;
     this.formatIndex = -1;
 }
コード例 #4
0
 public EnvironmentSpecs()
 {
     dataDimension  = DataDimension._3D;
     dataCloud3Type = DataCloud3Type.Cuboid;
     dataCloud2Type = DataCloud2Type.Rectangle;
 }