Point.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 
00011 
00012 #ifndef POINT_H
00013 #define POINT_H
00014 
00015 #include "ColorType.h"
00016 #include "EnumWrapper.h"
00017 #include "LocationType.h"
00018 #include "PlotObject.h"
00019 #include "TypesFile.h"
00020 
00021 class PointSet;
00022 
00023 /**
00024  *  A Point.
00025  *
00026  *  This subclass of Subject will notify upon the following conditions:
00027  *  - The following methods are called: setLocation(), setSymbol(),
00028  *    setSymbolSize(), setColor(). 
00029  *  - Everything else documented in PlotObject.
00030  *
00031  *  @see     PlotObject
00032  */
00033 class Point : public PlotObject
00034 {
00035 public:
00036    
00037    /**
00038    *  Pixel marker symbol for Point PlotObjects.
00039    *
00040    *  Selected pixels are displayed on the scene in various symbols so that the user can
00041    *  identify multiple selections on a single pixel.
00042    *
00043 
00044    */
00045    enum PointSymbolTypeEnum { 
00046       SOLID,                  /**< Filled box */
00047       X,                      /**< X */
00048       CROSS_HAIR,             /**< Crosshair */
00049       ASTERISK,               /**< Asterick */
00050       HORIZONTAL_LINE,        /**< Horizontal line */
00051       VERTICAL_LINE,          /**< Vertical line */
00052       FORWARD_SLASH,          /**< Forward slash */
00053       BACK_SLASH,             /**< Back slash */
00054       BOX,                    /**< Box */
00055       BOXED_X,                /**< Box with X */
00056       BOXED_CROSS_HAIR,       /**< Box with crosshair */
00057       BOXED_ASTERISK,         /**< Box with asterick */
00058       BOXED_HORIZONTAL_LINE,  /**< Box with horizontal line */
00059       BOXED_VERTICAL_LINE,    /**< Box with vertical line */
00060       BOXED_FORWARD_SLASH,    /**< Box with forward slash */
00061       BOXED_BACK_SLASH,       /**< Box with back slash */
00062       DIAMOND,                /**< Diamond */
00063       DIAMOND_FILLED,         /**< Filled Diamond */
00064       DIAMOND_CROSS_HAIR,     /**< Diamond with crosshair */
00065       TRIANGLE,               /**< Triangle */
00066       TRIANGLE_FILLED,        /**< Filled Triangle */
00067       RIGHT_TRIANGLE,         /**< Right Triangle */
00068       RIGHT_TRIANGLE_FILLED,  /**< Filled Right Triangle */
00069       LEFT_TRIANGLE,          /**< Left Triangle */
00070       LEFT_TRIANGLE_FILLED,   /**< Filled Left Triangle */
00071       DOWN_TRIANGLE,          /**< Down Triangle */
00072       DOWN_TRIANGLE_FILLED,   /**< Filled Down Triangle */
00073       CIRCLE,                 /**< Circle */
00074       CIRCLE_FILLED,          /**< Filled Circle */
00075       OCTAGON,                /**< Octagon */
00076       OCTAGON_FILLED,         /**< Filled Octagon */
00077       OCTAGON_CROSS_HAIR      /**< Octagon with crosshair */
00078    };
00079 
00080    /**
00081     * @EnumWrapper Point::PointSymbolTypeEnum.
00082     */
00083    typedef EnumWrapper<PointSymbolTypeEnum> PointSymbolType;
00084 
00085    /**
00086     *  Emitted with boost::any<LocationType> when the point's location changes.
00087     */
00088    SIGNAL_METHOD(Point, LocationChanged)
00089    /**
00090     *  Emitted with boost::any<PointSymbolType> when a point's symbol changes.
00091     */
00092    SIGNAL_METHOD(Point, SymbolChanged)
00093    /**
00094     *  Emitted with boost::any<int> when a point's symbol size changes.
00095     */
00096    SIGNAL_METHOD(Point, SymbolSizeChanged)
00097    /**
00098     *  Emitted with boost::any<ColorType> when a point's color changes.
00099     */
00100    SIGNAL_METHOD(Point, ColorChanged)
00101 
00102    /**
00103     *  Returns the x value
00104     *  
00105     *  @return  A double representation of the x value
00106     */
00107    virtual double getXLocation() const = 0;
00108    
00109    /**
00110     *  Returns the y value 
00111     *  
00112     *  @return  A double representation of the y value
00113     */
00114    virtual double getYLocation() const = 0;
00115    
00116    /**
00117     *  Returns the location of the point, both x and y in a LocationType structure
00118     *  
00119     *  @return  The LocationType structure
00120     *
00121     *  @see LocationType
00122     */
00123    virtual const LocationType& getLocation() const = 0;
00124 
00125    /**
00126     *  Returns the point symbol
00127     *  
00128     *  @return  The symbol type
00129     *
00130     *  @see PointSymbolType
00131     */
00132    virtual PointSymbolType getSymbol() const = 0;
00133 
00134    /**
00135     *  Returns the size of the symbol
00136     *  
00137     *  @return  The symbol size
00138     */
00139    virtual int getSymbolSize() const = 0;
00140 
00141    /**
00142     *  Returns the color of the point
00143     *  
00144     *  @return  The point color
00145     */
00146    virtual ColorType getColor() const = 0;
00147 
00148    /**
00149     *  Returns the PointSet that contains the point
00150     *  
00151     *  @return  The PointSet. Will return \c NULL if the Point is not in a PointSet.
00152     */
00153    virtual const PointSet* getPointSet() const = 0;
00154 
00155    /**
00156    *  Returns the PointSet that contains the point
00157    *  
00158    *  @return  The PointSet. Will return \c NULL if the Point is not in a PointSet.
00159    */
00160    virtual PointSet* getPointSet() = 0;
00161 
00162    /**
00163     *  Determines if this plot object resides at this point, most likely a mouse click
00164     *
00165     *  @param point  The location of the mouse click
00166     *  @return       True if the plot object is at this point
00167     */
00168    virtual bool hit(LocationType point) const = 0;
00169 
00170    /**
00171     *  Sets the location of the point
00172     *  
00173     *  @param location  The new location
00174     *
00175     *  @see LocationType
00176     *
00177     *  @notify  This method will notify signalLocationChanged with any<LocationType>.
00178     */
00179    virtual void setLocation(const LocationType& location) = 0;
00180 
00181    /**
00182     *  Sets the location of the point
00183     *  
00184     *  @param dX  The x value
00185     *  @param dY  The y value
00186     *
00187     *  @notify  This method will notify signalLocationChanged with any<LocationType>.
00188     */
00189    virtual void setLocation(double dX, double dY) = 0;
00190 
00191    /**
00192     *  Sets the point symbol
00193     *  
00194     *  @param eSymbol  The new symbol
00195     *
00196     *  @see PointSymbolType
00197     *
00198     *  @notify  This method will notify signalSymbolChanged() with boost::any<PointSymbolType>.
00199     */
00200    virtual void setSymbol(const PointSymbolType& eSymbol) = 0;
00201 
00202    /**
00203     *  Sets the point symbol size
00204     *  
00205     *  @param iSize  The new symbol size
00206     *
00207     *  @notify  This method will notify signalSymbolSizeChanged with any<int>.
00208     */
00209    virtual void setSymbolSize(int iSize) = 0;
00210 
00211    /**
00212     *  Sets the point symbol color
00213     *  
00214     *  @param clrSymbol  The new color
00215     *
00216     *  @notify  This method will notify signalColorChanged with any<ColorType>.
00217     */
00218    virtual void setColor(const ColorType& clrSymbol) = 0;
00219 
00220    /**
00221     *  Sets the PointSet of the Point
00222     *  
00223     *  @param pPointSet  The PointSet. Pass \c NULL to remove the Point from current PointSet.
00224     */
00225    virtual void setPointSet(PointSet* pPointSet) = 0;
00226 
00227 protected:
00228    /**
00229     * This should be destroyed by calling PlotView::deleteObject.
00230     */
00231    virtual ~Point() {}
00232 };
00233 
00234 /**
00235  * \cond INTERNAL
00236  * This template specialization is required to allow this type to be put into a DataVariant.
00237  */
00238 template <> class VariantTypeValidator<Point::PointSymbolType> {};
00239 /// \endcond
00240 
00241 #endif

Software Development Kit - Opticks 4.9.0 Build 16218