Jspice3
objects.c File Reference
#include "spice.h"
#include "sced.h"
#include "scedmacs.h"
Include dependency graph for objects.c:

Go to the source code of this file.

Data Structures

struct  pp
 
struct  clist
 

Macros

#define ka_copy(BB1, BB2)
 

Functions

static void do_del ()
 
void Del (int *LookedAhead)
 
static void do_del (int Info, struct ka *BB)
 
static void allocate_wire ()
 
static void record_wire ()
 
static void zap_last_point ()
 
static void append_point ()
 
static void last_path_point ()
 
static struct pallocate_path ()
 
void Wires (int *LookedAhead)
 
void ShowWire (int Color, long Width, struct p *Path)
 
int IsManhattan (long X1, long Y1, long X2, long Y2)
 
static void allocate_wire (int Layer, struct p *Path, long Width, struct ka *BB, struct o **Pointer, int Info)
 
static void record_wire (struct o *Pointer)
 
static void zap_last_point (struct p **Path)
 
static void append_point (long X, long Y, struct p **Path)
 
static void last_path_point (long *X, long *Y, struct p *Path)
 
static struct pallocate_path (long X, long Y)
 
void ShowPath (int Color, struct p *Path, int Terminate)
 
void ShowPolygon (int Color, struct p *Path)
 
int InBox (long X, long Y, struct ka *AOI)
 
void OversizeBox (struct ka *BB, int Delta)
 
void OutlineBox (struct ka *AOI)
 
void ShowEmptyBox (int Color, struct ka *boxBB)
 
void EraseBox (struct ka *boxBB)
 
static void restore_stretch ()
 
static void do_stretch_path ()
 
static struct pget_nearest_vertex ()
 
static void set_ref_to_vertex ()
 
void StretchPath (int *LookedAhead)
 
void ShowStretch (long MapX, long MapY, long RefX, long RefY)
 
static void do_stretch_path (long RefX, long RefY, long MapX, long MapY, struct ka *NBB, int SelectNew)
 
static struct pget_nearest_vertex (struct p *Path, long X, long Y)
 
static void set_ref_to_vertex (long *X, long *Y)
 
static void clear_dots ()
 
static void create_dots ()
 
static void save_vertex ()
 
static void save_dot ()
 
static void add_dots ()
 
static void list_cells ()
 
static void mlist ()
 
static struct sadd_to_list ()
 
void Dots (int *LookedAhead)
 
static void clear_dots (struct s *CellDesc)
 
static void create_dots (struct s *CellDesc)
 
static void save_vertex (int x, int y, int type)
 
static void save_dot (int x, int y)
 
static void add_dots (struct s *CellDesc)
 
static void mlist (struct m *md)
 
static struct sadd_to_list (char *name)
 

Variables

char * MenuDELET
 
char * MenuUNDO
 
char * MenuWIRES
 
char * MenuSTRCH
 
char * MenuDOTS
 
static char DotP []
 
static struct pDotList
 
static struct ppVertexList
 
static struct clistCList
 

Macro Definition Documentation

#define ka_copy (   BB1,
  BB2 
)
Value:
BB1.kaLeft = BB2->kaLeft; \
BB1.kaRight = BB2->kaRight; \
BB1.kaBottom = BB2->kaBottom; \
BB1.kaTop = BB2->kaTop; \
TPoint(&BB1.kaLeft,&BB1.kaBottom); \
TPoint(&BB1.kaRight,&BB1.kaTop); \
if (BB1.kaLeft > BB1.kaRight) \
SwapInts(BB1.kaLeft,BB1.kaRight); \
if (BB1.kaBottom > BB1.kaTop) \
SwapInts(BB1.kaBottom,BB1.kaTop);
void TPoint()
if(TDesc==NULL)
Definition: cd.c:1326
#define SwapInts(Dragon, Eagle)
Definition: cdmacs.h:20

Definition at line 552 of file objects.c.

Function Documentation

static void add_dots ( )
static
static void add_dots ( struct s CellDesc)
static

Definition at line 1391 of file objects.c.

1395 {
1396  struct p *p, *pd, *Path;
1397  struct o *Pointer;
1398  int i;
1399 
1400  for (pd = DotList; pd; pd = pd->pSucc) {
1401 
1402  p = Path = alloc(p);
1403  if (p == NULL) MallocFailed();
1404  p->pX = pd->pX + DotP[0];
1405  p->pY = pd->pY + DotP[1];
1406  for (i = 1; i < 9; i++) {
1407  p->pSucc = alloc(p);
1408  p = p->pSucc;
1409  if (p == NULL) MallocFailed();
1410  p->pX = pd->pX + DotP[2*i];
1411  p->pY = pd->pY + DotP[2*i+1];
1412  }
1413  p->pSucc = NULL;
1414  if (!CDMakePolygon(CellDesc,1,Path,&Pointer))
1415  MallocFailed();
1416  }
1417  for (; DotList; DotList = p) {
1418  p = DotList->pSucc;
1419  txfree((char*)DotList);
1420  }
1421  for (; VertexList; VertexList = (struct pp*)p) {
1422  p = (struct p*)VertexList->ppSucc;
1423  txfree((char*)VertexList);
1424  }
1425  DotList = NULL;
1426  VertexList = NULL;
1427 }
static struct pp * VertexList
Definition: objects.c:1188
int struct o * Pointer
Definition: cd.c:1311
Definition: objects.c:1183
FILE * p
Definition: proc2mod.c:48
int CDMakePolygon()
Definition: cddefs.h:215
#define alloc(type)
Definition: cdmacs.h:21
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
void txfree()
#define NULL
Definition: spdefs.h:121
static struct p * DotList
Definition: objects.c:1181
Definition: cddefs.h:142
long pX
Definition: cddefs.h:216
static char DotP[]
Definition: objects.c:1178
struct pp * ppSucc
Definition: objects.c:1186
struct p * pSucc
Definition: cddefs.h:217
static struct s* add_to_list ( )
static
static struct s* add_to_list ( char *  name)
static

Definition at line 1465 of file objects.c.

1469 {
1470  struct clist *s;
1471  struct s *cd;
1472 
1473  for (s = CList; s; s = s->next) {
1474  if (!strcmp(s->name,name))
1475  return (NULL);
1476  }
1477  if (!CDOpen(name,&cd,'r'))
1478  return (NULL);
1479  s = alloc(clist);
1480  if (s == NULL)
1481  MallocFailed();
1482  s->name = name;
1483  s->cd = cd;
1484  s->next = CList;
1485  CList = s;
1486  return (cd);
1487 }
struct clist * next
Definition: objects.c:1193
Definition: cddefs.h:119
struct s * cd
Definition: objects.c:1192
int CDOpen()
#define alloc(type)
Definition: cdmacs.h:21
char * name
Definition: objects.c:1191
void MallocFailed()
Definition: scedintr.c:857
#define NULL
Definition: spdefs.h:121
static struct clist * CList
Definition: objects.c:1195
static struct p* allocate_path ( )
static
static struct p* allocate_path ( long  X,
long  Y 
)
static

Definition at line 438 of file objects.c.

442 {
443  struct p *Path;
444 
445  if ((Path = alloc(p)) == NULL) MallocFailed();
446  Path->pX = X;
447  Path->pY = Y;
448  Path->pSucc = NULL;
449  return (Path);
450 }
Definition: cddefs.h:215
#define alloc(type)
Definition: cdmacs.h:21
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
long X
Definition: actions.c:450
#define NULL
Definition: spdefs.h:121
long pX
Definition: cddefs.h:216
struct p * pSucc
Definition: cddefs.h:217
long Y
Definition: actions.c:450
static void allocate_wire ( )
static
static void allocate_wire ( int  Layer,
struct p Path,
long  Width,
struct ka BB,
struct o **  Pointer,
int  Info 
)
static

Definition at line 310 of file objects.c.

