<?xml version="1.0" encoding="WIN-1251"?>
<rmml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="R:\collaborative-nir\program\Cscl3DWS\rmml\RMML.xsd">
<define name="KMRESPATH" value="':mmlab.chemcommon.resources.graphics:/molconst/'"/>
<define name="KMWS_X" value="226"/>
<define name="KMWS_Y" value="47"/>
<define name="KMWS_W" value="563"/>
<define name="KMWS_H" value="423"/>

<include src="rmcomscr:imhint.xml"/>
<include src="rmcomscr:frames.xml"/>
<include src="rmcomscr:molconst/mcbase.xml"/>
<include src="scene.xml"/>
<scene name="ScnTmplMCView" class="ScnTmplBasic" final="false">
	<composition name="mcHint" class="CHint" x="5" y="50" visible="true">
		<text name="itext" src="../resources/molconst/mchint.htm" width="180" y="0"/>
	</composition>
	<composition name="MolViewerFrame" class="CMolBorder" x="eval(KMWS_X)" y="eval(KMWS_Y)">
		<script>
			this.imFrame.resize(eval(KMWS_W)+4,eval(KMWS_H)+4);
			this.x -=2;
			this.y -=2;
		</script>
	</composition>
	<include src="rmcomscr:molconst/workspace.xml"/>
	<text name="txMCText" x="130" y="489" width="762"/>
	<script>
		function createAtomScene(id)
		{
			var scn = new Scene3D();
			scn._class = "CAtomScene";
			scn.parent = scene;
			scn.name = "atom_scene" + id;

			var frame = new Composition();
			frame._class = "CMolBorder";
			frame.parent = scene;
			frame.name = "MolViewerFrame" + id;

			var vport = new Viewport();
			vport.parent = scene;
			vport.name = "main_viewport" + id;
			vport.camera = eval("atom_scene" +id + ".main_camera");
			vport.depth = -1;
			vport.enabled = false;

			var img = new Image();
			img._class = "CBaseMCImage";
			img.parent = scene;
			img.name = "mcviewimage" + id;
			img.depth = -1;
			img.myPlugin = eval("scene.atom_scene"  +id + ".molconst.dll");
		}

		function setScenePos(x,y,w,h, id)
		{<![CDATA[
			var scn;
			var frame;
			var vport;
			var img;
			if (id == null || id == undefined)
			{
				scn = scene.atom_scene;
				frame = scene.MolViewerFrame;
				vport = scene.main_viewport;
				img = scene.mcviewimage;
			}
			else
			{
				scn = eval("scene.atom_scene" + id);
				frame = eval("scene.MolViewerFrame" + id);
				vport = eval("scene.main_viewport" + id);
				img = eval("scene.mcviewimage" + id);
			}
			//trace(frame.imFrame._class.name);
			frame.x = x;
			frame.y = y;
			frame.imFrame.resize(w, h);
			vport.x = x+2;
			vport.y = y+2;
			vport.width = w-4;
			vport.height = h-4;
			img.x = x;
			img.y = y;
			img.width = w;
			img.height = h;
		}]]>

		function rendllmes(message, params, id)
		{
			var scn;
			if (id == null || id == undefined)
				scn = scene.atom_scene
			else
				scn = eval("scene.atom_scene" +id);
			scn.molconst.dll.call("", ""+message, ""+params);
		}
		function Initialize(sXML, id)
		{
			scene.rendllmes("freeze", "", id);
			scene.rendllmes("loadxml", sXML, id);
			scene.rendllmes("fit", "", id);
		}
		function SetText(txt)
		{
			txMCText.value = txt;
		}
	</script>
</scene>
</rmml>