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

  1. // attributes.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.LIB); if not, write to the        //
  17. // Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
  18. //                                                                         //
  19.  
  20. #include <data_enum.h>
  21. #include "attributes.h"
  22.  
  23. // Attributes class is a manager for graphical attributes of geometry
  24. // which has been registered with the vd GL canvas pane class
  25.  
  26. Attributes::Attributes()
  27. {
  28. }
  29.  
  30. Attributes::Attributes(int color, unsigned short style, unsigned int thick,unsigned int lyr): // specific constructor
  31.     colorValue(color), lineStyle(style), thickness(thick) ,layer(lyr) {}
  32.  
  33. Attributes::~Attributes(){}    // destructor 
  34.  
  35. Attributes::Attributes(const Attributes& a)          // copy constructor
  36. {
  37.     colorValue = a.colorValue;
  38.     lineStyle = a.lineStyle;
  39.     thickness = a.thickness;
  40.     layer = a.layer;
  41. }
  42.  
  43. Attributes& Attributes::operator=(const Attributes& a) // assignment operator
  44. {
  45.     colorValue = a.colorValue;
  46.     lineStyle = a.lineStyle;
  47.     thickness = a.thickness;
  48.     layer = a.layer;
  49.     return *this;
  50. }
  51.  
  52. bool operator==(const Attributes& a1, const Attributes& a2)
  53. {
  54.     return ( (a1.colorValue == a2.colorValue)
  55.     &&       (a1.lineStyle == a2.lineStyle) 
  56.     &&     (a1.thickness == a2.thickness) 
  57.     &&     (a1.layer == a2.layer )             );
  58. }
  59.  
  60.