319 {
321  Layer,Width,Path,Pointer)) MallocFailed();
322  (*Pointer)->oInfo = Info;
324  &BB->kaLeft,&BB->kaBottom,&BB->kaRight,&BB->kaTop);
325  OversizeBox(BB,Width);
326 }
long kaRight
Definition: sced.h:112
long kaBottom
Definition: sced.h:112
struct s * kpCellDesc
Definition: sced.h:207
#define Not
Definition: cdmacs.h:16
int CDStatusInt
Definition: cd.c:75
int CDMakeWire()
void MallocFailed()
Definition: scedintr.c:857
struct kp Parameters
Definition: init.c:19
long kaTop
Definition: sced.h:112
long kaLeft
Definition: sced.h:112
void OversizeBox(struct ka *BB, int Delta)
Definition: objects.c:581
int Layer
Definition: cd.c:1908
int CDBB()
static void append_point ( )
static
static void append_point ( long  X,
long  Y,
struct p **  Path 
)
static

Definition at line 382 of file objects.c.

387 {
388  struct p *OldPair;
389  struct p *NewPair;
390 
391  if (Path == NULL || *Path == NULL)
392  return;
393  OldPair = *Path;
394  if ((NewPair = alloc(p)) == NULL)
395  MallocFailed();
396  *Path = NewPair;
397  NewPair->pX = OldPair->pX;
398  NewPair->pY = OldPair->pY;
399  NewPair->pSucc = NULL;
400  OldPair = OldPair->pSucc;
401  while (OldPair != NULL) {
402  if ((NewPair->pSucc = alloc(p)) == NULL)
403  MallocFailed();
404  NewPair = NewPair->pSucc;
405  NewPair->pX = OldPair->pX;
406  NewPair->pY = OldPair->pY;
407  NewPair->pSucc = NULL;
408  OldPair = OldPair->pSucc;
409  }
410  /* Append the new reference point */
411  if ((NewPair->pSucc = alloc(p)) == NULL)
412  MallocFailed();
413  NewPair = NewPair->pSucc;
414  NewPair->pX = X;
415  NewPair->pY = Y;
416  NewPair->pSucc = NULL;
417 }
Definition: cddefs.h:215
#define alloc(type)
Definition: cdmacs.h:21
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
long X
Definition: actions.c:450
#define NULL
Definition: spdefs.h:121
long pX
Definition: cddefs.h:216
long Y
Definition: actions.c:450
struct p * pSucc
Definition: cddefs.h:217
static void clear_dots ( )
static
static void clear_dots ( struct s CellDesc)
static

Definition at line 1261 of file objects.c.

1264 {
1265  struct g *GenDesc;
1266  struct o *Pointer;
1267 
1268  if (Not CDInitGen(CellDesc,1,-CDINFINITY,-CDINFINITY,
1269  CDINFINITY,CDINFINITY,&GenDesc)) MallocFailed();
1270 
1271  loop {
1272  CDGen(CellDesc,GenDesc,&Pointer);
1273  if (Pointer == NULL) break;
1274  if (Pointer->oInfo == SQ_GONE Or Pointer->oInfo == SQ_INCMPLT)
1275  continue;
1276  if (Pointer->oType == CDPOLYGON) {
1277  CDDelete(CellDesc,Pointer);
1278  }
1279  }
1280 }
#define loop
Definition: cdmacs.h:11
int struct o * Pointer
Definition: cd.c:1311
#define Or
Definition: cdmacs.h:15
#define SQ_GONE
Definition: sced.h:347
#define CDINFINITY
Definition: cddefs.h:70
char oType
Definition: cddefs.h:148
#define Not
Definition: cdmacs.h:16
#define CDDelete
Definition: cddefs.h:19
void CDGen()
void MallocFailed()
Definition: scedintr.c:857
#define SQ_INCMPLT
Definition: sced.h:356
int CDInitGen()
#define NULL
Definition: spdefs.h:121
Definition: cddefs.h:142
Definition: cddefs.h:227
#define CDPOLYGON
Definition: cddefs.h:44
short oInfo
Definition: cddefs.h:147
static void create_dots ( )
static
static void create_dots ( struct s CellDesc)
static

Definition at line 1283 of file objects.c.

1286 {
1287  struct g *GenDesc;
1288  struct o *Pointer;
1289  struct p *p;
1290  struct prpty *pd;
1291 
1292  /* Process wires */
1293 
1294  if (Not CDInitGen(CellDesc,1,-CDINFINITY,-CDINFINITY,
1295  CDINFINITY,CDINFINITY,&GenDesc)) MallocFailed();
1296 
1297  loop {
1298  CDGen(CellDesc,GenDesc,&Pointer);
1299  if (Pointer == NULL) break;
1300  if (Pointer->oInfo == SQ_GONE Or Pointer->oInfo == SQ_INCMPLT)
1301  continue;
1302  if (Pointer->oType == CDWIRE) {
1303  p = ((struct w *)Pointer->oRep)->wPath;
1304  save_vertex(p->pX,p->pY,0);
1305  for (p = p->pSucc; p && p->pSucc; p = p->pSucc)
1306  save_vertex(p->pX,p->pY,1);
1307  if (p)
1308  save_vertex(p->pX,p->pY,0);
1309  }
1310  }
1311 
1312  /* Process devices */
1313 
1314  if (Not CDInitGen(CellDesc,0,-CDINFINITY,-CDINFINITY,CDINFINITY,
1315  CDINFINITY,&GenDesc)) MallocFailed();
1316 
1317  loop {
1318  CDGen(CellDesc,GenDesc,&Pointer);
1319  if (Pointer == NULL) break;
1320  if (Pointer->oInfo == SQ_GONE) continue;
1321 
1322  pd = Pointer->oPrptyList;
1323  for (; pd; pd = pd->prpty_Succ) {
1324  if (pd->prpty_Value != P_NODE)
1325  continue;
1327  pd->prpty_Data->p_node.y,0);
1328  }
1329  }
1330  add_dots(CellDesc);
1331 }
#define loop
Definition: cdmacs.h:11
int struct o * Pointer
Definition: cd.c:1311
#define Or
Definition: cdmacs.h:15
int prpty_Value
Definition: cdprpty.h:67
#define SQ_GONE
Definition: sced.h:347
#define CDINFINITY
Definition: cddefs.h:70
char oType
Definition: cddefs.h:148
#define Not
Definition: cdmacs.h:16
struct prp_node p_node
Definition: cdprpty.h:52
FILE * p
Definition: proc2mod.c:48
static void add_dots()
int x
Definition: cdprpty.h:26
void CDGen()
#define P_NODE
Definition: cdprpty.h:12
Definition: cddefs.h:169
Definition: cddefs.h:215
union prp_data * prpty_Data
Definition: cdprpty.h:65
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
#define SQ_INCMPLT
Definition: sced.h:356
int CDInitGen()
#define NULL
Definition: spdefs.h:121
struct o * oRep
Definition: cddefs.h:144
int y
Definition: cdprpty.h:27
Definition: cddefs.h:142
long pX
Definition: cddefs.h:216
#define CDWIRE
Definition: cddefs.h:47
struct prpty * prpty_Succ
Definition: cdprpty.h:66
Definition: cddefs.h:227
struct p * pSucc
Definition: cddefs.h:217
Definition: cdprpty.h:62
short oInfo
Definition: cddefs.h:147
struct prpty * oPrptyList
Definition: cddefs.h:146
static void save_vertex()
void Del ( int *  LookedAhead)

Definition at line 36 of file objects.c.

39 {
40  struct ks *SQDesc;
41  int Info = SQ_GONE;
42 
44  if (SelectQHead == NULL) {
45  ShowPrompt("There are no selected objects to delete.");
47  return;
48  }
49  SQComputeBB();
50  /* take care of instance markers */
51  SelectQBB.kaRight += 600;
52  SelectQBB.kaLeft -= 600;
53  SelectQBB.kaTop += 600;
54  SelectQBB.kaBottom -= 600;
55 
58 
59 top:
60  switch (PointLoop(LookedAhead)) {
61  case PL_UND:
63  if (Info == SQ_GONE) Info = SQ_OLDSEL;
64  else Info = SQ_GONE;
65  do_del(Info,&SelectQBB);
67  case PL_ESC:
68  case PL_PCW:
69  goto top;
70  case PL_CMD:
71  break;
72  }
73  if (Info == SQ_GONE) {
74  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
76  }
77  SQClear();
81  }
82  else
83  SQComputeBB();
84 }
char * MenuDELET
Definition: scedintr.c:71
#define PL_ESC
Definition: sced.h:62
char * MenuUNDO
Definition: objects.c:115
#define SQ_GONE
Definition: sced.h:347
#define PL_UND
Definition: sced.h:63
int kpModified
Definition: sced.h:261
long kaRight
Definition: sced.h:112
struct o * ksPointer
Definition: sced.h:335
int PointLoop()
long kaBottom
Definition: sced.h:112
struct s * kpCellDesc
Definition: sced.h:207
#define PL_PCW
Definition: sced.h:65
#define CDDelete
Definition: cddefs.h:19
void MenuDeselect()
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
long kaTop
Definition: sced.h:112
#define True
Definition: scedstub.c:16
long kaLeft
Definition: sced.h:112
struct ks * SelectQHead
Definition: scedext.h:64
static void do_del()
Definition: sced.h:333
void SQClear()
Definition: choose.c:690
#define PL_CMD
Definition: sced.h:64
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
struct ka SelectQBB
Definition: scedext.h:65
#define SQ_OLDSEL
Definition: sced.h:344
void SQComputeBB()
Definition: choose.c:749
static void do_del ( )
static
static void do_del ( int  Info,
struct ka BB 
)
static

