Changeset 44 in Sophya for trunk/SophyaPI/PI/psfile.h
- Timestamp:
- Apr 9, 1997, 5:45:23 PM (28 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/psfile.h
r40 r44 12 12 * Au depart, 1UC == 1cm 13 13 * - Les reperes sont orientes a la maniere XWindow 14 * 15 * 17/02/97 : modification des constructeurs(1-->eps,2-->ps) 16 * ajout du type enum orientation 14 17 * 15 18 */ … … 22 25 #endif 23 26 #include "pisysdep.h" 27 //#include "piinclude.h" 24 28 25 29 #include PIBWDG_H // Types enumeres repris de Peida:PIFontSize... … … 29 33 30 34 31 /* 32 * Unique format actuellement gere : A4 33 * 34 */ 35 enum PIPaperSizes { PI_A3 = 0, PI_A4 = 1, PI_A5 = 2, PI_NotDef = -1}; 36 37 #define PAGE_WIDTH 21.0 /* == 595 points */ 38 #define PAGE_HEIGHT 29.7 /* == 842 points */ 39 40 #define PORTRAIT 1 41 #define LANDSCAPE 0 35 36 /* 37 *#define PAGE_WIDTH 21.0 == 595 points 38 *#define PAGE_HEIGHT 29.7 == 842 points 39 *#define PORTRAIT 1 40 *#define LANDSCAPE 0 41 */ 42 42 43 43 44 44 45 45 /* Valable pour une page, ou un bloc */ 46 typedef struct { 47 float X0; /* Coordonnes sommet NO */ 48 float Y0; /* en unites courantes */ 49 float Tx; /* Format */ 50 float Ty; /* en unites courantes */ 51 float Dx; /* Coord sommet SE */ 52 float Dy; /* en unites courantes */ 53 int orientation; /* LANDSCAPE OU PORTRAIT */ 54 } Format; 55 56 57 typedef struct{ 58 char *Name; 59 int Tx; /* En 1/72e de pouce !! */ 60 int Ty; /* unite naturelle de ps */ 61 } PIMedia; 62 46 /*typedef struct { 47 * float X0; Coordonnes sommet NO 48 * float Y0; en unites courantes 49 * float Tx; Format 50 * float Ty; en unites courantes 51 * float Dx; Coord sommet SE 52 * float Dy; en unites courantes 53 * int orientation; LANDSCAPE OU PORTRAIT 54 *} Format; 55 */ 56 57 /* 58 *typedef struct{ 59 * char *Name; 60 * int Tx; En 1/72e de pouce !! 61 * int Ty; unite naturelle de ps 62 *} PIMedia; 63 */ 63 64 64 65 … … 67 68 68 69 public: 69 70 PSFile (char * FileName, float Tx = 0, float Ty = 0, 71 float Dx = 0, float Dy = 0); 72 /* PSFile (PSFile *File, int PageNum, int BlocNum);*/ 73 /* PSFile (char * FileName, int PageNum, int BlocNum);*/ 70 /* Production fichier eps */ 71 PSFile (char * FileName, float sc = 1.0); 72 /* Production fichier ps */ 73 PSFile (char * FileName, PIOrientation orientation, 74 PIPaperSize paperSize= PI_A4, 75 float marginX = 1.0, float marginY = 1.0 ) ; 74 76 75 77 virtual ~PSFile(); … … 79 81 80 82 81 /* A changer ? 82 * Pourrait introduire des incompatibilites 83 * en cas de chgt sur la struct format ? 84 */ 85 virtual Format* GetFormat(); 86 87 /*Attributs graphiques */ 83 /* virtual Format* GetFormat(); */ 84 /* Attributs graphiques */ 88 85 virtual PIColors GetDrawColor(); 89 86 virtual PIColors GetFillColor(); … … 93 90 virtual PIMarker GetMarker(); 94 91 95 virtual void NewPage(float Dx, float Dy, intorientation);92 virtual void NewPage(float Dx, float Dy, PIOrientation orientation); 96 93 virtual void EndPage(); 97 94 virtual void NewBloc(float x0, float y0, float Tx, float Ty, … … 130 127 virtual void DrawMarker (float x0, float y0, 131 128 PIMarker MrkType = PI_NotDefMarker, 132 PIColors DrawColor = PI_NotDefColor); 129 PIColors DrawColor = PI_NotDefColor, 130 int MarkerSize=14); 133 131 virtual void DrawMarkers (float *x0, float *y0, int n, 134 132 PIMarker MrkType = PI_NotDefMarker, 135 PIColors DrawColor = PI_NotDefColor); 133 PIColors DrawColor = PI_NotDefColor, 134 int MarkerSize=14); 136 135 137 136 virtual void Image(float x0, float y0, float Tx, float Ty, … … 140 139 PIColorMap *mColorMap); 141 140 142 143 144 145 146 147 148 typedef struct { 149 off_t begin; 150 off_t end; 151 } Offset; 152 141 #ifndef __DECCXX 142 private: 143 #endif 144 145 153 146 /* Blocs */ 154 147 typedef struct { 155 148 int num; 156 149 char* label; 157 Format format; 158 Offset offset; 159 } Bloc; 150 float X0, Y0; /* coordonnees sommet NO */ 151 float Tx, Ty; /* Format */ 152 float Dx, Dy; /* Repere utilisateur */ 153 long begin,end,tmp; /* offsets dans le fichier */ 154 } Bloc ; 160 155 typedef list<Bloc> BlocList; /* STL */ 156 161 157 162 158 /* Pages */ … … 164 160 int num; 165 161 int BlocCounter; 166 Format format; 167 Offset offset; 168 BlocList mBlocList; /* Page == Liste de blocs */ 169 } Page; 162 float Dx,Dy; /* Sommet SE (unites utilisateur) */ 163 PIOrientation orientation; 164 long begin, end, tmp; /* Offsets dans le fichier */ 165 BlocList mBlocList; /* Page == Liste de blocs */ 166 } Page ; 170 167 typedef list<Page> PageList; /* STL */ 171 168 169 #ifdef __DECCXX 172 170 private: 173 174 /* --> Toute la classe */ 175 static PSFile** PSFiles; /* Tableau des PSFiles existants */ 176 177 /* --> le fichier */ 171 #endif 172 173 /* Fichier ps/eps */ 178 174 FILE * mPSFile; 179 175 char * mPSFileName; 176 float Tw,Th ; /* Format, en cm */ 177 float WMargin,HMargin ; /* Marges minimales */ 180 178 int isEPS; /* Vrai si PostScript Encapsule */ 181 Format mFormat; /* Format par defaut */ 182 int PageCounter; /* Nbre de pages */ 183 PageList mPageList; /* Fichier == Liste de pages */ 184 185 /* Attributs graphiques */ 179 long boundingBox; /* Endroit ou est specifiee la bb */ 180 float scale; /* boundingbox = Dx*scale ; Dy*scale */ 181 PIPaperSize mPaperSize ; 182 int PageCounter; /* nbr pages */ 183 int FileEmpty; 184 Page* currentPage; /* Avant empilage */ 185 Bloc* currentBloc; /* Avant empilage */ 186 PageList mPageList; /* Fichier == Liste de pages */ 187 188 189 /* Attributs graphiques, initialises par constructeur */ 186 190 enum PIColors mDrawColor; /* Couleur de trace courante */ 187 191 enum PIColors mFillColor; /* Couleur de remplissage courante */ 188 enum PIFontAtt mFontAtt; 189 enum PIFontSize mFontSize; 192 enum PIFontAtt mFontAtt; 193 enum PIFontSize mFontSize; 190 194 enum PILineAtt mLineAtt; /* Epaisseur d une ligne */ 191 195 enum PIMarker mMarker; /* Marker courant */ 192 193 194 /* Ecriture du PostScript dans le fichier Physique */ 195 /* Le code se trouve ds PSDict.cc */ 196 virtual void WriteHeader(); 197 virtual void WriteTrailer(); 198 virtual void WriteNewPage(Page *mPage); 199 virtual void WriteEndPage(Page *mPage); 200 virtual void WriteNewBloc(Bloc *mBloc); 201 virtual void WriteEndBloc(Bloc *mBloc); 202 virtual void WriteDrawString(float x, float y, char* s); 203 virtual void WriteDrawLine(float x1, float y1, float x2, float y2); 204 virtual void WriteDrawBox(float x0, float y0, float Tx, float Ty); 205 virtual void WriteDrawFBox(float x0, float y0, float Tx, float Ty); 206 virtual void WriteDrawCircle(float x0, float y0, float r); 207 virtual void WriteDrawFCircle(float x0, float y0, float r); 208 virtual void WriteDrawPolygon(float *x, float *y, int n); 209 virtual void WriteDrawFPolygon(float *x, float *y, int n); 210 virtual void WriteDrawMarker(float x0, float y0); 211 virtual void WriteDrawMarkers(float *x0, float *y0, int n); 212 virtual void WriteImage(float x0, float y0, float Tx, float Ty, 213 int Nx, int Ny, unsigned char *pict, PIColorMap *mColorMap); 214 virtual void WriteSetColor(PIColors mDrawColor); 215 virtual void WriteSetFont(PIFontAtt mFontAtt, int mFontSize); 216 virtual void WriteSetLineWidth(PILineAtt mLineAtt); 217 }; /* End class PSFile */ 196 int mMarkerSize; /* Taille (en points) du marker courant */ 197 } ; 198 218 199 219 200 #endif/* PSFILE_H_SEEN */
Note:
See TracChangeset
for help on using the changeset viewer.