Jspice3
choose.c File Reference
#include "spice.h"
#include "sced.h"
#include <string.h>
Include dependency graph for choose.c:

Go to the source code of this file.

Macros

#define UpdateBB(BB2, BB1)
 

Functions

void MX ()
 
void MY ()
 
void Rotat0 ()
 
void Rotat90 ()
 
void Rotat180 ()
 
void Rotat270 ()
 
static struct ksselect_items ()
 
static void sl_free ()
 
static void sl_bb ()
 
static void get_BB ()
 
static int is_BB_visible ()
 
static void redisplay_edges ()
 
static struct kswhich_cell ()
 
static void sq_set_NEW ()
 
static void sq_delete_dups ()
 
static void sq_display_selected ()
 
static int overlap_path ()
 
static int overlap_line ()
 
static int cross_line ()
 
static int point_in_poly ()
 
void Sel (int *LookedAhead)
 
void Area (int *LookedAhead)
 
void Desel ()
 
void Selection (struct ka *AOI)
 
static struct ksselect_items (struct ka *AOI, int PointSelect)
 
static void sl_free (struct ks *SList)
 
static void sl_bb (struct ks *SList, struct ka *BB)
 
static void get_BB (struct o *Pointer, struct ka *BB)
 
static int is_BB_visible (struct o *Pointer)
 
static void redisplay_edges (struct ka *BB)
 
static struct kswhich_cell (struct ks *SList)
 
int AreTypesInQ (char *Types)
 
void SelectTypes (char *Types)
 
void SQInit ()
 
void SQClear ()
 
void SQInsert (struct o *Pointer)
 
void SQDelete (struct o *Pointer)
 
void SQComputeBB ()
 
void SQRestore (int Undo)
 
void SQDesel (char *Types)
 
void SQShow ()
 
static void sq_set_NEW (struct o *Pointer)
 
static void sq_display_selected (struct o *Pointer)
 
long * InPath (int Delta, struct p *Path, long X, long Y)
 
static int point_in_poly (int Delta, struct p *Path, long X, long Y)
 
static int overlap_path (struct p *Path, struct ka *BB)
 
static int overlap_line (struct ka *Line, struct ka *BB)
 
static int cross_line (struct ka *Line, struct ka *BB)
 

Variables

char * MenuMX
 
char * MenuMY
 
char * Menu0
 
char * Menu90
 
char * Menu180
 
char * Menu270
 
char * MenuAREA
 
char * MenuDESEL
 
char * MenuSELEC
 
char * MenuUNDO
 

Macro Definition Documentation

#define UpdateBB (   BB2,
  BB1 
)
Value:
if (BB1.kaLeft < BB2.kaLeft) BB2.kaLeft = BB1.kaLeft; \
if (BB1.kaBottom < BB2.kaBottom) BB2.kaBottom = BB1.kaBottom; \
if (BB1.kaRight > BB2.kaRight) BB2.kaRight = BB1.kaRight; \
if (BB1.kaTop > BB2.kaTop) BB2.kaTop = BB1.kaTop;
if(TDesc==NULL)
Definition: cd.c:1326

Definition at line 165 of file choose.c.

Function Documentation

void Area ( int *  LookedAhead)

Definition at line 209 of file choose.c.

212 {
213  struct ka AOI;
214  long OldRawX,OldRawY;
215  int FirstTime = True;
216 
218 top:
219  loop {
220  ShowPrompt("Point to endpoints of diagonal.");
221  switch (PointLoop(LookedAhead)) {
222  case PL_ESC:
223  case PL_CMD:
224  goto quit;
225  case PL_UND:
226  if (FirstTime == True) goto quit;
228  Selection(&AOI);
230  goto top;
231  case PL_PCW:
232  FBSetRubberBanding('R');
233  OldRawX = SCursor.kcRawX;
234  OldRawY = SCursor.kcRawY;
235  }
236  ShowPrompt("Point to second endpoint.");
237  switch (PointLoop(LookedAhead)) {
238  case PL_ESC:
239  case PL_CMD:
240  goto quit;
241  case PL_UND:
243  goto top;
244  case PL_PCW:
246  break;
247  }
248  AOI.kaLeft = Min(OldRawX,SCursor.kcRawX);
249  AOI.kaBottom = Min(OldRawY,SCursor.kcRawY);
250  AOI.kaRight = Max(OldRawX,SCursor.kcRawX);
251  AOI.kaTop = Max(OldRawY,SCursor.kcRawY);
252  Selection(&AOI);
253  FirstTime = False;
254  }
255 
256 quit:
259  ErasePrompt();
260 }
#define PL_ESC
Definition: sced.h:62
void ErasePrompt()
Definition: viewport.c:538
#define loop
Definition: cdmacs.h:11
void Selection(struct ka *AOI)
Definition: choose.c:281
long kcRawY
Definition: sced.h:103
char * MenuUNDO
Definition: scedintr.c:108
#define PL_UND
Definition: sced.h:63
long kcRawX
Definition: sced.h:103
int PointLoop()
struct kc SCursor
Definition: init.c:21
#define Max(Dragon, Eagle)
Definition: cdmacs.h:17
#define PL_PCW
Definition: sced.h:65
#define Min(Dragon, Eagle)
Definition: cdmacs.h:18
Definition: sced.h:111
void MenuDeselect()
#define True
Definition: scedstub.c:16
char * MenuAREA
Definition: scedintr.c:64
void FBSetRubberBanding()
#define False
Definition: scedstub.c:15
#define PL_CMD
Definition: sced.h:64
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
int AreTypesInQ ( char *  Types)

Definition at line 639 of file choose.c.

645 {
646  struct ks *SQDesc;
647 
648  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
649  if (Types == NULL || strchr(Types,SQDesc->ksPointer->oType))
650  if (SQDesc->ksPointer->oInfo == SQ_OLDSEL) return (True);
651  }
652  return (False);
653 }
struct o * ksPointer
Definition: sced.h:335
char oType
Definition: cddefs.h:148
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
#define True
Definition: scedstub.c:16
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
#define False
Definition: scedstub.c:15
short oInfo
Definition: cddefs.h:147
#define SQ_OLDSEL
Definition: sced.h:344
static int cross_line ( )
static
static int cross_line ( struct ka Line,
struct ka BB 
)
static

Definition at line 1220 of file choose.c.