Definition at line 88 of file objects.c.

92 {
93  struct ks *SQDesc;
94  /*
95  * Change Info field and redisplay.
96  */
97  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc)
98  SQDesc->ksPointer->oInfo = Info;
99 
100  EraseBox(BB);
101  Redisplay(BB);
102  DevUpdate();
103 }
void Redisplay()
struct o * ksPointer
Definition: sced.h:335
struct ks * ksSucc
Definition: sced.h:334
void DevUpdate()
Definition: display.c:359
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
void EraseBox(struct ka *boxBB)
Definition: objects.c:719
short oInfo
Definition: cddefs.h:147
static void do_stretch_path ( )
static
static void do_stretch_path ( long  RefX,
long  RefY,
long  MapX,
long  MapY,
struct ka NBB,
int  SelectNew 
)
static

Definition at line 1037 of file objects.c.

1043 {
1044  struct ks *SQDesc;
1045  struct ka OBB,BB;
1046  struct o *Pointer;
1047  struct p *Path, *pp;
1048  int Layer;
1049  long Width;
1050 
1051  NBB->kaLeft = CDINFINITY;
1052  NBB->kaRight = -CDINFINITY;
1053  NBB->kaBottom = CDINFINITY;
1054  NBB->kaTop = -CDINFINITY;
1055 
1056  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
1057  if (SQDesc->ksPointer->oInfo == SQ_GONE) continue;
1058  if (SQDesc->ksPointer->oType != CDWIRE) continue;
1059 
1060  CDWire(SQDesc->ksPointer,&Layer,&Width,&Path);
1062  &OBB.kaLeft,&OBB.kaBottom,&OBB.kaRight,&OBB.kaTop);
1063 
1064  Path = CopyPath(Path);
1065  pp = get_nearest_vertex(Path,RefX,RefY);
1066  pp->pX += MapX - RefX;
1067  pp->pY += MapY - RefY;
1068 
1069  if (Not CDMakeWire(Parameters.kpCellDesc,Layer,Width,Path,
1070  &Pointer)) MallocFailed();
1071  AssignWireProperties(Pointer);
1072 
1073  if (SelectNew)
1074  Pointer->oInfo = SQ_NEWSEL;
1075  else
1076  Pointer->oInfo = SQ_NEW;
1077 
1078  SQInsert(Pointer);
1079 
1081  &BB.kaLeft,&BB.kaBottom,&BB.kaRight,&BB.kaTop);
1082 
1083  if (OBB.kaLeft < BB.kaLeft) BB.kaLeft = OBB.kaLeft;
1084  if (OBB.kaRight > BB.kaRight) BB.kaRight = OBB.kaRight;
1085  if (OBB.kaBottom < BB.kaBottom) BB.kaBottom = OBB.kaBottom;
1086  if (OBB.kaTop > BB.kaTop) BB.kaTop = OBB.kaTop;
1087 
1088  if (BB.kaLeft < NBB->kaLeft) NBB->kaLeft = BB.kaLeft;
1089  if (BB.kaRight > NBB->kaRight) NBB->kaRight = BB.kaRight;
1090  if (BB.kaBottom < NBB->kaBottom) NBB->kaBottom = BB.kaBottom;
1091  if (BB.kaTop > NBB->kaTop) NBB->kaTop = BB.kaTop;
1092 
1093  TPush();
1094  TIdentity();
1095  TTranslate(MapX-RefX,MapY-RefY);
1096  TransformReferencePoint(SQDesc->ksPointer,RefX,RefY);
1097  HYtransformStretch(SQDesc->ksPointer,Pointer,RefX,RefY,MapX,MapY);
1098  TPop();
1099  SQDesc->ksPointer->oInfo = SQ_GONE;
1100  }
1101 }
int struct o * Pointer
Definition: cd.c:1311
#define SQ_GONE
Definition: sced.h:347
long kaRight
Definition: sced.h:112
#define CDINFINITY
Definition: cddefs.h:70
struct o * ksPointer
Definition: sced.h:335
void SQInsert()
Definition: objects.c:1183
char oType
Definition: cddefs.h:148
long kaBottom
Definition: sced.h:112
#define Not
Definition: cdmacs.h:16
struct s * kpCellDesc
Definition: sced.h:207
int CDStatusInt
Definition: cd.c:75
int CDMakeWire()
Definition: sced.h:111
void TTranslate()
void CDWire()
Definition: cddefs.h:215
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
#define SQ_NEW
Definition: sced.h:350
struct ks * ksSucc
Definition: sced.h:334
void HYtransformStretch()
struct kp Parameters
Definition: init.c:19
long kaTop
Definition: sced.h:112
struct p * CopyPath()
long kaLeft
Definition: sced.h:112
Definition: cddefs.h:142
void TransformReferencePoint()
struct ks * SelectQHead
Definition: scedext.h:64
long pX
Definition: cddefs.h:216
int Layer
Definition: cd.c:1908
#define CDWIRE
Definition: cddefs.h:47
void AssignWireProperties()
void TIdentity()
Definition: xforms.c:189
Definition: sced.h:333
static struct p * get_nearest_vertex()
int CDBB()
#define SQ_NEWSEL
Definition: sced.h:353
void TPop()
Definition: xforms.c:64
short oInfo
Definition: cddefs.h:147
void TPush()
Definition: xforms.c:53
void Dots ( int *  LookedAhead)

Definition at line 1219 of file objects.c.

1222 {
1223  struct clist *s;
1224 
1227  list_cells();
1228  for (s = CList; s; s = s->next)
1229  create_dots(s->cd);
1232 
1233  loop {
1234  switch (PointLoop(LookedAhead)) {
1235  case PL_CMD:
1236  if (Matching(MenuDOTS))
1237  Parameters.kpCommand[0] = '\0';
1238  case PL_ESC:
1239  case PL_UND:
1240  goto quit;
1241  case PL_PCW:
1242  break;
1243  }
1244  }
1245 quit:
1246  for (s = CList; s; s = s->next)
1247  clear_dots(s->cd);
1248  for (; CList; CList = s) {
1249  s = CList->next;
1250  txfree((char*)CList);
1251  }
1252  CList = NULL;
1257 }
#define PL_ESC
Definition: sced.h:62
struct clist * next
Definition: objects.c:1193
#define loop
Definition: cdmacs.h:11
void Redisplay()
struct ka * kvCoarseWindow
Definition: sced.h:149
static void list_cells()
Definition: objects.c:1431
#define PL_UND
Definition: sced.h:63
Definition: cddefs.h:119
int PointLoop()
struct s * cd
Definition: objects.c:1192
#define PL_PCW
Definition: sced.h:65
void EraseLargeCoarseViewport()
Definition: viewport.c:583
static void clear_dots()
char * MenuDOTS
Definition: scedintr.c:74
#define Matching(string)
Definition: scedmacs.h:63
char * kpCommand
Definition: sced.h:219
void MenuDeselect()
void txfree()
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
static void create_dots()
struct kv * View
Definition: init.c:17
int kpShowDots
Definition: sced.h:270
static struct clist * CList
Definition: objects.c:1195
#define False
Definition: scedstub.c:15
#define PL_CMD
Definition: sced.h:64
void MenuSelect()
void EraseBox ( struct ka boxBB)

Definition at line 719 of file objects.c.

