00001 #pragma ident "$Id: Frame.hpp 1644 2009-01-27 19:26:14Z ckiesch $" 00002 00004 00005 //============================================================================ 00006 // 00007 // This file is part of GPSTk, the GPS Toolkit. 00008 // 00009 // The GPSTk is free software; you can redistribute it and/or modify 00010 // it under the terms of the GNU Lesser General Public License as published 00011 // by the Free Software Foundation; either version 2.1 of the License, or 00012 // any later version. 00013 // 00014 // The GPSTk is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU Lesser General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Lesser General Public 00020 // License along with GPSTk; if not, write to the Free Software Foundation, 00021 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 // 00023 // Copyright 2004, The University of Texas at Austin 00024 // 00025 //============================================================================ 00026 00027 00028 #ifndef VDRAW_FRAME_H 00029 #define VDRAW_FRAME_H 00030 00031 #include "GraphicsConstants.hpp" 00032 #include "VGImage.hpp" 00033 #include "Canvas.hpp" 00034 00035 namespace vdraw 00036 { 00039 00045 class Frame : public Canvas 00046 { 00047 public: 00048 00050 Frame(void) 00051 :Canvas(),display(0) 00052 {valid=false;}; 00053 00055 Frame(VGImage& target); 00056 //Frame(const Frame& rhs); 00057 00058 ~Frame() {} 00059 00063 inline void setWidth(double newWidth) {width=newWidth;} 00064 00068 inline void setHeight(double newHeight) {height=newHeight;} 00069 00073 inline double getWidth(void) const {return width;} 00074 00078 inline double getHeight(void) const {return height;} 00079 00080 /* 00081 * From canvas 00082 */ 00083 void comment(const Comment& comment); 00084 00085 using Canvas::comment; 00086 00087 void line (const Line& line); 00088 00089 using Canvas::line; 00090 00091 void rectangle (const Rectangle& rect); 00092 00093 void circle (const Circle& circle); 00094 00095 void text (const Text& text); 00096 00097 void polygon(const Polygon& polygon); 00098 00099 void bitmap(const Bitmap& bitmap); 00100 00107 void nest(const Frame& parent, double xoffset, double yoffset); 00108 00110 inline double cx(void) const { return width/2;} 00112 inline double cy(void) const { return height/2;} 00114 inline double lx(void) const { return 0;} 00116 inline double ux(void) const { return width;} 00118 inline double uy(void) const { return height;} 00120 inline double ly(void) const { return 0;} 00121 00122 inline bool isLL() { return display->isLL(); } 00123 00125 inline double actualX(void) const { return originX;} 00127 inline double actualY(void) const { return originY;} 00128 00129 protected: 00131 bool isTopLevel; 00133 double originX; 00135 double originY; 00137 double width; 00139 double height; 00141 bool valid; 00143 VGImage *display; 00144 00146 void fixMarker(Markable* m); 00148 void fixStrokeStyle(BasicShape* s); 00150 void fixFillColor(Fillable* f); 00152 void fixTextStyle(Text* t); 00153 00154 }; 00155 00157 00158 } // namespace vdraw 00159 00160 #endif
1.3.9.1