1226 {
1227  struct ka LineBB,MBB;
1228  long X,Y;
1229 
1230  MBB = *BB;
1231  if (MBB.kaTop < MBB.kaBottom)
1232  SwapInts(MBB.kaTop,MBB.kaBottom);
1233  if (MBB.kaRight < MBB.kaLeft)
1234  SwapInts(MBB.kaRight,MBB.kaLeft);
1235  LineBB = *Line;
1236  if (LineBB.kaTop < LineBB.kaBottom)
1237  SwapInts(LineBB.kaTop,LineBB.kaBottom);
1238  if (LineBB.kaRight < LineBB.kaLeft)
1239  SwapInts(LineBB.kaRight,LineBB.kaLeft);
1240 
1241  /* return False if BB's don't overlap */
1242  if (LineBB.kaLeft > MBB.kaRight ||
1243  LineBB.kaRight < MBB.kaLeft ||
1244  LineBB.kaBottom > MBB.kaTop ||
1245  LineBB.kaTop < MBB.kaBottom)
1246  return (False);
1247 
1248  /* if Line is Manhattan, return True */
1249  if (Line->kaLeft == Line->kaRight || Line->kaBottom == Line->kaTop)
1250  return (True);
1251 
1252  if (BB->kaBottom == BB->kaTop) {
1253 
1254  X = (BB->kaBottom - Line->kaBottom)*
1255  ((double)(Line->kaRight - Line->kaLeft)/
1256  (Line->kaTop - Line->kaBottom)) +
1257  Line->kaLeft;
1258  if (X < BB->kaLeft || X > BB->kaRight) return (False);
1259  }
1260  else {
1261 
1262  Y = (BB->kaLeft - Line->kaLeft)*
1263  ((double)(Line->kaTop - Line->kaBottom)/
1264  (Line->kaRight - Line->kaLeft))
1265  + Line->kaBottom;
1266  if (Y < BB->kaBottom || Y > BB->kaTop) return (False);
1267  }
1268  return (True);
1269 }
long kaRight
Definition: sced.h:112
if(TDesc==NULL)
Definition: cd.c:1326
long kaBottom
Definition: sced.h:112
Definition: sced.h:111
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 False
Definition: scedstub.c:15
long Y
Definition: actions.c:450
#define SwapInts(Dragon, Eagle)
Definition: cdmacs.h:20
void Desel ( )

Definition at line 264 of file choose.c.

266 {
268  SQComputeBB();
269  if (SelectQHead != NULL) {
270  SQClear();
271  /* Take care of Instance markers */
272  OversizeBox(&SelectQBB,200);
275  }
277 }
void Redisplay()
void MenuDeselect()
void SQComputeBB()
Definition: choose.c:749
#define NULL
Definition: spdefs.h:121
void SQClear()
Definition: choose.c:690
void EraseBox()
struct ks * SelectQHead
Definition: scedext.h:64
void OversizeBox()
char * MenuDESEL
Definition: scedintr.c:72
void MenuSelect()
struct ka SelectQBB
Definition: scedext.h:65
static void get_BB ( )
static
static void get_BB ( struct o Pointer,
struct ka BB 
)
static

Definition at line 527 of file choose.c.

531 {
532  if (Pointer->oType == CDLABEL)
533  BBLabel(View->kvCoarseWindow,Pointer,BB);
534  else
536  &BB->kaBottom,&BB->kaRight,&BB->kaTop);
537 }
struct ka * kvCoarseWindow
Definition: sced.h:149
long kaRight
Definition: sced.h:112
char oType
Definition: cddefs.h:148
long kaBottom
Definition: sced.h:112
struct s * kpCellDesc
Definition: sced.h:207
int CDStatusInt
Definition: cd.c:75
void BBLabel()
struct kp Parameters
Definition: init.c:19
long kaTop
Definition: sced.h:112
struct kv * View
Definition: init.c:17
long kaLeft
Definition: sced.h:112
int CDBB()
#define CDLABEL
Definition: cddefs.h:46
long* InPath ( int  Delta,
struct p Path,
long  X,
long  Y 
)

Definition at line 1059 of file choose.c.

1067 {
1068  struct p *Pair;
1069  struct ka BB;
1070  double x1,x2,y1,y2,d0,d1,d2,d3,w;
1071  static long xy[2];
1072 
1073  if (Delta < 10) Delta = 10;
1074 
1075  if (Path == NULL) return (False);
1076  for (Pair = Path; Pair->pSucc != NULL; Pair = Pair->pSucc) {
1077 
1078  if (Pair->pX < Pair->pSucc->pX) {
1079  BB.kaLeft = Pair->pX;
1080  BB.kaRight = Pair->pSucc->pX;
1081  }
1082  else {
1083  BB.kaRight = Pair->pX;
1084  BB.kaLeft = Pair->pSucc->pX;
1085  }
1086  if (Pair->pY < Pair->pSucc->pY) {
1087  BB.kaBottom = Pair->pY;
1088  BB.kaTop = Pair->pSucc->pY;
1089  }
1090  else {
1091  BB.kaBottom = Pair->pSucc->pY;
1092  BB.kaTop = Pair->pY;
1093  }
1094  OversizeBox(&BB,Delta);
1095  if (!InBox(X,Y,&BB)) continue;
1096 
1097  x1 = Pair->pX - Pair->pSucc->pX;
1098  y1 = Pair->pY - Pair->pSucc->pY;
1099  d0 = x1*x1 + y1*y1;
1100 
1101  x1 = Pair->pX - X;
1102  y1 = Pair->pY - Y;
1103  d1 = x1*x1 + y1*y1;
1104  x2 = Pair->pSucc->pX - X;
1105  y2 = Pair->pSucc->pY - Y;
1106  d2 = x2*x2 + y2*y2;
1107 
1108  d3 = (d2 - d1)/(2*sqrt(d0));
1109  w = (d1+d2)/2 - d0/4 - d3*d3;
1110 
1111  if (w <= (long)Delta*Delta) {
1112  /* should be positive, fabs() just in case */
1113  d1 = sqrt(fabs(d1-w)/d0);
1114  xy[0] = Pair->pX + (Pair->pSucc->pX - Pair->pX)*d1;
1115  xy[1] = Pair->pY + (Pair->pSucc->pY - Pair->pY)*d1;
1116  return (xy);
1117  }
1118  }
1119  return (NULL);
1120 }
int InBox()
Definition: cddefs.h:169
Definition: sced.h:111
Definition: cddefs.h:215
long pY
Definition: cddefs.h:216
long X
Definition: actions.c:450
#define NULL
Definition: spdefs.h:121
long pX
Definition: cddefs.h:216
#define False
Definition: scedstub.c:15
void OversizeBox()
long Y
Definition: actions.c:450
struct p * pSucc
Definition: cddefs.h:217
static int is_BB_visible ( )
static
static int is_BB_visible ( struct o Pointer)
static