723 {
724  struct ka BB,BB1;
725 
726  SetCurrentAOI(boxBB);
727  ka_copy(BB,boxBB);
728 
731 
732  CoarseLToP(BB.kaLeft,BB.kaBottom,BB1.kaLeft,BB1.kaBottom);
733  CoarseLToP(BB.kaRight,BB.kaTop,BB1.kaRight,BB1.kaTop);
734 
735  if (BB1.kaLeft <= CurrentAOI.aRC And BB1.kaRight >= CurrentAOI.aLC And
736  BB1.kaBottom <= CurrentAOI.aTC And BB1.kaTop >= CurrentAOI.aBC) {
737 
738  if (BB1.kaLeft < CurrentAOI.aLC)
739  BB1.kaLeft = CurrentAOI.aLC;
740  if (BB1.kaBottom < CurrentAOI.aBC)
741  BB1.kaBottom = CurrentAOI.aBC;
742  if (BB1.kaRight > CurrentAOI.aRC)
743  BB1.kaRight = CurrentAOI.aRC;
744  if (BB1.kaTop > CurrentAOI.aTC)
745  BB1.kaTop = CurrentAOI.aTC;
746  FBEraseBox(BB1.kaLeft,BB1.kaBottom,
747  BB1.kaRight,BB1.kaTop);
748  }
749  }
750 
753 
754  FineLToP(BB.kaLeft,BB.kaBottom,BB1.kaLeft,BB1.kaBottom);
755  FineLToP(BB.kaRight,BB.kaTop,BB1.kaRight,BB1.kaTop);
756 
757  if (BB1.kaLeft <= CurrentAOI.aRF And BB1.kaRight >= CurrentAOI.aLF And
758  BB1.kaBottom <= CurrentAOI.aTF And BB1.kaTop >= CurrentAOI.aBF) {
759 
760  if (BB1.kaLeft < CurrentAOI.aLF)
761  BB1.kaLeft = CurrentAOI.aLF;
762  if (BB1.kaBottom < CurrentAOI.aBF)
763  BB1.kaBottom = CurrentAOI.aBF;
764  if (BB1.kaRight > CurrentAOI.aRF)
765  BB1.kaRight = CurrentAOI.aRF;
766  if (BB1.kaTop > CurrentAOI.aTF)
767  BB1.kaTop = CurrentAOI.aTF;
768  FBEraseBox(BB1.kaLeft,BB1.kaBottom,
769  BB1.kaRight,BB1.kaTop);
770  }
771  }
772 }
long aTF
Definition: sced.h:121
#define FBEraseBox(L, B, R, T)
Definition: scedmacs.h:65
#define COARSEVIEWPORTONLY
Definition: sced.h:51
long aBF
Definition: sced.h:121
long aTC
Definition: sced.h:122
#define FineLToP(X, Y, XT, YT)
Definition: sced.h:379
Definition: sced.h:111
char kpRedisplayControl
Definition: sced.h:312
long aLC
Definition: sced.h:122
struct a CurrentAOI
Definition: init.c:22
#define FINEVIEWPORTONLY
Definition: sced.h:50
long aLF
Definition: sced.h:121
struct kp Parameters
Definition: init.c:19
int aInFine
Definition: sced.h:123
long aRC
Definition: sced.h:122
void SetCurrentAOI()
#define ka_copy(BB1, BB2)
Definition: objects.c:552
long aBC
Definition: sced.h:122
#define CoarseLToP(X, Y, XT, YT)
Definition: sced.h:373
#define And
Definition: cdmacs.h:14
long aRF
Definition: sced.h:121
int aInCoarse
Definition: sced.h:124
static struct p* get_nearest_vertex ( )
static
static struct p* get_nearest_vertex ( struct p Path,
long  X,
long  Y 
)
static

Definition at line 1105 of file objects.c.

1110 {
1111  double dx,dy,d,mind;
1112  struct p *p;
1113  int i,indx = 0;
1114 
1115  mind = 1e30;
1116  for (p = Path,i = 0; p; p = p->pSucc,i++) {
1117  dx = p->pX - X;
1118  dy = p->pY - Y;
1119  d = dx*dx + dy*dy;
1120  if (d < mind) {
1121  mind = d;
1122  indx = i;
1123  }
1124  }
1125  for (p = Path, i = 0; i < indx; p = p->pSucc,i++) ;
1126  return (p);
1127 }
FILE * p
Definition: proc2mod.c:48
Definition: cddefs.h:215
long pY
Definition: cddefs.h:216
long X
Definition: actions.c:450
Definition: cddefs.h:237
long pX
Definition: cddefs.h:216
long Y
Definition: actions.c:450
struct p * pSucc
Definition: cddefs.h:217
int InBox ( long  X,
long  Y,
struct ka AOI 
)

Definition at line 565 of file objects.c.

570 {
571  if (((AOI->kaLeft <= X And X <= AOI->kaRight) Or
572  (AOI->kaRight <= X And X <= AOI->kaLeft)) And
573  ((AOI->kaBottom <= Y And Y <= AOI->kaTop) Or
574  (AOI->kaTop <= Y And Y <= AOI->kaBottom)))
575  return (True);
576  return (False);
577 }
#define Or
Definition: cdmacs.h:15
long kaRight
Definition: sced.h:112
long kaBottom
Definition: sced.h:112
long X
Definition: actions.c:450
long kaTop
Definition: sced.h:112
#define True
Definition: scedstub.c:16
long kaLeft
Definition: sced.h:112
#define And
Definition: cdmacs.h:14
#define False
Definition: scedstub.c:15
long Y
Definition: actions.c:450
int IsManhattan ( long  X1,
long  Y1,
long  X2,
long  Y2 
)

Definition at line 298 of file objects.c.

302 {
303  if (X1 == X2 Or Y1 == Y2)
304  return (True);
305  else return (False);
306 }
#define Or
Definition: cdmacs.h:15
#define True
Definition: scedstub.c:16
#define False
Definition: scedstub.c:15
static void last_path_point ( )
static
static void last_path_point ( long *  X,
long*  Y,
struct p Path 
)
static

Definition at line 421 of file objects.c.

426 {
427  struct p *p;
428 
429  for (p = Path; p && p->pSucc; p = p->pSucc) ;
430  if (p) {
431  *X = p->pX;
432  *Y = p->pY;
433  }
434 }
FILE * p
Definition: proc2mod.c:48
Definition: cddefs.h:215
long pY
Definition: cddefs.h:216
long X
Definition: actions.c:450
long pX
Definition: cddefs.h:216
long Y
Definition: actions.c:450
struct p * pSucc
Definition: cddefs.h:217
static void list_cells ( )
static

Definition at line 1431 of file objects.c.

1434 {
1435  CList = alloc(clist);
1436  if (CList == NULL)
1437  MallocFailed();
1440  CList->next = NULL;
1442 }
static void mlist()
struct clist * next
Definition: objects.c:1193
struct s * cd
Definition: objects.c:1192
struct s * kpCellDesc
Definition: sced.h:207
char * kpCellName
Definition: sced.h:210
char * name
Definition: objects.c:1191
#define alloc(type)
Definition: cdmacs.h:21
void MallocFailed()
Definition: scedintr.c:857
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
struct m * sMasterList
Definition: cddefs.h:132
static struct clist * CList
Definition: objects.c:1195
static void mlist ( )
static
static void mlist ( struct m md)
static

Definition at line 1446 of file objects.c.

1450 {
1451  struct s *cd;
1452 
1453  for (; md; md = md->mSucc) {
1454  if (!IsCellInLib(md->mName)) {
1455  cd = add_to_list(md->mName);
1456  if (cd) {
1457  mlist(cd->sMasterList);
1458  }
1459  }
1460  }
1461 }
static void mlist()
Definition: cddefs.h:119
char * mName
Definition: cddefs.h:111
struct m * sMasterList
Definition: cddefs.h:132
static struct s * add_to_list()
struct m * mSucc
Definition: cddefs.h:112
int IsCellInLib()
void OutlineBox ( struct ka AOI)

Definition at line 595 of file objects.c.

599 {
600  int x1,y1,x2,y2;
601  x1 = AOI->kaLeft;
602  y1 = AOI->kaBottom;
603  x2 = AOI->kaRight;
604  y2 = AOI->kaTop;
605  DevLine(x1,y1,x2,y1);
606  DevLine(x2,y1,x2,y2);
607  DevLine(x2,y2,x1,y2);
608  DevLine(x1,y2,x1,y1);
609 }
long kaRight
Definition: sced.h:112
long kaBottom
Definition: sced.h:112
long kaTop
Definition: sced.h:112
void DevLine()
long kaLeft
Definition: sced.h:112
void OversizeBox ( struct ka BB,
int  Delta 
)

