clip.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "clip.h"

Go to the source code of this file.

Classes

struct  LOC_cohen_sutherland_line_clip

Defines

#define TRUE   -1
#define FALSE   0

Typedefs

typedef long outcode

Enumerations

enum  edge { LEFT, RIGHT, BOTTOM, TOP }

Functions

void CompOutCode (double x, double y, outcode *code, struct LOC_cohen_sutherland_line_clip *LINK)
ClipResult cohen_sutherland_line_clip_i (int *x0_, int *y0_, int *x1_, int *y1_, int xmin_, int xmax_, int ymin_, int ymax_)
ClipResult cohen_sutherland_line_clip_d (double *x0, double *y0, double *x1, double *y1, double xmin_, double xmax_, double ymin_, double ymax_)


Define Documentation

#define FALSE   0
 

Definition at line 35 of file clip.c.

Referenced by ViewControl::add_event_obj(), add_GxsmPluginInfo(), Grey2D::add_object(), DSPPeakFindControl::addPFcontrol(), DSPPeakFindControl::addPFfolder(), AngularAnalysis_configure(), AppBase::AppBase(), App::AppWidgetInit(), AppBase::AppWidgetInit(), ViewControl::AppWidgetInit(), V3dControl::AppWidgetInit(), DataBox::atrun(), autocorrelation_run(), SPM_ScanControl::autosave_check(), rhk_ScanControl::autosave_check(), bggamma_run(), BoxEmpty(), BoxFull(), ViewControl::canvas_event_cb(), CCDControl::CCDControl(), ChannelSelector::ChannelSelector(), GnomeAppService::check_file(), Gtk_EntryControl::CheckRemoteCmd(), ChkBoxEmpty(), ChkBoxFull(), App::close_scan_event_cb(), cohen_sutherland_line_clip_d(), MemDigiFilter::Convolve(), App::create_as_control(), App::create_control(), DSPMoverControl::create_folder(), create_GxsmPluginList(), App::create_spa_control(), App::create_spm_control(), App::create_ui_control(), create_window_key_press_event_lcb(), ProfileControl::cur_Ashow_callback(), ProfileControl::cur_Bshow_callback(), ProfileControl::cursor_event(), DataBox::DataBox(), details_callback(), Dialog(), external_converter_Control::dlg_clicked(), converterControl::dlg_clicked(), DlgBase::DlgBase(), DlgBase::DlgDone(), SPM_ScanControl::do_hscapture(), rhk_ScanControl::do_hscapture(), SPM_ScanControl::do_scan(), rhk_ScanControl::do_scan(), Profiles::draw(), Grey2D::draw(), ProfileControl::drawScans(), DriftControl::DriftControl(), DSPControl::DSPControl(), DSPPeakFindControl::DSPPeakFindControl(), DSPProbeControl::DSPProbeControl(), DumpableNcFile::dump_togtkwin(), ec_gtk_spin_button_sci_input(), EpsfTools::EpsfTools(), ViewControl::events_labels_callback(), expose_event(), GnomeAppService::file_dialog(), App::file_exit_callback(), App::file_save_as_callback(), remote_crtl::FindFktExec(), SPM_ScanControl::finish_scan(), rhk_ScanControl::finish_scan(), Focus::Focus(), VObject::follow(), VObPoint::follow_off(), Gtk_EntryControl::Freeze(), get_dport_range(), innovative_dsp_hwi_dev::get_DSP_softinfo(), get_parent(), Focus::getdata(), getintsfromstring(), VObject::GetRn(), V3dControl::glarea_event_cb(), Surf3d::GLdrawscene(), Surf3d::GLvarinit(), gnome_res_apply_info_callback(), gnome_res_new_user_druid_construct_page(), gnome_res_preferences_new(), gnome_res_run_change_user_config(), gnome_res_write_user_config(), Grey2D::Grey2D(), gtk_led_expose(), gtk_led_init(), gtk_led_is_on(), gtk_led_switch(), gtk_spin_button_sci_button_press(), gtk_spin_button_sci_class_init(), gtk_spin_button_sci_default_input(), gtk_spin_button_sci_default_output(), gtk_spin_button_sci_enter_notify(), gtk_spin_button_sci_expose(), gtk_spin_button_sci_get_numeric(), gtk_spin_button_sci_get_snap_to_ticks(), gtk_spin_button_sci_get_wrap(), gtk_spin_button_sci_init(), gtk_spin_button_sci_leave_notify(), gtk_spin_button_sci_motion_notify(), gtk_spin_button_sci_realize(), gtk_spin_button_sci_scroll(), gtk_spin_button_sci_set_numeric(), gtk_spin_button_sci_set_value(), gtk_spin_button_sci_set_wrap(), gtk_spin_button_sci_snap(), gtk_spin_button_sci_stop_spinning(), gtk_spin_button_sci_timer(), gtk_spin_button_sci_update(), gtk_spin_button_sci_value_changed(), App::Gxsm_Plugin_Check(), App::GxsmSplash(), AppBase::hide(), histogram_run(), Xsm::HwI_Plugin_Check(), PNG_ImExportFile::import_data(), Gdat_ImExportFile::import_data(), DataBox::Init(), Mem2d::Init(), DSPControl::init_probedata_arrays(), SPM_ScanControl::initialize_scan_lists(), rhk_ScanControl::initialize_scan_lists(), App::input_func(), RemoteControl::InputFunction(), insert_into_ctree(), LineInfo::invalidate(), islandlbl_configure(), Focus::item_event(), VObject::item_event(), led_bar_clear(), led_bar_new(), led_bar_new_with_decades(), led_bar_unlight_segment(), led_bar_unlight_segments(), LineInfo::LineInfo(), log_z_run(), DataBox::loop(), main(), make_edit(), App::math_twoarg_no_same_size_check_callback(), MkIconsPI(), MonitorControl::MonitorControl(), MyGnomeTools::mygtk_add_input(), MyGnomeTools::mygtk_add_list(), MyGnomeTools::mygtk_add_spin(), nano_manipulatorControl::nano_manipulatorControl(), NanoPlottControl::NanoPlottControl(), ProfileControl::NewData(), Focus::on_Invers_clicked(), Focus::on_SetAuto_clicked(), page_select_callback(), PanView::PanView(), PanView_cleanup(), PanView_tip_refresh_callback(), pcdsp_halt(), pcdsp_initialize(), pcdsp_ioctl(), DSPPeakFindControl::PFfollow(), DSPPeakFindControl::PFtmoutfkt(), PIPrintPS(), RemoteControl::play(), PolarHist_configure(), PolarHist_run(), SPM_ScanControl::prepare_to_start_scan(), rhk_ScanControl::prepare_to_start_scan(), ProbeScan::Probe(), ProbeEntry::ProbeEntry(), ProbeFifoReadThread(), DSPControl::Probing_eventcheck_callback(), DSPControl::Probing_graph_callback(), procedure_clist_select_callback(), procedure_ctree_select_callback(), procedure_general_select_callback(), VObject::properties(), DSPControl::push_probedata_arrays(), GnomeAppService::questioncallback(), r_saveas(), r_WakeUp(), random_number(), ReadBox(), PanView::refresh(), remote::remote(), RemoteControl::RemoteControl(), App::RemoveGxsmSplash(), Surf3d::reshape(), ShmImage2D::Resize(), RemoteControl::resume(), rhk_ScanControl::rhk_ScanControl(), sranger_hwi_spm::RTQuery(), sranger_hwi_dev::RTQuery(), XSM_Hardware::RTQuery(), external_converter_Control::run(), converterControl::run(), PIPrintControl::run(), MkIconsPIControl::run(), RemoteControl::run(), rhk_ScanControl::run_probe(), NanoPlottControl::RunPlott(), SPM_ScanControl::scan_in_progress(), rhk_ScanControl::scan_in_progress(), ScanEvent::ScanEvent(), sranger_hwi_spm::ScanLineM(), innovative_dsp_hwi_spa::ScanLineM(), XSM_Hardware::ScanLineM(), ServiceRequest(), LineProfile1D::SetData(), innovative_dsp_hwi_dev::SetParameter(), SPM_ScanControl::setup_scan(), rhk_ScanControl::setup_scan(), MyGnomeTools::SetupScale(), XSM_Hardware::SetUserParam(), Scan::SetVM(), Gtk_EntryControl::Show(), smallconvol_configure(), SPA_PeakFind_p::SPA_PeakFind_p(), SpaLeedControl::SpaLeedControl(), spasimkz_configure(), spin_button_sci_at_limit(), SPM_ScanControl::SPM_ScanControl(), spm_scancontrol_movie_callback(), spm_scancontrol_start_callback(), App::spm_update_all(), UK2k_ImExportFile::spmReadPar(), Omicron_SPM_ImExportFile::spmReadPar(), sranger_hwi_dev::sranger_hwi_dev(), sranger_hwi_dev::start_fifo_read(), PanView::start_tip_monitor(), sranger_hwi_spm::StartScan2D(), LAN_rhk_hwi_spm::StartScan2D(), innovative_dsp_hwi_spm::StartScan2D(), innovative_dsp_hwi_spa::StartScan2D(), comedi_hwi_spm::StartScan2D(), RemoteControl::stop(), tips_dialog_create(), tips_show_next(), tips_toggle_update(), App::ui_setcomment(), ViewControl::unflag_scan_event_and_remove_obj(), Profiles::update(), Grey2D::update(), Gtk_EntryControl::update_callback(), ViewControl::update_trace(), V3dControl::V3dControl(), VacancyLineAnalysis_configure(), GnomeAppService::ValueRequest(), ViewControl::view_file_loadobjects_callback(), ViewControl::view_file_save_as_callback(), V3dControl::view_file_save_as_callback(), ViewControl::view_tool_labels_callback(), ViewControl::view_view_coord_absolute_callback(), ViewControl::view_view_coord_pixels_callback(), ViewControl::view_view_coord_relative_callback(), ViewControl::view_view_redline_callback(), ViewControl::ViewControl(), ViewInfo::ViewInfo(), VObPoint::VObPoint(), DSPControl::write_dsp_probe(), write_png(), WriteBox(), Mem2d::WriteScanEvents(), Z_limiter_run(), and PanView::~PanView().

