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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
/***********************************************************************
* star_draw_rules.h : Definition of the list of rules for drawing stars.
***********************************************************************/
/***********************************************************************
* This file is part of SpaceChart.
* Copyright (C) 1999 Miguel Coca <e970095@zipi.fi.upm.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
***********************************************************************/
#ifndef _INCLUDE_STAR_DRAW_RULES_H_
#define _INCLUDE_STAR_DRAW_RULES_H_
#include "starmap.h"
#include "star.h"
#include "star_selection.h"
/* Maximum priority for user defined rules. */
#define PRIORITY_USER_MAX 10
/* Priorities of the rule for each spectral class color. */
#define PRIORITY_SPECTRUM_O 11
#define PRIORITY_SPECTRUM_B 12
#define PRIORITY_SPECTRUM_A 13
#define PRIORITY_SPECTRUM_F 14
#define PRIORITY_SPECTRUM_G 15
#define PRIORITY_SPECTRUM_K 16
#define PRIORITY_SPECTRUM_M 17
#define PRIORITY_SPECTRUM_WD 18
/* Priority used for luminosity rules. */
#define PRIORITY_LUMINOSITY 19
/* Priority used for the rule to display the star name. */
#define PRIORITY_SHOW_NAME 20
#define DEFAULT_SIZE 1
extern double default_color[];
typedef struct st_star_draw_rules star_drawing_rules_t;
/* Create an empty list of rules, using the given attributes as the default. */
star_drawing_rules_t* star_drawing_rules_new( int default_radius,
double default_rgb[] );
/* Add a new rule of the given priority, that applies to stars that match
* selection, and with the attributes given. */
int star_drawing_rules_add( star_drawing_rules_t* rules,
star_selection_t* selection,
int priority,
int radius, double rgb[], int show_name );
/* Find the attributes used to draw the given star. */
void star_drawing_rules_find( star_drawing_rules_t* rules,
star_t* star, int* radius, double rgb[],
int* show_name );
/* Loop over the rules within a priority range. */
void star_drawing_rules_foreach( star_drawing_rules_t* rules,
int min_priority, int max_priority,
void (*function)( star_selection_t* selection,
int is_radius, int radius,
int is_rgb, double rgb[],
int show_name, void *data ),
void *data );
/* Destroy the list. */
void star_drawing_rules_destroy( star_drawing_rules_t* rules );
#endif
|