Definition at line 541 of file choose.c.

544 {
545  struct ka BB;
546 
547  /* will edges show in coarse window? */
549  &BB.kaLeft,&BB.kaBottom,&BB.kaRight,&BB.kaTop);
550  if (BB.kaLeft <= View->kvCoarseWindow->kaLeft &&
551  BB.kaRight >= View->kvCoarseWindow->kaRight &&
552  BB.kaBottom <= View->kvCoarseWindow->kaBottom &&
553  BB.kaTop >= View->kvCoarseWindow->kaTop)
554  return (False);
555  return (True);
556 }
struct ka * kvCoarseWindow
Definition: sced.h:149
long kaRight
Definition: sced.h:112
long kaBottom
Definition: sced.h:112
struct s * kpCellDesc
Definition: sced.h:207
int CDStatusInt
Definition: cd.c:75
Definition: sced.h:111
struct kp Parameters
Definition: init.c:19
long kaTop
Definition: sced.h:112
#define True
Definition: scedstub.c:16
struct kv * View
Definition: init.c:17
long kaLeft
Definition: sced.h:112
int CDBB()
#define False
Definition: scedstub.c:15
void MX ( )

Definition at line 52 of file choose.c.

54 {
55  if (Parameters.kpMX) {
58  }
59  else {
62  }
63 }
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
char * MenuMX
Definition: scedintr.c:90
int kpMX
Definition: sced.h:283
#define False
Definition: scedstub.c:15
void MenuSelect()
void MY ( )

Definition at line 67 of file choose.c.

69 {
70  if (Parameters.kpMY) {
73  }
74  else {
77  }
78 }
void MenuDeselect()
int kpMY
Definition: sced.h:284
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
char * MenuMY
Definition: scedintr.c:91
#define False
Definition: scedstub.c:15
void MenuSelect()
static int overlap_line ( )
static
static int overlap_line ( struct ka Line,
struct ka BB 
)
static

Definition at line 1190 of file choose.c.

1194 {
1195  struct ka LBB;
1196 
1197  LBB.kaLeft = BB->kaLeft;
1198  LBB.kaRight = BB->kaLeft;
1199  LBB.kaBottom = BB->kaBottom;
1200  LBB.kaTop = BB->kaTop;
1201  if (cross_line(Line,&LBB)) return (True);
1202 
1203  LBB.kaRight = BB->kaRight;
1204  LBB.kaBottom = BB->kaTop;
1205  if (cross_line(Line,&LBB)) return (True);
1206 
1207  LBB.kaLeft = BB->kaRight;
1208  LBB.kaBottom = BB->kaBottom;
1209  if (cross_line(Line,&LBB)) return (True);
1210 
1211  LBB.kaLeft = BB->kaLeft;
1212  LBB.kaTop = BB->kaBottom;
1213  if (cross_line(Line,&LBB)) return (True);
1214 
1215  return (False);
1216 }
long kaRight
Definition: sced.h:112
long kaBottom
Definition: sced.h:112
Definition: sced.h:111
long kaTop
Definition: sced.h:112
#define True
Definition: scedstub.c:16
long kaLeft
Definition: sced.h:112
#define False
Definition: scedstub.c:15
static int cross_line()
static int overlap_path ( )
static
static int overlap_path ( struct p Path,
struct ka BB 
)
static

Definition at line 1167 of file choose.c.

1172 {
1173  struct ka Line;
1174 
1175  Line.kaLeft = Path->pX;
1176  Line.kaBottom = Path->pY;
1177  Path = Path->pSucc;
1178  for (; Path != NULL; Path = Path->pSucc) {
1179  Line.kaRight = Path->pX;
1180  Line.kaTop = Path->pY;
1181  if (overlap_line(&Line,BB)) return (True);
1182  Line.kaLeft = Line.kaRight;
1183  Line.kaBottom = Line.kaTop;
1184  }
1185  return (False);
1186 }
Definition: sced.h:111
long pY
Definition: cddefs.h:216
#define NULL
Definition: spdefs.h:121
#define True
Definition: scedstub.c:16
static int overlap_line()
long kaLeft
Definition: sced.h:112
long pX
Definition: cddefs.h:216
#define False
Definition: scedstub.c:15
struct p * pSucc
Definition: cddefs.h:217
static int point_in_poly ( )
static
static int point_in_poly ( int  Delta,
struct p Path,
long  X,
long  Y 
)
static

Definition at line 1124 of file choose.c.

1134 {
1135  struct p *p;
1136  double Xp,Yp,R,Theta,ThetaLast,Sum,zz;
1137 
1138  Sum = 0;
1139 
1140  for (p = Path; p != NULL; p = p->pSucc) {
1141 
1142  Xp = p->pX - X;
1143  Yp = p->pY - Y;
1144  R = sqrt(Xp*Xp + Yp*Yp);
1145  if (R <= Delta) return (True);
1146  Theta = asin(Yp/R);
1147  if (Xp >= 0) {
1148  if (Yp < 0)
1149  Theta = 2*M_PI + Theta;
1150  }
1151  else
1152  Theta = M_PI - Theta;
1153  if (p != Path) {
1154  zz = (Theta - ThetaLast);
1155  if (zz > M_PI) zz -= 2*M_PI;
1156  if (zz < -M_PI) zz += 2*M_PI;
1157  Sum += zz;
1158  }
1159  ThetaLast = Theta;
1160  }
1161  if (fabs(Sum) >= 1.99*M_PI) return (True);
1162  return (False);
1163 }
#define M_PI
Definition: spice.h:132
FILE * p
Definition: proc2mod.c:48
Definition: cddefs.h:215
long pY
Definition: cddefs.h:216
long X
Definition: actions.c:450
#define R
Definition: parse.c:444
#define NULL
Definition: spdefs.h:121
#define True
Definition: scedstub.c:16
long pX
Definition: cddefs.h:216
#define False
Definition: scedstub.c:15
long Y
Definition: actions.c:450
struct p * pSucc
Definition: cddefs.h:217
static void redisplay_edges ( )
static
static void redisplay_edges ( struct ka BB)
static

Definition at line 560 of file choose.c.

