VR-Forces 4.1.1 Class Documentation
colorCount.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1999 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: colorCount.h,v $ $Revision: 1.4 $ $State: Exp $
7 ******************************************************************************/
8 #ifndef colorCount_H_
9 #define colorCount_H_
10 
11 #include "gdb/gdbDefines.h"
12 #include "geometry/gdbColor.h"
13 
14 // class DtColorCountRecord:
15 //
16 // Record for counting colors. Maintains a count for each new color
17 // encountered. Maximum number of colors the structure can handle is
18 // defined as a constant.
19 
20 
22 {
23 public:
24 
25  // constructor
27 
28  // destructor
29  virtual ~DtColorCountRecord();
30 
31 private:
32  // Copy constructor and Assignment operator not implemented
33  DtColorCountRecord(const DtColorCountRecord& original);
34  DtColorCountRecord& operator=(const DtColorCountRecord& original);
35 
36 
37 public:
38 
39  virtual void addColor(const DtColor &c);
40  virtual DtColor mostCommon();
41 
42 protected:
43  // returns index of c if already exists in the table. returns -1
44  // otherwise.
45  virtual int lookupColor(const DtColor &c);
46 
47  // return i-th color stored in the array
48  virtual DtColor color(int i) const;
49 
50  // returns the index of the first free cell available
51  virtual int firstFreeCell() const;
52 
53 protected:
54 
55  static const unsigned int theMaxColors;
56 
57 protected:
58 
61  int* myCount;
62 };
63 
65 {
66  return myColor[i];
67 }
68 
70 {
71  return myFirstFreeCell;
72 }
73 
74 #endif

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)