casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
QPShape.h
Go to the documentation of this file.
00001 //# QPShape.h: Qwt implementation of generic PlotShape classes.
00002 //# Copyright (C) 2008
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: $
00027 #ifndef QPSHAPE_H_
00028 #define QPSHAPE_H_
00029 
00030 #ifdef AIPS_HAS_QWT
00031 
00032 #include <graphics/GenericPlotter/PlotShape.h>
00033 #include <casaqt/QwtPlotter/QPOptions.h>
00034 #include <casaqt/QwtPlotter/QPPlotItem.qo.h>
00035 
00036 #include <qwt_plot_item.h>
00037 #include <qwt_plot_marker.h>
00038 
00039 #include <casa/namespace.h>
00040 
00041 namespace casa {
00042 
00043 // QPShape is the abstract superclass for any qwt-based shapes.  It handles the
00044 // common functionality like changing the QPen and QBrush.
00045 class QPShape : public QPPlotItem, public virtual PlotShape {
00046 public:
00047     // Static //
00048     
00049     // Makes a copy of the given generic PlotShape into its Qwt-specific
00050     // subclass and returns it, or NULL for an error (shouldn't happen).
00051     static QPShape* clone(const PlotShape& copy);
00052     
00053     
00054     // Non-Static //
00055     
00056     // Constructor.
00057     QPShape();
00058     
00059     // Copy constructor which takes generic PlotShape.  Will be called by copy
00060     // constructors of children.
00061     QPShape(const PlotShape& copy);
00062     
00063     // Destructor.
00064     virtual ~QPShape();
00065     
00066     
00067     // Include overloaded methods.
00068     using PlotShape::setLine;
00069     using PlotShape::setAreaFill;
00070   
00071     
00072     // QPPlotItem Methods //
00073     
00074     // Overrides QwtPlotItem::legendItem().
00075     virtual QWidget* legendItem() const;
00076     
00077     
00078     // PlotShape Methods //
00079     
00080     // Implements PlotShape::lineShown().
00081     bool lineShown() const;
00082     
00083     // Implements PlotShape::setLineShown().
00084     void setLineShown(bool line = true);
00085     
00086     // Implements PlotShape::line().
00087     PlotLinePtr line() const;
00088     
00089     // Implements PlotShape::setLine().
00090     void setLine(const PlotLine& line);
00091     
00092     // Implements PlotShape::areaFilled().
00093     bool areaFilled() const;
00094     
00095     // Implements PlotShape::setAreaFilled().
00096     void setAreaFilled(bool area = true);
00097     
00098     // Implements PlotShape::areaFill().
00099     PlotAreaFillPtr areaFill() const;
00100     
00101     // Implements PlotShape::setAreaFill().
00102     void setAreaFill(const PlotAreaFill& fill);
00103 
00104 protected:
00105     QPLine m_line;     // Line
00106     QPAreaFill m_area; // Area fill
00107     
00108     
00109     // Used for creating legend items.
00110     virtual QwtSymbol::Style legendStyle() const = 0;
00111 };
00112 
00113 
00114 // Implementation of PlotShapeRectangle for Qwt plotter.
00115 class QPRectangle : public QPShape, public PlotShapeRectangle {
00116 public:
00117     // Static //
00118     
00119     // Convenient access to class name (QPRectangle).
00120     static const String CLASS_NAME;
00121     
00122     
00123     // Non-Static //
00124     
00125     // Constructor which takes the upper-left and lower-right coordinates.
00126     QPRectangle(const PlotCoordinate& upperLeft,
00127                 const PlotCoordinate& lowerRight);
00128     
00129     // Constructor which takes a QwtDoubleRect in world coordinates.
00130     QPRectangle(const QwtDoubleRect& r);
00131     
00132     // Copy constructor for generic PlotShapeRectangle.
00133     QPRectangle(const PlotShapeRectangle& copy);
00134     
00135     // Destructor.
00136     ~QPRectangle();
00137     
00138     
00139     // QPShape Methods //
00140     
00141     // Implements PlotItem::isValid().
00142     bool isValid() const;
00143     
00144     // Overrides QwtPlotItem::boundingRect().
00145     QwtDoubleRect boundingRect() const;
00146     
00147     
00148     // PlotShapeRectangle Methods //
00149     
00150     // Implements PlotShape::coordinates().
00151     vector<PlotCoordinate> coordinates() const;
00152     
00153     // Implements PlotShape::setCoordinates().
00154     void setCoordinates(const vector<PlotCoordinate>& coords);
00155     
00156     // Implements PlotShapeRectangle::setRectCoordinates().
00157     void setRectCoordinates(const PlotCoordinate& upperLeft,
00158                             const PlotCoordinate& lowerRight);
00159     
00160 protected:
00161     // Implements QPPlotItem::className().
00162     const String& className() const { return CLASS_NAME; }
00163     
00164     // Implements QPLayerItem::draw_().  Ignores draw index and count.
00165     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00166               const QwtScaleMap& yMap, const QRect& canvasRect,
00167               unsigned int drawIndex, unsigned int drawCount) const;
00168     
00169     // Implements QPShape::legendStyle().
00170     QwtSymbol::Style legendStyle() const { return QwtSymbol::Rect; }
00171     
00172 private:
00173     PlotCoordinate m_upperLeft;  // upper left coordinate
00174     PlotCoordinate m_lowerRight; // lower right coordinate
00175 };
00176 
00177 
00178 // Implementation of PlotShapeEllipse for Qwt plotter.
00179 class QPEllipse : public QPShape, public PlotShapeEllipse {
00180 public:
00181     // Static //
00182     
00183     // Convenient access to class name (QPEllipse).
00184     static const String CLASS_NAME;
00185     
00186     
00187     // Non-Static //
00188     
00189     // Constructor which takes the center and radii as PlotCoordinates.
00190     QPEllipse(const PlotCoordinate& center, const PlotCoordinate& radii);
00191     
00192     // Constructor which uses the given QwtDoubleRect in world coordinates.
00193     QPEllipse(const QwtDoubleRect& r);
00194     
00195     // Copy constructor for generic PlotShapeEllipse.
00196     QPEllipse(const PlotShapeEllipse& copy);
00197     
00198     // Destructor.
00199     ~QPEllipse();
00200     
00201     
00202     // QPShape Methods //
00203     
00204     // Implements PlotItem::isValid().
00205     bool isValid() const;
00206     
00207     // Overrides QwtPlotItem::boundingRect().
00208     QwtDoubleRect boundingRect() const;
00209     
00210     
00211     // PlotShapeEllipse Methods //
00212     
00213     // Implements PlotShape::coordinates().
00214     vector<PlotCoordinate> coordinates() const;
00215     
00216     // Implements PlotShape::setCoordinates().
00217     void setCoordinates(const vector<PlotCoordinate>& coords);
00218     
00219     // Implements PlotShapeEllipse::setEllipseCoordinates().
00220     void setEllipseCoordinates(const PlotCoordinate& center,
00221                                const PlotCoordinate& radii);
00222     
00223     // Implements PlotShapeEllipse::radii().
00224     PlotCoordinate radii() const;
00225     
00226     // Implements PlotShapeEllipse::setRadii().
00227     void setRadii(const PlotCoordinate& radii);
00228     
00229     // Implements PlotShapeEllipse::center().
00230     PlotCoordinate center() const;
00231     
00232     // Implements PlotShapeEllipse::setCenter().
00233     void setCenter(const PlotCoordinate& center);
00234     
00235 protected:
00236     // Implements QPPlotItem::className().
00237     const String& className() const { return CLASS_NAME; }
00238     
00239     // Implements QPLayerItem::draw_().  Ignores draw index and count.
00240     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00241               const QwtScaleMap& yMap, const QRect& canvasRect,
00242               unsigned int drawIndex, unsigned int drawCount) const;
00243     
00244     // Implements QPShape::legendStyle().
00245     QwtSymbol::Style legendStyle() const { return QwtSymbol::Ellipse; }
00246     
00247 private:
00248     PlotCoordinate m_center; // Center
00249     PlotCoordinate m_radii;  // Radii
00250 };
00251 
00252 
00253 // Implementation of PlotShapePolygon for Qwt plotter.
00254 class QPPolygon : public QPShape, public PlotShapePolygon {
00255 public:
00256     // Static //
00257     
00258     // Convenient access to class name (QPPolygon).
00259     static const String CLASS_NAME;
00260     
00261     
00262     // Non-Static //
00263     
00264     // Constructor which takes list of coordinates.
00265     QPPolygon(const vector<PlotCoordinate>& coords);
00266     
00267     // Copy constructor for generic PlotShapePolygon.
00268     QPPolygon(const PlotShapePolygon& copy);
00269     
00270     // Destructor.
00271     ~QPPolygon();
00272     
00273     
00274     // QPShape Methods //
00275     
00276     // Implements PlotItem::isValid().
00277     bool isValid() const;
00278     
00279     // Overrides QwtPlotItem::boundingRect().
00280     QwtDoubleRect boundingRect() const;
00281     
00282     
00283     // PlotShapePolygon Methods //
00284     
00285     // Implements PlotShape::coordinates().
00286     vector<PlotCoordinate> coordinates() const;
00287     
00288     // Implements PlotShape::setCoordinates().
00289     void setCoordinates(const vector<PlotCoordinate>& coords);
00290     
00291 protected:
00292     // Implements QPPlotItem::className().
00293     const String& className() const { return CLASS_NAME; }
00294     
00295     // Implements QPLayerItem::draw_().
00296     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00297               const QwtScaleMap& yMap, const QRect& canvasRect,
00298               unsigned int drawIndex, unsigned int drawCount) const;
00299     
00300     // Implements QPShape::legendStyle().
00301     QwtSymbol::Style legendStyle() const { return QwtSymbol::Hexagon; }
00302     
00303 private:
00304     vector<PlotCoordinate> m_coords; // Coordinates
00305 };
00306 
00307 
00308 // Implementation of PlotShapeLine for Qwt plotter.
00309 class QPLineShape : public QPShape, public PlotShapeLine {
00310 public:
00311     // Static //
00312     
00313     // Convenient access to class name (QPLineShape).
00314     static const String CLASS_NAME;
00315     
00316     
00317     // Non-Static //
00318     
00319     // Constructor which takes location in world coordinates and axis.
00320     QPLineShape(double location, PlotAxis axis);
00321     
00322     // Copy constructor for generic PlotShapeLine.
00323     QPLineShape(const PlotShapeLine& copy);
00324     
00325     // Destructor.
00326     ~QPLineShape();
00327     
00328     
00329     // QPShape Methods //
00330     
00331     // Implements PlotItem::isValid().
00332     bool isValid() const;
00333  
00334     // Overrides QwtPlotItem::boundingRect().
00335     QwtDoubleRect boundingRect() const;
00336     
00337     
00338     // PlotShapeLine Methods //
00339     
00340     // Implements PlotShape::coordinates().
00341     vector<PlotCoordinate> coordinates() const;
00342     
00343     // Implements PlotShape::setCoordinates().
00344     void setCoordinates(const vector<PlotCoordinate>& coords);
00345     
00346     // Implements PlotShapeLine::setLineCoordinates().
00347     void setLineCoordinates(double location, PlotAxis axis);
00348     
00349     // Implements PlotShapeLine::location().
00350     double location() const;
00351     
00352     // Implements PlotShapeLine::axis().
00353     PlotAxis axis() const;
00354     
00355 protected:
00356     // Implements QPPlotItem::className().
00357     const String& className() const { return CLASS_NAME; }
00358     
00359     // Implements QPLayerItem::draw_().  Ignores draw index and count.
00360     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00361               const QwtScaleMap& yMap, const QRect& canvasRect,
00362               unsigned int drawIndex, unsigned int drawCount) const;
00363     
00364     // Implements QPShape::legendStyle().
00365     QwtSymbol::Style legendStyle() const { return QwtSymbol::HLine; }
00366     
00367 private:
00368     QwtPlotMarker m_marker; // Marker
00369     PlotAxis m_axis;        // Axis
00370 };
00371 
00372 
00373 // Implementation of PlotShapeArrow for Qwt plotter.
00374 class QPArrow : public QPShape, public PlotShapeArrow {
00375 public:
00376     // Static //
00377     
00378     // Convenient access to class name (QPArrow).
00379     static const String CLASS_NAME;
00380     
00381     // Returns the two points necessary to make an arrow shape from the given
00382     // point to the given point, with the given length.  The two arrow points
00383     // are at a 45 degree angle from the "from" point and the line between the
00384     // point and the "from" point is equal to "length".
00385     // <group>
00386     static pair<QPointF, QPointF> arrowPoints(QPointF from, QPointF to,
00387                                               double length);    
00388     static void arrowPoints(double x1, double y1, double x2, double y2,
00389                             double length, double& resX1, double& resY1,
00390                             double& resX2, double& resY2);
00391     // </group>
00392     
00393     
00394     // Non-Static //
00395     
00396     // Constructor which takes the two coordinates.
00397     QPArrow(const PlotCoordinate& from, const PlotCoordinate& to);
00398     
00399     // Copy constructor for generic PlotshapeArrow.
00400     QPArrow(const PlotShapeArrow& copy);
00401     
00402     // Destructor.
00403     ~QPArrow();
00404     
00405     
00406     // QPShape Methods //
00407     
00408     // Implements PlotItem::isValid().
00409     bool isValid() const;
00410     
00411     // Overrides QwtPlotItem::boundingRect().
00412     QwtDoubleRect boundingRect() const;
00413     
00414     
00415     // PlotShapeArrow Methods //
00416     
00417     // Implements PlotShape::coordinates().
00418     vector<PlotCoordinate> coordinates() const;
00419     
00420     // Implements PlotShape::setCoordinates().
00421     void setCoordinates(const vector<PlotCoordinate>& coords);    
00422     
00423     // Implements PlotShapeArrow::setArrowCoordinates().
00424     void setArrowCoordinates(const PlotCoordinate& from,
00425                              const PlotCoordinate& to);
00426     
00427     // Implements PlotShapeArrow::arrowStyleFrom().
00428     Style arrowStyleFrom() const;
00429     
00430     // Implements PlotShapeArrow::arrowStyleTo().
00431     Style arrowStyleTo() const;
00432     
00433     // Implements PlotShapeArrow::setArrowStyleFrom().
00434     void setArrowStyleFrom(Style style) { setArrowStyles(style, m_toStyle); }
00435     
00436     // Implements PlotShapeArrow::setArrowStyleTo().
00437     void setArrowStyleTo(Style style) { setArrowStyles(m_fromStyle, style); }
00438     
00439     // Overrides PlotShapeArrow::setArrowStyles().
00440     void setArrowStyles(Style from, Style to);
00441     
00442     // Implements PlotShapeArrow::arrowSize().
00443     double arrowSize() const;
00444     
00445     // Implements PlotShapeArrow::setArrowSize().
00446     void setArrowSize(double size);
00447     
00448 protected:
00449     // Implements QPPlotItem::className().
00450     const String& className() const { return CLASS_NAME; }
00451     
00452     // Implements QPLayerItem::draw_().  Ignores draw index and count.
00453     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00454               const QwtScaleMap& yMap, const QRect& canvasRect,
00455               unsigned int drawIndex, unsigned int drawCount) const;
00456     
00457     // Implements QPShape::legendStyle().
00458     QwtSymbol::Style legendStyle() const { return QwtSymbol::HLine; }
00459     
00460 private:
00461     PlotCoordinate m_from;        // From point
00462     PlotCoordinate m_to;          // To point
00463     Style m_fromStyle, m_toStyle; // Arrow styles
00464     double m_size;                // Arrow size
00465     
00466     
00467     // Static //
00468     
00469     // Helper for arrowPoints.  Calculates the points under the assumption that
00470     // the arrow is pointing in an assumed direction, and then lets arrowPoints
00471     // rotate/transform the results as needed.
00472     static pair<QPointF, QPointF> arrowPointsHelper(QPointF p1, QPointF p2,
00473                                                     double length);
00474 };
00475 
00476 
00477 // Implementation of PlotShapePath for Qwt plotter.
00478 class QPPath : public QPShape, public PlotShapePath {
00479 public:
00480     // Static //
00481     
00482     // Convenient access to class name (QPPath).
00483     static const String CLASS_NAME;
00484     
00485     
00486     // Non-Static //
00487     
00488     // Constructor which takes the points.
00489     QPPath(const vector<PlotCoordinate>& points);
00490     
00491     // Copy constructor for generic PlotShapePath.
00492     QPPath(const PlotShapePath& copy);
00493     
00494     // Destructor.
00495     ~QPPath();
00496     
00497     
00498     // QPShape Methods //
00499     
00500     // Implements PlotItem::isValid().
00501     bool isValid() const;
00502     
00503     // Overrides QwtPlotItem::boundingRect().
00504     QwtDoubleRect boundingRect() const;
00505     
00506     
00507     // PlotShapePath Methods //
00508     
00509     // Implements PlotShape::coordinates().
00510     vector<PlotCoordinate> coordinates() const;
00511     
00512     // Implements PlotShape::setCoordinates().
00513     void setCoordinates(const vector<PlotCoordinate>& coords);
00514     
00515 protected:
00516     // Implements QPPlotItem::className().
00517     const String& className() const { return CLASS_NAME; }
00518     
00519     // Implements QPLayerItem::draw_().
00520     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00521               const QwtScaleMap& yMap, const QRect& canvasRect,
00522               unsigned int drawIndex, unsigned int drawCount) const;
00523     
00524     // Implements QPShape::legendStyle().
00525     QwtSymbol::Style legendStyle() const { return QwtSymbol::HLine; }
00526     
00527 private:
00528     vector<PlotCoordinate> m_coords; // Coordinates
00529 };
00530 
00531 
00532 // Implementation of PlotShapeArc for Qwt plotter.
00533 class QPArc : public QPShape, public PlotShapeArc {
00534 public:
00535     // Static //
00536     
00537     // Convenient access to class name (QPArc).
00538     static const String CLASS_NAME;
00539     
00540     
00541     // Non-Static //
00542     
00543     // Constructor which takes the start coordinate, width, height, start
00544     // angle, and span angle.
00545     QPArc(const PlotCoordinate& start, const PlotCoordinate& widthHeight,
00546           int startAngle, int spanAngle);
00547     
00548     // Copy constructor for generic PlotShapeArc.
00549     QPArc(const PlotShapeArc& copy);
00550     
00551     // Destructor.
00552     ~QPArc();
00553     
00554     
00555     // Include overloaded methods.
00556     using PlotShapeArc::setWidthHeight;
00557     
00558     
00559     // QPShape Methods //
00560     
00561     // Implements PlotItem::isValid().
00562     bool isValid() const;
00563     
00564     // Overrides QwtPlotItem::boundingRect().
00565     QwtDoubleRect boundingRect() const;
00566     
00567     
00568     // PlotShapeArc Methods //
00569     
00570     // Implements PlotShape::coordinates().
00571     vector<PlotCoordinate> coordinates() const;
00572     
00573     // Implements PlotShape::coordinates().
00574     void setCoordinates(const vector<PlotCoordinate>& coords);
00575     
00576     // Implements PlotShapeArc::startCoordinate().
00577     PlotCoordinate startCoordinate() const;
00578     
00579     // Implements PlotShapeArc::setStartCoordinate().
00580     void setStartCoordinate(const PlotCoordinate& coord);
00581     
00582     // Implements PlotShapeArc::widthHeight().
00583     PlotCoordinate widthHeight() const;
00584     
00585     // Implements PlotShapeArc::setWidthHeight().
00586     void setWidthHeight(const PlotCoordinate& widthHeight);
00587     
00588     // Implements PlotShapeArc::startAngle().
00589     int startAngle() const;
00590     
00591     // Implements PlotShapeArc::setStartAngle().
00592     void setStartAngle(int startAngle);
00593     
00594     // Implements PlotShapeArc::spanAngle().
00595     int spanAngle() const;
00596     
00597     // Implements PlotShapeArc::setSpanAngle().
00598     void setSpanAngle(int spanAngle);
00599     
00600     // Implements PlotShapeArc::orientation().
00601     int orientation() const;
00602     
00603     // Implements PlotShapeArc::setOrientation().
00604     void setOrientation(int o);
00605     
00606 protected:
00607     // Implements QPPlotItem::className().
00608     const String& className() const { return CLASS_NAME; }
00609     
00610     // Implements QPLayerItem::draw_().  Ignores draw index and count.
00611     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00612               const QwtScaleMap& yMap, const QRect& canvasRect,
00613               unsigned int drawIndex, unsigned int drawCount) const;
00614     
00615     // Implements QPShape::legendStyle().
00616     QwtSymbol::Style legendStyle() const { return QwtSymbol::HLine; }
00617     
00618 private:
00619     PlotCoordinate m_start; // Start coordinate
00620     PlotCoordinate m_size;  // Width and height
00621     int m_startAngle;       // Start angle
00622     int m_spanAngle;        // Span angle
00623     int m_orient;           // Orientation
00624 };
00625 
00626 
00627 // Implementation of PlotPoint for Qwt plotter.
00628 class QPPoint : public QPPlotItem, public PlotPoint {
00629 public:
00630     // Static //
00631     
00632     // Convenient access to class name (QPPoint).
00633     static const String CLASS_NAME;
00634     
00635     
00636     // Non-Static //
00637     
00638     // Constructors which take the location and symbol.
00639     // <group>
00640     QPPoint(const PlotCoordinate& coordinate, const PlotSymbol& symbol);
00641     QPPoint(const PlotCoordinate& coordinate, const PlotSymbolPtr symbol);    
00642     QPPoint(const PlotCoordinate& coordinate,
00643             PlotSymbol::Symbol symbol = PlotSymbol::DIAMOND);
00644     // </group>
00645     
00646     // Copy constructor for generic PlotPoint.
00647     QPPoint(const PlotPoint& copy);
00648     
00649     // Destructor.
00650     ~QPPoint();
00651     
00652     
00653     // Include overloaded methods.
00654     using PlotPoint::setSymbol;
00655     
00656     
00657     // QPPlotItem Methods //
00658     
00659     // Implements PlotItem::isValid().
00660     bool isValid() const { return true; }
00661 
00662     // Overrides QwtPlotItem::boundingRect();
00663     QwtDoubleRect boundingRect() const;
00664     
00665     // Overrides QwtPlotItem::legendItem().
00666     QWidget* legendItem() const;
00667     
00668     
00669     // PlotPoint Methods //
00670     
00671     // Implements PlotPoint::coordinate().
00672     PlotCoordinate coordinate() const;
00673     
00674     // Implements PlotPoint::setCoordinate().
00675     void setCoordinate(const PlotCoordinate& coordinate);
00676     
00677     // Implements PlotPoint::symbol().
00678     PlotSymbolPtr symbol() const;
00679     
00680     // Implements PlotPoint::setSymbol().
00681     void setSymbol(const PlotSymbol& symbol);
00682     
00683 protected:
00684     // Implements QPPlotItem::className().
00685     const String& className() const { return CLASS_NAME; }
00686     
00687     // Implements QPLayerItem::draw_().  Ignores draw index and count.
00688     void draw_(QPainter* painter, const QwtScaleMap& xMap,
00689               const QwtScaleMap& yMap, const QRect& canvasRect,
00690               unsigned int drawIndex, unsigned int drawCount) const;
00691     
00692 private:
00693     QPSymbol m_symbol;      // symbol
00694     PlotCoordinate m_coord; // location
00695 };
00696 
00697 }
00698 
00699 #else
00700 
00701 #include <QPointF>
00702 #include <utility>
00703 
00704 using namespace std;
00705 
00706 namespace casa {
00707 
00708 // Used by the viewer's region shapes, so have it outside the ifdefs in case
00709 // the flag isn't on.
00710 class QPArrow {
00711 public:
00712     static pair<QPointF, QPointF> arrowPoints(QPointF from, QPointF to,
00713                                               double length);
00714     
00715     static void arrowPoints(double x1, double y1, double x2, double y2,
00716                             double length, double& resX1, double& resY1,
00717                             double& resX2, double& resY2);
00718     
00719 private:
00720     static pair<QPointF, QPointF> arrowPointsHelper(QPointF p1, QPointF p2,
00721                                                     double length);
00722 };
00723 
00724 }
00725 
00726 #endif
00727 
00728 #endif /*QPSHAPE_H_*/