using System;
using System.Collections.Generic;
using System.Text;

namespace CSGBuilder {
    class Mirror : Transformation {

        private Point3Dh axis;

        public Point3Dh Axis {
            get { return axis; }
        }

        public Mirror(Point3Dh axis) {
            this.axis = axis;
            SetMatrix();
        }

        public override void SetMatrix() {
            TrMatrix = new Matrix(4, 4);
            TrMatrix[0, 0] = axis.X;
            TrMatrix[1, 1] = axis.Y;
            TrMatrix[2, 2] = axis.Z;
            TrMatrix[3, 3] = 1.0;
        }

        public override string ToString() {
            if (axis.X < 0) return "Mirror to X Axis";
            if (axis.Y < 0) return "Mirror to Y Axis";
            if (axis.Z < 0) return "Mirror to Z Axis";
            return "Mirror";
        }
    }
}
