Project

General

Profile

Download (3.28 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / helpers / ObjectSticker.java @ 9c7d220a

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.objectlib.helpers;
11

    
12
///////////////////////////////////////////////////////////////////////////////////////////////////
13

    
14
public class ObjectSticker
15
  {
16
  private final float[][][] mCoords;
17
  private final float[][] mCurvature;
18
  private final float[][] mRadii;
19
  private final float[][] mStrokes;
20

    
21
///////////////////////////////////////////////////////////////////////////////////////////////////
22

    
23
  public ObjectSticker(float[][][] coords, float[][] curvature, float[][] radii, float[][] strokes)
24
    {
25
    mCoords    = coords;
26
    mCurvature = curvature;
27
    mRadii     = radii;
28
    mStrokes   = strokes;
29
    }
30

    
31
///////////////////////////////////////////////////////////////////////////////////////////////////
32

    
33
  public float[][][] getCoords()
34
    {
35
    return mCoords;
36
    }
37

    
38
///////////////////////////////////////////////////////////////////////////////////////////////////
39

    
40
  public float[][] getCurvature()
41
    {
42
    return mCurvature;
43
    }
44

    
45
///////////////////////////////////////////////////////////////////////////////////////////////////
46

    
47
  public float[][] getRadii()
48
    {
49
    return mRadii;
50
    }
51

    
52
///////////////////////////////////////////////////////////////////////////////////////////////////
53

    
54
  public float[][] getStrokes()
55
    {
56
    return mStrokes;
57
    }
58

    
59
///////////////////////////////////////////////////////////////////////////////////////////////////
60

    
61
  public String debug()
62
    {
63
    int numLoops =mCoords.length;
64
    StringBuilder dbg = new StringBuilder();
65

    
66
    for(int l=0; l<numLoops; l++)
67
      {
68
      float[][] coords = mCoords[l];
69
      float[] curva = mCurvature==null ? null : mCurvature[l];
70
      float[] radii = mRadii[l];
71
      float[] stroke= mStrokes[l];
72

    
73
      dbg.append("coords: ");
74
      int len=mCoords[l].length;
75
      for(int i=0; i<len; i++)
76
        {
77
        dbg.append(" ");
78
        dbg.append(coords[i][0]);
79
        dbg.append(" ");
80
        dbg.append(coords[i][1]);
81
        }
82

    
83
      dbg.append("\ncurvature: ");
84
      len=curva==null ? 0 : mCurvature.length;
85
      for(int i=0; i<len; i++)
86
        {
87
        dbg.append(" ");
88
        dbg.append(curva[i]);
89
        }
90

    
91
      dbg.append("\nradii: ");
92
      len=radii==null ? 0 : mRadii.length;
93
      for(int i=0; i<len; i++)
94
        {
95
        dbg.append(" ");
96
        dbg.append(radii[i]);
97
        }
98

    
99
      dbg.append("\nstrokes: ");
100
      len=stroke==null ? 0 : mStrokes.length;
101
      for(int i=0; i<len; i++)
102
        {
103
        dbg.append(" ");
104
        dbg.append(stroke[i]);
105
        }
106
      }
107

    
108
    return dbg.toString();
109
    }
110
  }
(9-9/13)