1 // GDS3D, a program for viewing GDSII files in 3D. 2 // Created by Jasper Velner and Michiel Soer, http://icd.el.utwente.nl 3 // Based on code by Roger Light, http://atchoo.org/gds2pov/ 4 // 5 // Copyright (C) 2013 IC-Design Group, University of Twente. 6 // 7 // This program is free software; you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License as published by 9 // the Free Software Foundation; either version 2 of the License, or 10 // (at your option) any later version. 11 // 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // You should have received a copy of the GNU General Public License 18 // along with this program; if not, write to the Free Software 19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 21 #ifndef _PROCESS_CFG2_H 22 #define _PROCESS_CFG2_H 23 24 struct GDSUnits { 25 double Unitu; /* GDS Unit in micron*/ 26 double UserUnit; 27 }; 28 29 struct ProcessLayer{ 30 struct ProcessLayer *Next; 31 char *Name; 32 char *ProcessName; 33 char *Virtual; 34 char *Material; 35 char *OutMaterial; 36 int Layer; 37 int Datatype; 38 double Height; 39 double Thickness; 40 struct GDSUnits *Units; // GDS Unit 41 bool Top; 42 bool Bottom; 43 int Show; 44 float Red; 45 float Green; 46 float Blue; 47 float Filter; 48 int Metal; 49 double MinSpace; 50 double UnitSize; 51 int Index; 52 int LegendIndex; 53 bool Alt; 54 bool Ctrl; 55 bool Shift; 56 int ShortKey; 57 bool operator<(const ProcessLayer & n) const { 58 return this->Height < n.Height; 59 } operatorProcessLayer60 bool operator()(const ProcessLayer & n) const { 61 return this->Height < n.Height; 62 } 63 64 }; 65 66 typedef struct ProcessLayer layers; 67 68 class GDSProcess 69 { 70 private: 71 struct ProcessLayer *_FirstLayer; 72 int _Count; /* Number of layers found */ 73 char * _CurrentProcess; 74 bool _Valid; /* Is the process file valid? */ 75 76 public: 77 GDSProcess (); 78 ~GDSProcess (); 79 80 void Parse(char *processfile); 81 void ParseFile(char * processfile, int cur_layer, float offset, bool flip); 82 //void ParseFile(char * processfile, int cur_layer); 83 //bool Parse(char *processfile); 84 85 void AddLayer(struct ProcessLayer *NewLayer); 86 void AddLayer(int Layer, int Datatype); 87 void ChangeVisibility(struct ProcessLayer *Layer, bool Show); 88 void ChangeLegendIndex(struct ProcessLayer *Layer, int LegendIndex); 89 bool LayerExist(ProcessLayer * NewLayer); 90 void ChangeTopLayer(ProcessLayer * layer, ProcessLayer * NewLayer, bool flip); 91 void ChangeBottomLayer(ProcessLayer * layer, ProcessLayer * NewLayer, bool flip); 92 void AddLayer(ProcessLayer * NewLayer, bool flip); 93 struct ProcessLayer *GetLayer(int Number, int Datatype); 94 struct ProcessLayer *GetLayer(int Number, int Datatype, char * ProcessName); 95 struct ProcessLayer *GetLayer(int Index); 96 ProcessLayer * GetLayer(const char * Name); 97 struct ProcessLayer *GetLayer(); 98 ProcessLayer * GetLayerProcess(const char * ProcessName); 99 int LayerCount(); 100 char *GetCurrentProcess(); 101 void SetCurrentProcess(char * CurrentProcess); 102 void SetUnits(double dbUnitm, double dbUnituu); 103 bool IsValid(); 104 double GetHighest(); 105 double GetLowest(); 106 bool Save(const char *filename); 107 }; 108 109 #endif // _PROCESS_CFG_H 110 111