/******************************************************************************
 * ImageData.cs 
 * 
 * <Copyright and License> 
 * 
 * This file is part of GODS, a package for annotating medical images. 
 * 
 * Copyright (C) 2004 
 * Xuedong Chen 
 * Heri Mariwa 
 * Kimmy (Hsiang-ling) Lin 
 * Rui Yu 
 * 
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License 
 * as published by the Free Software Foundation; either version 2 
 * of the License, or (at your option) any later version. 
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 *  
 * For further questions about this file, please send email to 
 * gods@cs.umb.edu or visit us at http://gods.sourceforge.net.  
 ******************************************************************************/

using System;
using System.Drawing;

namespace GODS.DBHandler
{
	/// <summary>
	/// Summary description for ImageData.
	/// </summary>
	public class ImageData
	{
		//use public to save all those setters and getters

		public int ImageId,  MarkSetID;
		public string Category, AnnotImgPath, OrigImgPath, Summary, Reason, Mrn;
		public int OrigImgRectX, OrigImgRectY, OrigImgRectWidth, OrigImgRectHeight;  
		public bool LibFlag, final = false;
		public DateTime AppDate, UpdateDate;			

		public ImageData(int imageId,string mrn, int markSetID,
			string category, string annotImgPath, string origImgPath,
			int origImgRectX, int origImgRectY, int origImgRectWidth, int origImgRectHeight,
			string summary, string reason, bool libFlag,
			DateTime appDate, DateTime updateDate, bool finalized)
		{	
			this.ImageId = imageId;
			this.Mrn = mrn;
			this.MarkSetID = markSetID;
			this.Category = category;
			this.AnnotImgPath = annotImgPath;
			this.OrigImgPath = origImgPath;
			this.OrigImgRectX = origImgRectX;
			this.OrigImgRectY = origImgRectY;
			this.OrigImgRectWidth = origImgRectWidth;
			this.OrigImgRectHeight = origImgRectHeight;
			this.Summary = summary;
			this.Reason = reason;
			this.LibFlag = libFlag;
			this.AppDate = appDate;
			this.UpdateDate = updateDate;
			this.final = finalized;
		}

		public ImageData(int imageId,string mrn, int markSetID,
			string category, string annotImgPath, string origImgPath,
			Rectangle rect, string summary, string reason, bool libFlag,
			DateTime appDate, DateTime updateDate, bool finalized) : 
			this(imageId, mrn, markSetID, category, annotImgPath, origImgPath,
				 rect.X, rect.Y, rect.Width, rect.Height, summary, reason, libFlag,
				 appDate, updateDate, finalized)
		{}
/*
		public ImageData(int imageId, string mrn, int markSetID,
			string category, string annotImgPath, string origImgPath,
			Rectangle rect, string summary, string reason, bool libFlag,
			DateTime appDate, DateTime updateDate) : 
			this(imageId, mrn, markSetID, category, annotImgPath, origImgPath,
			rect.X, rect.Y, rect.Width, rect.Height, summary, reason, libFlag,
			appDate, updateDate)
		{}*/

		public Rectangle ImageRectangle
		{
			get
			{
				return new Rectangle(
					this.OrigImgRectX, 
					this.OrigImgRectY, 
					this.OrigImgRectWidth, 
					this.OrigImgRectHeight);
			}
		}

		public bool Final
		{
			get 
			{
				return this.final;
			}
			set
			{
				this.final = value;
			}
		}

		public bool Equals(ImageData imgData)
		{
			return (this.ImageId==imgData.ImageId &&
				this.Mrn == imgData.Mrn &&
				this.MarkSetID==imgData.MarkSetID &&
				this.Category==imgData.Category &&
				this.AnnotImgPath == imgData.AnnotImgPath &&
				this.OrigImgPath == imgData.OrigImgPath &&
				this.OrigImgRectX == imgData.OrigImgRectX &&
				this.OrigImgRectY == imgData.OrigImgRectY &&
				this.OrigImgRectWidth == imgData.OrigImgRectWidth &&
				this.OrigImgRectHeight == imgData.OrigImgRectHeight &&
				this.Summary == imgData.Summary &&
				this.Reason == imgData.Reason &&
				this.LibFlag == imgData.LibFlag &&
				this.AppDate == imgData.AppDate &&
				this.UpdateDate == imgData.UpdateDate &&
				this.final == imgData.final);
		}
	}
}