pmc/cube.cc
changeset 54 c064ce9f40f5
parent 46 4b9e1ac40246
child 65 76514757b0d6
equal deleted inserted replaced
53:6b3d7e3418c1 54:c064ce9f40f5
    21 
    21 
    22     P[4] = new Vector (25, 25);
    22     P[4] = new Vector (25, 25);
    23     P[5] = new Vector (125, 25);
    23     P[5] = new Vector (125, 25);
    24     P[6] = new Vector (125, 125);
    24     P[6] = new Vector (125, 125);
    25     P[7] = new Vector (25, 125);
    25     P[7] = new Vector (25, 125);
       
    26 
       
    27     refCounter++;
    26 }
    28 }
    27 
    29 
    28 Cube::Cube (Surface * s, Vector & p1, Vector & p2, Vector & p3, Vector & p4, int h)
    30 Cube::Cube (Surface * s, Vector & p1, Vector & p2, Vector & p3, Vector & p4, int h)
    29 {
    31 {
    30     surface = s;
    32     surface = s;
    37     P[1] = new Vector (p2);
    39     P[1] = new Vector (p2);
    38     P[2] = new Vector (p3);
    40     P[2] = new Vector (p3);
    39     P[3] = new Vector (p4);
    41     P[3] = new Vector (p4);
    40 
    42 
    41     for (int i = 0; i < 4; i++) {
    43     for (int i = 0; i < 4; i++) {
    42         P[4 + i] = new Vector (*P[i]);
    44         P[4 + i] = new Vector ();
    43         *P[4 + i] = *P[i] + location;
    45         *P[4 + i] = *P[i] + location;
    44     }
    46     }
       
    47 
       
    48     refCounter++;
    45 }
    49 }
    46 
    50 
    47 Cube::Cube (Surface * s, Vector p[4], int h)
    51 Cube::Cube (Surface * s, Vector p[4], int h)
    48 {
    52 {
    49     surface = s;
    53     surface = s;
    55     for (int i = 0; i < 4; i++) {
    59     for (int i = 0; i < 4; i++) {
    56         P[i] = new Vector (p[i]);
    60         P[i] = new Vector (p[i]);
    57         P[4 + i] = new Vector (*P[i]);
    61         P[4 + i] = new Vector (*P[i]);
    58         *P[4 + i] = *P[i] + location;
    62         *P[4 + i] = *P[i] + location;
    59     }
    63     }
       
    64 
       
    65     refCounter++;
       
    66 }
       
    67 
       
    68 Cube::Cube (const Cube & copy)
       
    69 {
       
    70     fprintf (stderr, "Copy Constructor in Cube disabled...\n");
    60 }
    71 }
    61 
    72 
    62 Cube::~Cube ()
    73 Cube::~Cube ()
    63 {
    74 {
    64     for (int i = 0; i < 8; i++) {
    75     for (int i = 0; i < 8; i++) {