OOFILE  1.9
oofDStyl.h
Go to the documentation of this file.
1 // COPYRIGHT 1996 A.D. Software, All rights reserved
2 
3 #ifndef H_OOFDSTYL
4 #define H_OOFDSTYL
5 //=================================================================================
6 // oofDStyl.h
7 //=================================================================================
8 
9 #ifndef H_OOF0
10  #include "oof0.h"
11 #endif
12 #ifndef H_OOF2
13  #include "oof2.h" // for OOF_ExpandableLongArray
14 #endif
15 #ifndef H_OOFbool
16  #include "oofbool.h"
17 #endif
18 #ifndef H_OOFCOLOR
19  #include "oofcolor.h"
20 #endif
21 #ifndef H_OOFRECT
22  #include "oofrect.h"
23 #endif
24 
25 class oofSymbol;
26 
33 public:
34  //typedef enum { eSquare,eCircle,eCross,eEcs } symbolType;
36  const oofPattern& colPat = oofPattern::gray,
37  const oofPattern& monoPat = oofPattern::gray,
38  const oofColor& bg = oofColor::White,
39  oofSymbol *sym = 0, bool adoptsSymbol=false);
40  //oofDrawStyle::symbolType sym = oofDrawStyle::eSquare);
41  oofDrawStyle(const oofDrawStyle&);
42  oofDrawStyle(const oofDrawStyle*);
43  ~oofDrawStyle();
44  const oofDrawStyle& operator=(oofDrawStyle&);
45  void setPattern(const oofPattern&);
46 
47  void setJustColorPattern(const oofPattern&);
48  void setJustMonoPattern(const oofPattern&);
49  const oofColor& foreColor() const;
50  const oofColor& backColor() const;
51  const oofPattern& colorPattern() const;
52  const oofPattern& monoPattern() const;
53  const oofPattern& currentPattern() const;
54  oofSymbol* symbol() const { return mSymbol; };
55  void useStyleColors() const;
56  static void setStyleToMono();
57  static void setStyleToColor();
58  static bool isMono();
59 
60 private:
61  oofColor mForeColor,
62  mBackColor;
63  oofPattern *mColorPattern;
64  oofPattern *mMonoPattern;
65  static bool sIsMono;
66  //symbolType mSymbol; ///< symbol when drawing a point
68  oofSymbol *mSymbol;
69 
70 #ifdef _Windows
71  oofPen mPen;
72 #endif
73 };
74 
75 
76 
87 public:
90  void append(oofDrawStyle&);
93  const oofDrawStyle& item(unsigned long index) const;
94  void adopt(oofDrawStyleArray*);
95  unsigned long count() const;
96  void deleteAll();
97 private:
98  OOF_ExpandableLongArray mDrawStyles;
99 };
100 
101 
102 
114 public:
115  oofDrawStyleSet() : mNumDrawStylesProduced(0) {};
116  virtual ~oofDrawStyleSet() {};
117 
118  virtual oofDrawStyle getNextDrawStyle();
119 
120 // data storage
121 protected:
122  unsigned long mNumDrawStylesProduced;
123 };
124 
125 
126 
132 public:
135  virtual oofDrawStyle getNextDrawStyle();
136  static oofColor CalculateColor(unsigned long index);
137 };
138 
139 
140 
149 public:
151  virtual ~oofDrawStyleSetSupplied();
152  virtual oofDrawStyle getNextDrawStyle();
153 protected:
154  oofDrawStyleArray mDrawStyles; // pointers to draw styles - owned
155 };
156 
157 
158 
164 public:
165  virtual ~oofSymbol() {};
166  virtual void draw(short,short);
167  virtual oofRect BoundingRect()=0;
168  virtual oofSymbol* clone() const=0;
169 protected:
170  virtual void DrawSelf(short,short)=0;
171  unsigned short getSymbolSizeX() { return 7; };
172  unsigned short getSymbolSizeY() { return 7; };
173 };
174 
175 
176 
182 public:
183  virtual ~oofSimpleSymbol() {};
184  virtual oofRect BoundingRect();
185 private:
186  virtual void DrawSelf(short,short)=0;
187 };
188 
189 
190 
196 public:
197  virtual ~oofEcsSymbol() {};
198  virtual oofSymbol* clone() const;
199 private:
200  virtual void DrawSelf(short,short);
201 };
202 
203 
204 
210 public:
213  virtual oofSymbol* clone() const;
214 private:
215  virtual void DrawSelf(short,short);
216 };
217 
218 
219 
225 public:
228  virtual oofSymbol* clone() const;
229 private:
230  virtual void DrawSelf(short,short);
231 };
232 
233 
234 
240 public:
243  virtual oofSymbol* clone() const;
244 private:
245  virtual void DrawSelf(short,short);
246 };
247 #endif
248 
249 
250 
Cross-platform way to specify rectangle with Mac-style setter.
Definition: oofRect.h:39
oofDrawStyleArray mDrawStyles
Definition: oofDStyl.h:154
Draw a hollow square symbol on a line graph.
Definition: oofDStyl.h:239
Calculate bounding rect for a simple symbol on a line graph.
Definition: oofDStyl.h:181
Declare macros used by most of OOFILE.
Abstract base to draw a symbol on a line graph.
Definition: oofDStyl.h:163
Draw a circular symbol on a line graph.
Definition: oofDStyl.h:224
virtual void DrawSelf(short, short)=0
virtual oofRect BoundingRect()=0
virtual ~oofSimpleSymbol()
Definition: oofDStyl.h:183
Common set generator generates well-distributed colours.
Definition: oofDStyl.h:131
Returns sequence of independently defined oofDrawStyle's.
Definition: oofDStyl.h:148
unsigned short getSymbolSizeY()
temporary method for experimenting with symbol sizes
Definition: oofDStyl.h:172
virtual ~oofDrawStyleSet()
Definition: oofDStyl.h:116
#define OOFGRAPH_EXPORT
Prefix for graph classes to enable optional DLL linking.
Definition: oof0.h:188
virtual ~oofDrawStyleSetDefaultIteration()
Definition: oofDStyl.h:134
Array of longs which expands automatically as you write to cells.
Definition: oofarray.h:21
unsigned long mNumDrawStylesProduced
Definition: oofDStyl.h:122
Provide cross-platform way to specify patterns.
Definition: oofcolor.h:75
Virtual base for generator class returning sequence of oofDrawStyle.
Definition: oofDStyl.h:113
Attempts to define 'bool' regardless of compiler and whether it implements true bools.
Cross-platform color specification class.
Definition: oofcolor.h:123
Specify drawing styles used in graphs.
Definition: oofDStyl.h:32
virtual ~oofSymbol()
Definition: oofDStyl.h:165
Array of owned oofDrawStyle's adopting them for correct lifetime management.
Definition: oofDStyl.h:86
unsigned short getSymbolSizeX()
Definition: oofDStyl.h:171
OOFILE_EXPORT std::ostream & operator<<(std::ostream &, OOF_IndexOptions)
virtual ~oofEcsSymbol()
Definition: oofDStyl.h:197
oofSymbol * symbol() const
Definition: oofDStyl.h:54
Draw a cross symbol on a line graph.
Definition: oofDStyl.h:209
Draw a "X" symbol on a line graph.
Definition: oofDStyl.h:195
virtual oofSymbol * clone() const =0
virtual oofDrawStyle getNextDrawStyle()
Definition: oofDStyl.cpp:360