home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / freedraft.tar.gz / freedraft.tar / FREEdraft-050298 / DRAWABLES / drawablepoint.cpp < prev    next >
C/C++ Source or Header  |  1998-04-23  |  2KB  |  56 lines

  1. // drawablepoint.cpp
  2.  
  3. // Copyright (C) 1997  Cliff Johnson                                       //
  4. //                                                                         //
  5. // This program is free software; you can redistribute it and/or           //
  6. // modify it under the terms of the GNU  General Public                    //
  7. // License as published by the Free Software Foundation; either            //
  8. // version 2 of the License, or (at your option) any later version.        //
  9. //                                                                         //
  10. // This software is distributed in the hope that it will be useful,        //
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of          //
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       //
  13. // General Public License for more details.                                //
  14. //                                                                         //
  15. // You should have received a copy of the GNU General Public License       //
  16. // along with this software (see COPYING); if not, write to the        //
  17. // Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
  18.  
  19.  
  20. #include <geom_enum.h>
  21. #include <drawablepoint.h>
  22. #include <GL/gl.h>
  23. #include <GL/glu.h>
  24. #include <point.h>
  25.  
  26. //*************************************************************************
  27.  
  28. DrawablePoint::DrawablePoint(): DrawableGeom(POINT) {}
  29.  
  30. //*************************************************************************
  31. void DrawablePoint::Draw(const Geom* geom,const float& scale) const
  32. {
  33.     if(DrawableGeom::Type()!=POINT)return;
  34.  
  35.     Point p = Point(*(reinterpret_cast<const Point* >(geom) ) );
  36.  
  37.     glBegin(GL_POINTS);
  38.                 glVertex2f(p[0],p[1]);
  39.         glEnd();
  40. }
  41. //*************************************************************************
  42. void DrawablePoint::Select(const Geom* geom, const Handle& handle,const float& scale) const
  43. {
  44.     if(DrawableGeom::Type()!=POINT)return;
  45.  
  46.         Point p = Point(*(reinterpret_cast<const Point* >(geom) ) );
  47.  
  48.     glLoadName(handle.Value());
  49.  
  50.     glBegin(GL_POINTS);
  51.         glVertex2f(p[0],p[1]);
  52.     glEnd();
  53.  
  54. }
  55.     
  56.