MovementCategorizer Class |
Namespace: Telogis.GeoBase.Navigation
The MovementCategorizer type exposes the following members.
Name | Description | |
---|---|---|
MovementCategorizer |
Creates a MovementCategorizer that uses the default images. Images should be
available in your TurnIcons folder.
| |
MovementCategorizer(String) |
Creates a MovementCategorizer that uses images from a specified folder. The images
should be in PNG or BMP format.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetFilename |
Returns the filename of the schematic image for the given
Movement. If no path was specified when creating the
MovementCategorizer it returns an empty string.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetImage |
Returns an image for the given Movement.
| |
GetMovementDescription |
Returns a MovementDescription for the given
Movement.
| |
GetProgressImage |
Returns the progress image for the given progress proportion.
| |
GetProgressImageName |
Returns the progress image name for the given progress proportion.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
MovementCategorizer mc = new MovementCategorizer(); // ^^ creates a new MovementCategorizer with default settings /// MovementCategorizer mc = new MovementCategorizer(path); // ^^ creates a new MovementCategorizer that uses images from the // specified path. Images should be in PNG or BMP format // If a path is specified, the required images with their correct filenames must be present. // You can obtain schematic information from a Movement, mv, using MovementDescription md = mc.GetMovementDescription(mv); String filename = mc.GetFilename(mv); Image img = mc.GetImage(mv);
// Create a MovementCategorizer with defaults and look for images in the // Program Files\Telogis\GeoBase\GeoBaseResources\TurnIcons folder. MovementCategorizer mc = new MovementCategorizer(); // Create a MovementCategorizer that points to the specified image folder. // This folder must contain all images with their correct file names. // MovementCategorizer mc = new MovementCategorizer(@"C:\path_to_folder\TurnIcons"); Route tr = new Route(); tr.Start = new RouteStop(33.903187, -118.225697); tr.AddStopAtEnd(new RouteStop(33.903457, -118.225756)); tr.End = new RouteStop(33.903178, -118.225835); Directions myDirections = tr.GetDirections(); foreach (Direction d in myDirections) { // Used to build the instructions for display. StringBuilder instruction = new StringBuilder(); // Use only Movements. Ignore Notes. if (d is Movement) { // Retrieve an image in PNG or BMP format // that represents the movement. For UI use. Image img = mc.GetImage(d as Movement); // Retrieve the image file name as text // eg. 'destination.png' or 'uturn_rhd.png'. String filename = mc.GetFilename(d as Movement); // Retrieve a text description of the movement // eg. 'UTurn' or 'SharpLeft'. MovementDescription ddesc = mc.GetMovementDescription(d as Movement); // Retrieve the natural language direction as text. String instr = d.Instructions; instruction.AppendFormat("Instructions: " + instr + "\n"); instruction.AppendFormat("UI image: " + filename + "\n"); instruction.AppendFormat("Plain text: " + ddesc + "\n"); } // Output the generated instruction Console.WriteLine(instruction); }