Пример #1
0
        /// <summary>
        /// Create a new plane that is identical the current but flipped.
        /// </summary>
        /// <returns></returns>
        public Plane3D  GetFlipped()
        {
            Plane3D plane = (Plane3D)this.Clone();

            plane.Flip();
            return(plane);
        }
Пример #2
0
        object ICloneable.Clone()
        {
            Plane3D plane = new Plane3D();

            plane.Constant = this.Constant;
            plane.Normal   = (Vector3D)this.Normal.Clone();
            return(plane);
        }
Пример #3
0
 /// <summary>
 /// Is given object equal to current planes?
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public override bool    Equals(object o)
 {
     if (o is Plane3D)
     {
         Plane3D plane = (Plane3D)o;
         return((this.Constant == plane.Constant) && (this.Normal == plane.Normal));
     }
     return(false);
 }
Пример #4
0
 /// <summary>
 /// Calculate the plane of the polygon
 /// </summary>
 /// <returns></returns>
 public Plane3D         GetPlane()
 {
     if (_points.Count < 3)
     {
         throw new PlaneIllDefinedException("verticies in polygon are less than 3.");
     }
     // TODO: ensure that polygon is actually planar... currently no checking is done.
     return(Plane3D.FromCoplanarPoints(_points[0], _points[1], _points[2]));
 }
Пример #5
0
        public void Reverse()
        {
            int count = this.Count;

            for (int i = 0; i < count / 2; i++)
            {
                Plane3D temp = this[i];
                this[i]             = this[count - i - 1];
                this[count - i - 1] = temp;
            }
        }
Пример #6
0
		object	ICloneable.Clone() {
			Plane3D plane	= new Plane3D();
			plane.Constant	= this.Constant;
			plane.Normal	= (Vector3D) this.Normal.Clone();
			return plane;
		}
Пример #7
0
 public Plane3D[] ToArray()
 {
     Plane3D[] array = new Plane3D[this.Count];
     this.CopyTo(array, 0);
     return(array);
 }