Definition at line 581 of file objects.c.

586 {
587  BB->kaTop += Delta;
588  BB->kaRight += Delta;
589  BB->kaBottom -= Delta;
590  BB->kaLeft -= Delta;
591 }
long kaRight
Definition: sced.h:112
long kaBottom
Definition: sced.h:112
long kaTop
Definition: sced.h:112
long kaLeft
Definition: sced.h:112
static void record_wire ( )
static
static void record_wire ( struct o Pointer)
static

Definition at line 330 of file objects.c.

336 {
337  int Info;
338 
339  if (Pointer == NULL) return;
340  if (Pointer->oInfo == SQ_GONE)
341  CDDelete(Parameters.kpCellDesc,Pointer);
342  else {
343  Pointer->oInfo = SQ_OLD;
344  if (Pointer->oPrptyList == NULL)
345  AssignWireProperties(Pointer);
346  }
347 }
#define SQ_GONE
Definition: sced.h:347
#define SQ_OLD
Definition: sced.h:341
struct s * kpCellDesc
Definition: sced.h:207
#define CDDelete
Definition: cddefs.h:19
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
void AssignWireProperties()
short oInfo
Definition: cddefs.h:147
struct prpty * oPrptyList
Definition: cddefs.h:146
static void restore_stretch ( )
static

Definition at line 1017 of file objects.c.

1020 {
1021  struct ks *SQDesc;
1022  struct p *Path;
1023  int Layer;
1024  long Width;
1025 
1026  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
1027  if (SQDesc->ksPointer->oInfo == SQ_GONE) continue;
1028  if (SQDesc->ksPointer->oType != CDWIRE) continue;
1029 
1030  CDWire(SQDesc->ksPointer,&Layer,&Width,&Path);
1031  ShowWire(DrawingColor,Width,Path);
1032  }
1033 }
#define SQ_GONE
Definition: sced.h:347
struct o * ksPointer
Definition: sced.h:335
char oType
Definition: cddefs.h:148
#define DrawingColor
Definition: sced.h:87
void CDWire()
Definition: cddefs.h:215
void ShowWire(int Color, long Width, struct p *Path)
Definition: objects.c:286
struct ks * ksSucc
Definition: sced.h:334
struct ks * SelectQHead
Definition: scedext.h:64
int Layer
Definition: cd.c:1908
#define CDWIRE
Definition: cddefs.h:47
Definition: sced.h:333
short oInfo
Definition: cddefs.h:147
static void save_dot ( )
static
static void save_dot ( int  x,
int  y 
)
static

Definition at line 1368 of file objects.c.

1374 {
1375  struct p *p;
1376 
1377  for (p = DotList; p; p = p->pSucc) {
1378  if (p->pX == x && p->pY == y)
1379  return;
1380  }
1381  p = alloc(p);
1382  if (p == NULL) MallocFailed();
1383  p->pX = x;
1384  p->pY = y;
1385  p->pSucc = DotList;
1386  DotList = p;
1387 }
FILE * p
Definition: proc2mod.c:48
Definition: cddefs.h:215
#define alloc(type)
Definition: cdmacs.h:21
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
#define NULL
Definition: spdefs.h:121
static struct p * DotList
Definition: objects.c:1181
long pX
Definition: cddefs.h:216
struct p * pSucc
Definition: cddefs.h:217
static void save_vertex ( )
static
static void save_vertex ( int  x,
int  y,
int  type 
)
static

Definition at line 1335 of file objects.c.

1341 {
1342  struct pp *p;
1343 
1344  for (p = VertexList; p; p = p->ppSucc) {
1345  if (p->ppX == x && p->ppY == y) {
1346  /* already there, if both types are zero,
1347  * update the stored entry to type 1 (so as
1348  * not to mark two abutting line segments)
1349  */
1350  if (p->ppType == 0 && type == 0)
1351  p->ppType = 1;
1352  else
1353  save_dot(x,y);
1354  return;
1355  }
1356  }
1357  p = alloc(pp);
1358  if (p == NULL) MallocFailed();
1359  p->ppX = x;
1360  p->ppY = y;
1361  p->ppType = type;
1362  p->ppSucc = VertexList;
1363  VertexList = p;
1364 }
static struct pp * VertexList
Definition: objects.c:1188
Definition: objects.c:1183
int ppY
Definition: objects.c:1184
FILE * p
Definition: proc2mod.c:48
static void save_dot()
int ppX
Definition: objects.c:1184
#define alloc(type)
Definition: cdmacs.h:21
void MallocFailed()
Definition: scedintr.c:857
#define NULL
Definition: spdefs.h:121
Definition: types.c:18
int ppType
Definition: objects.c:1185
struct pp * ppSucc
Definition: objects.c:1186
static void set_ref_to_vertex ( )
static
static void set_ref_to_vertex ( long *  X,
long*  Y 
)
static

Definition at line 1131 of file objects.c.

1135 {
1136  struct ks *SQDesc;
1137  struct o *Pointer;
1138  struct p *p,*Path;
1139  double dx,dy,d,mind;
1140  int i,indx;
1141 
1142 
1143  mind = 1e30;
1144  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
1145 
1146  if (SQDesc->ksPointer->oInfo == SQ_GONE) continue;
1147  if (SQDesc->ksPointer->oType != CDWIRE) continue;
1148  Path = ((struct w *)SQDesc->ksPointer->oRep)->wPath;
1149 
1150  for (p = Path,i = 0; p; p = p->pSucc,i++) {
1151  dx = p->pX - *X;
1152  dy = p->pY - *Y;
1153  d = dx*dx + dy*dy;
1154  if (d < mind) {
1155  mind = d;
1156  indx = i;
1157  Pointer = SQDesc->ksPointer;
1158  }
1159  }
1160  }
1161  Path = ((struct w *)Pointer->oRep)->wPath;
1162  for (p = Path, i = 0; i < indx; p = p->pSucc,i++) ;
1163  *X = p->pX;
1164  *Y = p->pY;
1165 }
int struct o * Pointer
Definition: cd.c:1311
#define SQ_GONE
Definition: sced.h:347
struct o * ksPointer
Definition: sced.h:335
char oType
Definition: cddefs.h:148
FILE * p
Definition: proc2mod.c:48
Definition: cddefs.h:169
Definition: cddefs.h:215
long pY
Definition: cddefs.h:216
long X
Definition: actions.c:450
Definition: cddefs.h:237
struct ks * ksSucc
Definition: sced.h:334
struct o * oRep
Definition: cddefs.h:144
Definition: cddefs.h:142
struct ks * SelectQHead
Definition: scedext.h:64
long pX
Definition: cddefs.h:216
#define CDWIRE
Definition: cddefs.h:47
Definition: sced.h:333
long Y
Definition: actions.c:450
struct p * pSucc
Definition: cddefs.h:217
short oInfo
Definition: cddefs.h:147
void ShowEmptyBox ( int  Color,
struct ka boxBB 
)

Definition at line 613 of file objects.c.

