123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976 |
- #include "sys-defines.h"
- #include "extern.h"
- #define MAX_COLOR_NAME_LEN 32
- #ifndef LIBPLOTTER
- const Plotter _pl_h_default_plotter =
- {
-
- _pl_h_initialize, _pl_h_terminate,
-
- _pl_h_begin_page, _pl_h_erase_page, _pl_h_end_page,
-
- _pl_g_push_state, _pl_g_pop_state,
-
- _pl_h_paint_path, _pl_h_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments,
-
- _pl_g_paint_marker, _pl_h_paint_point,
-
- _pl_g_paint_text_string_with_escapes, _pl_h_paint_text_string,
- _pl_g_get_text_width,
-
- _pl_g_retrieve_font,
-
- _pl_g_flush_output,
-
- _pl_g_warning,
- _pl_g_error,
- };
- #endif
- #ifndef LIBPLOTTER
- const Plotter _pl_q_default_plotter =
- {
-
- _pl_q_initialize, _pl_q_terminate,
-
- _pl_h_begin_page, _pl_h_erase_page, _pl_h_end_page,
-
- _pl_g_push_state, _pl_g_pop_state,
-
- _pl_h_paint_path, _pl_h_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments,
-
- _pl_g_paint_marker, _pl_h_paint_point,
-
- _pl_g_paint_text_string_with_escapes, _pl_h_paint_text_string,
- _pl_g_get_text_width,
-
- _pl_g_retrieve_font,
-
- _pl_g_flush_output,
-
- _pl_g_warning,
- _pl_g_error,
- };
- #endif
- void
- _pl_h_initialize (S___(Plotter *_plotter))
- {
- int i;
- #ifndef LIBPLOTTER
-
- _pl_g_initialize (S___(_plotter));
- #endif
-
- #ifndef LIBPLOTTER
-
- _plotter->data->type = PL_HPGL;
- #endif
-
- _plotter->data->output_model = PL_OUTPUT_ONE_PAGE_AT_A_TIME;
-
- _plotter->data->have_wide_lines = 1;
- _plotter->data->have_dash_array = 1;
- _plotter->data->have_solid_fill = 1;
- _plotter->data->have_odd_winding_fill = 1;
- _plotter->data->have_nonzero_winding_fill = 1;
- _plotter->data->have_settable_bg = 0;
- _plotter->data->have_escaped_string_support = 0;
- #ifdef USE_PS_FONTS_IN_PCL
- _plotter->data->have_ps_fonts = 1;
- #else
- _plotter->data->have_ps_fonts = 0;
- #endif
- _plotter->data->have_pcl_fonts = 1;
- _plotter->data->have_stick_fonts = 1;
- _plotter->data->have_extra_stick_fonts = 1;
- _plotter->data->have_other_fonts = 0;
-
- _plotter->data->default_font_type = PL_F_HERSHEY;
- _plotter->data->pcl_before_ps = true;
- _plotter->data->have_horizontal_justification = false;
- _plotter->data->have_vertical_justification = false;
- _plotter->data->kern_stick_fonts = true;
- _plotter->data->issue_font_warning = true;
-
- _plotter->data->have_mixed_paths = true;
- _plotter->data->allowed_arc_scaling = AS_UNIFORM;
- _plotter->data->allowed_ellarc_scaling = AS_NONE;
- _plotter->data->allowed_quad_scaling = AS_NONE;
- _plotter->data->allowed_cubic_scaling = AS_NONE;
- _plotter->data->allowed_box_scaling = AS_AXES_PRESERVED;
- _plotter->data->allowed_circle_scaling = AS_UNIFORM;
- _plotter->data->allowed_ellipse_scaling = AS_NONE;
-
- _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL;
- _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI;
- _plotter->data->flipped_y = false;
- _plotter->data->imin = 0;
- _plotter->data->imax = 0;
- _plotter->data->jmin = 0;
- _plotter->data->jmax = 0;
- _plotter->data->xmin = HPGL_SCALED_DEVICE_LEFT;
- _plotter->data->xmax = HPGL_SCALED_DEVICE_RIGHT;
- _plotter->data->ymin = HPGL_SCALED_DEVICE_BOTTOM;
- _plotter->data->ymax = HPGL_SCALED_DEVICE_TOP;
- _plotter->data->page_data = (plPageData *)NULL;
-
- _compute_ndc_to_device_map (_plotter->data);
-
-
- _plotter->hpgl_version = 2;
- _plotter->hpgl_rotation = 0;
- _plotter->hpgl_p1.x = 0.0;
- _plotter->hpgl_p1.y = 8128.0;
- _plotter->hpgl_p2.x = 0.0;
- _plotter->hpgl_p2.y = 8128.0;
- _plotter->hpgl_plot_length = 10668.0;
- _plotter->hpgl_have_screened_vectors = false;
- _plotter->hpgl_have_char_fill = false;
- _plotter->hpgl_can_assign_colors = false;
- _plotter->hpgl_use_opaque_mode = true;
-
-
- _plotter->hpgl_pen = 1;
- _plotter->hpgl_free_pen = 2;
- _plotter->hpgl_bad_pen = false;
- _plotter->hpgl_pendown = false;
- _plotter->hpgl_pen_width = 0.001;
- _plotter->hpgl_line_type = HPGL_L_SOLID;
- _plotter->hpgl_cap_style = HPGL_CAP_BUTT;
- _plotter->hpgl_join_style = HPGL_JOIN_MITER;
- _plotter->hpgl_miter_limit = 5.0;
- _plotter->hpgl_pen_type = HPGL_PEN_SOLID;
- _plotter->hpgl_pen_option1 = 0.0;
- _plotter->hpgl_pen_option2 = 0.0;
- _plotter->hpgl_fill_type = HPGL_FILL_SOLID_BI;
- _plotter->hpgl_fill_option1 = 0.0;
- _plotter->hpgl_fill_option2 = 0.0;
- _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE;
- _plotter->hpgl_symbol_set = PCL_ROMAN_8;
- _plotter->hpgl_spacing = 0;
- _plotter->hpgl_posture = 0;
- _plotter->hpgl_stroke_weight = 0;
- _plotter->hpgl_pcl_typeface = PCL_STICK_TYPEFACE;
- _plotter->hpgl_charset_lower = HPGL_CHARSET_ASCII;
- _plotter->hpgl_charset_upper = HPGL_CHARSET_ASCII;
- _plotter->hpgl_rel_char_height = 0.0;
- _plotter->hpgl_rel_char_width = 0.0;
- _plotter->hpgl_rel_label_rise = 0.0;
- _plotter->hpgl_rel_label_run = 0.0;
- _plotter->hpgl_tan_char_slant = 0.0;
- _plotter->hpgl_position_is_unknown = true;
- _plotter->hpgl_pos.x = 0;
- _plotter->hpgl_pos.y = 0;
-
-
-
-
- {
- const char *version_s;
-
- version_s = (const char *)_get_plot_param (_plotter->data, "HPGL_VERSION");
-
- if (strcmp (version_s, "1") == 0)
- {
- _plotter->hpgl_version = 0;
- _plotter->data->have_wide_lines = 0;
- _plotter->data->have_dash_array = 0;
- _plotter->data->have_solid_fill = 0;
- _plotter->data->have_odd_winding_fill = 1;
- _plotter->data->have_nonzero_winding_fill = 0;
- _plotter->data->have_ps_fonts = 0;
- _plotter->data->have_pcl_fonts = 0;
- _plotter->data->have_stick_fonts = 1;
- _plotter->data->have_extra_stick_fonts = 0;
- _plotter->data->kern_stick_fonts = true;
- _plotter->data->have_other_fonts = 0;
- }
- else if (strcmp (version_s, "1.5") == 0)
- {
- _plotter->hpgl_version = 1;
- _plotter->data->have_wide_lines = 0;
- _plotter->data->have_dash_array = 0;
- _plotter->data->have_solid_fill = 1;
- _plotter->data->have_odd_winding_fill = 1;
- _plotter->data->have_nonzero_winding_fill = 0;
- _plotter->data->have_ps_fonts = 0;
- _plotter->data->have_pcl_fonts = 0;
- _plotter->data->have_stick_fonts = 1;
- _plotter->data->have_extra_stick_fonts = 1;
- _plotter->data->kern_stick_fonts = true;
- _plotter->data->have_other_fonts = 0;
- }
- }
-
-
-
- {
-
- _set_page_type (_plotter->data);
-
-
- _plotter->hpgl_p1.x = (HPGL_UNITS_PER_INCH
- * (0.0
- + _plotter->data->viewport_xoffset));
- _plotter->hpgl_p2.x = (HPGL_UNITS_PER_INCH
- * (0.0
- + _plotter->data->viewport_xoffset
- + _plotter->data->viewport_xsize));
- _plotter->hpgl_p1.y = (HPGL_UNITS_PER_INCH
- * (0.0
- + _plotter->data->viewport_yoffset));
- _plotter->hpgl_p2.y = (HPGL_UNITS_PER_INCH
- * (0.0
- + _plotter->data->viewport_yoffset
- + _plotter->data->viewport_ysize));
-
- _plotter->data->xmin = HPGL_SCALED_DEVICE_LEFT;
- _plotter->data->xmax = HPGL_SCALED_DEVICE_RIGHT;
- _plotter->data->ymin = HPGL_SCALED_DEVICE_BOTTOM;
- _plotter->data->ymax = HPGL_SCALED_DEVICE_TOP;
-
- _plotter->hpgl_plot_length =
- _plotter->data->page_data->hpgl2_plot_length * HPGL_UNITS_PER_INCH;
- }
-
- {
- const char *rotate_s;
- rotate_s = (const char *)_get_plot_param (_plotter->data, "HPGL_ROTATE");
-
- if (strcasecmp (rotate_s, "yes") == 0
- || strcmp (rotate_s, "90") == 0)
- _plotter->hpgl_rotation = 90;
- else if (strcmp (rotate_s, "180") == 0 && _plotter->hpgl_version == 2)
- _plotter->hpgl_rotation = 180;
- else if (strcmp (rotate_s, "270") == 0 && _plotter->hpgl_version == 2)
- _plotter->hpgl_rotation = 270;
- else
- _plotter->hpgl_rotation = 0;
- }
-
- {
- const char *transparent_s;
- transparent_s = (const char *)_get_plot_param (_plotter->data, "HPGL_OPAQUE_MODE" );
- if (strcasecmp (transparent_s, "no") == 0)
- _plotter->hpgl_use_opaque_mode = false;
- }
-
-
- if (_plotter->hpgl_version == 2)
- {
- const char *palette_s;
-
- palette_s = (const char *)_get_plot_param (_plotter->data, "HPGL_ASSIGN_COLORS");
- if (strcasecmp (palette_s, "yes") == 0)
- _plotter->hpgl_can_assign_colors = true;
- }
-
-
- for (i = 0; i < HPGL2_MAX_NUM_PENS; i++)
- _plotter->hpgl_pen_defined[i] = 0;
-
-
- _plotter->hpgl_pen_color[0].red = 255;
- _plotter->hpgl_pen_color[0].green = 255;
- _plotter->hpgl_pen_color[0].blue = 255;
- _plotter->hpgl_pen_defined[0] = 2;
-
-
- {
- const char *pen_s;
- pen_s = (const char *)_get_plot_param (_plotter->data, "HPGL_PENS");
-
- if (pen_s == NULL
- || _pl_h_parse_pen_string (R___(_plotter) pen_s) == false
- || (_plotter->hpgl_can_assign_colors == false
- && _plotter->hpgl_pen_defined[1] == 0))
-
- {
- if (_plotter->hpgl_version == 0)
- pen_s = HPGL_DEFAULT_PEN_STRING;
- else
- pen_s = HPGL2_DEFAULT_PEN_STRING;
- _pl_h_parse_pen_string (R___(_plotter) pen_s);
- }
- }
-
-
- {
- bool undefined_pen_seen = false;
-
- for (i = 2; i < HPGL2_MAX_NUM_PENS; i++)
- {
- if (_plotter->hpgl_pen_defined[i] == 0)
-
- {
-
- _plotter->hpgl_free_pen = i;
- undefined_pen_seen = true;
- break;
- }
- }
- if (!undefined_pen_seen)
-
- _plotter->hpgl_can_assign_colors = false;
- }
- }
- void
- _pl_q_initialize (S___(Plotter *_plotter))
- {
- int i;
- #ifndef LIBPLOTTER
-
- _pl_h_initialize (S___(_plotter));
- #endif
-
- #ifndef LIBPLOTTER
-
- _plotter->data->type = PL_PCL;
- #endif
-
- _plotter->data->output_model = PL_OUTPUT_ONE_PAGE_AT_A_TIME;
-
- _plotter->data->have_wide_lines = 1;
- _plotter->data->have_dash_array = 1;
- _plotter->data->have_solid_fill = 1;
- _plotter->data->have_odd_winding_fill = 1;
- _plotter->data->have_nonzero_winding_fill = 1;
- _plotter->data->have_settable_bg = 0;
- _plotter->data->have_escaped_string_support = 0;
- #ifdef USE_PS_FONTS_IN_PCL
- _plotter->data->have_ps_fonts = 1;
- #else
- _plotter->data->have_ps_fonts = 0;
- #endif
- _plotter->data->have_pcl_fonts = 1;
- _plotter->data->have_stick_fonts = 1;
- _plotter->data->have_extra_stick_fonts = 0;
- _plotter->data->have_other_fonts = 0;
-
- _plotter->data->default_font_type = PL_F_PCL;
- _plotter->data->pcl_before_ps = true;
- _plotter->data->have_horizontal_justification = false;
- _plotter->data->have_vertical_justification = false;
- _plotter->data->kern_stick_fonts = false;
- _plotter->data->issue_font_warning = true;
-
- _plotter->data->have_mixed_paths = true;
- _plotter->data->allowed_arc_scaling = AS_UNIFORM;
- _plotter->data->allowed_ellarc_scaling = AS_NONE;
- _plotter->data->allowed_quad_scaling = AS_NONE;
- _plotter->data->allowed_cubic_scaling = AS_ANY;
- _plotter->data->allowed_box_scaling = AS_AXES_PRESERVED;
- _plotter->data->allowed_circle_scaling = AS_UNIFORM;
- _plotter->data->allowed_ellipse_scaling = AS_NONE;
-
- _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL;
- _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI;
- _plotter->data->flipped_y = false;
- _plotter->data->imin = 0;
- _plotter->data->imax = 0;
- _plotter->data->jmin = 0;
- _plotter->data->jmax = 0;
- _plotter->data->xmin = HPGL_SCALED_DEVICE_LEFT;
- _plotter->data->xmax = HPGL_SCALED_DEVICE_RIGHT;
- _plotter->data->ymin = HPGL_SCALED_DEVICE_BOTTOM;
- _plotter->data->ymax = HPGL_SCALED_DEVICE_TOP;
- _plotter->data->page_data = (plPageData *)NULL;
-
- _compute_ndc_to_device_map (_plotter->data);
-
-
- _plotter->hpgl_version = 2;
- _plotter->hpgl_rotation = 0;
- _plotter->hpgl_p1.x = 0.0;
- _plotter->hpgl_p1.y = 8128.0;
- _plotter->hpgl_p2.x = 0.0;
- _plotter->hpgl_p2.y = 8128.0;
- _plotter->hpgl_plot_length = 10668.0;
- _plotter->hpgl_have_screened_vectors = true;
- _plotter->hpgl_have_char_fill = true;
- _plotter->hpgl_can_assign_colors = false;
- _plotter->hpgl_use_opaque_mode = true;
-
-
- _plotter->hpgl_pen = 1;
- _plotter->hpgl_free_pen = 2;
- _plotter->hpgl_bad_pen = false;
- _plotter->hpgl_pendown = false;
- _plotter->hpgl_pen_width = 0.001;
- _plotter->hpgl_line_type = HPGL_L_SOLID;
- _plotter->hpgl_cap_style = HPGL_CAP_BUTT;
- _plotter->hpgl_join_style = HPGL_JOIN_MITER;
- _plotter->hpgl_miter_limit = 5.0;
- _plotter->hpgl_pen_type = HPGL_PEN_SOLID;
- _plotter->hpgl_pen_option1 = 0.0;
- _plotter->hpgl_pen_option2 = 0.0;
- _plotter->hpgl_fill_type = HPGL_FILL_SOLID_BI;
- _plotter->hpgl_fill_option1 = 0.0;
- _plotter->hpgl_fill_option2 = 0.0;
- _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE;
- _plotter->hpgl_symbol_set = PCL_ROMAN_8;
- _plotter->hpgl_spacing = 0;
- _plotter->hpgl_posture = 0;
- _plotter->hpgl_stroke_weight = 0;
- _plotter->hpgl_pcl_typeface = PCL_STICK_TYPEFACE;
- _plotter->hpgl_charset_lower = HPGL_CHARSET_ASCII;
- _plotter->hpgl_charset_upper = HPGL_CHARSET_ASCII;
- _plotter->hpgl_rel_char_height = 0.0;
- _plotter->hpgl_rel_char_width = 0.0;
- _plotter->hpgl_rel_label_rise = 0.0;
- _plotter->hpgl_rel_label_run = 0.0;
- _plotter->hpgl_tan_char_slant = 0.0;
-
-
-
-
-
- {
-
- _set_page_type (_plotter->data);
-
-
-
- _plotter->hpgl_p1.x = (HPGL_UNITS_PER_INCH
- * (_plotter->data->viewport_xorigin
- + _plotter->data->viewport_xoffset
- - _plotter->data->page_data->pcl_hpgl2_xorigin));
- _plotter->hpgl_p2.x = (HPGL_UNITS_PER_INCH
- * (_plotter->data->viewport_xorigin
- + _plotter->data->viewport_xoffset
- + _plotter->data->viewport_xsize
- - _plotter->data->page_data->pcl_hpgl2_xorigin));
- _plotter->hpgl_p1.y = (HPGL_UNITS_PER_INCH
- * (_plotter->data->viewport_yorigin
- + _plotter->data->viewport_yoffset
- - _plotter->data->page_data->pcl_hpgl2_yorigin));
- _plotter->hpgl_p2.y = (HPGL_UNITS_PER_INCH
- * (_plotter->data->viewport_yorigin
- + _plotter->data->viewport_yoffset
- + _plotter->data->viewport_ysize
- - _plotter->data->page_data->pcl_hpgl2_yorigin));
-
- _plotter->hpgl_plot_length =
- _plotter->data->page_data->hpgl2_plot_length * HPGL_UNITS_PER_INCH;
- }
-
- _plotter->hpgl_rotation = 0;
-
- _plotter->hpgl_can_assign_colors = false;
- {
- const char *palette_s;
-
- palette_s = (const char *)_get_plot_param (_plotter->data, "PCL_ASSIGN_COLORS");
- if (strcasecmp (palette_s, "yes") == 0)
- _plotter->hpgl_can_assign_colors = true;
- }
-
-
- {
- const char *bezier_s;
-
- bezier_s = (const char *)_get_plot_param (_plotter->data, "PCL_BEZIERS");
- if (strcasecmp (bezier_s, "yes") != 0)
- _plotter->data->allowed_cubic_scaling = AS_NONE;
- }
-
- for (i = 0; i < HPGL2_MAX_NUM_PENS; i++)
- _plotter->hpgl_pen_defined[i] = 0;
-
-
- _plotter->hpgl_pen_color[0].red = 255;
- _plotter->hpgl_pen_color[0].green = 255;
- _plotter->hpgl_pen_color[0].blue = 255;
- _plotter->hpgl_pen_defined[0] = 2;
-
-
- {
- const char *pen_s;
- pen_s = HPGL2_DEFAULT_PEN_STRING;
- _pl_h_parse_pen_string (R___(_plotter) pen_s);
- }
-
-
- {
- bool undefined_pen_seen = false;
-
- for (i = 2; i < HPGL2_MAX_NUM_PENS; i++)
- {
- if (_plotter->hpgl_pen_defined[i] == 0)
-
- {
-
- _plotter->hpgl_free_pen = i;
- undefined_pen_seen = true;
- break;
- }
- }
- if (!undefined_pen_seen)
-
- _plotter->hpgl_can_assign_colors = false;
- }
- }
- bool
- _pl_h_parse_pen_string (R___(Plotter *_plotter) const char *pen_s)
- {
- const char *charp;
- char name[MAX_COLOR_NAME_LEN];
- int i;
- charp = pen_s;
- while (*charp)
- {
- int pen_num;
- bool got_digit;
- const char *tmp;
- plColor color;
- if (*charp == ':')
- {
- charp++;
- continue;
- }
- pen_num = 0;
- got_digit = false;
- while (*charp >= '0' && *charp <= '9')
- {
- pen_num = 10 * pen_num + (int)*charp - (int)'0';
- got_digit = true;
- charp++;
- }
- if (!got_digit || pen_num < 1 || pen_num >= HPGL2_MAX_NUM_PENS)
- return false;
- if (*charp != '=')
- return false;
- charp++;
- for (tmp = charp, i = 0; i < MAX_COLOR_NAME_LEN; tmp++, i++)
- {
- if (*tmp == ':')
- {
- name[i] = '\0';
- charp = tmp + 1;
- break;
- }
- else if (*tmp == '\0')
- {
- name[i] = '\0';
- charp = tmp;
- break;
- }
- else
- name[i] = *tmp;
- }
-
- if (_string_to_color (name, &color, _plotter->data->color_name_cache))
- {
- _plotter->hpgl_pen_color[pen_num] = color;
- _plotter->hpgl_pen_defined[pen_num] = 2;
- }
- else
- return false;
- }
- return true;
- }
- void
- _pl_h_terminate (S___(Plotter *_plotter))
- {
- #ifndef LIBPLOTTER
-
- _pl_g_terminate (S___(_plotter));
- #endif
- }
- void
- _pl_q_terminate (S___(Plotter *_plotter))
- {
- #ifndef LIBPLOTTER
-
- _pl_h_terminate (S___(_plotter));
- #endif
- }
- #ifdef LIBPLOTTER
- HPGLPlotter::HPGLPlotter (FILE *infile, FILE *outfile, FILE *errfile)
- :Plotter (infile, outfile, errfile)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (FILE *outfile)
- :Plotter (outfile)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (istream& in, ostream& out, ostream& err)
- : Plotter (in, out, err)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (ostream& out)
- : Plotter (out)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter ()
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters)
- :Plotter (infile, outfile, errfile, parameters)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (FILE *outfile, PlotterParams ¶meters)
- :Plotter (outfile, parameters)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters)
- : Plotter (in, out, err, parameters)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (ostream& out, PlotterParams ¶meters)
- : Plotter (out, parameters)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::HPGLPlotter (PlotterParams ¶meters)
- : Plotter (parameters)
- {
- _pl_h_initialize ();
- }
- HPGLPlotter::~HPGLPlotter ()
- {
-
- if (_plotter->data->open)
- _API_closepl ();
- _pl_h_terminate ();
- }
- #endif
- #ifdef LIBPLOTTER
- PCLPlotter::PCLPlotter (FILE *infile, FILE *outfile, FILE *errfile)
- :HPGLPlotter (infile, outfile, errfile)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (FILE *outfile)
- :HPGLPlotter (outfile)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (istream& in, ostream& out, ostream& err)
- : HPGLPlotter (in, out, err)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (ostream& out)
- : HPGLPlotter (out)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter ()
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters)
- :HPGLPlotter (infile, outfile, errfile, parameters)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (FILE *outfile, PlotterParams ¶meters)
- :HPGLPlotter (outfile, parameters)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters)
- : HPGLPlotter (in, out, err, parameters)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (ostream& out, PlotterParams ¶meters)
- : HPGLPlotter (out, parameters)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::PCLPlotter (PlotterParams ¶meters)
- : HPGLPlotter (parameters)
- {
- _pl_q_initialize ();
- }
- PCLPlotter::~PCLPlotter ()
- {
-
- if (_plotter->data->open)
- _API_closepl ();
- _pl_q_terminate ();
- }
- #endif
- #ifndef LIBPLOTTER
-
- void
- _maybe_switch_to_hpgl (Plotter *_plotter)
- {
- switch ((int)(_plotter->data->type))
- {
- case (int)PL_HPGL:
- default:
- _pl_h_maybe_switch_to_hpgl (_plotter);
- break;
- case (int)PL_PCL:
- _pl_q_maybe_switch_to_hpgl (_plotter);
- break;
- }
- }
- void
- _maybe_switch_from_hpgl (Plotter *_plotter)
- {
- switch ((int)(_plotter->data->type))
- {
- case (int)PL_HPGL:
- default:
- _pl_h_maybe_switch_from_hpgl (_plotter);
- break;
- case (int)PL_PCL:
- _pl_q_maybe_switch_from_hpgl (_plotter);
- break;
- }
- }
- #endif
|