WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
PlotAttr.h
1#ifndef _WINC_PLOTATTR
2#define _WINC_PLOTATTR
3
4#include <WXP/Const.h>
5#include <WXP/StrLib.h>
6
7namespace WXP {
8 class PlotAttr {
9 float width;
10 float height;
11 float weight;
12 float expan;
13 int style;
14 int shadow;
15 int fill_pat;
16 int color_ind;
17 char color[20];
18 char font[120];
19 char label[20];
20
21 public:
22 PlotAttr();
23 PlotAttr( const char *str );
24 PlotAttr( const char *str, const char *def );
25 int set( const char *str );
26 int set( const char *str, const char *def );
27 int parse( const char *str );
28
29 inline int setWidth( float val ){ width = val; return 1; };
30 inline float getWidth(){ return width; };
31 inline bool validWidth(){ return width != Const::MISS; };
32
33 inline int setWeight( float val ){ weight = val; return 1; };
34 inline float getWeight(){ return weight; };
35 inline bool validWeight(){ return weight != Const::MISS; };
36
37 inline int setHeight( float val ){ height = val; return 1; };
38 inline float getHeight(){ return height; };
39 inline bool validHeight(){ return height != Const::MISS; };
40
41 inline int setExpan( float val ){ expan = val; return 1; };
42 inline float getExpan(){ return expan; };
43 inline bool validExpan(){ return expan != Const::MISS; };
44
45 inline int getStyle(){ return style; };
46 inline bool validStyle(){ return style != Const::MISS; };
47
48 inline int setShadow( int val ){ shadow = val; return 1; };
49 inline int getShadow(){ return shadow; };
50 inline bool validShadow(){ return shadow != Const::MISS; };
51
52 inline int getFillPat(){ return fill_pat; };
53 inline bool validFillPat(){ return fill_pat != Const::MISS; };
54
55 inline int setColorInd( int val ){ color_ind = val; return 1; };
56 inline int getColorInd(){ return color_ind; };
57 inline bool validColorInd(){ return color_ind != Const::MISS; };
58
59 int setColor( const char *str );
60 inline const char *getColor(){ return color; };
61 bool validColor();
62
63 inline const char *getFont(){ return font; };
64 inline bool validFont(){ return StrLib::valid( font ); };
65
66 inline bool validLabel(){ return label[0] != 0; };
67 inline const char *getLabel(){ return label; };
68
69 int update( PlotAttr &attr );
70
71 int print();
72 int init();
73
74 static int parseFillStyle( const char *str );
75 static int parseMarker( const char *str );
76 static int update( PlotAttr &attr1, PlotAttr &attr2 );
77 };
78}
79#endif
static const int MISS
Definition Const.h:7
This class stores plot attributes.
Definition PlotAttr.h:8
static bool valid(const char *str)
Definition StrLib.cc:791
All WXP classes fall under the WXP namespace.
Definition Angle.h:4