home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume11 / starchart / part28 < prev    next >
Encoding:
Text File  |  1990-03-25  |  40.0 KB  |  1,888 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v11i056: starchart 3.2 Part 28/32
  3. from: ccount@ATHENA.MIT.EDU
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 11, Issue 56
  7. Submitted-by: ccount@ATHENA.MIT.EDU
  8. Archive-name: starchart/part28
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 28 (of 32)."
  17. # Contents:  starchart/starimages.c
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f 'starchart/starimages.c' -a "${1}" != "-c" ; then 
  20.   echo shar: Will not clobber existing file \"'starchart/starimages.c'\"
  21. else
  22. echo shar: Extracting \"'starchart/starimages.c'\" \(37431 characters\)
  23. sed "s/^X//" >'starchart/starimages.c' <<'END_OF_FILE'
  24. X/*
  25. X** This file defines the star and planet images for vector type devices.
  26. X** All vector formed images are here (for tektronix, hp series and laserjet)
  27. X**
  28. X** Original images by Alan W. Paeth, dynamic 'star compilation' and
  29. X** cluster/galaxy images added by (pl) 15-Mar-87
  30. X**
  31. X** New images added by Steve Kennedy 31-Dec-87 and 1989
  32. X**
  33. X** Modified for 3.0 by Craig Counterman Jan, 1989
  34. X *
  35. X * Copyright (c) 1990 by Steve Kennedy and Craig Counterman.
  36. X * All rights reserved.
  37. X *
  38. X * This software may be redistributed freely, not sold.
  39. X * This copyright notice and disclaimer of warranty must remain
  40. X *    unchanged. 
  41. X *
  42. X * No representation is made about the suitability of this
  43. X * software for any purpose.  It is provided "as is" without express or
  44. X * implied warranty, to the extent permitted by applicable law.
  45. X *
  46. X */
  47. X
  48. Xstatic char rcsid[]="$Header: starimages.c,v 2.11 90/03/10 15:34:34 ccount Exp $";
  49. X
  50. X#include <stdio.h>
  51. X#include <math.h>
  52. X#ifndef SYSV
  53. X#include <strings.h>
  54. X#else
  55. X#include <string.h>
  56. X#endif
  57. X
  58. X#include "star3.h"
  59. X
  60. X
  61. X#define IMAROWS        20
  62. X#define IMACOLS        20        /* both should be more than plenty */
  63. X#define ENDCOORD    32767        /* should be out of offset range */
  64. X#define MIN_MAG        (-1.5)        /* all magnitude below become this */
  65. X#define MAX_MAG        (10.0)        /* all magnitude above become this */
  66. X
  67. X/* Externs */
  68. Xextern int g_argc;
  69. Xextern char **g_argv;
  70. X
  71. Xextern char *title;    /* Title of page */
  72. X
  73. Xextern mapwindow *mapwin[MAXWINDOWS];
  74. Xextern int numwins;
  75. X
  76. Xextern int cur_function;
  77. Xextern int cur_map_type;
  78. Xextern int cur_map_tag;
  79. Xextern char *cur_tag_field;
  80. X
  81. X
  82. X/* Defined in lower level routines */
  83. X
  84. X/* Point sizes for font calls */
  85. Xextern int titlesize;
  86. Xextern int subtlsize;
  87. Xextern int namesize;
  88. Xextern int lblsize;
  89. Xextern int magsize;
  90. X
  91. X/* Fonts for font calls */
  92. Xextern int namefnt;
  93. Xextern int lblfnt;
  94. Xextern int magfnt;
  95. Xextern int titlefnt;
  96. Xextern int subtlfnt;
  97. X
  98. X/* externs for labels */
  99. Xextern int x_nameoffset, y_nameoffset;
  100. Xextern int x_lbloffset, y_lbloffset;
  101. Xextern int x_magoffset, y_magoffset;
  102. X
  103. X/* externs for legend: variables of positioning are here */
  104. Xextern int l_til;
  105. Xextern int l_stil;
  106. X
  107. Xextern int l_lmar1;
  108. Xextern int l_lmar2;
  109. Xextern int l_ltext;
  110. Xextern int l_rmar1;
  111. Xextern int l_rmar2;
  112. Xextern int l_rtext;
  113. X
  114. Xextern int l_line1;
  115. Xextern int l_line2;
  116. Xextern int l_line3;
  117. Xextern int l_line4;
  118. Xextern int l_line5;
  119. Xextern int l_line6;
  120. X
  121. X
  122. X/*** begin star definition ***/
  123. X
  124. X/*
  125. X * Star Images
  126. X */
  127. X
  128. Xchar    *S1[] = {
  129. X    "*",
  130. X    NULL
  131. X    };  /* area = 1 */
  132. X
  133. X/* inner circle, r = 1 */
  134. Xchar    *S2[] = {
  135. X    "**",
  136. X    "**",
  137. X    NULL
  138. X    };    /* area = 4 */
  139. X
  140. X/* outer circle, r = 1 */
  141. Xchar    *S3[] = {
  142. X    " * ",
  143. X    "***",
  144. X    " * ",
  145. X    NULL
  146. X    };    /* area = 5 */
  147. X
  148. Xchar    *S3a[] = {
  149. X    "***",
  150. X    "***",
  151. X    "***",
  152. X    NULL
  153. X    };    /* area = 9 */
  154. X
  155. X/* inner circle, r = 2 */
  156. Xchar    *S4[] = {
  157. X    " ** ",
  158. X    "****",
  159. X    "****",
  160. X    " ** ",
  161. X    NULL
  162. X    };    /* area = 12 */
  163. X
  164. Xchar    *S4a[] = {
  165. X    "  *  ",
  166. X    " *** ",
  167. X    "*****",
  168. X    " *** ",
  169. X    "  *  ",
  170. X    NULL
  171. X    };    /* area = 13 */
  172. X
  173. X/* outer circle, r = 2 */
  174. Xchar    *S5[] = {
  175. X    " *** ",
  176. X    "*****",
  177. X    "*****",
  178. X    "*****",
  179. X    " *** ",
  180. X    NULL
  181. X    };    /* area = 21 */
  182. X
  183. X/* inner circle, r = 3 */
  184. Xchar    *S6[] = {
  185. X    " **** ",
  186. X    "******",
  187. X    "******",
  188. X    "******",
  189. X    "******",
  190. X    " **** ",
  191. X    NULL
  192. X    };    /* area = 32 */
  193. X
  194. X/* outer circle, r = 3 */
  195. Xchar    *S7[] = {
  196. X    "  ***  ",
  197. X    " ***** ",
  198. X    "*******",
  199. X    "*******",
  200. X    "*******",
  201. X    " ***** ",
  202. X    "  ***  ",
  203. X    NULL
  204. X    };    /* area = 37 */
  205. X
  206. X/* inner circle, r = 4 */
  207. Xchar    *S8[] = {
  208. X    "  ****  ",
  209. X    " ****** ",
  210. X    "********",
  211. X    "********",
  212. X    "********",
  213. X    "********",
  214. X    " ****** ",
  215. X    "  ****  ",
  216. X    NULL
  217. X    };    /* area = 52 */
  218. X
  219. X/* outer circle, r = 4 */
  220. Xchar    *S9[] = {
  221. X    "   ***   ",
  222. X    " ******* ",
  223. X    " ******* ",
  224. X    "*********",
  225. X    "*********",
  226. X    "*********",
  227. X    " ******* ",
  228. X    " ******* ",
  229. X    "   ***   ",
  230. X    NULL
  231. X    };    /* area = 61 */
  232. X
  233. X/* inner circle, r = 5 */
  234. Xchar    *S10[] = {
  235. X    "   ****   ",
  236. X    "  ******  ",
  237. X    " ******** ",
  238. X    "**********",
  239. X    "**********",
  240. X    "**********",
  241. X    "**********",
  242. X    " ******** ",
  243. X    "  ******  ",
  244. X    "   ****   ",
  245. X    NULL
  246. X    };    /* area = 76 */
  247. X
  248. X/* outer circle, r = 5 */
  249. Xchar    *S11[] = {
  250. X    "   *****   ",
  251. X    "  *******  ",
  252. X    " ********* ",
  253. X    "***********",
  254. X    "***********",
  255. X    "***********",
  256. X    "***********",
  257. X    "***********",
  258. X    " ********* ",
  259. X    "  *******  ",
  260. X    "   *****   ",
  261. X    NULL
  262. X    };    /* area = 97 */
  263. X
  264. X/* inner circle, r = 6 */
  265. Xchar    *S12[] = {
  266. X    "    ****    ",
  267. X    "  ********  ",
  268. X    " ********** ",
  269. X    " ********** ",
  270. X    "************",
  271. X    "************",
  272. X    "************",
  273. X    "************",
  274. X    " ********** ",
  275. X    " ********** ",
  276. X    "  ********  ",
  277. X    "    ****    ",
  278. X    NULL
  279. X    };    /* area = 112 */
  280. X
  281. X/* outer circle, r = 6 */
  282. Xchar    *S13[] = {
  283. X    "    *****    ",
  284. X    "  *********  ",
  285. X    " *********** ",
  286. X    " *********** ",
  287. X    "*************",
  288. X    "*************",
  289. X    "*************",
  290. X    "*************",
  291. X    "*************",
  292. X    " *********** ",
  293. X    " *********** ",
  294. X    "  *********  ",
  295. X    "    *****    ",
  296. X    NULL
  297. X    };    /* area = 129 */
  298. X
  299. X/* inner circle, r = 7 */
  300. Xchar    *S14[] = {
  301. X    "    ******    ",
  302. X    "   ********   ",
  303. X    "  **********  ",
  304. X    " ************ ",
  305. X    "**************",
  306. X    "**************",
  307. X    "**************",
  308. X    "**************",
  309. X    "**************",
  310. X    "**************",
  311. X    " ************ ",
  312. X    "  **********  ",
  313. X    "   ********   ",
  314. X    "    ******    ",
  315. X    NULL
  316. X    };    /* area = 156 */
  317. X
  318. X/* outer circle, r = 7 */
  319. Xchar    *S15[] = {
  320. X    "     *****     ",
  321. X    "   *********   ",
  322. X    "  ***********  ",
  323. X    " ************* ",
  324. X    " ************* ",
  325. X    "***************",
  326. X    "***************",
  327. X    "***************",
  328. X    "***************",
  329. X    "***************",
  330. X    " ************* ",
  331. X    " ************* ",
  332. X    "  ***********  ",
  333. X    "   *********   ",
  334. X    "     *****     ",
  335. X    NULL
  336. X    };    /* area = 177 */
  337. X
  338. X/* inner circle, r = 8 */
  339. Xchar    *S16[] = {
  340. X    "     ******     ",
  341. X    "   **********   ",
  342. X    "  ************  ",
  343. X    " ************** ",
  344. X    " ************** ",
  345. X    "****************",
  346. X    "****************",
  347. X    "****************",
  348. X    "****************",
  349. X    "****************",
  350. X    "****************",
  351. X    " ************** ",
  352. X    " ************** ",
  353. X    "  ************  ",
  354. X    "   **********   ",
  355. X    "     ******     ",
  356. X    NULL
  357. X    };    /* area = 208 */
  358. X
  359. X/* outer circle, r = 8 */
  360. Xchar    *S17[] = {
  361. X    "      *****      ",
  362. X    "    *********    ",
  363. X    "   ***********   ",
  364. X    "  *************  ",
  365. X    " *************** ",
  366. X    " *************** ",
  367. X    "*****************",
  368. X    "*****************",
  369. X    "*****************",
  370. X    "*****************",
  371. X    "*****************",
  372. X    " *************** ",
  373. X    " *************** ",
  374. X    "  *************  ",
  375. X    "   ***********   ",
  376. X    "    *********    ",
  377. X    "      *****      ",
  378. X    NULL
  379. X    };    /* area = 221 */
  380. X
  381. X/* inner circle, r = 9 */
  382. Xchar    *S18[] = {
  383. X    "      ******      ",
  384. X    "    **********    ",
  385. X    "   ************   ",
  386. X    "  **************  ",
  387. X    " **************** ",
  388. X    " **************** ",
  389. X    "******************",
  390. X    "******************",
  391. X    "******************",
  392. X    "******************",
  393. X    "******************",
  394. X    "******************",
  395. X    " **************** ",
  396. X    " **************** ",
  397. X    "  **************  ",
  398. X    "   ************   ",
  399. X    "    **********    ",
  400. X    "      ******      ",
  401. X    NULL
  402. X    };    /* area = 256 */
  403. X
  404. X/* outer circle, r = 9 */
  405. Xchar    *S19[] = {
  406. X    "       *****       ",
  407. X    "     *********     ",
  408. X    "   *************   ",
  409. X    "  ***************  ",
  410. X    "  ***************  ",
  411. X    " ***************** ",
  412. X    " ***************** ",
  413. X    "*******************",
  414. X    "*******************",
  415. X    "*******************",
  416. X    "*******************",
  417. X    "*******************",
  418. X    " ***************** ",
  419. X    " ***************** ",
  420. X    "  ***************  ",
  421. X    "  ***************  ",
  422. X    "   *************   ",
  423. X    "     *********     ",
  424. X    "       *****       ",
  425. X    NULL
  426. X    };    /* area = 277 */
  427. X
  428. X/* inner circle, r = 10 */
  429. Xchar    *S20[] = {
  430. X    "       ******       ",
  431. X    "     **********     ",
  432. X    "    ************    ",
  433. X    "   **************   ",
  434. X    "  ****************  ",
  435. X    " ****************** ",
  436. X    " ****************** ",
  437. X    "********************",
  438. X    "********************",
  439. X    "********************",
  440. X    "********************",
  441. X    "********************",
  442. X    "********************",
  443. X    " ****************** ",
  444. X    " ****************** ",
  445. X    "  ****************  ",
  446. X    "   **************   ",
  447. X    "    ************    ",
  448. X    "     **********     ",
  449. X    "       ******       ",
  450. X    NULL
  451. X    };    /* area = 308 */
  452. X
  453. X/* outer circle, r = 10 */
  454. Xchar    *S21[] = {
  455. X    "       *******       ",
  456. X    "     ***********     ",
  457. X    "    *************    ",
  458. X    "   ***************   ",
  459. X    "  *****************  ",
  460. X    " ******************* ",
  461. X    " ******************* ",
  462. X    "*********************",
  463. X    "*********************",
  464. X    "*********************",
  465. X    "*********************",
  466. X    "*********************",
  467. X    "*********************",
  468. X    "*********************",
  469. X    " ******************* ",
  470. X    " ******************* ",
  471. X    "  *****************  ",
  472. X    "   ***************   ",
  473. X    "    *************    ",
  474. X    "     ***********     ",
  475. X    "       *******       ",
  476. X    NULL
  477. X    };    /* area = 349 */
  478. X
  479. X/* inner circle, r = 11 */
  480. Xchar    *S22[] = {
  481. X    "        ******        ",
  482. X    "      **********      ",
  483. X    "    **************    ",
  484. X    "   ****************   ",
  485. X    "  ******************  ",
  486. X    "  ******************  ",
  487. X    " ******************** ",
  488. X    " ******************** ",
  489. X    "**********************",
  490. X    "**********************",
  491. X    "**********************",
  492. X    "**********************",
  493. X    "**********************",
  494. X    "**********************",
  495. X    " ******************** ",
  496. X    " ******************** ",
  497. X    "  ******************  ",
  498. X    "  ******************  ",
  499. X    "   ****************   ",
  500. X    "    **************    ",
  501. X    "      **********      ",
  502. X    "        ******        ",
  503. X    NULL
  504. X    };    /* area = 376 */
  505. X
  506. X/* outer circle, r = 11 */
  507. Xchar    *S23[] = {
  508. X    "        *******        ",
  509. X    "      ***********      ",
  510. X    "     *************     ",
  511. X    "   *****************   ",
  512. X    "   *****************   ",
  513. X    "  *******************  ",
  514. X    " ********************* ",
  515. X    " ********************* ",
  516. X    "***********************",
  517. X    "***********************",
  518. X    "***********************",
  519. X    "***********************",
  520. X    "***********************",
  521. X    "***********************",
  522. X    "***********************",
  523. X    " ********************* ",
  524. X    " ********************* ",
  525. X    "  *******************  ",
  526. X    "   *****************   ",
  527. X    "   *****************   ",
  528. X    "     *************     ",
  529. X    "      ***********      ",
  530. X    "        *******        ",
  531. X    NULL
  532. X    };    /* area = 413 */
  533. X
  534. X/* inner circle, r = 12 */
  535. Xchar    *S24[] = {
  536. X    "         ******         ",
  537. X    "      ************      ",
  538. X    "     **************     ",
  539. X    "    ****************    ",
  540. X    "   ******************   ",
  541. X    "  ********************  ",
  542. X    " ********************** ",
  543. X    " ********************** ",
  544. X    " ********************** ",
  545. X    "************************",
  546. X    "************************",
  547. X    "************************",
  548. X    "************************",
  549. X    "************************",
  550. X    "************************",
  551. X    " ********************** ",
  552. X    " ********************** ",
  553. X    " ********************** ",
  554. X    "  ********************  ",
  555. X    "   ******************   ",
  556. X    "    ****************    ",
  557. X    "     **************     ",
  558. X    "      ************      ",
  559. X    "         ******         ",
  560. X    NULL
  561. X    };    /* area = 448 */
  562. X
  563. X/* outer circle, r = 12 */
  564. Xchar    *S25[] = {
  565. X    "         *******         ",
  566. X    "       ***********       ",
  567. X    "     ***************     ",
  568. X    "    *****************    ",
  569. X    "   *******************   ",
  570. X    "  *********************  ",
  571. X    "  *********************  ",
  572. X    " *********************** ",
  573. X    " *********************** ",
  574. X    "*************************",
  575. X    "*************************",
  576. X    "*************************",
  577. X    "*************************",
  578. X    "*************************",
  579. X    "*************************",
  580. X    "*************************",
  581. X    " *********************** ",
  582. X    " *********************** ",
  583. X    "  *********************  ",
  584. X    "  *********************  ",
  585. X    "   *******************   ",
  586. X    "    *****************    ",
  587. X    "     ***************     ",
  588. X    "       ***********       ",
  589. X    "         *******         ",
  590. X    NULL
  591. X    };    /* area = 489 */
  592. X
  593. X/* inner circle, r = 13 */
  594. Xchar    *S26[] = {
  595. X    "         ********         ",
  596. X    "       ************       ",
  597. X    "     ****************     ",
  598. X    "    ******************    ",
  599. X    "   ********************   ",
  600. X    "  **********************  ",
  601. X    "  **********************  ",
  602. X    " ************************ ",
  603. X    " ************************ ",
  604. X    "**************************",
  605. X    "**************************",
  606. X    "**************************",
  607. X    "**************************",
  608. X    "**************************",
  609. X    "**************************",
  610. X    "**************************",
  611. X    "**************************",
  612. X    " ************************ ",
  613. X    " ************************ ",
  614. X    "  **********************  ",
  615. X    "  **********************  ",
  616. X    "   ********************   ",
  617. X    "    ******************    ",
  618. X    "     ****************     ",
  619. X    "       ************       ",
  620. X    "         ********         ",
  621. X    NULL
  622. X    };    /* area = 540 */
  623. X
  624. X/* outer circle, r = 13 */
  625. Xchar    *S27[] = {
  626. X    "          *******          ",
  627. X    "       *************       ",
  628. X    "      ***************      ",
  629. X    "     *****************     ",
  630. X    "    *******************    ",
  631. X    "   *********************   ",
  632. X    "  ***********************  ",
  633. X    " ************************* ",
  634. X    " ************************* ",
  635. X    " ************************* ",
  636. X    "***************************",
  637. X    "***************************",
  638. X    "***************************",
  639. X    "***************************",
  640. X    "***************************",
  641. X    "***************************",
  642. X    "***************************",
  643. X    " ************************* ",
  644. X    " ************************* ",
  645. X    " ************************* ",
  646. X    "  ***********************  ",
  647. X    "   *********************   ",
  648. X    "    *******************    ",
  649. X    "     *****************     ",
  650. X    "      ***************      ",
  651. X    "       *************       ",
  652. X    "          *******          ",
  653. X    NULL
  654. X    };    /* area = 569 */
  655. X
  656. X/* inner circle, r = 14 */
  657. Xchar    *S28[] = {
  658. X    "          ********          ",
  659. X    "        ************        ",
  660. X    "      ****************      ",
  661. X    "     ******************     ",
  662. X    "    ********************    ",
  663. X    "   **********************   ",
  664. X    "  ************************  ",
  665. X    "  ************************  ",
  666. X    " ************************** ",
  667. X    " ************************** ",
  668. X    "****************************",
  669. X    "****************************",
  670. X    "****************************",
  671. X    "****************************",
  672. X    "****************************",
  673. X    "****************************",
  674. X    "****************************",
  675. X    "****************************",
  676. X    " ************************** ",
  677. X    " ************************** ",
  678. X    "  ************************  ",
  679. X    "  ************************  ",
  680. X    "   **********************   ",
  681. X    "    ********************    ",
  682. X    "     ******************     ",
  683. X    "      ****************      ",
  684. X    "        ************        ",
  685. X    "          ********          ",
  686. X    NULL
  687. X    };    /* area = 616 */
  688. X
  689. X/* outer circle, r = 14 */
  690. Xchar    *S29[] = {
  691. X    "           *******           ",
  692. X    "        *************        ",
  693. X    "       ***************       ",
  694. X    "     *******************     ",
  695. X    "    *********************    ",
  696. X    "   ***********************   ",
  697. X    "   ***********************   ",
  698. X    "  *************************  ",
  699. X    " *************************** ",
  700. X    " *************************** ",
  701. X    " *************************** ",
  702. X    "*****************************",
  703. X    "*****************************",
  704. X    "*****************************",
  705. X    "*****************************",
  706. X    "*****************************",
  707. X    "*****************************",
  708. X    "*****************************",
  709. X    " *************************** ",
  710. X    " *************************** ",
  711. X    " *************************** ",
  712. X    "  *************************  ",
  713. X    "   ***********************   ",
  714. X    "   ***********************   ",
  715. X    "    *********************    ",
  716. X    "     *******************     ",
  717. X    "       ***************       ",
  718. X    "        *************        ",
  719. X    "           *******           ",
  720. X    NULL
  721. X    };    /* area = 657 */
  722. X
  723. X/*
  724. X * list of images in order of decreasing size
  725. X */
  726. Xchar    **star_image_tab[] = {
  727. X    S1, S2, S3, S3a, S4, S4a, S5, S6, S7, S8, S9, S10,
  728. X    S11, S12, S13, S14, S15, S16, S17, S18, S19, S20,
  729. X    S21, S22, S23, S24, S25, S26, S27, S28, S29
  730. X    };
  731. X
  732. X/*
  733. X * pointer to "compiled" version of each image
  734. X */
  735. X#define N_IMAGES    (sizeof star_image_tab /sizeof (char **))
  736. Xint    *star_def_tab[N_IMAGES];
  737. X
  738. X/*
  739. X * table which converts from star magnitude to an index into star_def_tab.
  740. X *
  741. X * table entry 0 corresponds to magnitude -1.5 and so on up to
  742. X * magnitude 10.0 increments of 0.1 magnitude.
  743. X */
  744. X#ifdef BIG_STARS
  745. Xshort star_mag_to_image[] = {
  746. X    30, /* -1.5 */
  747. X    30, /* -1.4 */
  748. X    30, /* -1.3 */
  749. X    30, /* -1.2 */
  750. X    30, /* -1.1 */
  751. X    30, /* -1.0 */
  752. X    30, /* -0.9 */
  753. X    30, /* -0.8 */
  754. X    29, /* -0.7 */
  755. X    28, /* -0.6 */
  756. X    27, /* -0.5 */
  757. X    26, /* -0.4 */
  758. X    26, /* -0.3 */
  759. X    25, /* -0.2 */
  760. X    24, /* -0.1 */
  761. X    23, /* 0.0 */
  762. X    22, /* 0.1 */
  763. X    22, /* 0.2 */
  764. X    21, /* 0.3 */
  765. X    20, /* 0.4 */
  766. X    20, /* 0.5 */
  767. X    19, /* 0.6 */
  768. X    18, /* 0.7 */
  769. X    18, /* 0.8 */
  770. X    17, /* 0.9 */
  771. X    16, /* 1.0 */
  772. X    16, /* 1.1 */
  773. X    16, /* 1.2 */
  774. X    15, /* 1.3 */
  775. X    15, /* 1.4 */
  776. X    14, /* 1.5 */
  777. X    14, /* 1.6 */
  778. X    13, /* 1.7 */
  779. X    13, /* 1.8 */
  780. X    12, /* 1.9 */
  781. X    12, /* 2.0 */
  782. X    12, /* 2.1 */
  783. X    11, /* 2.2 */
  784. X    11, /* 2.3 */
  785. X    11, /* 2.4 */
  786. X    10, /* 2.5 */
  787. X    10, /* 2.6 */
  788. X    10, /* 2.7 */
  789. X    9, /* 2.8 */
  790. X    9, /* 2.9 */
  791. X    9, /* 3.0 */
  792. X    9, /* 3.1 */
  793. X    8, /* 3.2 */
  794. X    8, /* 3.3 */
  795. X    8, /* 3.4 */
  796. X    7, /* 3.5 */
  797. X    7, /* 3.6 */
  798. X    7, /* 3.7 */
  799. X    7, /* 3.8 */
  800. X    6, /* 3.9 */
  801. X    6, /* 4.0 */
  802. X    6, /* 4.1 */
  803. X    6, /* 4.2 */
  804. X    6, /* 4.3 */
  805. X    6, /* 4.4 */
  806. X    6, /* 4.5 */
  807. X    5, /* 4.6 */
  808. X    5, /* 4.7 */
  809. X    5, /* 4.8 */
  810. X    5, /* 4.9 */
  811. X    4, /* 5.0 */
  812. X    4, /* 5.1 */
  813. X    3, /* 5.2 */
  814. X    3, /* 5.3 */
  815. X    3, /* 5.4 */
  816. X    3, /* 5.5 */
  817. X    3, /* 5.6 */
  818. X    3, /* 5.7 */
  819. X    3, /* 5.8 */
  820. X    2, /* 5.9 */
  821. X    2, /* 6.0 */
  822. X    2, /* 6.1 */
  823. X    2, /* 6.2 */
  824. X    2, /* 6.3 */
  825. X    2, /* 6.4 */
  826. X    1, /* 6.5 */
  827. X    1, /* 6.6 */
  828. X    1, /* 6.7 */
  829. X    1, /* 6.8 */
  830. X    1, /* 6.9 */
  831. X    1, /* 7.0 */
  832. X    1, /* 7.1 */
  833. X    1, /* 7.2 */
  834. X    0, /* 7.3 */
  835. X    0, /* 7.4 */
  836. X    0, /* 7.5 */
  837. X    0, /* 7.6 */
  838. X    0, /* 7.7 */
  839. X    0, /* 7.8 */
  840. X    0, /* 7.9 */
  841. X    0, /* 8.0 */
  842. X    0, /* 8.1 */
  843. X    0, /* 8.2 */
  844. X    0, /* 8.3 */
  845. X    0, /* 8.4 */
  846. X    0, /* 8.5 */
  847. X    0, /* 8.6 */
  848. X    0, /* 8.7 */
  849. X    0, /* 8.8 */
  850. X    0, /* 8.9 */
  851. X    0, /* 9.0 */
  852. X    0, /* 9.1 */
  853. X    0, /* 9.2 */
  854. X    0, /* 9.3 */
  855. X    0, /* 9.4 */
  856. X    0, /* 9.5 */
  857. X    0, /* 9.6 */
  858. X    0, /* 9.7 */
  859. X    0, /* 9.8 */
  860. X    0, /* 9.9 */
  861. X    0, /* 10.0 */
  862. X};
  863. X#else
  864. Xshort star_mag_to_image[] = {
  865. X    8, /* -1.5 */
  866. X    8, /* -1.4 */
  867. X    8, /* -1.3 */
  868. X    8, /* -1.2 */
  869. X    8, /* -1.1 */
  870. X    8, /* -1.0 */
  871. X    8, /* -0.9 */
  872. X    8, /* -0.8 */
  873. X    8, /* -0.7 */
  874. X    8, /* -0.6 */
  875. X    8, /* -0.5 */
  876. X    8, /* -0.4 */
  877. X    8, /* -0.3 */
  878. X    8, /* -0.2 */
  879. X    8, /* -0.1 */
  880. X    8, /* 0.0 */
  881. X    8, /* 0.1 */
  882. X    8, /* 0.2 */
  883. X    8, /* 0.3 */
  884. X    8, /* 0.4 */
  885. X    7, /* 0.5 */
  886. X    7, /* 0.6 */
  887. X    7, /* 0.7 */
  888. X    7, /* 0.8 */
  889. X    7, /* 0.9 */
  890. X    7, /* 1.0 */
  891. X    7, /* 1.1 */
  892. X    7, /* 1.2 */
  893. X    7, /* 1.3 */
  894. X    7, /* 1.4 */
  895. X    6, /* 1.5 */
  896. X    6, /* 1.6 */
  897. X    6, /* 1.7 */
  898. X    6, /* 1.8 */
  899. X    6, /* 1.9 */
  900. X    6, /* 2.0 */
  901. X    6, /* 2.1 */
  902. X    6, /* 2.2 */
  903. X    6, /* 2.3 */
  904. X    6, /* 2.4 */
  905. X    5, /* 2.5 */
  906. X    5, /* 2.6 */
  907. X    5, /* 2.7 */
  908. X    5, /* 2.8 */
  909. X    5, /* 2.9 */
  910. X    5, /* 3.0 */
  911. X    5, /* 3.1 */
  912. X    5, /* 3.2 */
  913. X    5, /* 3.3 */
  914. X    5, /* 3.4 */
  915. X    4, /* 3.5 */
  916. X    4, /* 3.6 */
  917. X    4, /* 3.7 */
  918. X    4, /* 3.8 */
  919. X    4, /* 3.9 */
  920. X    4, /* 4.0 */
  921. X    4, /* 4.1 */
  922. X    4, /* 4.2 */
  923. X    4, /* 4.3 */
  924. X    4, /* 4.4 */
  925. X    3, /* 4.5 */
  926. X    3, /* 4.6 */
  927. X    3, /* 4.7 */
  928. X    3, /* 4.8 */
  929. X    3, /* 4.9 */
  930. X    3, /* 5.0 */
  931. X    3, /* 5.1 */
  932. X    3, /* 5.2 */
  933. X    3, /* 5.3 */
  934. X    3, /* 5.4 */
  935. X    2, /* 5.5 */
  936. X    2, /* 5.6 */
  937. X    2, /* 5.7 */
  938. X    2, /* 5.8 */
  939. X    2, /* 5.9 */
  940. X    2, /* 6.0 */
  941. X    2, /* 6.1 */
  942. X    2, /* 6.2 */
  943. X    2, /* 6.3 */
  944. X    2, /* 6.4 */
  945. X    1, /* 6.5 */
  946. X    1, /* 6.6 */
  947. X    1, /* 6.7 */
  948. X    1, /* 6.8 */
  949. X    1, /* 6.9 */
  950. X    1, /* 7.0 */
  951. X    1, /* 7.1 */
  952. X    1, /* 7.2 */
  953. X    1, /* 7.3 */
  954. X    1, /* 7.4 */
  955. X    0, /* 7.5 */
  956. X    0, /* 7.6 */
  957. X    0, /* 7.7 */
  958. X    0, /* 7.8 */
  959. X    0, /* 7.9 */
  960. X    0, /* 8.0 */
  961. X    0, /* 8.1 */
  962. X    0, /* 8.2 */
  963. X    0, /* 8.3 */
  964. X    0, /* 8.4 */
  965. X    0, /* 8.5 */
  966. X    0, /* 8.6 */
  967. X    0, /* 8.7 */
  968. X    0, /* 8.8 */
  969. X    0, /* 8.9 */
  970. X    0, /* 9.0 */
  971. X    0, /* 9.1 */
  972. X    0, /* 9.2 */
  973. X    0, /* 9.3 */
  974. X    0, /* 9.4 */
  975. X    0, /* 9.5 */
  976. X    0, /* 9.6 */
  977. X    0, /* 9.7 */
  978. X    0, /* 9.8 */
  979. X    0, /* 9.9 */
  980. X    0, /* 10.0 */
  981. X};
  982. X#endif
  983. X
  984. X/*** end of star definition ***/
  985. X
  986. X/* Planetary images */
  987. X
  988. Xchar    *Sun[] = {
  989. X    "         ",
  990. X    "         ",
  991. X    "   ***   ",
  992. X    "  *   *  ",
  993. X    "  * * *  ",
  994. X    "  *   *  ",
  995. X    "   ***   ",
  996. X    "         ",
  997. X    "         ",
  998. X    NULL
  999. X    };
  1000. X
  1001. Xchar    *Luna[] = {
  1002. X    "  **     ",
  1003. X    "   **    ",
  1004. X    "    **   ",
  1005. X    "    * *  ",
  1006. X    "    * *  ",
  1007. X    "    * *  ",
  1008. X    "    **   ",
  1009. X    "   **    ",
  1010. X    "  **     ",
  1011. X    NULL
  1012. X    };
  1013. X
  1014. Xchar    *Mercury[] = {
  1015. X    "  *   *  ",
  1016. X    "   ***   ",
  1017. X    "  *   *  ",
  1018. X    "  *   *  ",
  1019. X    "  *   *  ",
  1020. X    "   ***   ",
  1021. X    "    *    ",
  1022. X    "   ***   ",
  1023. X    "    *    ",
  1024. X    NULL
  1025. X    };
  1026. X
  1027. Xchar    *Venus[] = {
  1028. X    "         ",
  1029. X    "   ***   ",
  1030. X    "  *   *  ",
  1031. X    "  *   *  ",
  1032. X    "  *   *  ",
  1033. X    "   ***   ",
  1034. X    "    *    ",
  1035. X    "   ***   ",
  1036. X    "    *    ",
  1037. X    NULL
  1038. X    };
  1039. X
  1040. Xchar    *Mars[] = {
  1041. X    "         ",
  1042. X    "    ***  ",
  1043. X    "     **  ",
  1044. X    "    * *  ",
  1045. X    "    *    ",
  1046. X    "   ***   ",
  1047. X    "  *   *  ",
  1048. X    "  *   *  ",
  1049. X    "   ***   ",
  1050. X    NULL
  1051. X    };
  1052. X
  1053. Xchar    *Jupiter[] = {
  1054. X    "   *     ",
  1055. X    "  * * *  ",
  1056. X    "    * *  ",
  1057. X    "    * *  ",
  1058. X    "   *  *  ",
  1059. X    "   *  *  ",
  1060. X    "   ****  ",
  1061. X    "      *  ",
  1062. X    "         ",
  1063. X    NULL
  1064. X    };
  1065. X
  1066. Xchar    *Saturn[] = {
  1067. X    "         ",
  1068. X    "  ***    ",
  1069. X    "   *     ",
  1070. X    "   *     ",
  1071. X    "   ***   ",
  1072. X    "   *  *  ",
  1073. X    "   * *   ",
  1074. X    "   * *   ",
  1075. X    "      *  ",
  1076. X    NULL
  1077. X    };
  1078. X
  1079. Xchar    *Uranus[] = {
  1080. X    "    *    ",
  1081. X    "   ***   ",
  1082. X    "  * * *  ",
  1083. X    "    *    ",
  1084. X    "   ***   ",
  1085. X    "  *   *  ",
  1086. X    "  * * *  ",
  1087. X    "  *   *  ",
  1088. X    "   ***   ",
  1089. X    NULL
  1090. X    };
  1091. X
  1092. Xchar    *Neptune[] = {
  1093. X    "  * * *  ",
  1094. X    "  * * *  ",
  1095. X    "  * * *  ",
  1096. X    "  * * *  ",
  1097. X    "   ***   ",
  1098. X    "    *    ",
  1099. X    "   ***   ",
  1100. X    "    *    ",
  1101. X    "         ",
  1102. X    NULL
  1103. X    };
  1104. X
  1105. Xchar    *Pluto[] = {
  1106. X    "         ",
  1107. X    "  ****   ",
  1108. X    "  *   *  ",
  1109. X    "  *   *  ",
  1110. X    "  ****   ",
  1111. X    "  *      ",
  1112. X    "  *****  ",
  1113. X    "         ",
  1114. X    NULL
  1115. X    };
  1116. X
  1117. Xchar    *Comet[] = {
  1118. X    "      * *",
  1119. X    "     * * ",
  1120. X    "  ***    ",
  1121. X    " **** * *",
  1122. X    " ***** * ",
  1123. X    "  ***    ",
  1124. X    "     * * ",
  1125. X    "      * *",
  1126. X    NULL
  1127. X    };
  1128. X
  1129. Xchar    *Aster[] = {
  1130. X    "*       *",
  1131. X    " *     * ",
  1132. X    "  * * *  ",
  1133. X    "   ***   ",
  1134. X    "   ***   ",
  1135. X    "  * * *  ",
  1136. X    " *     * ",
  1137. X    "*       *",
  1138. X    NULL
  1139. X    };
  1140. X
  1141. X/* Galaxy images */
  1142. X
  1143. Xchar    *Gal_E[] = {
  1144. X    "***   ",
  1145. X    "****  ",
  1146. X    "***** ",
  1147. X    " *****",
  1148. X    "  ****",
  1149. X    "   ***",
  1150. X    NULL
  1151. X    };
  1152. X
  1153. Xchar    *Gal_S[] = {
  1154. X    " ***  ",
  1155. X    "*   * ",
  1156. X    "  **  ",
  1157. X    " **** ",
  1158. X    "  **  ",
  1159. X    " *   *",
  1160. X    "  *** ",
  1161. X    NULL
  1162. X    };
  1163. X
  1164. X/* Cluster images */
  1165. X
  1166. Xchar    *Clu_G[] = {
  1167. X    "   *   ",
  1168. X    " *   * ",
  1169. X    "   *   ",
  1170. X    "* *** *",
  1171. X    "   *   ",
  1172. X    " *   * ",
  1173. X    "   *   ",
  1174. X    NULL
  1175. X    };
  1176. X
  1177. Xchar    *Clu_O[] = {
  1178. X    "   *   ",
  1179. X    " *   * ",
  1180. X    "       ",
  1181. X    "*     *",
  1182. X    "       ",
  1183. X    " *   * ",
  1184. X    "   *   ",
  1185. X    NULL
  1186. X    };
  1187. X
  1188. X/* Nebula images */
  1189. X
  1190. Xchar    *Neb_D[] = {
  1191. X    "  *  ",
  1192. X    " * * ",
  1193. X    "*   *",
  1194. X    " * * ",
  1195. X    "  *  ",
  1196. X    NULL
  1197. X    };
  1198. X
  1199. Xchar    *Neb_P[] = {
  1200. X    "   ***",
  1201. X    "  *  *",
  1202. X    " *   *",
  1203. X    "*   * ",
  1204. X    "*  *  ",
  1205. X    "***   ",
  1206. X    NULL
  1207. X    };
  1208. X
  1209. X/* Other images */
  1210. X
  1211. Xchar    *Unk_U[] = {
  1212. X    " *** ",
  1213. X    "*   *",
  1214. X    "   **",
  1215. X    "  *  ",
  1216. X    "  *  ",
  1217. X    "     ",
  1218. X    "  *  ",
  1219. X    NULL
  1220. X    };
  1221. X
  1222. Xchar    *Other_O[] = {
  1223. X    "* * * ",
  1224. X    " * * *",
  1225. X    "* * * ",
  1226. X    " * * *",
  1227. X    "* * * ",
  1228. X    " * * *",
  1229. X    NULL
  1230. X    };
  1231. X
  1232. Xchar *calloc();
  1233. X
  1234. X/**********************************************************************
  1235. X**
  1236. X** cimage:
  1237. X**
  1238. X** Parameters:
  1239. X**    image        char ** pointer to ascii reprentation of images
  1240. X**
  1241. X** Function:
  1242. X**    'compiles' star image data for drawlen from char pointers given
  1243. X**    this method simplifies the creation and updating of images.
  1244. X**    The lengths of rows of images MUST be equal !!
  1245. X**
  1246. X** Returns:
  1247. X**    NULL when ptr != NULL, pointer to allocated vector defining
  1248. X**    drawlen information and ending to ENDCOORD value when ptr == NULL
  1249. X**
  1250. X** History:
  1251. X**
  1252. X**    Modified from cstar by Steve Kennedy 3/1/89
  1253. X** 
  1254. X*/
  1255. Xint *
  1256. Xcimage(image)
  1257. Xchar **image;
  1258. X{
  1259. X    int n;                /* number of lines gathered */
  1260. X    int len;            /* longest line found */
  1261. X    int cx, cy;            /* center points */
  1262. X    char *ptr;
  1263. X    char **rptr;
  1264. X    int *retarea;
  1265. X    int i,j, x, s, l;
  1266. X    
  1267. X
  1268. X    n = 0;
  1269. X    len = 0;
  1270. X    for (rptr = image; *rptr != NULL; ++rptr, ++n)
  1271. X    {
  1272. X        cx = strlen (*rptr);        /* get max len */
  1273. X        if  (cx > len) len = cx;
  1274. X    }
  1275. X
  1276. X    /*
  1277. X    ** start 'compilation'
  1278. X    */
  1279. X    cy = n / 2;                /* align */
  1280. X    cx = len / 2;
  1281. X
  1282. X    /*
  1283. X    ** allocate offset area
  1284. X    */
  1285. X    retarea = (int *) calloc 
  1286. X        ((unsigned)(len * n * (n / 2 + 1) * 3 + 1), sizeof (int));
  1287. X    if  (retarea == NULL) {
  1288. X        perror ("Memory allocation failed");
  1289. X        exit (2);
  1290. X    }
  1291. X    /*
  1292. X    ** fill return area
  1293. X    */
  1294. X    j = 0;
  1295. X    for (i = 0; i < n; i++) {
  1296. X        l = 0;  s = 0;  x = 0;
  1297. X        ptr = image [i];
  1298. X        while (*ptr) {
  1299. X            if  (*ptr == ' ') {
  1300. X                if  (l) { /* flush */
  1301. X                    retarea [j++] = s - cx;
  1302. X/*                    retarea [j++] = i - cy;*/
  1303. X                    retarea [j++] = cy - i;
  1304. X                    retarea [j++] = l;
  1305. X                            
  1306. X                    l = 0;
  1307. X                }
  1308. X            }
  1309. X            else {
  1310. X                if  (l)
  1311. X                    l++;
  1312. X                else {
  1313. X                    s = x;
  1314. X                    l = 1;
  1315. X                }
  1316. X            }
  1317. X            ptr++;
  1318. X            x++;
  1319. X        } /* while */
  1320. X        if  (l) { /* flush */
  1321. X            retarea [j++] = s - cx;
  1322. X/*            retarea [j++] = i - cy;*/
  1323. X            retarea [j++] = cy - i;
  1324. X            retarea [j++] = l;
  1325. X        }
  1326. X    } /* for */
  1327. X    n = 0;
  1328. X    retarea [j] = ENDCOORD;
  1329. X    return retarea;
  1330. X} /* cimage */
  1331. X
  1332. X
  1333. X/* Interface Function */
  1334. X/* Draw object at x, y.  properties set by other parameters */
  1335. Xdrawobj(x, y, mag, type, color_str, label_field, con_str, obj_name,
  1336. X    comment_str, file_line,
  1337. X    draw_glyph, draw_text, use_lbl, use_name, use_mag)
  1338. X
  1339. X     int x, y;
  1340. X     double mag;    /* Magnitude of object */
  1341. X     char *type;    /* 2 chars, object code and subcode */
  1342. X     char *color_str;    /* 2 chars, spectral type for stars, 
  1343. X               color code otherwise */
  1344. X     char *label_field;    /* 2 chars, Bayer or flamsteed for stars,
  1345. X               size in seconds for nebulae and
  1346. X               planets */
  1347. X     char *con_str;    /* 3 chars, the constellation the object is in */
  1348. X     char *obj_name;    /* Name of object */
  1349. X     char *comment_str;    /* Comment field */
  1350. X     char *file_line;    /* The full line from the file,
  1351. X               containing the above if it is in
  1352. X               standard format */
  1353. X     int draw_glyph;    /* Draw object symbol */
  1354. X     int draw_text;    /* Draw text */
  1355. X     int use_lbl;    /* Label object with the label_field string */
  1356. X     int use_name;    /* Label object with the obj_name string */
  1357. X     int use_mag;    /* Label object with a 2 or 3 character string
  1358. X               containing the magnitude * 10 without
  1359. X               decimal point */
  1360. X{
  1361. X  char magstr[10];
  1362. X
  1363. X/*fprintf(stderr, "%d %d %f <%s> <%s> <%s> <%s> <%s> <%s> <%s>\n", x, y, mag,
  1364. X    type, color_str, label_field, con_str, obj_name, comment_str,
  1365. X    file_line);*/
  1366. X
  1367. X  if (draw_glyph)
  1368. X    switch(type[0]) {
  1369. X    case 'S':    drawStar(x,y,mag,type[1],color_str);
  1370. X      break;
  1371. X    case 'P':    drawPlan(x,y,mag,type[1],color_str, size_obj(label_field),
  1372. X             comment_str);
  1373. X      break;
  1374. X    case 'N':    drawNebu(x,y,mag,type[1],color_str, size_obj(label_field));
  1375. X      break;
  1376. X    case 'G':    drawGalx(x,y,mag,type[1],color_str, size_obj(label_field));
  1377. X      break;
  1378. X    case 'C':    drawClus(x,y,mag,type[1],color_str, size_obj(label_field));
  1379. X      break;
  1380. X    case 'U':
  1381. X      drawUnknown(x,y,mag,type[1],color_str, size_obj(label_field));
  1382. X      break;
  1383. X    case 'O':
  1384. X      drawOther(x,y,mag,type[1],color_str, size_obj(label_field));
  1385. X      break;
  1386. X    case 'V':
  1387. X    case 'A':
  1388. X    case 'I':
  1389. X      break;
  1390. X    case '#':
  1391. X    default:
  1392. X      break;
  1393. X    };
  1394. X
  1395. X
  1396. X/*
  1397. X * use name or label
  1398. X */
  1399. X  if (draw_text) {
  1400. X    if (type[0] == 'I')
  1401. X      D_color(color_str);
  1402. X    else
  1403. X      D_color("  ");
  1404. X
  1405. X    if (use_name && obj_name[0]) {
  1406. X      D_fontsize(namesize, namefnt);
  1407. X      D_text(x+x_nameoffset, y+y_nameoffset, obj_name, FALSE);
  1408. X    } else if (use_lbl &&
  1409. X           ((label_field[0] != ' ') || (label_field[1] != ' '))) {
  1410. X      D_fontsize(lblsize, lblfnt);
  1411. X      D_text(x+x_lbloffset, y+y_lbloffset, label_field, TRUE);
  1412. X    }
  1413. X/* If you want to mag label other objects, change this */
  1414. X    if (use_mag && (type[0] == 'S')) {
  1415. X      sprintf(magstr, "%02d", (int)(mag*10.0+0.5));
  1416. X      D_fontsize(magsize, magfnt);
  1417. X      D_text(x+x_magoffset, y+y_magoffset, magstr, FALSE);
  1418. X    }
  1419. X  }
  1420. X}
  1421. X
  1422. XdrawStar (x, y, mag, type, color)
  1423. X     int x, y;
  1424. X     double mag;
  1425. X     char type, *color;
  1426. X{
  1427. X    int        *coord;
  1428. X    int        i;
  1429. X    int        i_mag;
  1430. X    int        maxlen;
  1431. X
  1432. X
  1433. X    if (mag < MIN_MAG)
  1434. X    {
  1435. X    mag = MIN_MAG;
  1436. X    }
  1437. X    else if (mag > MAX_MAG)
  1438. X    {
  1439. X    mag = MAX_MAG;
  1440. X    }
  1441. X    mag += 1.5;
  1442. X
  1443. X    i_mag = star_mag_to_image[(int) (mag*10.0 + 0.5)];
  1444. X
  1445. X    D_color(color);
  1446. X    switch (type)
  1447. X    {
  1448. X    case 'S':
  1449. X    default:
  1450. X    if (star_def_tab[i_mag] == NULL)
  1451. X    {
  1452. X        star_def_tab[i_mag] = cimage(star_image_tab[i_mag]);
  1453. X    }
  1454. X    coord = star_def_tab[i_mag];
  1455. X    break;
  1456. X    }
  1457. X
  1458. X    i = 0;
  1459. X    maxlen = 0;
  1460. X    while (coord [i] != ENDCOORD)
  1461. X    {
  1462. X    drawlen (x, y, coord [i], coord [i+1], coord [i+2]);
  1463. X#ifdef NOTYET
  1464. X    if (type == 'D' && coord [i+2] > maxlen)
  1465. X    {
  1466. X        maxlen = coord [i + 2];
  1467. X        dx = coord [i];
  1468. X    }
  1469. X#endif
  1470. X    i += 3;
  1471. X    }
  1472. X#ifdef NOTYET
  1473. X    if (type == 'D' && maxlen >= 5)
  1474. X    {
  1475. X    fprintf(stderr, "(%d,%d) dx=%d, dy=%d, len=%d\n",
  1476. X        x, y, dx, 0, maxlen);
  1477. X    drawlen(x, y, dx - 2, 0, maxlen + 4);
  1478. X    }
  1479. X#endif
  1480. X
  1481. X    D_color(" ");
  1482. X}
  1483. X
  1484. X
  1485. XdrawPlan(x, y, mag, pcode, color, plansize, comment_str)
  1486. X     int x,y;
  1487. X     double mag;
  1488. X     char pcode, *color;
  1489. X     long plansize;
  1490. X     char *comment_str;
  1491. X{
  1492. X  static int def[128], *coord[128];
  1493. X#define MOONR    5
  1494. X#define DTR(x)    ((x)*.0174532925199)
  1495. X  static char    moon[2*MOONR+1][2*MOONR+2];
  1496. X  int    *tcoord;
  1497. X  int i;
  1498. X
  1499. X    D_color(color);
  1500. X  if (!def[pcode]) {
  1501. X    def[pcode] = 1;
  1502. X    switch (pcode) {
  1503. X    case 'S':
  1504. X      tcoord = cimage(Sun);
  1505. X      break;
  1506. X    case 'L':
  1507. X      tcoord = cimage(Luna);
  1508. X      break;
  1509. X    case 'M':
  1510. X      tcoord = cimage(Mercury);
  1511. X      break;
  1512. X    case 'V':
  1513. X      tcoord = cimage(Venus);
  1514. X      break;
  1515. X    case 'm':
  1516. X      tcoord = cimage(Mars);
  1517. X      break;
  1518. X    case 'J':
  1519. X      tcoord = cimage(Jupiter);
  1520. X      break;
  1521. X    case 's':
  1522. X      tcoord = cimage(Saturn);
  1523. X      break;
  1524. X    case 'U':
  1525. X      tcoord = cimage(Uranus);
  1526. X      break;
  1527. X    case 'N':
  1528. X      tcoord = cimage(Neptune);
  1529. X      break;
  1530. X    case 'P':
  1531. X      tcoord = cimage(Pluto);
  1532. X      break;
  1533. X    case 'C':
  1534. X      tcoord = cimage(Comet);
  1535. X      break;
  1536. X    case 'A':
  1537. X      tcoord = cimage(Aster);
  1538. X      break;
  1539. X    default:
  1540. X      tcoord = cimage(Unk_U);
  1541. X      break;
  1542. X    }
  1543. X    coord[pcode] = tcoord;
  1544. X  }
  1545. X
  1546. X  i = 0;
  1547. X  while (coord[pcode][i] != ENDCOORD) {
  1548. X    drawlen (x, y, coord[pcode][i], coord[pcode][i+1],
  1549. X         coord[pcode][i+2]);
  1550. X    i += 3;
  1551. X  }
  1552. X    D_color(" ");
  1553. X}
  1554. X
  1555. X
  1556. XdrawGalx(x, y, mag, type, color, nebsize)
  1557. Xint x, y;
  1558. Xdouble mag;
  1559. Xchar type, *color;
  1560. Xlong nebsize;        /* -1 should give default size */
  1561. X{
  1562. X    static int defSpiral, *coordSpiral;
  1563. X    static int defEll, *coordEll;
  1564. X    int    *coord;
  1565. X    int i;
  1566. X
  1567. X    D_color(color);
  1568. X    switch (type)
  1569. X        {
  1570. X    case 'S':
  1571. X    default:
  1572. X        if  (!defSpiral) {
  1573. X        defSpiral = 1;
  1574. X        coordSpiral = cimage(Gal_S);
  1575. X        }
  1576. X        coord = coordSpiral;
  1577. X        break;
  1578. X    case 'E':
  1579. X        if (!defEll) {
  1580. X        defEll = 1;
  1581. X        coordEll = cimage(Gal_E);
  1582. X        }
  1583. X        coord = coordEll;
  1584. X        break;
  1585. X        }
  1586. X
  1587. X    i = 0;
  1588. X    while (coord [i] != ENDCOORD) {
  1589. X        drawlen (x, y, coord [i], coord [i+1], coord [i+2]);
  1590. X        i += 3;
  1591. X    }
  1592. X    D_color(" ");
  1593. X}
  1594. X
  1595. XdrawClus(x, y, mag, type, color, nebsize)
  1596. Xint x, y;
  1597. Xdouble mag;
  1598. Xchar type, *color;
  1599. Xlong nebsize;        /* -1 should give default size */
  1600. X{
  1601. X    static int defGlob, *coordGlob;
  1602. X    static int defOpen, *coordOpen;
  1603. X    int    *coord;
  1604. X    int i;
  1605. X
  1606. X    D_color(color);
  1607. X    switch (type)
  1608. X        {
  1609. X    case 'G':
  1610. X        if (!defGlob) {
  1611. X        defGlob = 1;
  1612. X        coordGlob = cimage(Clu_G);
  1613. X        }
  1614. X        coord = coordGlob;
  1615. X        break;
  1616. X    case 'O':
  1617. X    default:
  1618. X        if  (! defOpen) {
  1619. X        defOpen = 1;
  1620. X        coordOpen = cimage(Clu_O);
  1621. X        }
  1622. X        coord = coordOpen;
  1623. X        break;
  1624. X        }
  1625. X
  1626. X    i = 0;
  1627. X    while (coord [i] != ENDCOORD) {
  1628. X        drawlen (x, y, coord [i], coord [i+1], coord [i+2]);
  1629. X        i += 3;
  1630. X    }
  1631. X    D_color(" ");
  1632. X}
  1633. X
  1634. XdrawNebu(x, y, mag, type, color, nebsize)
  1635. Xint x, y;
  1636. Xdouble mag;
  1637. Xchar type, *color;
  1638. Xlong nebsize;        /* -1 should give default size */
  1639. X{
  1640. X    static int defDiff, *coordDiff;
  1641. X    static int defPlan, *coordPlan;
  1642. X    int    *coord;
  1643. X    int i;
  1644. X
  1645. X    D_color(color);
  1646. X    switch (type)
  1647. X        {
  1648. X    case 'P':
  1649. X        if  (!defPlan) {
  1650. X        defPlan = 1;
  1651. X        coordPlan = cimage(Neb_P);
  1652. X        }
  1653. X        coord = coordPlan;
  1654. X        break;
  1655. X    default:
  1656. X    case 'D':
  1657. X        if (!defDiff) {
  1658. X        defDiff = 1;
  1659. X        coordDiff = cimage(Neb_D);
  1660. X        }
  1661. X        coord = coordDiff;
  1662. X        break;
  1663. X        }
  1664. X
  1665. X    i = 0;
  1666. X    while (coord [i] != ENDCOORD) {
  1667. X        drawlen (x, y, coord [i], coord [i+1], coord [i+2]);
  1668. X        i += 3;
  1669. X    }
  1670. X    D_color(" ");
  1671. X}
  1672. X
  1673. XdrawUnknown(x, y, mag, type, color, nebsize)
  1674. Xint x, y;
  1675. Xdouble mag;
  1676. Xchar type, *color;
  1677. Xlong nebsize;        /* -1 should give default size */
  1678. X{
  1679. X    static int defUnk, *coordUnk;
  1680. X    int    *coord;
  1681. X    int i;
  1682. X
  1683. X    D_color(color);
  1684. X    switch (type)
  1685. X        {
  1686. X        case ' ':
  1687. X    default:
  1688. X        if (!defUnk) {
  1689. X        defUnk = 1;
  1690. X        coordUnk = cimage(Unk_U);
  1691. X        }
  1692. X        coord = coordUnk;
  1693. X        break;
  1694. X        }
  1695. X
  1696. X    i = 0;
  1697. X    while (coord [i] != ENDCOORD) {
  1698. X        drawlen (x, y, coord [i], coord [i+1], coord [i+2]);
  1699. X        i += 3;
  1700. X    }
  1701. X    D_color(" ");
  1702. X}
  1703. X
  1704. XdrawOther(x, y, mag, type, color, nebsize)
  1705. Xint x, y;
  1706. Xdouble mag;
  1707. Xchar type, *color;
  1708. Xlong nebsize;        /* -1 should give default size */
  1709. X{
  1710. X    static int defOthr_O, *coordOthr_O;
  1711. X    int    *coord;
  1712. X    int i;
  1713. X
  1714. X    D_color(color);
  1715. X    switch (type)
  1716. X        {
  1717. X        case ' ':
  1718. X    default:
  1719. X        if (!defOthr_O) {
  1720. X        defOthr_O = 1;
  1721. X        coordOthr_O = cimage(Other_O);
  1722. X        }
  1723. X        coord = coordOthr_O;
  1724. X        break;
  1725. X        }
  1726. X
  1727. X    i = 0;
  1728. X    while (coord [i] != ENDCOORD) {
  1729. X        drawlen (x, y, coord [i], coord [i+1], coord [i+2]);
  1730. X        i += 3;
  1731. X    }
  1732. X    D_color(" ");
  1733. X}
  1734. X
  1735. X
  1736. X#ifdef AREAS
  1737. X/* Functions for areas, drawn as lines for now */
  1738. Xstatic struct {int x,y;} areapts[1000];
  1739. Xstatic int nareapts;
  1740. X/* Move to (x, y) to begin an area */
  1741. XD_areamove(x, y)
  1742. X     int x, y;
  1743. X{
  1744. X  nareapts = 0;
  1745. X  areapts[nareapts].x = x;
  1746. X  areapts[nareapts].y = y;
  1747. X  nareapts++;
  1748. X}
  1749. X
  1750. X/* Add a segment to the area border */
  1751. XD_areaadd(x, y)
  1752. X     int x, y;
  1753. X{
  1754. X  areapts[nareapts].x = x;
  1755. X  areapts[nareapts].y = y;
  1756. X  nareapts++;
  1757. X}
  1758. X
  1759. X/* Fill the area, after adding the last segment */
  1760. XD_areafill(x, y)
  1761. X     int x, y;
  1762. X{
  1763. X  int i;
  1764. X
  1765. X  areapts[nareapts].x = x;
  1766. X  areapts[nareapts].y = y;
  1767. X  nareapts++;
  1768. X
  1769. X
  1770. X  D_move(areapts[0].x, areapts[0].y);
  1771. X
  1772. X  for (i = 1; i < nareapts; i++)
  1773. X    D_draw(areapts[i].x, areapts[i].y);
  1774. X}
  1775. X#endif
  1776. X
  1777. X
  1778. X
  1779. X
  1780. X/* Note externs which are used */
  1781. X
  1782. Xchartlegend(win)
  1783. X     mapwindow *win;
  1784. X{
  1785. X  char ras[20], dls[20], outstr[40];
  1786. X  if (!title[0]) title = "LEGEND";
  1787. X  rastr(ras, win->racen);
  1788. X  declstr(dls, win->dlcen);
  1789. X
  1790. X  if (win->map_type != FULLPAGEMAP) {
  1791. X    sprintf(outstr, "(%s,%s lim: %2.1f)", ras, dls, win->maglim);
  1792. X    D_fontsize(titlesize, titlefnt); D_text(l_lmar1, l_til, title, FALSE);
  1793. X    D_fontsize(subtlsize, subtlfnt); D_text(l_lmar1, l_stil, outstr, FALSE);
  1794. X    
  1795. X    drawStar(l_lmar2, l_line1, 0.0, 'S', "  ");
  1796. X    D_fontsize(namesize, namefnt);
  1797. X    D_text(l_ltext, l_line1,"<0.5", FALSE);
  1798. X    if (win->maglim >= 0.5)
  1799. X      {
  1800. X    drawStar(l_rmar2, l_line1, 1.0, 'S', "  ");
  1801. X    D_fontsize(namesize, namefnt);
  1802. X    D_text( l_rtext, l_line1,"<1.5", FALSE);
  1803. X      }
  1804. X    if (win->maglim >= 1.5)
  1805. X      {
  1806. X    drawStar(l_lmar2, l_line2, 2.0, 'S', "  ");
  1807. X    D_fontsize(namesize, namefnt);
  1808. X    D_text(l_ltext, l_line2,"<2.5", FALSE);
  1809. X      }
  1810. X    if (win->maglim >= 2.5)
  1811. X      {
  1812. X    drawStar(l_rmar2, l_line2, 3.0, 'S', "  ");
  1813. X    D_fontsize(namesize, namefnt);
  1814. X    D_text(l_rtext, l_line2,"<3.5", FALSE);
  1815. X      }
  1816. X    if (win->maglim >= 3.5)
  1817. X      {
  1818. X    drawStar(l_lmar2, l_line3, 4.0, 'S', "  ");
  1819. X    D_fontsize(namesize, namefnt);
  1820. X    D_text(l_ltext, l_line3,"<4.5", FALSE);
  1821. X      }
  1822. X    if (win->maglim > 4.5)
  1823. X      {
  1824. X    drawStar(l_rmar2, l_line3, 5.0, 'S', "  ");
  1825. X    D_fontsize(namesize, namefnt);
  1826. X    D_text(l_rtext, l_line3,">4.5", FALSE);
  1827. X      }
  1828. X    
  1829. X    D_fontsize(namesize, namefnt);
  1830. X    D_text(l_ltext,l_line4,"double", FALSE);
  1831. X    drawStar(l_lmar2,l_line4,2.0, 'D', "  ");
  1832. X    D_fontsize(namesize, namefnt);
  1833. X    D_text(l_rtext,l_line4,"variable",FALSE);
  1834. X    drawStar(l_rmar2,l_line4,2.0, 'V', "  ");
  1835. X
  1836. X    D_fontsize(namesize, namefnt);
  1837. X    D_text(l_ltext,l_line5,"planet", FALSE);
  1838. X    drawPlan(l_lmar2,l_line5,1.0, ' ', "  ", (long) -1, "");
  1839. X
  1840. X    D_fontsize(namesize, namefnt);
  1841. X    D_text(l_rtext,l_line5,"galaxy", FALSE);
  1842. X    drawGalx(l_rmar2,l_line5,1.0, 'E', "  ", (long) -1);
  1843. X    drawGalx(l_rmar1,l_line5,1.0, 'S', "  ", (long) -1);
  1844. X
  1845. X    D_fontsize(namesize, namefnt);
  1846. X    D_text(l_ltext,l_line6,"nebula", FALSE);
  1847. X    drawNebu(l_lmar2,l_line6,1.0, 'D', "  ", (long) -1);
  1848. X    drawNebu( l_lmar1,l_line6,1.0, 'P', "  ", (long) -1);
  1849. X
  1850. X    D_fontsize(namesize, namefnt);
  1851. X    D_text(l_rtext,l_line6,"cluster", FALSE);
  1852. X    drawClus(l_rmar2,l_line6,1.0, 'O', "  ", (long) -1);
  1853. X    drawClus(l_rmar1,l_line6,1.0, 'G', "  ", (long) -1);
  1854. X  } else {
  1855. X    D_fontsize(namesize, namefnt);
  1856. X
  1857. X    sprintf(outstr, "%s: %s,%s lim: %2.1f", title, ras, dls, win->maglim);
  1858. X    D_text(15, 15, outstr, FALSE);
  1859. X  }
  1860. X}
  1861. X
  1862. X
  1863. X
  1864. END_OF_FILE
  1865. if test 37431 -ne `wc -c <'starchart/starimages.c'`; then
  1866.     echo shar: \"'starchart/starimages.c'\" unpacked with wrong size!
  1867. fi
  1868. # end of 'starchart/starimages.c'
  1869. fi
  1870. echo shar: End of archive 28 \(of 32\).
  1871. cp /dev/null ark28isdone
  1872. MISSING=""
  1873. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ; do
  1874.     if test ! -f ark${I}isdone ; then
  1875.     MISSING="${MISSING} ${I}"
  1876.     fi
  1877. done
  1878. if test "${MISSING}" = "" ; then
  1879.     echo You have unpacked all 32 archives.
  1880.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1881. else
  1882.     echo You still need to unpack the following archives:
  1883.     echo "        " ${MISSING}
  1884. fi
  1885. ##  End of shell archive.
  1886. exit 0
  1887.  
  1888.