Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vieweasel.C

Go to the documentation of this file.
00001 /*!
00002  *  \file vieweasel.C
00003  *  \brief Contains the implementation of the VIEW_EASEL class.
00004  *  \author Jonathan M. Cohen (jmc)
00005  *  \date Fri Jun 12 16:06:40 US/Eastern 1998
00006  *
00007  *  \sa vieweasel.H
00008  *
00009  */
00010 
00011 #include "geom/world.H"
00012 
00013 #include "vieweasel.H"
00014 
00015 using mlib::XYpt;
00016 
00017 /*************************************************************************
00018  * Function Name: VIEW_EASEL::VIEW_EASEL
00019  * Parameters: CVIEWptr &v
00020  * Effects: 
00021  *************************************************************************/
00022 VIEW_EASEL::VIEW_EASEL(
00023    CVIEWptr &v) :
00024    _view(v) /* , _trace(NULL) */
00025 {
00026    _camera = CAMptr( new CAM( str_ptr("easel cam") ) ); 
00027    saveCam( _view->cam() );
00028 }
00029 
00030 VIEW_EASEL::~VIEW_EASEL()
00031 {
00032 }
00033 
00034 void 
00035 VIEW_EASEL::saveCam(const CAMptr &c) 
00036 {
00037    if (c && _camera)
00038       *_camera = *c; 
00039 }
00040 
00041 // void
00042 // VIEW_EASEL::bindTrace(TRACEptr t)
00043 // {
00044 //    if(_trace){
00045 //       WORLD::undisplay(_trace, false);
00046 //    }
00047 
00048 //    _trace = t;
00049 //    if (!DRAWN.contains(_trace))
00050 //       WORLD::display(_trace, false);
00051 // }
00052 
00053 /*************************************************************************
00054  * Function Name: VIEW_EASEL::restoreEasel
00055  * Parameters: 
00056  * Returns: void
00057  * Effects: 
00058  *************************************************************************/
00059 void
00060 VIEW_EASEL::restoreEasel()
00061 {
00062    _view->copy_cam(_camera);
00063    for ( int i = 0; i < _lines.num(); i++ ) {
00064       if (!DRAWN.contains(_lines[i]))
00065          WORLD::display(_lines[i], false);
00066    }
00067 //    if (_trace && !DRAWN.contains(_trace))
00068 //       WORLD::display(_trace, false);
00069 }
00070 
00071 
00072 /*************************************************************************
00073  * Function Name: VIEW_EASEL::removeEasel
00074  * Parameters: 
00075  * Returns: void
00076  * Effects: 
00077  *************************************************************************/
00078 void
00079 VIEW_EASEL::removeEasel()
00080 {
00081    WORLD::undisplay_gels(_lines, false);
00082 //    if (_trace )
00083 //       WORLD::undisplay(_trace, false);
00084 }
00085 
00086 void
00087 VIEW_EASEL::add_line(const GELptr &p)
00088 { 
00089    _lines.add_uniquely(p);
00090    if (!DRAWN.contains(p))
00091       WORLD::display(p, false);
00092 } 
00093 
00094 void
00095 VIEW_EASEL::rem_line(const GELptr &p)
00096 { 
00097    if (p) {
00098       WORLD::undisplay(p, false);
00099       _lines -= p; 
00100    }
00101 }
00102 
00103 void
00104 VIEW_EASEL::clear_lines()
00105 {
00106    WORLD::undisplay_gels(_lines, false); // not undoable
00107    _lines.clear();
00108 }
00109 
00110 GELptr 
00111 VIEW_EASEL::extract_closest(
00112    Cstr_ptr&            /* type */,
00113    const XYpt&          /* pt */,
00114    double               /* max_dist */, 
00115    const GELptr&        /* except */
00116    ) 
00117 {
00118    cerr << "VIEW_EASEL::extract_closest: not implemented" << endl;
00119    return 0;
00120 }
00121 
00122 GELptr 
00123 VIEW_EASEL::extract_closest_pix(
00124    Cstr_ptr&            /* type */,
00125    const XYpt&          /* pt */,
00126    double               /* max_dist */, 
00127    const GELptr&        /* except */
00128    ) 
00129 {
00130    cerr << "VIEW_EASEL::extract_closest_pix: not implemented" << endl;
00131    return 0;
00132 }
00133 
00134 /* end of file vieweasel.C */

Generated on Mon Sep 18 11:39:34 2006 for jot by  doxygen 1.4.4