Normand Briere
2019-09-07 3e5c2d344e04e0adb6a210c5c6302bfbfd8af102
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
 
import java.awt.Rectangle;
import java.util.Enumeration;
import java.util.Vector;
 
class Attribute extends Object3D implements java.io.Serializable
{
    static final long serialVersionUID = 1583170840242900475L;
    
    Attribute()
    {
        cleardepth = false;
        passtest = false;
        backfacecull = false;
        name = "Attribute";
    }
 
    Object3D deepCopy()
    {
        Attribute csg = new Attribute();
        deepCopySelf(csg);
        return csg;
    }
 
    protected void deepCopyNode(Object3D other)
    {
        super.deepCopyNode(other);
        Attribute c = (Attribute) other;
        
        c.cleardepth = cleardepth;
        c.passtest = passtest;
        c.backfacecull = backfacecull;
    }
 
    void createEditWindow(GroupEditor callee, boolean newWindow)
    {
        if (newWindow)
        {
            objectUI = new AttributeEditor(this, deepCopy(), callee);
        } else
        {
            objectUI = new AttributeEditor(this, callee);
        }
        
        editWindow = objectUI.GetEditor();
    }
 
    void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
    {
        if (hide)
            return;
        
//            super.draw(display, root, selected);
        if (display.IsAmbientOcclusionOn())
            return;
        
        if (cleardepth)
            display.ClearDepth();
        display.DepthTest(!passtest);
        PASSTEST = passtest;
    //    System.err.println("DISPLAY = " + display.drawMode);
    //    System.err.println("PASS TEST = " + PASSTEST);
        //display.DepthWrite(!passtest);
        if (backfacecull)
            display.BackFaceCull(true);
        else
            display.BackFaceCull(display.BackFaceCullMode());
    }
 
    boolean cleardepth;
//    boolean writedepth;
    boolean passtest;
    boolean backfacecull;
}