618 {
619  struct ka BB,BB1;
620  int ShowLeft = True;
621  int ShowBottom = True;
622  int ShowRight = True;
623  int ShowTop = True;
624 
625  ka_copy(BB,boxBB);
626 
629 
630  CoarseLToP(BB.kaLeft,BB.kaBottom,BB1.kaLeft,BB1.kaBottom);
631  CoarseLToP(BB.kaRight,BB.kaTop,BB1.kaRight,BB1.kaTop);
632 
633  if (BB1.kaLeft <= CurrentAOI.aRC And BB1.kaRight >= CurrentAOI.aLC And
634  BB1.kaBottom <= CurrentAOI.aTC And BB1.kaTop >= CurrentAOI.aBC) {
635 
636  if (BB1.kaLeft < CurrentAOI.aLC) {
637  BB1.kaLeft = CurrentAOI.aLC;
638  ShowLeft = False;
639  }
640  if (BB1.kaBottom < CurrentAOI.aBC) {
641  BB1.kaBottom = CurrentAOI.aBC;
642  ShowBottom = False;
643  }
644  if (BB1.kaRight > CurrentAOI.aRC) {
645  BB1.kaRight = CurrentAOI.aRC;
646  ShowRight = False;
647  }
648  if (BB1.kaTop > CurrentAOI.aTC) {
649  BB1.kaTop = CurrentAOI.aTC;
650  ShowTop = False;
651  }
653 
654  if (ShowTop)
655  DevLine((int)BB1.kaLeft,(int)BB1.kaTop,
656  (int)BB1.kaRight,(int)BB1.kaTop);
657  if (ShowRight)
658  DevLine((int)BB1.kaRight,(int)BB1.kaTop,
659  (int)BB1.kaRight,(int)BB1.kaBottom);
660  if (ShowBottom)
661  DevLine((int)BB1.kaRight,(int)BB1.kaBottom,
662  (int)BB1.kaLeft,(int)BB1.kaBottom);
663  if (ShowLeft)
664  DevLine((int)BB1.kaLeft,(int)BB1.kaBottom,
665  (int)BB1.kaLeft,(int)BB1.kaTop);
666  }
667  }
668 
669  ShowLeft = True;
670  ShowBottom = True;
671  ShowRight = True;
672  ShowTop = True;
673 
676 
677  FineLToP(BB.kaLeft,BB.kaBottom,BB1.kaLeft,BB1.kaBottom);
678  FineLToP(BB.kaRight,BB.kaTop,BB1.kaRight,BB1.kaTop);
679 
680  if (BB1.kaLeft <= CurrentAOI.aRF And BB1.kaRight >= CurrentAOI.aLF And
681  BB1.kaBottom <= CurrentAOI.aTF And BB1.kaTop >= CurrentAOI.aBF) {
682 
683  if (BB1.kaLeft < CurrentAOI.aLF) {
684  BB1.kaLeft = CurrentAOI.aLF;
685  ShowLeft = False;
686  }
687  if (BB1.kaBottom < CurrentAOI.aBF) {
688  BB1.kaBottom = CurrentAOI.aBF;
689  ShowBottom = False;
690  }
691  if (BB1.kaRight > CurrentAOI.aRF) {
692  BB1.kaRight = CurrentAOI.aRF;
693  ShowRight = False;
694  }
695  if (BB1.kaTop > CurrentAOI.aTF) {
696  BB1.kaTop = CurrentAOI.aTF;
697  ShowTop = False;
698  }
700 
701  if (ShowTop)
702  DevLine((int)BB1.kaLeft,(int)BB1.kaTop,
703  (int)BB1.kaRight,(int)BB1.kaTop);
704  if (ShowRight)
705  DevLine((int)BB1.kaRight,(int)BB1.kaTop,
706  (int)BB1.kaRight,(int)BB1.kaBottom);
707  if (ShowBottom)
708  DevLine((int)BB1.kaRight,(int)BB1.kaBottom,
709  (int)BB1.kaLeft,(int)BB1.kaBottom);
710  if (ShowLeft)
711  DevLine((int)BB1.kaLeft,(int)BB1.kaBottom,
712  (int)BB1.kaLeft,(int)BB1.kaTop);
713  }
714  }
715 }
long aTF
Definition: sced.h:121
void DevSetColor()
#define COARSEVIEWPORTONLY
Definition: sced.h:51
long aBF
Definition: sced.h:121
long aTC
Definition: sced.h:122
#define FineLToP(X, Y, XT, YT)
Definition: sced.h:379
Definition: sced.h:111
char kpRedisplayControl
Definition: sced.h:312
long aLC
Definition: sced.h:122
struct a CurrentAOI
Definition: init.c:22
#define FINEVIEWPORTONLY
Definition: sced.h:50
long aLF
Definition: sced.h:121
struct kp Parameters
Definition: init.c:19
int aInFine
Definition: sced.h:123
void Color()
#define True
Definition: scedstub.c:16
void DevLine()
long aRC
Definition: sced.h:122
#define ka_copy(BB1, BB2)
Definition: objects.c:552
long aBC
Definition: sced.h:122
#define CoarseLToP(X, Y, XT, YT)
Definition: sced.h:373
#define And
Definition: cdmacs.h:14
#define False
Definition: scedstub.c:15
long aRF
Definition: sced.h:121
int aInCoarse
Definition: sced.h:124
void ShowPath ( int  Color,
struct p Path,
int  Terminate 
)

Definition at line 462 of file objects.c.

468 {
469  struct p *Pair;
470  long firstX,firstY,X,Y,lastX,lastY;
471 
472  Pair = Path;
473  firstX = lastX = Pair->pX;
474  firstY = lastY = Pair->pY;
475  Pair = Pair->pSucc;
476  while (Pair != NULL) {
477  X = Pair->pX;
478  Y = Pair->pY;
479  ShowLine(Color,lastX,lastY,X,Y);
480  lastX = X;
481  lastY = Y;
482  Pair = Pair->pSucc;
483  }
484  if (Terminate)
485  ShowLine(Color,firstX,firstY,lastX,lastY);
486 }
Definition: cddefs.h:215
long pY
Definition: cddefs.h:216
long X
Definition: actions.c:450
#define NULL
Definition: spdefs.h:121
void Color()
long pX
Definition: cddefs.h:216
void ShowLine()
struct p * pSucc
Definition: cddefs.h:217
long Y
Definition: actions.c:450
void ShowPolygon ( int  Color,
struct p Path 
)

Definition at line 490 of file objects.c.

495 {
496  struct p *Pair;
497  struct ka Fw, Cw;
498  static long PolygonBuffer[POLYGONBUFSIZE];
499  char oldRedisplay;
500  int i,n,nfine,ncoarse,n2;
501  long X,Y;
502 
503 
504  if (Color == HighlightingColor) {
505  ShowPath(Color,Path,True);
506  return;
507  }
508 
509  for (n = 0,Pair = Path; Pair != NULL; n++,Pair = Pair->pSucc) ;
510  n = Min(MAXPOLYGONVERTICES,n);
511  n2 = n << 1;
512  ncoarse = nfine = n;
513 
516 
517  for (i = 0,Pair = Path; i < n2; i += 2,Pair = Pair->pSucc) {
518  X = Pair->pX;
519  Y = Pair->pY;
520  TPoint(&X,&Y);
521  CoarseLToP(X,Y,PolygonBuffer[i],PolygonBuffer[i+1]);
522  }
523 
524  FBPolygonClip(PolygonBuffer,&ncoarse,(struct ka*)&CurrentAOI.aLC);
525  FBPolygon(Color,FILL,PolygonBuffer,ncoarse);
526  }
527 
530 
531  for (i = 0,Pair = Path; i < n2; i += 2,Pair = Pair->pSucc) {
532  X = Pair->pX;
533  Y = Pair->pY;
534  TPoint(&X,&Y);
535  FineLToP(X,Y,PolygonBuffer[i],PolygonBuffer[i+1]);
536  }
537 
538  FBPolygonClip(PolygonBuffer,&nfine,(struct ka*)&CurrentAOI.aLF);
539  FBPolygon(Color,FILL,PolygonBuffer,nfine);
540  }
541 
542 }
#define POLYGONBUFSIZE
Definition: sced.h:42
void TPoint()
#define COARSEVIEWPORTONLY
Definition: sced.h:51
#define FineLToP(X, Y, XT, YT)
Definition: sced.h:379
#define Min(Dragon, Eagle)
Definition: cdmacs.h:18
Definition: sced.h:111
char kpRedisplayControl
Definition: sced.h:312
long aLC
Definition: sced.h:122
struct a CurrentAOI
Definition: init.c:22
Definition: cddefs.h:215
#define FINEVIEWPORTONLY
Definition: sced.h:50
void ShowPath(int Color, struct p *Path, int Terminate)
Definition: objects.c:462
long aLF
Definition: sced.h:121
long X
Definition: actions.c:450
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
int aInFine
Definition: sced.h:123
void Color()
#define True
Definition: scedstub.c:16
void FBPolygonClip()
#define CoarseLToP(X, Y, XT, YT)
Definition: sced.h:373
#define And
Definition: cdmacs.h:14
#define FILL
Definition: scedmacs.h:13
void FBPolygon()
struct p * pSucc
Definition: cddefs.h:217
long Y
Definition: actions.c:450
#define HighlightingColor
Definition: sced.h:74
#define MAXPOLYGONVERTICES
Definition: sced.h:43
int aInCoarse
Definition: sced.h:124
void ShowStretch ( long  MapX,
long  MapY,
long  RefX,
long  RefY 
)

