Main Page   Class Hierarchy   Compound List   File List   Compound Members  

text.h

00001 /*
00002 Program TEXT.H
00003 Purpose GdsII text definition
00004 Programmers     R. Spekreijse & N. Noorlander
00005 Last Update     12-12-1995
00006 */
00007 
00010 #ifndef TEXT_H
00011 #define TEXT_H
00012 
00013 #ifdef __GNUG__
00014 #pragma interface
00015 #endif
00016 
00017 #include <string.h>
00018 #include <stdlib.h>
00019 
00020 #include "misc.h"
00021 #include "wxmatrix.h"
00022 #include "point.h"
00023 #include "bbox.h"
00024 #include "gdserr.h"
00025 #include "gdsii.h"
00026 #include "shape.h"
00027 
00028 class DrawDriver;
00029 class Driver_out;
00030 
00031 class Strans;
00032 
00033 // temporary defines, textfont can be different
00034 #define         _char_width             10
00035 #define         _char_height    8
00036 
00037 enum TEXT_PATHTYPE {TEXT_PATH_END_SQAURE,TEXT_PATH_END_ROUND,TEXT_PATH_END_SQAURE_EXT};
00038 typedef  short int TEXT_TYPE;
00039 
00040 //
00041 // enumerates used by the Presentation class
00042 //
00043 enum {FONT0,FONT1,FONT2,FONT3};
00044 enum {TOP, MIDDLE, BOTTOM};
00045 enum {LEFT, CENTER, RIGTH};
00046 
00047 typedef struct pres_bitflags
00048 {
00049 
00050 #if wxBYTE_ORDER == wxBIG_ENDIAN
00051                 unsigned        reserved  :      10;
00052                 unsigned        _font:           2;
00053                 unsigned        _vertical:       2;
00054                 unsigned        _horizontal: 2;
00055 #else
00056                 unsigned        _horizontal: 2;
00057                 unsigned        _vertical:       2;
00058                 unsigned        _font:           2;
00059                 unsigned        reserved  :      10;
00060 #endif
00061 } pres_bitflags;
00062 
00063 
00064 //
00065 // defaults for Presentation
00066 //
00067 #define DEFAULT_PRESENTATION_FONT                       FONT0
00068 #define DEFAULT_PRESENTATION_VERTICAL           TOP
00069 #define DEFAULT_PRESENTATION_HORIZONTAL LEFT
00070 #define DEFAULT_FONT_HEIGHT                                     1
00071 
00073 
00076 class Text : public Shape
00077 {
00078         public:
00079                 // Constructors & destructor
00080                 Text(int layernr = 0);
00081                 ~Text();
00082 
00083       void OWrite(Driver_out& where);
00084       void DoWrite(DrawDriver& dr);
00085 
00086                 TYPE                                            GetType() {return TEXT;};
00087                 void                                            GetPoint(Point& offsetpoint);
00088 
00089                 // public member funtions
00090                 void                                            Init(int);
00091                 Element*                                        Duplicate();
00092                 Text&                                           operator=(Text&);
00093                 // get and set functions
00094                 void                 SetRelativeMatrix(wxTransformMatrix* m);
00095                 wxTransformMatrix*      GetRelativeMatrix();
00096                 BoundingBox&                    CalcBoundingBox();
00097                 void                            SetPresentationFlags(   short int total);
00098                 short int                       GetPresentationFlags( );
00099                 TEXT_TYPE       GetTexttype();
00100                 void                            SetTexttype(TEXT_TYPE);
00101                 TEXT_PATHTYPE   GetPathtype();
00102                 void                            SetPathtype(TEXT_PATHTYPE);
00103                 void                            SetText(const wxString& text);
00104                 wxString                        MyText();
00105                 void                                       Transform(wxTransformMatrix* _Matrix);
00106       void                 Convert(G_Polygon* noneed, double marge);
00107 
00108                 bool                    Select(Point*);
00109                 bool                    Select(BoundingBox*,wxTransformMatrix*);
00110 
00111       double                                    GetHeight();
00112       void                                              SetHeight(double newheight);
00113       Point                    GetMin();
00114       Point                 GetMax();
00115 
00116                 wxPropertySheet* GetPropList();
00117       void                              UpdatePropList();
00118 
00119                 void SetFont(char nw_font = DEFAULT_PRESENTATION_FONT);
00120                 void SetVertical(char nw_vertical = DEFAULT_PRESENTATION_VERTICAL);
00121                 void SetHorizontal(char nw_horizontal = DEFAULT_PRESENTATION_HORIZONTAL);
00122                 char    GetFont();
00123                 char    GetVertical();
00124                 char    GetHorizontal();
00125                 void SetRotation(double rotation);
00126                 double GetRotation();
00127 
00128 
00129         protected:
00130                 wxString                                        _text;
00131                 TEXT_TYPE                               _texttype;
00132                 TEXT_PATHTYPE                   _pathtype;
00133       wxTransformMatrix         _relative_matrix;
00134       Point                    _min;
00135       Point                    _max;
00136                 union  {
00137                                         short int total;
00138                                         pres_bitflags bits;
00139                                  } _presentationflags;
00140 };
00141 
00142 #endif
text.h Source File -- Thu Nov 28 21:24:56 2002 -- 28 Nov 2002 -- 1.2.18 -- -- . -- Main Page