Curve.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 CURVE_H
00013 #define CURVE_H
00014 
00015 #include "ColorType.h"
00016 #include "LocationType.h"
00017 #include "PlotObject.h"
00018 #include "TypesFile.h"
00019 
00020 #include <vector>
00021 
00022 /**
00023  *  A set of points connected by a line.
00024  *
00025  *  This subclass of Subject will notify upon the following conditions:
00026  *  - The following methods are called: setPoints(), setColor(), setLineWidth(),
00027  *    setLineStyle(). 
00028  *  - Everything else documented in PlotObject.
00029  *
00030  *  @see     PlotObject
00031  */
00032 class Curve : public PlotObject
00033 {
00034 public:
00035    /**
00036     *  Emitted with any<vector<LocationType> > when the points are changed.
00037     */
00038    SIGNAL_METHOD(Curve, PointsChanged)
00039 
00040    /**
00041     *  Sets the location of each point in the curve.
00042     *
00043     *  @param   points
00044     *           The points for the curve.  Any existing points are removed, and the
00045     *           connecting line connects the points in the order in which they are
00046     *           contained in the vector.
00047     *
00048     *  @return  TRUE if the curve points were successfully set, otherwise FALSE.
00049     *
00050     *  @notify  signalPointsChanged with any<vector<LocationType> >
00051     */
00052    virtual bool setPoints(const std::vector<LocationType>& points) = 0;
00053 
00054    /**
00055     *  Returns the curve point locations.
00056     *
00057     *  @return  The points for the curve.  The order of the points in the vector
00058     *           indicate how the connecting line is drawn.
00059     */
00060    virtual const std::vector<LocationType>& getPoints() const = 0;
00061 
00062    /**
00063     *  Sets the curve color.
00064     *
00065     *  @param   curveColor
00066     *           The new curve color.  Must be a valid color.
00067     *
00068     *  @see     ColorType::isValid()
00069     *
00070     *  @notify  Subject::signalModified
00071     */
00072    virtual void setColor(const ColorType& curveColor) = 0;
00073 
00074    /**
00075     *  Returns the curve color.
00076     *
00077     *  @return  The current curve color.
00078     */
00079    virtual ColorType getColor() const = 0;
00080 
00081    /**
00082     *  Sets the curve line width.
00083     *
00084     *  @param   iWidth
00085     *           The new curve line width.  Cannot be zero.
00086     *
00087     *  @notify  Subject::signalModified
00088     */
00089    virtual void setLineWidth(int iWidth) = 0;
00090 
00091    /**
00092     *  Returns the curve line width.
00093     *
00094     *  @return  The current curve line width.
00095     */
00096    virtual int getLineWidth() const = 0;
00097 
00098    /**
00099     *  Sets the curve line style.
00100     *
00101     *  @param   lineStyle
00102     *           The new curve line style.
00103     *
00104     *  @notify  Subject::signalModified
00105     *
00106     *  @see     LineStyle
00107     */
00108    virtual void setLineStyle(const LineStyle& lineStyle) = 0;
00109 
00110    /**
00111     *  Returns the curve line style.
00112     *
00113     *  @return  The current curve line style.
00114     */
00115    virtual LineStyle getLineStyle() const = 0;
00116 
00117 protected:
00118    /**
00119     * This should be destroyed by calling PlotView::deleteObject.
00120     */
00121    virtual ~Curve() {}
00122 };
00123 
00124 #endif

Software Development Kit - Opticks 4.9.0 Build 16218