Normand Briere
2019-11-21 ddb10cb84dddfeef1ef9946f2e13cef3c93e6cc4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
 
/**
 *
 * @author nbriere
 */
public class TextureNode extends Composite implements java.io.Serializable
{
    // may 2014: new Texture node
    static final long serialVersionUID = 0; // -5280151442948961597L; // new java
                                         //   7695543694999681408L; // old java !!!
    
    // default = -8076744133104150348L
    
    TextureNode()
    {
        super("TextureNode");
    }
    
//    void Reset()
//    {
//        if (hide)
//        {
//            if (maxcount > 10)
//                maxcount /= 10;
//            else
//                assert(maxcount == 1);
//        }
//        else
//        if (link2master)
//        {
//            toParent[3][0] /= 2;
//            toParent[3][1] /= 2;
//            toParent[3][2] /= 2;
//            fromParent[3][0] *= 2;
//            fromParent[3][1] *= 2;
//            fromParent[3][2] *= 2;
//        }
//        else
//            transformcount = 0;
//    }
//    
//    void Step()
//    {
//        if (hide)
//        {
//            maxcount *= 10;
//        }
//        else
//        if (link2master)
//        {
//            toParent[3][0] *= 2;
//            toParent[3][1] *= 2;
//            toParent[3][2] *= 2;
//            fromParent[3][0] /= 2;
//            fromParent[3][1] /= 2;
//            fromParent[3][2] /= 2;
//        }
//        else
//            transformcount++;
//    }
//
    // tabarbak
    int maxcount;
    int transformcount;
    int step;
    
    void resetmaxcount()
    {
        if (maxcount != 0)
            setmaxcount(maxcount);
        
        maxcount = 0;
    }
    
    void resettransformcount()
    {
        if (transformcount != 0)
            settransformcount(transformcount);
        
        transformcount = 0;
    }
    
    void resetstep()
    {
        if (step != 0)
            setstep(step);
        
        step = 0;
    }
    
//    
//    int GetTransformCount()
//    {
//        if (step == 0)
//            step = 1;
//        if (maxcount == 0)
//            maxcount = 1000;
//        
//        if (CameraPane.LIVE && live && CameraPane.drawMode == CameraPane.SHADOW)
//        {
//            //System.err.println("transformcount = " + transformcount);
//
//            if (transformcount > maxcount)
//                transformcount = 0; // step = -1;
//            if (transformcount <= 0)
//                step = 1;
//
//            transformcount += step;
//        }
//        
//        int factor = 1;
//        
//        if (!CameraPane.AntialiasingEnabled())
//        {
//            factor = 4; // patch for 2x2 antialiasing only
//        }
//        
//        if (live)
//            return transformcount * factor;
//        else
//            return 1;
//    }
    protected void deepCopyNode(Object3D other)
    {
        super.deepCopyNode(other);
        
        other.maxcount = maxcount;
        other.transformcount = transformcount;
        other.step = step;
    }
 
    Object3D deepCopy()
    {
            Composite comp = new TextureNode();
            deepCopySelf(comp);
            return comp;
    }
}