Example #1
0
		//---------------------------------

		public void AddEmitter()
		{
			ParticleEmitter pe = new ParticleEmitter(mMainForm);
			
			int lCount = mvEmitters.Count +1;
			pe.msName = lCount <= 9 ? "Emitter0"+lCount : "Emitter"+lCount;

			mvEmitters.Add(pe);
			
			mMainForm.objEmitterList.Items.Add(pe.msName);
			mMainForm.objEmitterList.SelectedIndex = lCount-1;
		}
Example #2
0
		//---------------------------------

		public void Load(String asFile)
		{
			//Clear main form and emitter vector
			mMainForm.objEmitterList.Items.Clear();
			mvEmitters.Clear();

			//Load the document
			XmlDocument Doc = new XmlDocument();
			Doc.Load(asFile);

			XmlElement DocRoot = (XmlElement)Doc.FirstChild;
						
			//Iterate trough all emitters
			for(int child_count=0; child_count< DocRoot.ChildNodes.Count; ++child_count)
			{
				XmlElement ChildNode = (XmlElement)DocRoot.ChildNodes[child_count];
				ParticleEmitter pe = new ParticleEmitter(mMainForm);

				pe.Load(ChildNode);
				
				mvEmitters.Add(pe);
				mMainForm.objEmitterList.Items.Add(pe.msName);
			}

			//Variables
			mbShowRoom = DocRoot.GetAttribute("ShowRoom");
			mvRoomSize.FromText(DocRoot.GetAttribute("RoomSize"));

			mMainForm.objShowRoom.Checked = mbShowRoom == "True";
			mMainForm.txtRoomSizeX.Text = mvRoomSize.x;
			mMainForm.txtRoomSizeY.Text = mvRoomSize.y;
			mMainForm.txtRoomSizeZ.Text = mvRoomSize.z;
		
            
			//Set current particle system
			mCurrentEmitter = (ParticleEmitter)mvEmitters[0];

			mMainForm.objEmitterList.SelectedIndex = 0;

			mCurrentEmitter.CopyToGui();
		}
Example #3
0
		//---------------------------------
		
		public void Reset()
		{
			mCurrentEmitter = null;
			mvEmitters.Clear();

			ParticleEmitter pe = new ParticleEmitter(mMainForm);
			mvEmitters.Add(pe);
			mCurrentEmitter = pe;
			mlCurrentNum =0;

			mMainForm.objEmitterList.Items.Clear();
            
			mMainForm.objEmitterList.Items.Add("Emitter01");
			mMainForm.objEmitterList.SelectedIndex = 0;

			mMainForm.objShowRoom.Checked = false;
			mMainForm.txtRoomSizeX.Text = "6";
			mMainForm.txtRoomSizeY.Text = "6";
			mMainForm.txtRoomSizeZ.Text = "6";

			mMainForm.txtFileName.Text = "";
		}
Example #4
0
		//---------------------------------

		public void CopyEmitter(int alIdx)
		{
			ParticleEmitter pe = new ParticleEmitter(mMainForm);
			ParticleEmitter oldPE = (ParticleEmitter)mvEmitters[alIdx];
			
			XmlDocument TempDoc = new XmlDocument();
			XmlElement TempElem = TempDoc.CreateElement("Element");

            oldPE.Save(TempElem);
			pe.Load(TempElem);
			pe.msName = "Copy of "+ oldPE.msName;

			mvEmitters.Add(pe);
			
			mMainForm.objEmitterList.Items.Add(pe.msName);
			mMainForm.objEmitterList.SelectedIndex = mvEmitters.Count-1;
		}