summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/pmglobalsettings.h
blob: b254afe0a993fbac2a071cce08295c1e28ccef33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
//-*-C++-*-
/*
**************************************************************************
                                 description
                             --------------------
    copyright            : (C) 2002 by Luis Carvalho
    email                : [email protected]
**************************************************************************

**************************************************************************
*                                                                        *
*  This program is free software; you can redistribute it and/or modify  *
*  it under the terms of the GNU General Public License as published by  *
*  the Free Software Foundation; either version 2 of the License, or     *
*  (at your option) any later version.                                   *
*                                                                        *
**************************************************************************/


#ifndef PMGLOBALSETTINGS_H
#define PMGLOBALSETTINGS_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "pmcompositeobject.h"
#include "pmcolor.h"

/**
 * Class for global settings.
 */

class PMGlobalSettings : public PMCompositeObject
{
   typedef PMCompositeObject Base;
public:
   enum PMNoiseType { Original = 0, RangeCorrected = 1, Perlin = 2 };

   /**
    * Creates a PMGlobalSettings
    */
   PMGlobalSettings( PMPart* part );
   /**
    * Copy constructor
    */
   PMGlobalSettings( const PMGlobalSettings& s );
   /**
    * deletes the PMGlobalSettings
    */
   virtual ~PMGlobalSettings( );

   /** */
   virtual PMObject* copy( ) const { return new PMGlobalSettings( *this ); }
   /** */
   virtual TQString description( ) const;

   /** */
   virtual PMMetaObject* tqmetaObject( ) const;
   /** */
   virtual void cleanUp( ) const;

   /** */
   virtual void serialize( TQDomElement& e, TQDomDocument& doc ) const;
   /** */
   virtual void readAttributes( const PMXMLHelper& h );

   /**
    * Returns a new @ref PMGlobalSettingsEdit
    */
   virtual PMDialogEditBase* editWidget( TQWidget* tqparent ) const;
   /**
    * Returns the name of the pixmap that is displayed in the tree view
    * and dialog view
    */
   virtual TQString pixmap( ) const { return TQString( "pmglobalsettings" ); }

   /**
    * Returns the adc bailout
    */
   double adcBailout( ) const { return m_adcBailout; }
   /**
    * Sets the adc bailout
    */
   void setAdcBailout( double c );
   /**
    * Returns the ambient color
    */
   PMColor ambientLight( ) const { return m_ambientLight; }
   /**
    * Sets the ambient color
    */
   void setAmbientLight( const PMColor& c );
   /**
    * Returns the assumed gamma
    */
   double assumedGamma( ) const { return m_assumedGamma; }
   /**
    * Sets the assumed gamma
    */
   void setAssumedGamma( double c );
   /**
    * Returns the hf gray 16
    */
   bool hfGray16( ) const { return m_hfGray16; }
   /**
    * Sets the hf gray 16
    */
   void setHfGray16( bool c );
   /**
    * Returns the iridiscence wavelength
    */
   PMColor iridWaveLength( ) const { return m_iridWaveLength; }
   /**
    * Sets the iridiscence wavelength
    */
   void setIridWaveLength( const PMColor& c );
   /**
    * Returns the maximum number of intersections
    */
   int maxIntersections( ) const { return m_maxIntersections; }
   /**
    * Sets the maximum number of intersections
    */
   void setMaxIntersections( int c );
   /**
    * Returns the maximum trace level
    */
   int maxTraceLevel( ) const { return m_maxTraceLevel; }
   /**
    * Sets the maximum trace level
    */
   void setMaxTraceLevel( int c );
   /**
    * Returns the number of waves
    */
   int numberWaves( ) const { return m_numberWaves; }
   /**
    * Sets the number of waves
    */
   void setNumberWaves( int c );
   /**
    * Returns the current noise generator
    */
   PMNoiseType noiseGenerator( ) const { return m_noiseGenerator; }
   /**
    * Sets the noise generator
    */
   void setNoiseGenerator( PMNoiseType c );
   /**
    * Returns true if radiosity is enabled
    */
   bool isRadiosityEnabled( ) const { return m_radiosityEnabled; }
   /**
    * Enables/Disables radiosity
    */
   void enableRadiosity( bool c );
   /**
    * Returns brightness
    */
   double brightness( ) const { return m_brightness; }
   /**
    * Sets the brightness
    */
   void setBrightness( double c );
   /**
    * Returns count
    */
   int count( ) const { return m_count; }
   /**
    * Sets the count
    */
   void setCount( int c );
   /**
    * Returns maximum distance
    */
   double distanceMaximum( ) const { return m_distanceMaximum; }
   /**
    * Sets the maximum distance
    */
   void setDistanceMaximum( double c );
   /**
    * Returns error boundary
    */
   double errorBound( ) const { return m_errorBound; }
   /**
    * Sets the error boundary
    */
   void setErrorBound( double c );
   /**
    * Returns gray threshold
    */
   double grayThreshold( ) const { return m_grayThreshold; }
   /**
    * Sets the gray threshold
    */
   void setGrayThreshold( double c );
   /**
    * Returns low error factor
    */
   double lowErrorFactor( ) const { return m_lowErrorFactor; }
   /**
    * Sets the low error factor
    */
   void setLowErrorFactor( double c );
   /**
    * Returns minimum reuse
    */
   double minimumReuse( ) const { return m_minimumReuse; }
   /**
    * Sets the minimum reuse
    */
   void setMinimumReuse( double c );
   /**
    * Returns nearest count
    */
   int nearestCount( ) const { return m_nearestCount; }
   /**
    * Sets the nearest count
    */
   void setNearestCount( int c );
   /**
    * Returns recursion limit
    */
   int recursionLimit( ) const { return m_recursionLimit; }
   /**
    * Sets the recursion limit
    */
   void setRecursionLimit( int c );

   /** */
   virtual void restoreMemento( PMMemento* s );
private:
   /**
    * IDs for @ref PMMementoData
    */
   enum PMGlobalSettingsMementoID { PMAdcBailoutID, PMAmbientLightID, PMAssumedGammaID,
                                    PMHfGray16ID, PMIridWaveLengthID, PMMaxIntersectionsID,
                                    PMMaxTraceLevelID, PMNumberWavesID, PMNoiseGeneratorID,
                                    PMRadiosityEnabledID, PMBrightnessID, PMCountID,
                                    PMDistanceMaximumID, PMErrorBoundID, PMGrayThresholdID,
                                    PMLowErrorFactorID, PMMinimumReuseID, PMNearestCountID,
                                    PMRecursionLimitID };

   double      m_adcBailout;
   PMColor     m_ambientLight;
   double      m_assumedGamma;
   bool        m_hfGray16;
   PMColor     m_iridWaveLength;
   int         m_maxIntersections;
   int         m_maxTraceLevel;
   int         m_numberWaves;
   PMNoiseType m_noiseGenerator;
   bool        m_radiosityEnabled;
   double      m_brightness;
   int         m_count;
   double      m_distanceMaximum;
   double      m_errorBound;
   double      m_grayThreshold;
   double      m_lowErrorFactor;
   double      m_minimumReuse;
   int         m_nearestCount;
   int         m_recursionLimit;

   static PMMetaObject* s_pMetaObject;
};

#endif