UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_scaled_palette_inline.hpp
1 /* zq_scaled_palette_inline.hpp */
2 /* $Id: zq_scaled_palette_inline.hpp,v 1.2 2007/03/08 08:14:43 rus1 Exp $ */
3 #ifndef __zq_scaled_palette_inline_hpp
4 #define __zq_scaled_palette_inline_hpp
5 
6 #ifdef __zq_scaled_palette_hpp
7 #define INLINE inline
8 #else
9 #define INLINE
10 #endif /* __zq_scaled_palette_hpp */
11 
12 
19 //modify by haoyg,begin
20 #ifndef HAOYG
21 INLINE void
23 {
25 }
26 #endif
27 //modify by haoyg,end
28 
29 
34 INLINE void
36 {
37  m_nThickness = -1;
38  setThickness(nPixels);
39 }
40 
41 
42 /*
43  * Properties
44  */
45 
52 INLINE void
53 ZqScaledPalette::setOrientation (Qt::Orientation eOrient)
54 {
55  m_eOrient = eOrient;
56 
57  /* Update thickness interpretation and set dirty flag. */
59 }
60 
61 
66 INLINE Qt::Orientation
68 {
69  return m_eOrient;
70 }
71 
72 
80 INLINE void
82 {
83  if(m_nThickness == nPixels || nPixels <= 0)
84  /* Don't change state of the object. */
85  return;
86 
87  m_nThickness = nPixels;
88  if(NULL != getPlace())
89  {
90  switch(getOrientation())
91  {
92  case Qt::Vertical:
93  getPlace()->px.setHint(Z_SH_FIXED_SIZE, m_nThickness);
94  getPlace()->py.setHint(Z_SH_NO_LIMITS);
95  break;
96  case Qt::Horizontal:
97  getPlace()->px.setHint(Z_SH_NO_LIMITS);
98  getPlace()->py.setHint(Z_SH_FIXED_SIZE, m_nThickness);
99  break;
100  }
101  getPlace()->setDirty();
102  }
103 }
104 
109 INLINE int
111 {
112  return m_nThickness;
113 }
114 
115 
120 INLINE void
122 {
123  m_ScPal = pal;
124  if(NULL != getPlace())
125  getPlace()->setDirty();
126 }
127 
128 
134 INLINE void
136 {
137  double fRange[2];
138  /* Save range */
139  m_ScPal.getRange(fRange);
140  m_ScPal = pal;
141  /* Restore range */
142  m_ScPal.setRange(fRange);
143  if(NULL != getPlace())
144  getPlace()->setDirty();
145 }
146 
147 
152 INLINE const ZqbScaledPalette&
154 {
155  return m_ScPal;
156 }
157 
158 
159 #undef INLINE
160 
161 #endif /* zq_scaled_palette_inline.hpp */
virtual void setOrientation(Qt::Orientation eOrient)
Definition: zq_scaled_palette_inline.hpp:53
Definition: zqb_scaled_palette.hpp:15
virtual Qt::Orientation getOrientation() const
Definition: zq_scaled_palette_inline.hpp:67
ZqbScaledPalette m_ScPal
Definition: zq_scaled_palette.hpp:109
virtual void setRange(double lowi, double highi)
Qt::Orientation m_eOrient
Definition: zq_scaled_palette.hpp:102
virtual void updateLimits(QPainter *paint=NULL)
Definition: zq_scaled_palette_inline.hpp:22
ZqbPixGrpMember py
Definition: zqb_placeholder.hpp:130
virtual void getRange(double lh[2]) const
virtual const ZqbScaledPalette & getPalette() const
Definition: zq_scaled_palette_inline.hpp:153
virtual void setPalette(const ZqbScaledPalette &pal)
Definition: zq_scaled_palette_inline.hpp:121
virtual void setThickness(int nPixels)
Definition: zq_scaled_palette_inline.hpp:81
ZqbPlaceholder * getPlace() const
void setHint(ZqbSizeHint hint, int limitsize=0)
void forceThickness(int nPixels)
Definition: zq_scaled_palette_inline.hpp:35
Definition: zqb_palette.hpp:17
int m_nThickness
Definition: zq_scaled_palette.hpp:106
virtual int getThickness() const
Definition: zq_scaled_palette_inline.hpp:110
ZqbPixGrpMember px
Definition: zqb_placeholder.hpp:127