Definition at line 985 of file objects.c.

989 {
990  struct ks *SQDesc, *SQDesc1;
991  struct p *Path, *pp;
992  int Layer;
993  long Width;
994 
995  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
996  if (SQDesc->ksPointer->oInfo != SQ_OLDSEL &&
997  SQDesc->ksPointer->oInfo != SQ_NEWSEL) continue;
998  if (SQDesc->ksPointer->oType != CDWIRE) continue;
999 
1000  /* draw only once if in queue more than once */
1001  for (SQDesc1 = SQDesc->ksSucc; SQDesc1; SQDesc1 = SQDesc1->ksSucc)
1002  if (SQDesc1->ksPointer == SQDesc->ksPointer) break;
1003 
1004  if (SQDesc1 == NULL) {
1005  CDWire(SQDesc->ksPointer,&Layer,&Width,&Path);
1006  pp = get_nearest_vertex(Path,RefX,RefY);
1007  pp->pX += MapX - RefX;
1008  pp->pY += MapY - RefY;
1009  ShowWire(HighlightingColor,Width,Path);
1010  pp->pX -= MapX - RefX;
1011  pp->pY -= MapY - RefY;
1012  }
1013  }
1014 }
struct o * ksPointer
Definition: sced.h:335
Definition: objects.c:1183
char oType
Definition: cddefs.h:148
void CDWire()
Definition: cddefs.h:215
void ShowWire(int Color, long Width, struct p *Path)
Definition: objects.c:286
long pY
Definition: cddefs.h:216
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
struct ks * SelectQHead
Definition: scedext.h:64
long pX
Definition: cddefs.h:216
int Layer
Definition: cd.c:1908
#define CDWIRE
Definition: cddefs.h:47
Definition: sced.h:333
static struct p * get_nearest_vertex()
#define SQ_NEWSEL
Definition: sced.h:353
short oInfo
Definition: cddefs.h:147
#define SQ_OLDSEL
Definition: sced.h:344
#define HighlightingColor
Definition: sced.h:74
void ShowWire ( int  Color,
long  Width,
struct p Path 
)

Definition at line 286 of file objects.c.

292 {
293  ShowPath(Color,Path,0);
294 }
void ShowPath(int Color, struct p *Path, int Terminate)
Definition: objects.c:462
void Color()
void StretchPath ( int *  LookedAhead)

Definition at line 798 of file objects.c.

802 {
803  struct ka NBB,OBB;
804  long RefX,RefY,LastRefX,LastRefY,MapX,MapY;
805  long RefTmpX, RefTmpY;
806  int FirstTime = True;
807  int GotOne = False;
808  int Undo = False;
809  int Modified = 0;
810  int Pt;
811  char Types[2];
812 
814 
815  Types[0] = CDWIRE;
816  Types[1] = '\0';
817 
818  if (AreTypesInQ(Types))
819  GotOne = True;
820 
821  loop {
822 top:
823  if (Not GotOne) {
824  ShowPrompt("Point at wire to stretch");
825 
826  switch (PointLoop(LookedAhead)) {
827  case PL_ESC:
828  case PL_CMD:
829  goto quit;
830  case PL_UND:
831  if (FirstTime) goto quit;
832  if (Undo == False) {
837  HYundoTransform();
838  SQRestore(True);
839  /* restored objects have Info = SQ_NEWSEL */
840  Modified--;
841  Undo = True;
842  NBB = OBB;
843  EraseBox(&OBB);
844  Redisplay(&OBB);
848  break;
849  }
850  else {
853  /* should have only Info = SQ_NEW objects here */
854  do_stretch_path(RefX,RefY,MapX,MapY,&NBB,False);
855  Modified++;
856  EraseBox(&NBB);
857  Redisplay(&NBB);
860  Undo = False;
862  continue;
863  }
864  case PL_PCW:
865  SelectTypes(Types);
866  if (Not AreTypesInQ(Types))
867  goto top;
868  SQComputeBB();
869  NBB = SelectQBB;
870  }
871  }
872 
873 next:
874  ShowPrompt("Point to the vertex.");
875 
876  switch (PointLoop(LookedAhead)) {
877  case PL_ESC:
878  case PL_CMD:
879  goto quit;
880  case PL_UND:
882  if (Not GotOne)
883  SQDesel(Types);
884  /* newly selected objects deleted, restored objects
885  * have Info = SQ_NEW.
886  */
887  else {
888  if (FirstTime) {
890  goto quit;
891  }
892  if (Undo == False) {
896  HYundoTransform();
897  SQRestore(True);
898  /* restored objects have Info = SQ_NEWSEL */
899  Modified--;
900  Undo = True;
901  }
902  else {
905  /* should have only Info = SQ_NEWSEL objects here */
906  do_stretch_path(RefX,RefY,MapX,MapY,&NBB,True);
907  Modified++;
908  Undo = False;
909  }
910  }
911  EraseBox(&NBB);
912  Redisplay(&NBB);
913  if (GotOne && Parameters.kpShowTerminals)
916  goto top;
917  }
918 
919  LastRefX = RefX;
920  LastRefY = RefY;
921  RefX = SCursor.kcX;
922  RefY = SCursor.kcY;
923  set_ref_to_vertex(&RefX,&RefY);
924  ShowPrompt("Point to where it should stretch.");
925 
926  RefTmpX = SCursor.kcX;
927  RefTmpY = SCursor.kcY;
928  SCursor.kcX = RefX;
929  SCursor.kcY = RefY;
930  restore_stretch();
931  FBSetRubberBanding('s');
932  SCursor.kcX = RefTmpX;
933  SCursor.kcY = RefTmpY;
934  Pt = PointLoop(LookedAhead);
936 
937  switch (Pt) {
938  case PL_ESC:
939  case PL_CMD:
940  goto quit;
941  case PL_UND:
943  RefX = LastRefX;
944  RefY = LastRefY;
946  goto next;
947  }
948 
949  SQRestore(False);
950  /* should have only Info = SQ_OLDSEL objects here */
951  FirstTime = False;
952 
953  MapX = SCursor.kcX;
954  MapY = SCursor.kcY;
955 
957  do_stretch_path(RefX,RefY,MapX,MapY,&NBB,GotOne);
958  EraseBox(&NBB);
959  Redisplay(&NBB);
961  OBB = NBB;
962  Modified++;
963  Undo = False;
964  }
965 
966 quit:
969  SQRestore(False);
970  if (Not GotOne And AreTypesInQ(Types)) {
971  SQComputeBB();
972  SQDesel(Types);
975  }
976  if (Modified)
978  ErasePrompt();
981 }
#define PL_ESC
Definition: sced.h:62
void ErasePrompt()
Definition: viewport.c:538
char * MenuUNDO
Definition: objects.c:115
#define loop
Definition: cdmacs.h:11
void Redisplay()
int AreTypesInQ()
#define PL_UND
Definition: sced.h:63
int kpModified
Definition: sced.h:261
int PointLoop()
struct kc SCursor
Definition: init.c:21
void SQRestore()
#define ERASE
Definition: scedmacs.h:11
#define Not
Definition: cdmacs.h:16
#define PL_PCW
Definition: sced.h:65
void HYclearUndoFlags()
Definition: hypertxt.c:1071
Definition: sced.h:111
static void set_ref_to_vertex()
long kcY
Definition: sced.h:102
void Undo()
Definition: bascmd.c:43
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
int kpShowTerminals
Definition: sced.h:255
void HYundoTransform()
Definition: hypertxt.c:1049
void DisplayTerminals()
void SQDesel()
#define DISPLAY
Definition: scedmacs.h:12
char * MenuSTRCH
Definition: scedintr.c:105
void SelectTypes()
#define CDWIRE
Definition: cddefs.h:47
long kcX
Definition: sced.h:102
#define And
Definition: cdmacs.h:14
void FBSetRubberBanding()
static void restore_stretch()
Definition: objects.c:1017
#define False
Definition: scedstub.c:15
void ClearReferenceUndoFlags()
Definition: netlist.c:1893
#define PL_CMD
Definition: sced.h:64
static void do_stretch_path()
void UndoReferenceTransform()
Definition: netlist.c:1876
void EraseBox(struct ka *boxBB)
Definition: objects.c:719
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
struct ka SelectQBB
Definition: scedext.h:65
void SQComputeBB()
Definition: choose.c:749
void Wires ( int *  LookedAhead)

