home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / star.lzh / star.28 < prev    next >
Encoding:
Text File  |  1990-04-06  |  39.7 KB  |  1,881 lines

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