#define TRUE   -1
 

Definition at line 34 of file clip.c.

Referenced by ViewControl::add_event_obj(), plugin_ctrl::add_pi(), DSPPeakFindControl::addPFfolder(), Gtk_EntryControl::adjustment_callback(), AngularAnalysis_configure(), App::App(), AppBase::AppWidgetInit(), ViewControl::AppWidgetInit(), V3dControl::AppWidgetInit(), ascii_data_im_export_filecheck_load_callback(), AppBase::askfor_close_callback(), autocorrelation_run(), SPM_ScanControl::autosave_check(), rhk_ScanControl::autosave_check(), BoxEmpty(), BoxFull(), App::build_gxsm(), ViewControl::canvas_event_cb(), CCDControl::CCDControl(), GnomeAppService::check_file(), Gtk_EntryControl::CheckRemoteCmd(), ChkBoxEmpty(), ChkBoxFull(), GnomeAppService::choice(), App::close_scan_event_cb(), cohen_sutherland_line_clip_d(), configure_event(), MemDigiFilter::Convolve(), SCAN_DATA::CpUnits(), App::create_as_control(), DSPMoverControl::create_folder(), create_GxsmPluginList(), App::create_spa_control(), App::create_spm_control(), App::create_ui_control(), create_window_key_press_event_lcb(), ProfileControl::cur_Ashow_callback(), ProfileControl::cur_Bshow_callback(), ProfileControl::cursor_event(), DataBox::DataBox(), AppBase::destroy(), details_callback(), GnomeAppService::dialog(), external_converter_Control::dlg_clicked(), converterControl::dlg_clicked(), DlgBase::DlgStart(), AppBase::do_hide_callback(), SPM_ScanControl::do_hscapture(), rhk_ScanControl::do_hscapture(), SPM_ScanControl::do_scan(), rhk_ScanControl::do_scan(), Grey2D::draw(), ProfileControl::drawScans(), DriftControl::DriftControl(), DSPControl::DSPControl(), DSPPeakFindControl::DSPPeakFindControl(), DSPProbeControl::DSPProbeControl(), DumpableNcFile::dump_togtkwin(), ec_gtk_spin_button_sci_output(), ViewControl::events_labels_callback(), GnomeAppService::file_dialog(), App::file_exit_callback(), App::file_save_callback(), remote_crtl::FindFktExec(), SPM_ScanControl::finish_scan(), rhk_ScanControl::finish_scan(), Focus::Focus(), VObPoint::follow_on(), DSPControl::free_probedata_array_set(), g_dat_im_export_filecheck_load_callback(), get_dport_range(), getintsfromstring(), VObject::GetRn(), V3dControl::glarea_event_cb(), gmeyer_im_export_filecheck_load_callback(), gnome_res_make_resource_variable_edit_field(), gnome_res_new_user_druid_construct(), gnome_res_preferences_new(), gnome_res_run_change_user_config(), gnome_res_write_user_config(), gtk_led_expose(), gtk_spin_button_sci_button_press(), gtk_spin_button_sci_button_release(), gtk_spin_button_sci_draw_arrow(), gtk_spin_button_sci_init(), gtk_spin_button_sci_key_release(), gtk_spin_button_sci_new_with_range(), gtk_spin_button_sci_scroll(), gtk_spin_button_sci_timer(), gxsm_check_new_user_config(), App::Gxsm_Plugin_Check(), spa4_ImExportFile::import(), RHK_SPM32_ImportFile::import(), PsiHDF_ImExportFile::import(), PNG_ImExportFile::import_data(), Gdat_ImExportFile::import_data(), ProfileControl::Init(), DSPControl::init_probedata_arrays(), SPM_ScanControl::initialize_scan_lists(), rhk_ScanControl::initialize_scan_lists(), Gtk_EntryControl::InitRegisterCb(), RemoteControl::InputFunction(), insert_into_ctree(), islandlbl_configure(), VObject::item_event(), sranger_hwi_spm::KillScan2D(), innovative_dsp_hwi_spa::KillScan2D(), innovative_dsp_hwi_spm::KillScan2D(), comedi_hwi_spm::KillScan2D(), led_bar_light_percent(), led_bar_light_segment(), led_bar_light_segments(), LineProfile1D::LineProfile1D(), AppBase::LoadGeometry(), DataBox::loop(), main(), DataBox::make_copy(), make_edit(), App::math_twoarg_callback(), Surface::MathOperation(), Surface::MathOperationX(), MkIconsPI(), MonitorControl::MonitorControl(), MyGnomeTools::mygtk_add_input(), MyGnomeTools::mygtk_add_list(), MyGnomeTools::mygtk_add_spin(), nano_import_filecheck_load_callback(), nano_manipulatorControl::nano_manipulatorControl(), NanoPlottControl::NanoPlottControl(), ProfileControl::NewData(), omicron_io_filecheck_load_callback(), Focus::on_Invers_clicked(), Focus::on_SetAuto_clicked(), PanView::PanView(), PanView_tip_refresh_callback(), RemoteControl::pause(), pcdsp_initialize(), pcdsp_ioctl(), pcdsp_read(), pcdsp_reset(), pcdsp_run(), pcdsp_write(), Gtk_EntryControl::pcs_adjustment_configure(), PeakFindScan::PeakFindScan(), DSPPeakFindControl::PFfollow(), PeakFindScan::PFhwrun(), DSPPeakFindControl::PFtmoutfkt(), PIPrintPS(), EpsfTools::placeimage(), RemoteControl::play(), png_im_export_filecheck_load_callback(), PolarHist_configure(), SPM_ScanControl::prepare_to_start_scan(), rhk_ScanControl::prepare_to_start_scan(), primitive_im_export_filecheck_load_callback(), ProbeEntry::ProbeEntry(), ProbeFifoReadThread(), ProbeScan::ProbeScan(), DSPControl::Probing_eventcheck_callback(), DSPControl::Probing_graph_callback(), GnomeAppService::progress_info_add_info(), GnomeAppService::progress_info_new(), VObject::properties(), PsiHDF_im_export_filecheck_load_callback(), DSPControl::push_probedata_arrays(), GnomeAppService::questioncallback(), r_save(), random_number(), Focus::ratemeter_changed(), ReadBox(), remote::readfifo(), innovative_dsp_hwi_dev::ReadScanData(), realize(), App::RemoveGxsmSplash(), Surf3d::reshape(), innovative_dsp_hwi_spa::RestoreParameter(), rhk200_im_export_filecheck_load_callback(), rhk_ScanControl::rhk_ScanControl(), rhk_spm32_import_filecheck_load_callback(), external_converter_Control::run(), converterControl::run(), PIPrintControl::run(), MkIconsPIControl::run(), RemoteControl::run(), NanoPlottControl::RunPlott(), AppBase::SaveGeometry(), SCAN_DATA::SCAN_DATA(), SPM_ScanControl::scan_in_progress(), rhk_ScanControl::scan_in_progress(), sranger_hwi_spm::ScanLineM(), innovative_dsp_hwi_spm::ScanLineM(), innovative_dsp_hwi_spa::ScanLineM(), sdfimport_run(), ServiceRequest(), LineInfo::set(), LineProfile1D::SetData(), DataBox::SetHeading(), SPM_ScanControl::setup_scan(), rhk_ScanControl::setup_scan(), Scan::SetVM(), Grey2D::SetZF(), Gtk_EntryControl::Show(), AppBase::show(), Gtk_EntryControl::ShowMessage(), smallconvol_configure(), spa4_im_export_filecheck_load_callback(), SPA_PeakFind_p::SPA_PeakFind_p(), SpaLeedControl::SpaLeedControl(), spasimkz_configure(), spin_button_sci_at_limit(), spin_button_sci_redraw(), SPM_ScanControl::SPM_ScanControl(), spm_scancontrol_movie_callback(), spm_scancontrol_start_callback(), App::spm_update_all(), UK2k_ImExportFile::spmReadPar(), Omicron_SPM_ImExportFile::spmReadPar(), start_spinning(), ProbeScan::Stop(), PeakFindScan::Stop(), PanView::stop_tip_monitor(), Surface::Surface(), Gtk_EntryControl::Thaw(), tips_dialog_create(), tips_dialog_hide(), tips_toggle_update(), UK2k_import_filecheck_load_callback(), Profiles::update(), Grey2D::update(), rhk_ScanControl::updateRHK(), V3dControl::V3dControl(), VacancyLineAnalysis_configure(), GnomeAppService::ValueRequest(), ViewControl::view_file_loadobjects_callback(), ViewControl::view_file_save_callback(), V3dControl::view_file_save_callback(), ViewControl::view_tool_labels_callback(), ViewControl::view_view_coord_pixels_callback(), ViewControl::view_view_redline_callback(), ViewControl::ViewControl(), VObEvent::VObEvent(), DSPControl::write_dsp_probe(), WriteBox(), converter::writeFromCh(), Mem2d::WriteScanEvents(), WSxM_im_export_filecheck_load_callback(), Z_limiter_run(), Grey2D::ZoomIn(), Grey2D::ZoomOut(), App::~App(), probedata::~probedata(), ProbeEntry::~ProbeEntry(), rhk_ScanControl::~rhk_ScanControl(), scandata::~scandata(), SPM_ScanControl::~SPM_ScanControl(), and UserEntry::~UserEntry().