564 {
565  struct ka EdgeOfBB;
566 
567  /* Left edge. */
568  EdgeOfBB.kaLeft = BB->kaLeft-300;
569  EdgeOfBB.kaRight = BB->kaLeft+300;
570  EdgeOfBB.kaTop = BB->kaTop+300;
571  EdgeOfBB.kaBottom = BB->kaBottom-300;
572  EraseBox(&EdgeOfBB);
573  Redisplay(&EdgeOfBB);
574 
575  /* Right edge. */
576  EdgeOfBB.kaRight = BB->kaRight+300;
577  EdgeOfBB.kaLeft = BB->kaRight-300;
578  EdgeOfBB.kaTop = BB->kaTop+300;
579  EdgeOfBB.kaBottom = BB->kaBottom-300;
580  EraseBox(&EdgeOfBB);
581  Redisplay(&EdgeOfBB);
582 
583  /* Bottom edge. */
584  EdgeOfBB.kaBottom = BB->kaBottom-300;
585  EdgeOfBB.kaTop = BB->kaBottom+300;
586  EdgeOfBB.kaRight = BB->kaRight;
587  EdgeOfBB.kaLeft = BB->kaLeft;
588  EraseBox(&EdgeOfBB);
589  Redisplay(&EdgeOfBB);
590 
591  /* Top edge. */
592  EdgeOfBB.kaBottom = BB->kaTop-300;
593  EdgeOfBB.kaTop = BB->kaTop+300;
594  EdgeOfBB.kaRight = BB->kaRight;
595  EdgeOfBB.kaLeft = BB->kaLeft;
596  EraseBox(&EdgeOfBB);
597  Redisplay(&EdgeOfBB);
598 
599  DevUpdate();
600 }
void Redisplay()
long kaRight
Definition: sced.h:112
long kaBottom
Definition: sced.h:112
Definition: sced.h:111
long kaTop
Definition: sced.h:112
void EraseBox()
long kaLeft
Definition: sced.h:112
void DevUpdate()
Definition: display.c:359
void Rotat0 ( )

Definition at line 82 of file choose.c.

84 {
88 }
char * Menu90
Definition: scedintr.c:54
struct kp Parameters
Definition: init.c:19
int kpRotationAngle
Definition: sced.h:282
void AlterMenuEntries()
void MenuSelect()
char * Menu0
Definition: scedintr.c:53
void Rotat180 ( )

Definition at line 102 of file choose.c.

104 {
108 }
char * Menu180
Definition: scedintr.c:55
struct kp Parameters
Definition: init.c:19
int kpRotationAngle
Definition: sced.h:282
char * Menu270
Definition: scedintr.c:56
void AlterMenuEntries()
void MenuSelect()
void Rotat270 ( )

Definition at line 112 of file choose.c.

114 {
118 }
void MenuDeselect()
struct kp Parameters
Definition: init.c:19
int kpRotationAngle
Definition: sced.h:282
char * Menu270
Definition: scedintr.c:56
void AlterMenuEntries()
char * Menu0
Definition: scedintr.c:53
void Rotat90 ( )

Definition at line 92 of file choose.c.

94 {
98 }
char * Menu90
Definition: scedintr.c:54
char * Menu180
Definition: scedintr.c:55
struct kp Parameters
Definition: init.c:19
int kpRotationAngle
Definition: sced.h:282
void AlterMenuEntries()
void MenuSelect()
void Sel ( int *  LookedAhead)

Definition at line 174 of file choose.c.

177 {
178  struct ka AOI;
179  int FirstTime = True;
180 
182  ShowPrompt("Point to select.");
183  loop {
184  switch (PointLoop(LookedAhead)) {
185  case PL_CMD:
186  case PL_ESC:
187  goto quit;
188  case PL_UND:
189  if (FirstTime == True) goto quit;
191  Selection(&AOI);
193  continue;
194  case PL_PCW:
195  AOI.kaLeft = AOI.kaRight = SCursor.kcRawX;
196  AOI.kaBottom = AOI.kaTop = SCursor.kcRawY;
197  ErasePrompt();
198  Selection(&AOI);
199  FirstTime = False;
200  }
201  }
202 quit:
204  ErasePrompt();
205 }
#define PL_ESC
Definition: sced.h:62
void ErasePrompt()
Definition: viewport.c:538
#define loop
Definition: cdmacs.h:11
void Selection(struct ka *AOI)
Definition: choose.c:281
long kcRawY
Definition: sced.h:103
char * MenuUNDO
Definition: scedintr.c:108
#define PL_UND
Definition: sced.h:63
long kcRawX
Definition: sced.h:103
int PointLoop()
struct kc SCursor
Definition: init.c:21
#define PL_PCW
Definition: sced.h:65
Definition: sced.h:111
void MenuDeselect()
#define True
Definition: scedstub.c:16
char * MenuSELEC
Definition: scedintr.c:103
#define False
Definition: scedstub.c:15
#define PL_CMD
Definition: sced.h:64
void MenuSelect()
void ShowPrompt(char *str)
Definition: scedstub.c:71
static struct ks* select_items ( )
static
static struct ks* select_items ( struct ka AOI,
int  PointSelect 
)
static

Definition at line 374 of file choose.c.

