Ejemplo n.º 1
0
		/// <summary>
		/// Triggers a MeshPrep event and tells any subscribers that mesh prep has succeeded
		/// </summary>
		public virtual void MeshPreparationDidSucceed ()
		{ 
			if (m_meshPrepProgress == null)
				m_meshPrepProgress = new MeshPreparationProgress ();

			if (MeshPrep != null) {
				m_meshPrepProgress.PreparationDidSucceed = true;
				MeshPrep (this, m_meshPrepProgress);
			}
		}
Ejemplo n.º 2
0
		public void DisposeOfModelData ()
		{
			if (ModelFile != null) {
				ModelFile.Dispose ();
				ModelFile = null;
			}

			if (DisplayObjects != null) {
				foreach (var displayObject in DisplayObjects)
					displayObject.Dispose ();

				DisplayObjects.Clear ();
				DisplayObjects = null;
			}

			if (DisplayMeshes != null) {
				foreach (var displayMesh in DisplayMeshes)
					displayMesh.Dispose ();

				DisplayMeshes.Clear ();
				DisplayMeshes = null;
			}

			if (DisplayInstanceMeshes != null) {
				foreach (var displayInstanceMesh in DisplayInstanceMeshes)
					displayInstanceMesh.Dispose ();

				DisplayInstanceMeshes.Clear ();
				DisplayInstanceMeshes = null;
			}

			if (TransparentObjects != null) {
				foreach (var displayMesh in TransparentObjects)
					displayMesh.Dispose ();

				TransparentObjects.Clear ();
				TransparentObjects = null;
			}

			if (TransparentInstanceObjects != null) {
				foreach (var displayInstanceMesh in TransparentInstanceObjects)
					displayInstanceMesh.Dispose ();

				TransparentInstanceObjects.Clear ();
				TransparentInstanceObjects = null;
			}

			if (ModelObjectsDictionary != null) {
				ModelObjectsDictionary.Clear ();
				ModelObjectsDictionary = null;
			}

			if (ModelObjects != null) {
				ModelObjects.Clear ();
				ModelObjects = null;
			}

			if (DefaultView != null) {
				DefaultView.Dispose ();
				DefaultView = null;
			}

			if (AllMeshes != null) {
				AllMeshes.Clear ();
				AllMeshes = null;
			}

			if (Layers != null) {
				Layers.Clear ();
				Layers = null;
			}

			if (LayersWithGeometry != null) {
				LayersWithGeometry.Clear ();
				LayersWithGeometry = null;
			}

			if (LayerBBoxes != null) {
				LayerBBoxes.Clear ();
				LayerBBoxes = null;
			}

			VisibleLayersBBox = BoundingBox.Empty;
			BBox = BoundingBox.Empty;

			m_visibleLayersBoundingBox = BoundingBox.Empty;
			m_bBox = BoundingBox.Empty;
			m_meshPrepProgress = null;

			IsReadyForRendering = false;
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Triggers a MeshPrep event and passes a measure of progress to any subscribers
		/// </summary>
		public virtual void MeshPreparationProgressEvent (float progress) 
		{
			if (m_meshPrepProgress == null)
				m_meshPrepProgress = new MeshPreparationProgress ();

			if (MeshPrep != null) {
				m_meshPrepProgress.MeshProgress = progress;
				m_meshPrepProgress.PreparationDidSucceed = false;
				MeshPrep (this, m_meshPrepProgress);
			}
		}