/// <summary> /// Destroy any resources loaded from this location. /// </summary> /// <param name="repository">The repository containing the resources to destroy.</param> public void destroyResources(ShapeRepository repository) { foreach (String shape in shapesFound) { repository.removeCollection(shape); } foreach (String hull in hullsFound) { repository.destroyConvexMesh(hull); } foreach (String triMesh in meshesFound) { repository.destroyTriangleMesh(triMesh); } foreach (String material in materialsFound) { repository.destroyMaterial(material); } foreach (String softBody in softBodiesFound) { repository.destroySoftBodyMesh(softBody); } hullsFound.Clear(); shapesFound.Clear(); meshesFound.Clear(); materialsFound.Clear(); softBodiesFound.Clear(); }
/// <summary> /// Unload all loaded shapes. /// </summary> /// <param name="repository">The repository to unload the shapes from.</param> public void unloadShapes(ShapeRepository repository) { Log.Info("Unloading shape group {0}", Name); foreach (ShapeLocation location in shapeLocations.Values) { location.destroyResources(repository); location.Loaded = false; } loaded = false; }
/// <summary> /// Destroy the specified shape location. /// </summary> /// <param name="locName">The name of the location to destroy.</param> /// <param name="repository">The repository containing the shapes.</param> public void destroyShapeLocation(String locName, ShapeRepository repository) { ShapeLocation loc = shapeLocations[locName]; if (loc.Loaded) { loc.destroyResources(repository); } shapeLocations.Remove(locName); }
/// <summary> /// Constructor. /// </summary> public ShapeFileManager(ShapeRepository repository, ShapeBuilder builder) { this.shapeRepository = repository; this.builder = builder; }