383 {
384  struct g *GenDesc;
385  struct o *Pointer;
386  struct ka BB;
387  struct ks *SPointer = NULL, *S;
388  struct p *Path;
389  long Width;
390  int Delta,Layer;
391 
392  if (PointSelect) {
393  /* expand the point to finite size */
394  if (SCursor.kcInFine == True)
395  Delta = 3.0/View->kvFineRatio;
396  else
397  Delta = 3.0/View->kvCoarseRatio;
398  OversizeBox(AOI,Delta);
399  }
400 
402  AOI->kaRight,AOI->kaTop,&GenDesc)) MallocFailed();
403  loop {
404  CDGen(Parameters.kpCellDesc,GenDesc,&Pointer);
405  if (Pointer == NULL) break;
406  if (Pointer->oInfo == SQ_GONE) continue;
408  !strchr(Parameters.kpSelectTypes,Pointer->oType)) continue;
409 
410  switch (Pointer->oType) {
411  case CDWIRE:
412  CDWire(Pointer,&Layer,&Width,&Path);
413  if (PointSelect) {
414  if (InPath(Delta+(int)Width/2,Path,
415  AOI->kaLeft+Delta,AOI->kaBottom+Delta) != NULL)
416  break;
417  }
418  else {
419  if (overlap_path(Path,AOI)) break;
420  if (InBox(Path->pX,Path->pY,AOI)) break;
421  }
422  continue;
423 
424  case CDPOLYGON:
425  CDPolygon(Pointer,&Layer,&Path);
426  if (PointSelect) {
427  if (point_in_poly(Delta,Path,
428  AOI->kaLeft+Delta,AOI->kaBottom+Delta))
429  break;
430  }
431  else {
432  if (point_in_poly(0,Path,AOI->kaLeft,AOI->kaBottom))
433  break;
434  if (overlap_path(Path,AOI)) break;
435  if (InBox(Path->pX,Path->pY,AOI)) break;
436  }
437  continue;
438 
439  case CDLABEL:
440  case CDBOX:
441  break;
442 
443  default:
444  continue;
445  }
446  if (SPointer == NULL)
447  S = SPointer = alloc(ks);
448  else {
449  S->ksSucc = alloc(ks);
450  S = S->ksSucc;
451  }
452  if (S == NULL) MallocFailed();
453  S->ksPointer = Pointer;
454  S->ksSucc = NULL;
455  }
456 
457 
458  /* Now for the instances... */
459 
462  if (PointSelect) OversizeBox(AOI,-Delta);
463  return (SPointer);
464  }
465 
467  AOI->kaRight,AOI->kaTop,&GenDesc)) MallocFailed();
468  loop {
469  CDGen(Parameters.kpCellDesc,GenDesc,&Pointer);
470  if (Pointer == NULL) break;
471 
472  if (Pointer->oInfo == SQ_GONE) continue;
473  if (SPointer == NULL)
474  S = SPointer = alloc(ks);
475  else {
476  S->ksSucc = alloc(ks);
477  S = S->ksSucc;
478  }
479  if (S == NULL) MallocFailed();
480  S->ksPointer = Pointer;
481  S->ksSucc = NULL;
482  }
483  if (PointSelect) OversizeBox(AOI,-Delta);
484  return (SPointer);
485 }
#define loop
Definition: cdmacs.h:11
int struct o * Pointer
Definition: cd.c:1311
#define SQ_GONE
Definition: sced.h:347
long kaRight
Definition: sced.h:112
double kvFineRatio
Definition: sced.h:154
struct kc SCursor
Definition: init.c:21
char oType
Definition: cddefs.h:148
long kaBottom
Definition: sced.h:112
double kvCoarseRatio
Definition: sced.h:155
struct s * kpCellDesc
Definition: sced.h:207
#define Not
Definition: cdmacs.h:16
void CDPolygon()
void CDGen()
int InBox()
Definition: sced.h:111
void CDWire()
Definition: cddefs.h:215
#define alloc(type)
Definition: cdmacs.h:21
long * InPath(int Delta, struct p *Path, long X, long Y)
Definition: choose.c:1059
long pY
Definition: cddefs.h:216
void MallocFailed()
Definition: scedintr.c:857
#define CDSYMBOLCALL
Definition: cddefs.h:43
int CDInitGen()
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
long kaTop
Definition: sced.h:112
static int overlap_path()
#define True
Definition: scedstub.c:16
struct kv * View
Definition: init.c:17
long kaLeft
Definition: sced.h:112
Definition: cddefs.h:142
long pX
Definition: cddefs.h:216
int Layer
Definition: cd.c:1908
#define CDWIRE
Definition: cddefs.h:47
static int point_in_poly()
Definition: sced.h:333
Definition: cddefs.h:227
void OversizeBox()
int kcInFine
Definition: sced.h:105
#define CDPOLYGON
Definition: cddefs.h:44
short oInfo
Definition: cddefs.h:147
char kpSelectTypes[8]
Definition: sced.h:273
#define CDLABEL
Definition: cddefs.h:46
#define CDBOX
Definition: cddefs.h:48
void Selection ( struct ka AOI)

Definition at line 281 of file choose.c.

285 {
286  struct ks *SList, *S;
287  struct ka BB,OldSelectQBB;
288 
289  if (AOI->kaLeft == AOI->kaRight) {
290  /* Point selection. */
291 
292  SList = select_items(AOI,True);
293  if (SList == NULL) return;
294  if (SList->ksPointer->oType == CDSYMBOLCALL) {
295  /* no geometry found, get one symbol */
296  S = which_cell(SList);
297  if (S) {
298  if (S->ksPointer->oInfo == SQ_OLDSEL) {
299  /* already selected, deselect and break */
300  S->ksPointer->oInfo = SQ_OLD;
301  SQDelete(S->ksPointer);
302  get_BB(S->ksPointer,&BB);
303  redisplay_edges(&BB);
304  }
305  else {
306  /* add to select Q */
307  S->ksPointer->oInfo = SQ_OLDSEL;
308  SQInsert(S->ksPointer);
310  }
311  }
312  SQComputeBB();
313  sl_free(SList);
314  return;
315  }
316  for (S = SList; S != NULL; S = S->ksSucc) {
317  /* keep only geometry */
318  if (S->ksPointer->oType == CDSYMBOLCALL) break;
319 
320  if (S->ksPointer->oInfo == SQ_OLDSEL) {
321  /* already selected, deselect and break */
322  S->ksPointer->oInfo = SQ_OLD;
323  SQDelete(S->ksPointer);
324  get_BB(S->ksPointer,&BB);
325  EraseBox(&BB);
326  Redisplay(&BB);
327  DevUpdate();
328  break;
329  }
330  else {
331  /* add to select Q */
332  S->ksPointer->oInfo = SQ_OLDSEL;
333  SQInsert(S->ksPointer);
335  }
336  }
337  SQComputeBB();
338  }
339  else {
340 
341  /* Area select. */
342  SList = select_items(AOI,False);
343  if (SList == NULL) return;
344  SQComputeBB();
345  OldSelectQBB = SelectQBB;
346 
347  for (S = SList; S != NULL; S = S->ksSucc) {
348  if (S->ksPointer->oType == CDSYMBOLCALL &&
349  !is_BB_visible(S->ksPointer)) continue;
350 
351  if (S->ksPointer->oInfo == SQ_OLDSEL) {
352  /* already selected, deselect */
353  S->ksPointer->oInfo = SQ_OLD;
354  SQDelete(S->ksPointer);
355  }
356  else {
357  /* add to select Q */
358  S->ksPointer->oInfo = SQ_OLDSEL;
359  SQInsert(S->ksPointer);
360  }
361  }
362  SQComputeBB();
363  UpdateBB(SelectQBB,OldSelectQBB);
364  if (SelectQBB.kaLeft == CDINFINITY) return;
367  DevUpdate();
368  }
369  sl_free(SList);
370 }
void SQInsert(struct o *Pointer)
Definition: choose.c:706
void Redisplay()
static struct ks * select_items()
static void redisplay_edges()
#define SQ_OLD
Definition: sced.h:341
long kaRight
Definition: sced.h:112
#define CDINFINITY
Definition: cddefs.h:70
struct o * ksPointer
Definition: sced.h:335
char oType
Definition: cddefs.h:148
Definition: sced.h:111
static struct ks * which_cell()
#define CDSYMBOLCALL
Definition: cddefs.h:43
static void get_BB()
void SQComputeBB()
Definition: choose.c:749
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
#define True
Definition: scedstub.c:16
#define UpdateBB(BB2, BB1)
Definition: choose.c:165
static void sq_display_selected()
void EraseBox()
long kaLeft
Definition: sced.h:112
static int is_BB_visible()
void DevUpdate()
Definition: display.c:359
static void sl_free()
Definition: sced.h:333
#define False
Definition: scedstub.c:15
void SQDelete(struct o *Pointer)
Definition: choose.c:723
short oInfo
Definition: cddefs.h:147
struct ka SelectQBB
Definition: scedext.h:65
#define SQ_OLDSEL
Definition: sced.h:344
void SelectTypes ( char *  Types)

