Main Page   Class Hierarchy   Compound List   File List   Compound Members  

scrndrv.h

00001 
00002 
00003 /*
00004 Program                 SCRNDRV.H
00005 Purpose                 Virtual base class for all screendrivers (header)
00006                                         derived drivers must overload Draw functions!
00007                                         Mapping and clipping is done here
00008 */
00009 
00010 #ifndef _SCREENDRIVER
00011 #define _SCREENDRIVER
00012 
00013 #ifdef __GNUG__
00014 #pragma interface
00015 #endif
00016 
00018 enum DrawStyle { STORED,WIREFRAME, FILLED, SELECTED, INVERT_WIREFRAME };
00019 #define MAX_POINTS_TODRAW 40000
00020 #define MININT -30000
00021 #define MAXINT  30000
00022 
00023 #include "wx/dynarray.h"
00024 #include <wx/object.h>
00025 
00026 #include "_lnk_itr.h"
00027 #include "drivout.h"
00028 #include "wxmatrix.h"
00029 #include "bbox.h"
00030 #include "shape.h"
00031 #include "arc.h"
00032 #include "wxwin.h"
00033 #include "wx/image.h"
00034 
00035 #include "polyline.h"
00036 #include "doubledc.h"
00037 
00039 
00048 class DrawDriver:  public wxDoubleDCBase
00049 {
00050         public:
00051 
00053                 bool Pending();
00054 
00056                 DrawDriver();
00057 
00059                 ~DrawDriver();
00060 
00063                 void                            WriteDirect(ElementList*);
00066                 void                            WriteDirect(Path* _Path);
00069                 void                            WriteDirect(Boundary* _Boundary);
00070 
00071       void           WriteDirect(G_Polygon* _Polygon);
00072 
00075                 void                            WriteDirect(Box* _Box);
00078                 void                            WriteDirect(SLine* line);
00081                 void                            WriteDirect(Circle* _Circle);
00084                 void                            WriteDirect(Text*);
00087                 void                            WriteDirect(Arcseg*);
00088 
00089 
00090 
00091 
00093                 void                            DrawOrigin();
00094 
00096                 void    DrawGrid(double,long,int);
00097 
00098 
00100                 void                                    Init();
00101 
00102 
00104                 BoundingBox&                                    GetVirtualSizeScreen();
00105 
00106 
00108 
00116                 void                                                            SetDrawStyle(DrawStyle);
00117 
00119                 DrawStyle                                               GetDrawStyle();
00120 
00122                 bool                                                    IsDrawStyle(DrawStyle);
00123 
00125                 void                                    ClearScreen();
00126 
00127         public:
00128 
00130                 void                            Write(GdsII*);
00132                 void                            Write(Point*);
00134                 void                            Write(Segment*);
00136                 void                            Write(G_Polygon*);
00138                 void                            Write(G_Polyline*);
00139 
00142                 void                                    SetLayer(int layer);
00145                 void                                    UnSetLayer(int layer);
00146 
00148                 void                                    GDSDrawText(const wxString& text, double x, double y, double x2, double y2, Text*, wxTransformMatrix*);
00149 
00150 
00152                 void                                    GDSDrawLine(double x1,
00153                                                                                                                 double y1,
00154                                                                                                                 double x2,
00155                                                                                                                 double y2);
00156 
00160                 void                                                            Transform(double&,
00161                                                                                                                          double&);
00162 
00166                 void                                                            Transform(double&,
00167                                                                                                                          double&,
00168                                                                                                                          double&,
00169                                                                                                                          double&);
00170 
00172       void SetScroll(double vx1,double vy1,double vx2,double vy2);
00173 
00174       void SetMappingScroll(double vx1,double vy1,double vx2,double vy2,bool border);
00175 
00177                 bool                                                    NeedToDraw(int layer);
00178 
00180                 void WindowsPolygon_NoOutLine();
00181 
00183                 void                                    WindowsPolygon(void);
00184 
00186                 void                                    WindowsPolyline(void);
00187 
00189                 void                                    WindowsSpline(void);
00190 
00192                 void                               DrawRect(int x1, int y1, int x2, int y2);
00193 
00195                 bool                                                    ClipIt(Element* a_ele);
00196 
00197 
00198       G_Polygon* GetAbsPolygon(){return _AbsPolygon;};
00199       void SetFilled(bool filled){m_filled=filled;};
00200       void SetSelected(bool selected){_Selected=selected;};
00201       wxTransformMatrix* GetMatrix(){return _matrix;};
00202       void SetMatrix(wxTransformMatrix& matrix){*_matrix=matrix;};
00203 
00204       wxPen& GetSelectPen(){return *_penSelected;};
00205       wxPen& GetDrawPen(){return *_pen;};
00206       bool GetParentSelect(){return _SRefSelected;};
00207       void SetParentSelect(bool select){_SRefSelected=select;};
00208       void SetClipStatus(OVERLAP stat) {_clip_status=stat;};
00209       OVERLAP GetClipStatus() {return _clip_status;};
00210       void SetClipIt(bool clipit){_clipit=clipit;};
00211       void SetBusyDrawing(bool busy){_stopdrawing=false;_busydrawing=busy;};
00212       bool GetStopDrawing(){return _stopdrawing;};
00213       void SetActiveLayer(int lay){_ActiveLayer=lay;};
00214       int GetActiveLayer(){return _ActiveLayer;};
00215 
00217       Structure*                 _showstructure;
00218 
00220                 bool                                                    _Selected;
00221 
00223                 bool                                                    _SRefSelected;
00224 
00226                 bool                                                    m_filled;
00227 
00229                 BoundingBox                                     m_virtualsize;
00230 
00232                 BoundingBox                                     _absbox;
00233 
00235                 wxTransformMatrix*      _matrix;
00236 
00238                 OVERLAP                                                         _clip_status;
00239 
00241                 bool                                                    _visible;
00242 
00244                 bool                                                    _clipit;
00245 
00247                 G_Polygon*                 _AbsPolygon;
00248 
00250            TDLI<Segment>*                               _AI;
00251 
00253                 int                                                             _ActiveLayer;
00254 
00256                 DrawStyle                                               _drawstyle;
00258                 DrawStyle                                               _stored_drawstyle;
00259 
00261       bool                     _stopdrawing;
00263       bool                     _busydrawing;
00264 
00266         wxPoint*                todraw;
00267 
00268 
00270                 wxColour*               _textColor;
00272                 wxColour*               _textSelectedColor;
00274                 wxColour*               _fillcolor;
00276                 wxPen*                  _penSelected;
00277 
00278                 wxPen*                  _pentrans;
00279 
00280                 wxPen*                  _pentrans_sel;
00281 
00283                 wxPen*                  _pen;
00285                 wxPen*                  _pengrid;
00287                 wxPen*                  _penorigin;
00289                 wxBrush*                        _brush;
00291                 wxBrush*                        _brushbitm;
00293                 wxBrush*                        _brushnorm;
00295                 wxFont*                 _font;
00296 
00298                 wxBitmap*               _currentbitmap;
00299 
00301       int                               _layer;
00302 
00304                 int                                                             _pattern;
00305 
00307                 void ltowxc(long l,wxColour& color);
00308 
00310       void SetClippingRegionBox(BoundingBox&    a_box);
00311 
00312       bool m_scrolled;
00313 
00315       double m_virtm_minX, m_virtm_minY, m_virtm_maxX, m_virtm_maxY;
00316 
00317       bool _only_visible;
00318 
00319       Image hulp2;
00320 };
00321 
00322 #define NR_PATTERNS 72
00323 
00327 class FillPatterns
00328 {
00329    public:
00331       FillPatterns();
00333       ~FillPatterns();
00334       wxBitmap*      GetPattern(short patternnr);
00335    private:
00337                 wxBitmap*               _fillbitmaps[NR_PATTERNS];
00338 };
00339 
00340 
00341 
00342 #endif
scrndrv.h Source File -- Thu Nov 28 21:24:56 2002 -- 28 Nov 2002 -- 1.2.18 -- -- . -- Main Page