Definition at line 134 of file objects.c.

138 {
139  struct p *Path;
140  struct ka BB,OldBB;
141  struct o *Pointer = NULL,*OldPointer = NULL;
142  long Width;
143  long X,Y,FX,FY;
144  int NumVertices = 0;
145  int ExpectFirstPoint = True;
146  int Modified = 0;
147  int Undo = False;
148 
150  Path = NULL;
151 
152  Width = 0;
153 
154  ShowPrompt("Point to reference points.");
155  loop {
156  switch (PointLoop(LookedAhead)) {
157  case PL_UND:
159  if (NumVertices == 0) {
160  if (OldPointer == NULL) {
162  goto quit;
163  }
164  if (Undo == False) {
165  OldPointer->oInfo = SQ_GONE;
166  Modified--;
167  Undo = True;
168  }
169  else {
170  OldPointer->oInfo = SQ_NEW;
171  Modified++;
172  Undo = False;
173  }
174  EraseBox(&OldBB);
175  Redisplay(&OldBB);
177  continue;
178  }
179  if (NumVertices > 1)
180  zap_last_point(&Path);
181  CDDelete(Parameters.kpCellDesc,Pointer);
182  EraseBox(&BB);
183  Redisplay(&BB);
185  if (NumVertices == 1) {
186  ExpectFirstPoint = True;
187  }
188  else {
189  long tmpX, tmpY;
190 
191  allocate_wire(1,Path,Width,&BB,&Pointer,5);
192  ShowWire(DrawingColor,Width,Path);
193  last_path_point(&X,&Y,Path);
194  tmpX = SCursor.kcX;
195  tmpY = SCursor.kcY;
196  SCursor.kcX = X;
197  SCursor.kcY = Y;
198  FBSetRubberBanding('l');
199  SCursor.kcX = tmpX;
200  SCursor.kcY = tmpY;
201  }
202  NumVertices--;
204  continue;
205  case PL_ESC:
206  if (Not ExpectFirstPoint) {
207  CDDelete(Parameters.kpCellDesc,Pointer);
208  Pointer = NULL;
209  EraseBox(&BB);
210  Redisplay(&BB);
211  }
212  goto quit;
213  case PL_CMD:
214  if (Not ExpectFirstPoint) {
215  if (NumVertices == 1) {
216  CDDelete(Parameters.kpCellDesc,Pointer);
217  }
218  else {
219  Modified++;
220  record_wire(Pointer);
221  }
222  Pointer = NULL;
223  EraseBox(&BB);
224  Redisplay(&BB);
225  }
226  goto quit;
227  }
228  if (ExpectFirstPoint) {
229  NumVertices++;
230  ExpectFirstPoint = False;
231  FX = X = SCursor.kcX;
232  FY = Y = SCursor.kcY;
233  Path = allocate_path(X,Y);
234  allocate_wire(1,Path,Width,&BB,&Pointer,SQ_INCMPLT);
235  ShowWire(DrawingColor,Width,Path);
236  FBSetRubberBanding('l');
237  continue;
238  }
239  if (SCursor.kcX == X And SCursor.kcY == Y) {
240  if (NumVertices == 1) {
241  /* click twice to exit */
242  CDDelete(Parameters.kpCellDesc,Pointer);
243  Pointer = NULL;
244  goto quit;
245  }
246  else {
247  Pointer->oInfo = SQ_NEW;
248  record_wire(OldPointer);
249  OldPointer = Pointer;
250  Pointer = NULL;
251  OldBB = BB;
252  Modified++;
254  }
255  NumVertices = 0;
256  ExpectFirstPoint = True;
257  EraseBox(&BB);
258  Redisplay(&BB);
259  Undo = False;
260  }
261  else {
262  X = SCursor.kcX;
263  Y = SCursor.kcY;
264  append_point(X,Y,&Path);
265  CDDelete(Parameters.kpCellDesc,Pointer);
266  allocate_wire(1,Path,Width,&BB,&Pointer,SQ_INCMPLT);
268  FBSetRubberBanding('l');
269  ShowWire(DrawingColor,Width,Path);
270  NumVertices++;
271  }
272  }
273 quit:
274  record_wire(OldPointer);
275  record_wire(Pointer);
276  if (Modified)
278  ErasePrompt();
281 }
#define PL_ESC
Definition: sced.h:62
void ErasePrompt()
Definition: viewport.c:538
char * MenuUNDO
Definition: objects.c:115
#define loop
Definition: cdmacs.h:11
void Redisplay()
int struct o * Pointer
Definition: cd.c:1311
#define SQ_GONE
Definition: sced.h:347
#define PL_UND
Definition: sced.h:63
int kpModified
Definition: sced.h:261
int PointLoop()
struct kc SCursor
Definition: init.c:21
#define Not
Definition: cdmacs.h:16
struct s * kpCellDesc
Definition: sced.h:207
#define CDDelete
Definition: cddefs.h:19
#define DrawingColor
Definition: sced.h:87
Definition: sced.h:111
long kcY
Definition: sced.h:102
Definition: cddefs.h:215
static void allocate_wire()
void Undo()
Definition: bascmd.c:43
void ShowWire(int Color, long Width, struct p *Path)
Definition: objects.c:286
#define SQ_INCMPLT
Definition: sced.h:356
long X
Definition: actions.c:450
#define SQ_NEW
Definition: sced.h:350
void MenuDeselect()
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
static void append_point()
#define True
Definition: scedstub.c:16
Definition: cddefs.h:142
char * MenuWIRES
Definition: scedintr.c:112
static struct p * allocate_path()
long kcX
Definition: sced.h:102
#define And
Definition: cdmacs.h:14
void FBSetRubberBanding()
static void record_wire()
#define False
Definition: scedstub.c:15
static void last_path_point()
#define PL_CMD
Definition: sced.h:64
static void zap_last_point()
void EraseBox(struct ka *boxBB)
Definition: objects.c:719
void MenuSelect()
long Y
Definition: actions.c:450
void ShowPrompt(char *str)
Definition: scedstub.c:71
short oInfo
Definition: cddefs.h:147
static void zap_last_point ( )
static
static void zap_last_point ( struct p **  Path)
static

Definition at line 351 of file objects.c.

355 {
356  struct p *OldPair;
357  struct p *NewPair;
358 
359  OldPair = *Path;
360  if (OldPair == NULL Or OldPair->pSucc == NULL)
361  return;
362  if ((NewPair = alloc(p)) == NULL)
363  MallocFailed();
364  *Path = NewPair;
365  NewPair->pX = OldPair->pX;
366  NewPair->pY = OldPair->pY;
367  NewPair->pSucc = NULL;
368  OldPair = OldPair->pSucc;
369  while (OldPair->pSucc != NULL) {
370  if ((NewPair->pSucc = alloc(p)) == NULL)
371  MallocFailed();
372  NewPair = NewPair->pSucc;
373  NewPair->pX = OldPair->pX;
374  NewPair->pY = OldPair->pY;
375  NewPair->pSucc = NULL;
376  OldPair = OldPair->pSucc;
377  }
378 }
#define Or
Definition: cdmacs.h:15
Definition: cddefs.h:215
#define alloc(type)
Definition: cdmacs.h:21
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
#define NULL
Definition: spdefs.h:121
long pX
Definition: cddefs.h:216
struct p * pSucc
Definition: cddefs.h:217

Variable Documentation

struct clist* CList
static

Definition at line 1195 of file objects.c.

struct p* DotList
static

Definition at line 1181 of file objects.c.

char DotP[]
static
Initial value:
= {0,60, 40,40, 60,0, 40,-40, 0,-60, -40,-40,
-60,0, -40,40, 0,60}

Definition at line 1178 of file objects.c.

char* MenuDELET

Definition at line 71 of file scedintr.c.

char* MenuDOTS

Definition at line 74 of file scedintr.c.

char* MenuSTRCH

Definition at line 105 of file scedintr.c.

char* MenuUNDO

Definition at line 115 of file objects.c.

char* MenuWIRES

Definition at line 112 of file scedintr.c.

struct pp* VertexList
static

Definition at line 1188 of file objects.c.