Definition at line 657 of file choose.c.

663 {
664  struct ka BB;
665  char TTmp[8];
666 
667  BB.kaLeft = BB.kaRight = SCursor.kcRawX;
668  BB.kaBottom = BB.kaTop = SCursor.kcRawY;
669  if (Types == NULL) {
670  Selection(&BB);
671  return;
672  }
674  strncpy(Parameters.kpSelectTypes,Types,8);
675  Parameters.kpSelectTypes[7] = '\0';
676  Selection(&BB);
678 }
void Selection(struct ka *AOI)
Definition: choose.c:281
long kcRawY
Definition: sced.h:103
long kcRawX
Definition: sced.h:103
char * strcpy()
struct kc SCursor
Definition: init.c:21
Definition: sced.h:111
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
long kaLeft
Definition: sced.h:112
char kpSelectTypes[8]
Definition: sced.h:273
static void sl_bb ( )
static
static void sl_bb ( struct ks SList,
struct ka BB 
)
static

Definition at line 504 of file choose.c.

509 {
510  struct ks *S;
511  struct ka NBB,OBB;
512 
513  NBB.kaLeft = CDINFINITY;
514  NBB.kaBottom = CDINFINITY;
515  NBB.kaRight = -CDINFINITY;
516  NBB.kaTop = -CDINFINITY;
517 
518  for (S = SList; S != NULL; S = S->ksSucc) {
519  get_BB(S->ksPointer,&OBB);
520  UpdateBB(NBB,OBB);
521  }
522  *BB = NBB;
523 }
#define CDINFINITY
Definition: cddefs.h:70
struct o * ksPointer
Definition: sced.h:335
Definition: sced.h:111
static void get_BB()
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
#define UpdateBB(BB2, BB1)
Definition: choose.c:165
long kaLeft
Definition: sced.h:112
Definition: sced.h:333
static void sl_free ( )
static
static void sl_free ( struct ks SList)
static

Definition at line 489 of file choose.c.

493 {
494  struct ks *SQDesc,*SQNext;
495 
496  for (SQDesc = SList; SQDesc; SQDesc = SQNext) {
497  SQNext = SQDesc->ksSucc;
498  tfree(SQDesc);
499  }
500 }
#define tfree(x)
Definition: cdmacs.h:22
struct ks * ksSucc
Definition: sced.h:334
Definition: sced.h:333
static void sq_delete_dups ( )
static

Definition at line 983 of file choose.c.

986 {
987  struct ks *SQDesc,*SQDesc1,*SQNext;
988  int Info;
989 
990  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQNext) {
991  SQNext = SQDesc->ksSucc;
992  Info = SQDesc->ksPointer->oInfo;
993  for (SQDesc1 = SQDesc->ksSucc; SQDesc1; SQDesc1 = SQDesc1->ksSucc)
994  if (SQDesc->ksPointer == SQDesc1->ksPointer) {
995  SQDelete(SQDesc->ksPointer);
996  /* SQDelete sets Info to SQ_OLD, have to undo this */
997  SQDesc1->ksPointer->oInfo = Info;
998  break;
999  }
1000  }
1001 }
struct o * ksPointer
Definition: sced.h:335
struct ks * ksSucc
Definition: sced.h:334
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
void SQDelete(struct o *Pointer)
Definition: choose.c:723
short oInfo
Definition: cddefs.h:147
static void sq_display_selected ( )
static
static void sq_display_selected ( struct o Pointer)
static

Definition at line 1005 of file choose.c.

1008 {
1009  int Layer;
1010  struct p *Path;
1011  long Width;
1012  char OldRD;
1013  struct ka BB;
1014 
1015  if (Pointer->oType == CDWIRE) {
1016  CDWire(Pointer,&Layer,&Width,&Path);
1017  ShowWire(HighlightingColor,Width,Path);
1018  return;
1019  }
1020  if (Pointer->oType == CDSYMBOLCALL) {
1022  &BB.kaLeft,&BB.kaBottom,&BB.kaRight,&BB.kaTop);
1024  return;
1025  }
1026  if (Pointer->oType == CDLABEL) {
1027 
1028  /* BB of labels must be special-cased. Can't use CDBB. */
1029 
1031  if (OldRD != FINEVIEWPORTONLY) {
1033  BBLabel(View->kvCoarseWindow,Pointer,&BB);
1035  }
1036  if (OldRD != COARSEVIEWPORTONLY) {
1038  BBLabel(View->kvFineWindow,Pointer,&BB);
1040  }
1042  return;
1043  }
1044  if (Pointer->oType == CDPOLYGON) {
1045  CDPolygon(Pointer,&Layer,&Path);
1047  return;
1048  }
1049  if (Pointer->oType == CDBOX) {
1051  &BB.kaLeft,&BB.kaBottom,&BB.kaRight,&BB.kaTop);
1053  return;
1054  }
1055 }
struct ka * kvCoarseWindow
Definition: sced.h:149
char oType
Definition: cddefs.h:148
#define COARSEVIEWPORTONLY
Definition: sced.h:51
struct s * kpCellDesc
Definition: sced.h:207
int CDStatusInt
Definition: cd.c:75
void BBLabel()
void CDPolygon()
Definition: sced.h:111
char kpRedisplayControl
Definition: sced.h:312
void CDWire()
Definition: cddefs.h:215
#define FINEVIEWPORTONLY
Definition: sced.h:50
void ShowWire()
#define CDSYMBOLCALL
Definition: cddefs.h:43
struct kp Parameters
Definition: init.c:19
void ShowEmptyBox()
void ShowPath()
struct ka * kvFineWindow
Definition: sced.h:147
#define True
Definition: scedstub.c:16
struct kv * View
Definition: init.c:17
int Layer
Definition: cd.c:1908
#define CDWIRE
Definition: cddefs.h:47
int CDBB()
#define CDPOLYGON
Definition: cddefs.h:44
#define HighlightingColor
Definition: sced.h:74
#define CDLABEL
Definition: cddefs.h:46
#define CDBOX
Definition: cddefs.h:48
static void sq_set_NEW ( )
static
static void sq_set_NEW ( struct o Pointer)
static

