VR-Forces 4.0.4 Class Documentation
include/drawerNative/gridLineDrawer.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2008 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: gridLineDrawer.h,v $ $Revision: 1.1 $ $State: Exp $
00007 *********************************************************************/
00008 
00011 
00013 
00014 #ifndef DTGRIDLINEDRAWER_H_
00015 #define DTGRIDLINEDRAWER_H_
00016 
00017 #include "drawerNative/drawerNativeDefines.h"
00018 
00019 #include <QtGui/QColor>
00020 
00021 class DtExtent;
00022 class DtPrimitiveDrawer;
00023 class DtTerrainDatabase;
00024 class DtViewportExtents;
00025 class DtPoint;
00026 class DtCoordinateSystem;
00027 
00028 const int DtDatabaseGridLineDrawerType = 1;
00029 const int DtUTMGridLineDrawerType = 2;
00030 const int DtUserGridLineDrawerType = 1000;
00031 
00032 class DT_DLL_drawerNative DtGridLineDrawer
00033 {
00034 public:
00035    enum DtScaleType
00036    {
00037       DtGridScale= 0,
00038       DtScaleLowerLeft = 1,
00039       DtScaleLowerRight = 2
00040    };
00041 
00042 public:
00043    DtGridLineDrawer(const DtCoordinateSystem* c) : myCoordinateSystem(c),
00044       myScaleLine(DtGridScale)
00045    {
00046    };
00047 
00048    DtGridLineDrawer(const DtGridLineDrawer& orig) : myCoordinateSystem(orig.myCoordinateSystem),
00049       myGridLineColor(orig.myGridLineColor), myGridLineLabelColor(orig.myGridLineLabelColor), myScaleLine(orig.myScaleLine)
00050    {
00051    };
00052 
00053    virtual ~DtGridLineDrawer() {};
00054 
00055    void setGridLineColor(const QColor&);
00056    const QColor& gridLineColor() const;
00057 
00058    void setGridLineLabelColor(const QColor&);
00059    const QColor& gridLineLabelColor() const;
00060 
00062    void setDrawScale(DtGridLineDrawer::DtScaleType);
00063    DtGridLineDrawer::DtScaleType drawScale() const;
00064 
00065 public:
00067    virtual void drawGridLines(const DtPoint &vp_min_WC, const DtPoint &vp_max_WC,
00068       double increment, const DtTerrainDatabase* db, const DtViewportExtents* v, DtPrimitiveDrawer* painter) = 0;
00069 
00071    virtual DtGridLineDrawer* clone() = 0;
00072 
00075    virtual int type() const = 0;
00076 
00077 protected:
00078    const DtCoordinateSystem* myCoordinateSystem;
00079    QColor myGridLineColor;
00080    QColor myGridLineLabelColor;
00081    DtScaleType myScaleLine;
00082 };
00083 
00084 inline void DtGridLineDrawer::setGridLineColor(const QColor& c)
00085 {
00086    myGridLineColor = c;
00087 }
00088 
00089 inline const QColor& DtGridLineDrawer::gridLineColor() const
00090 {
00091    return myGridLineColor;
00092 }
00093 
00094 inline void DtGridLineDrawer::setGridLineLabelColor(const QColor& c)
00095 {
00096    myGridLineLabelColor = c;
00097 }
00098 
00099 inline const QColor& DtGridLineDrawer::gridLineLabelColor() const
00100 {
00101    return myGridLineLabelColor;
00102 }
00103 
00104 inline void DtGridLineDrawer::setDrawScale(DtGridLineDrawer::DtScaleType s)
00105 {
00106    myScaleLine = s;
00107 }
00108 
00109 inline DtGridLineDrawer::DtScaleType DtGridLineDrawer::drawScale() const
00110 {
00111    return myScaleLine;
00112 }
00113 
00114 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)