Typedef Documentation

typedef long outcode
 

Definition at line 40 of file clip.c.


Enumeration Type Documentation

enum edge
 

Enumerator:
LEFT 
RIGHT 
BOTTOM 
TOP 

Definition at line 37 of file clip.c.


Function Documentation

ClipResult cohen_sutherland_line_clip_d double *  x0,
double *  y0,
double *  x1,
double *  y1,
double  xmin_,
double  xmax_,
double  ymin_,
double  ymax_
 

cohen_sutherland_line_clip_d: : x coordinate of first point. : y coordinate of first point. : x coordinate of second point. : y coordinate of second point. : x coordinate of lower left edge of clipping rectangle. : y coordinate of lower left edge of clipping rectangle. : x coordinate of upper right edge of clipping rectangle. : y coordinate of lower left edge of clipping rectangle.

cohen_sutherland_line_clip_d() will clip a line from first point (, ) to (, ) so that it fits into the given min/max bounds of the rectange (, ) - (, ). The line input coordinates will be modified if necessary for clipping.

Returns: ClipResult.

Definition at line 100 of file clip.c.

Referenced by cohen_sutherland_line_clip_i(), and ViewInfo::makeDXYinfo().

ClipResult cohen_sutherland_line_clip_i int *  x0_,
int *  y0_,
int *  x1_,
int *  y1_,
int  xmin_,
int  xmax_,
int  ymin_,
int  ymax_
 

Definition at line 62 of file clip.c.

Referenced by Mem2d::GetDataLineFrom().

void CompOutCode double  x,
double  y,
outcode code,
struct LOC_cohen_sutherland_line_clip LINK
 

Definition at line 48 of file clip.c.

References BOTTOM, LEFT, RIGHT, TOP, LOC_cohen_sutherland_line_clip::xmax, and LOC_cohen_sutherland_line_clip::ymax.

Referenced by cohen_sutherland_line_clip_d().


Generated on Sat Apr 1 09:04:31 2006 for GXSM by  doxygen 1.4.6