Definition at line 965 of file choose.c.

969 {
970  struct ks *SQDesc;
971  int Info;
972 
973  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
974  if (SQDesc->ksPointer == Pointer) {
975  SQDesc->ksPointer->oInfo = SQ_NEW;
976  return;
977  }
978  }
979 }
struct o * ksPointer
Definition: sced.h:335
#define SQ_NEW
Definition: sced.h:350
struct ks * ksSucc
Definition: sced.h:334
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
short oInfo
Definition: cddefs.h:147
void SQClear ( )

Definition at line 690 of file choose.c.

693 {
694  struct ks *SQDesc,*SQNext;
695 
696  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQNext) {
697  SQNext = SQDesc->ksSucc;
698  SQDesc->ksPointer->oInfo = SQ_OLD;
699  tfree(SQDesc);
700  }
701  SelectQHead = NULL;
702 }
#define SQ_OLD
Definition: sced.h:341
struct o * ksPointer
Definition: sced.h:335
#define tfree(x)
Definition: cdmacs.h:22
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
short oInfo
Definition: cddefs.h:147
void SQComputeBB ( )

Definition at line 749 of file choose.c.

752 {
753  struct ks *SQDesc;
754  struct ka BB;
755  int Info;
756 
761 
762  for (SQDesc = SelectQHead; SQDesc != NULL; SQDesc = SQDesc->ksSucc) {
763  Info = SQDesc->ksPointer->oInfo;
764  if (Info == SQ_OLDSEL || Info == SQ_NEWSEL ||
765  (Info > 10 && Info <= 255)) {
766  get_BB(SQDesc->ksPointer,&BB);
767  UpdateBB(SelectQBB,BB);
768  }
769  }
770 }
long kaRight
Definition: sced.h:112
#define CDINFINITY
Definition: cddefs.h:70
struct o * ksPointer
Definition: sced.h:335
long kaBottom
Definition: sced.h:112
Definition: sced.h:111
static void get_BB()
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
long kaTop
Definition: sced.h:112
#define UpdateBB(BB2, BB1)
Definition: choose.c:165
long kaLeft
Definition: sced.h:112
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
#define SQ_NEWSEL
Definition: sced.h:353
short oInfo
Definition: cddefs.h:147
struct ka SelectQBB
Definition: scedext.h:65
#define SQ_OLDSEL
Definition: sced.h:344
void SQDelete ( struct o Pointer)

Definition at line 723 of file choose.c.

727 {
728  struct ks *SQDesc,*SQPrev,*SQNext;
729 
730  SQPrev = NULL;
731 
732  for (SQDesc = SelectQHead; SQDesc; SQPrev = SQDesc,SQDesc = SQNext) {
733  SQNext = SQDesc->ksSucc;
734 
735  if (SQDesc->ksPointer != Pointer) continue;
736  Pointer->oInfo = SQ_OLD;
737 
738  if (SQPrev == NULL)
739  SelectQHead = SQNext;
740  else
741  SQPrev->ksSucc = SQNext;
742  tfree(SQDesc);
743  return;
744  }
745 }
#define SQ_OLD
Definition: sced.h:341
#define tfree(x)
Definition: cdmacs.h:22
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
short oInfo
Definition: cddefs.h:147
void SQDesel ( char *  Types)

Definition at line 900 of file choose.c.

910 {
911  struct ks *SQDesc, *SQNext;
912  struct o *Pointer;
913  int Info;
914  char Type;
915 
916  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQNext) {
917  SQNext = SQDesc->ksSucc;
918  Type = SQDesc->ksPointer->oType;
919  if (Types And !strchr(Types,Type)) continue;
920  Info = SQDesc->ksPointer->oInfo;
921 
922  /* Have to be careful here. If selected object is already
923  * in queue have to reset Info of second entry to SQ_NEW.
924  */
925 
926  if (Info == SQ_OLDSEL) {
927  Pointer = SQDesc->ksPointer;
928  Pointer->oInfo = SQ_OLD;
929  SQDelete(Pointer);
930  sq_set_NEW(Pointer);
931  continue;
932  }
933  if (Info == SQ_NEWSEL)
934  SQDesc->ksPointer->oInfo = SQ_NEW;
935  }
936 }
int struct o * Pointer
Definition: cd.c:1311
#define SQ_OLD
Definition: sced.h:341
struct o * ksPointer
Definition: sced.h:335
char oType
Definition: cddefs.h:148
#define SQ_NEW
Definition: sced.h:350
static void sq_set_NEW()
struct ks * ksSucc
Definition: sced.h:334
Definition: cddefs.h:142
struct ks * SelectQHead
Definition: scedext.h:64
#define And
Definition: cdmacs.h:14
Definition: sced.h:333
#define SQ_NEWSEL
Definition: sced.h:353
int char Type
Definition: actions.c:449
void SQDelete(struct o *Pointer)
Definition: choose.c:723
short oInfo
Definition: cddefs.h:147
#define SQ_OLDSEL
Definition: sced.h:344
void SQInit ( )

Definition at line 682 of file choose.c.

684 {
685  SelectQHead = NULL;
686 }
#define NULL
Definition: spdefs.h:121
struct ks * SelectQHead
Definition: scedext.h:64
void SQInsert ( struct o Pointer)

Definition at line 706 of file choose.c.

710 {
711  struct ks *SQDesc;
712 
713  if ((SQDesc = alloc(ks)) == NULL) MallocFailed();
714 
715  /* SelectQHead is most recent addition */
716  SQDesc->ksPointer = Pointer;
717  SQDesc->ksSucc = SelectQHead;
718  SelectQHead = SQDesc;
719 }
int struct o * Pointer
Definition: cd.c:1311
struct o * ksPointer
Definition: sced.h:335
#define alloc(type)
Definition: cdmacs.h:21
void MallocFailed()
Definition: scedintr.c:857
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
struct ks * SelectQHead
Definition: scedext.h:64
Definition: sced.h:333
void SQRestore ( int  Undo)

Definition at line 802 of file choose.c.

