;+
;create view to show single image
;+
PRO sesChangeImage::Create , image , dimX , dimY
	COMPILE_OPT IDL2
	oSystem = self.oSystem

	self.oView = Obj_New('IDLgrView'				, $
						  Color = [128,128,128]	, $
						  Eye = 21				, $
						  ZClip = [20,-1]		)

	oSystem.oScene->Add , self.oView

	self.oModel = Obj_New('IDLgrModel')

	self.oView->Add, self.oModel

	self.imageModel = Obj_New('IDLgrModel')

	self.oModel->Add, self.imageModel

	red = Indgen(256)
	green = Indgen(256)
	blue = Indgen(256)

	self.oPalette = Obj_New('IDLgrPalette', red, green, blue)

	self.oImage = Obj_New('IDLgrImage'         			, $
			               Data = image	                , $
			               Blend_Function = [3,4]		, $
			               Interleave = 0           	, $
			               Location = [0,0,0]	)

	self.imageModel->Add, self.oImage

;	oSystem.oWindow->SetProperty, Graphics_Tree = self.oView

	drawSize = [(oSystem.mainDraw).drawSize,dimX, dimY]

	Type = 'initSize'
	oSystem.zoomState = Type

	sesViewSize, drawSize, Type = type				 	       , $
						 	ZoomRate = zoom			 	       , $
						 	windowVD = windowVD		           , $
							viewPlane = viewPlane	           , $
							viewDim = viewDim		           , $
							currentXY=currentXY                , $
							oDraw = (oSystem.mainDraw).drawID  , $
							oView = self.oView           , $
							viewLoc = viewLoc

	IF KeyWord_Set(viewDim) THEN self.oView->SetProperty, Dimensions = viewDim
	IF KeyWord_Set(viewLoc) THEN self.oView->SetProperty, Location = viewLoc
	IF KeyWord_Set(windowVD) THEN Widget_Control, (oSystem.mainDraw).drawID	, $
           Draw_XSize = windowVD[0], Draw_YSize = windowVD[1]

 	Widget_Control, (oSystem.mainDraw).drawID, Scr_XSize = (oSystem.mainDraw).drawSize[0], $
 						Scr_YSize = (oSystem.mainDraw).drawSize[1]

	self.zoom = zoom
	self.oModel->Reset
	self.oModel->Scale, zoom, zoom, 1

	self.oView->SetProperty, ViewPlane_Rect = viewPlane

	imageType = Size(image,/N_Dimensions)
	IF imageType EQ 2 THEN BEGIN
		self.oImage->Setproperty, Palette = self.oPalette
	ENDIF
	oSystem.oWindow -> Draw, oSystem.oScene
END
;+
;clean up
;+
PRO sesChangeImage::CleanUp
	COMPILE_OPT IDL2
	Obj_Destroy,self.oPalette
END
;+
;initialize
;+
FUNCTION sesChangeImage::Init, oSystem = oSystem , $
                               image = image     , $
                               dimX = dimX       , $
                               dimY = dimY       , $
                               content = content
	COMPILE_OPT IDL2
	self.oSystem = oSystem
	ImageSize = Size(image , /Dimensions)
	self.imageX = ImageSize[0]
	self.imageY = ImageSize[1]
	self.titleContent = content
	self->Create , image , dimX , dimY

	Return,1
END
;+
;draw class name
;+
PRO sesChangeImage__Define
	COMPILE_OPT IDL2
	void = { sesChangeImage                          , $
			 imageX             :    0               , $
			 imageY             :    0               , $
			 titleContent       :    StrArr(6)       , $
			 zoom               :    1.              , $
			 ;system objct
			 oView             :    Obj_New()        , $
			 oModel            :    Obj_New()        , $
			 imageModel        :    Obj_New()        , $
			 oPalette          :    Obj_New()        , $
			 oImage            :    Obj_New()        , $
			 SingleClass       :    Obj_New()        , $
			 MultiClass        :    Obj_New()        , $
	         oSystem           :    Obj_New()          $

			}


END