/* * Created by: Miguel Angel Medina P�rez (miguel.medina.perez@gmail.com) * Created: Thursday, December 20, 2007 * Comments by: Miguel Angel Medina P�rez (miguel.medina.perez@gmail.com) */ using System; using System.Drawing; namespace PatternRecognition.FingerprintRecognition.Core { /// <summary> /// Represents a non-generic object that can paint fingerprint features. /// </summary> public interface IFeatureDisplay { /// <summary> /// Paints the specified features using the specified <see cref="Graphics"/>. /// </summary> /// <param name="features">The features to be painted.</param> /// <param name="g">The <see cref="Graphics"/> object used to paint the features.</param> void Show(object features, Graphics g); } /// <summary> /// Represents an object that can paint fingerprint features. /// </summary> /// <typeparam name="FeatureType"> /// The type of the feature that the object can paint. /// </typeparam> public abstract class FeatureDisplay<FeatureType> : IFeatureDisplay { /// <summary> /// When implemented in a derived class, paints the specified features using the specified <see cref="Graphics"/>. /// </summary> /// <param name="features">The features to be painted.</param> /// <param name="g">The <see cref="Graphics"/> object used to paint the features.</param> public abstract void Show(FeatureType features, Graphics g); /// <summary> /// Paints the specified features using the specified <see cref="Graphics"/>. /// </summary> /// <param name="features">The features to be painted.</param> /// <param name="g">The <see cref="Graphics"/> object used to paint the features.</param> /// <exception cref="ArgumentOutOfRangeException"> /// Thrown when the type of the specified features is not correct. /// </exception> public void Show(object features, Graphics g) { if (features.GetType() != typeof(FeatureType)) { string msg = "Unable to display features: Invalid features type!"; throw new ArgumentOutOfRangeException("features", features, msg); } Show((FeatureType)features, g); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)