824 {
825  struct ks *SQDesc,*SQNext;
826  struct prpty *PDesc;
827  int Info;
828  struct o *Pointer;
829 
830  /* Properties added have the Info field set to "new", so we can
831  * remove them during Undo.
832  */
834  if (Undo == True) {
835  while (PDesc) {
836  if (PDesc->prpty_Info &&
837  !strcmp(PDesc->prpty_Info,"new")) {
839  PDesc->prpty_Succ;
840  free(PDesc->prpty_Data);
841  free(PDesc);
843  continue;
844  }
845  break;
846  }
847  }
848  else {
849  while (PDesc) {
850  if (PDesc->prpty_Info &&
851  !strcmp(PDesc->prpty_Info,"new")) {
852  PDesc->prpty_Info = NULL;
853  PDesc = PDesc->prpty_Succ;
854  continue;
855  }
856  break;
857  }
858  }
859 
860  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQNext) {
861  SQNext = SQDesc->ksSucc;
862  Pointer = SQDesc->ksPointer;
863  Info = Pointer->oInfo;
864 
865  if (Info == SQ_GONE) {
866  if (Undo == True)
867  Pointer->oInfo = SQ_NEWSEL;
868  else {
869  SQDelete(Pointer);
870  CDDelete(Parameters.kpCellDesc,Pointer);
871  }
872  continue;
873  }
874  if (Info == SQ_NEW) {
875  SQDelete(Pointer);
876  if (Undo == True) {
877  Pointer->oInfo = SQ_GONE;
878  CDDelete(Parameters.kpCellDesc,Pointer);
879  }
880  else
881  Pointer->oInfo = SQ_OLD;
882  continue;
883  }
884  if (Info == SQ_NEWSEL) {
885  if (Undo == True) {
886  SQDelete(Pointer);
887  Pointer->oInfo = SQ_GONE;
888  CDDelete(Parameters.kpCellDesc,Pointer);
889  }
890  else
891  Pointer->oInfo = SQ_OLDSEL;
892  }
893  }
894  if (Undo == False)
895  sq_delete_dups();
896 }
struct prpty * sPrptyList
Definition: cddefs.h:133
int struct o * Pointer
Definition: cd.c:1311
char * prpty_Info
Definition: cdprpty.h:64
#define SQ_GONE
Definition: sced.h:347
#define SQ_OLD
Definition: sced.h:341
struct o * ksPointer
Definition: sced.h:335
struct s * kpCellDesc
Definition: sced.h:207
#define CDDelete
Definition: cddefs.h:19
union prp_data * prpty_Data
Definition: cdprpty.h:65
void Undo()
Definition: bascmd.c:43
#define SQ_NEW
Definition: sced.h:350
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
struct kp Parameters
Definition: init.c:19
#define True
Definition: scedstub.c:16
Definition: cddefs.h:142
static void sq_delete_dups()
Definition: choose.c:983
struct ks * SelectQHead
Definition: scedext.h:64
struct prpty * prpty_Succ
Definition: cdprpty.h:66
Definition: sced.h:333
#define SQ_NEWSEL
Definition: sced.h:353
#define False
Definition: scedstub.c:15
void SQDelete(struct o *Pointer)
Definition: choose.c:723
Definition: cdprpty.h:62
short oInfo
Definition: cddefs.h:147
#define SQ_OLDSEL
Definition: sced.h:344
void free()
void SQShow ( )

Definition at line 940 of file choose.c.

943 {
944  struct ks *SQDesc;
945  int Info;
946 
948  for (SQDesc = SelectQHead; SQDesc; SQDesc = SQDesc->ksSucc) {
949  Info = SQDesc->ksPointer->oInfo;
950  /* Test for user interrupt */
953  return;
954  }
955  if (Info == SQ_OLDSEL || Info == SQ_NEWSEL ||
956  (Info > 10 && Info <= 255)) {
957  /* Show Selected Objects */
959  }
960  }
961 }
struct o * ksPointer
Definition: sced.h:335
#define Not
Definition: cdmacs.h:16
struct ks * ksSucc
Definition: sced.h:334
struct kp Parameters
Definition: init.c:19
void RedisplayAfterInterrupt()
Definition: display.c:623
static void sq_display_selected()
struct ks * SelectQHead
Definition: scedext.h:64
int kpEnableSelectQRedisplay
Definition: sced.h:249
Definition: sced.h:333
#define SQ_NEWSEL
Definition: sced.h:353
short oInfo
Definition: cddefs.h:147
#define SQ_OLDSEL
Definition: sced.h:344
int kpSIGINTERRUPT
Definition: sced.h:267
static struct ks* which_cell ( )
static
static struct ks* which_cell ( struct ks SList)
static

Definition at line 604 of file choose.c.

608 {
609  struct ks *S,*Sret;
610  char *SymbolName;
611  struct ka BB;
612  double A,Area;
613 
614  /* find the smallest cell */
615  sl_bb(SList,&BB);
616  Area = BB.kaRight - BB.kaLeft;
617  Area *= BB.kaTop - BB.kaBottom;
618  Sret = SList;
619  for (S = SList; S != NULL; S = S->ksSucc) {
621  &BB.kaLeft,&BB.kaBottom,&BB.kaRight,&BB.kaTop);
622  A = BB.kaRight - BB.kaLeft;
623  A *= BB.kaTop - BB.kaBottom;
624  if (A < Area) {
625  Sret = S;
626  Area = A;
627  }
628  }
629  if (!is_BB_visible(Sret->ksPointer)) return (NULL);
630 
631  SymbolName = ((struct c *)Sret->ksPointer->oRep)->cMaster->mName;
632  sprintf(TypeOut,"You have selected an instance of %s.",SymbolName);
634  return (Sret);
635 }
struct o * ksPointer
Definition: sced.h:335
struct s * kpCellDesc
Definition: sced.h:207
int CDStatusInt
Definition: cd.c:75
Definition: sced.h:111
struct ks * ksSucc
Definition: sced.h:334
#define NULL
Definition: spdefs.h:121
char TypeOut[200]
Definition: init.c:23
struct kp Parameters
Definition: init.c:19
struct o * oRep
Definition: cddefs.h:144
static int is_BB_visible()
Definition: cddefs.h:177
static void sl_bb()
void Area(int *LookedAhead)
Definition: choose.c:209
Definition: sced.h:333
int CDBB()
void ShowPrompt(char *str)
Definition: scedstub.c:71

Variable Documentation

char* Menu0

Definition at line 53 of file scedintr.c.

char* Menu180

Definition at line 55 of file scedintr.c.

char* Menu270

Definition at line 56 of file scedintr.c.

char* Menu90

Definition at line 54 of file scedintr.c.

char* MenuAREA

Definition at line 64 of file scedintr.c.

char* MenuDESEL

Definition at line 72 of file scedintr.c.

char* MenuMX

Definition at line 90 of file scedintr.c.

char* MenuMY

Definition at line 91 of file scedintr.c.

char* MenuSELEC

Definition at line 103 of file scedintr.c.

char* MenuUNDO

Definition at line 108 of file scedintr.c.