SeExpr

ExprDeepWater.cpp
Go to the documentation of this file.
1 /*
2 * Copyright Disney Enterprises, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License
6 * and the following modification to it: Section 6 Trademarks.
7 * deleted and replaced with:
8 *
9 * 6. Trademarks. This License does not grant permission to use the
10 * trade names, trademarks, service marks, or product names of the
11 * Licensor and its affiliates, except as required for reproducing
12 * the content of the NOTICE file.
13 *
14 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * @file ExprDeepWater.cpp
18 */
19 #include <iostream>
20 #include <algorithm>
21
22 #include <QDialog>
23 #include <QHBoxLayout>
24 #include <QLabel>
25 #include <QVBoxLayout>
26 #include <QResizeEvent>
27 #include <QIntValidator>
28
29 #include <SeExpr2/ExprBuiltins.h>
30 #include <cfloat>
31
32 #include "ExprDeepWater.h"
33
34 void DeepWaterGraphicsView::resizeEvent(QResizeEvent *event) {
35 emit resizeSignal(event->size().width(), event->size().height());
36 }
37
38 DeepWaterScene::DeepWaterScene()
39 : _curve(new T_CURVE), _width(320), _height(170), _curvePoly(0), _baseRect(0), _gridRect(0) {
40 resize(_width, _height);
41 }
42
43 DeepWaterScene::~DeepWaterScene() { delete _curve; }
44
45 void DeepWaterScene::resize(const int width, const int height) {
46 // width and height already have the 8 px padding factored in
47 _width = width - 16;
48 _height = height - 16;
49 setSceneRect(-9, -7, width, height);
50 drawRect();
51 drawPoly();
52 drawGrid();
53 }
54
55 void DeepWaterScene::resolutionChanged(int val) {
56 params.resolution = val;
57 setParams(params);
58 }
59
60 void DeepWaterScene::tileSizeChanged(double val) {
61 params.tileSize = val;
62 setParams(params);
63 }
64
65 void DeepWaterScene::lengthCutoffChanged(double val) {
66 params.lengthCutoff = val;
67 setParams(params);
68 }
69
70 void DeepWaterScene::amplitudeChanged(double val) {
71 params.amplitude = val;
72 setParams(params);
73 }
74
75 void DeepWaterScene::windAngleChanged(double val) {
76 params.windAngle = val;
77 setParams(params);
78 }
79
80 void DeepWaterScene::windSpeedChanged(double val) {
81 params.windSpeed = val;
82 setParams(params);
83 }
84
85 void DeepWaterScene::flowDirectionChanged(QString val) {
86 QString flowDirection = val.remove(0, 1);
87 flowDirection = flowDirection.remove(flowDirection.size() - 1, 1);
88 QStringList components = flowDirection.split(",");
89 params.flowDirection = SeExpr2::Vec3d(components[0].toDouble(), components[1].toDouble(), components[2].toDouble());
90 setParams(params);
91 }
92
93 void DeepWaterScene::directionalFactorExponentChanged(double val) {
94 params.directionalFactorExponent = val;
95 setParams(params);
96 }
97
98 void DeepWaterScene::directionalReflectionDampingChanged(double val) {
99 params.directionalReflectionDamping = val;
100 setParams(params);
101 }
102
103 void DeepWaterScene::sharpenChanged(double val) {
104 params.sharpen = val;
105 setParams(params);
106 }
107
108 void DeepWaterScene::setParams(const SeDeepWaterParams &paramsIn) {
109 params = paramsIn;
110 rebuildDeepWater();
111 drawPoly();
112 drawGrid();
113 emitDeepWaterChanged();
114 }
115
116 void DeepWaterScene::rebuildDeepWater() {
117 delete _curve;
118 _curve = new T_CURVE;
119 _curve->setParams(params);
120 _curve->generateSpectrum();
121 }
122
123 // return points in reverse order in order to use same parsing in editor
124 void DeepWaterScene::emitDeepWaterChanged() { emit deepWaterChanged(); }
125
126 // draws the base gray outline rectangle
127 void DeepWaterScene::drawRect() {
128 if (_baseRect == 0) {
129 _baseRect = addRect(0, 0, _width, _height, QPen(Qt::black, 1.0), QBrush(Qt::gray));
130 }
131 _baseRect->setRect(0, 0, _width, _height);
132 _baseRect->setZValue(0);
133 }
134
135 // draws the poly curve representation
136 void DeepWaterScene::drawPoly() {
137 if (_curvePoly == 0) {
138 _curvePoly = addPolygon(QPolygonF(), QPen(Qt::black, 1.0), QBrush(Qt::darkGray));
139 }
140
141 QPolygonF poly;
142 poly.append(QPointF(_width, 0));
143 poly.append(QPointF(0, 0));
144 for (int i = 0; i < 1000; i++) {
145 double x = i / 1000.0;
146 poly.append(QPointF(_width * x, _height * _curve->getValue(x)));
147 }
148 poly.append(QPointF(_width, 0));
149 _curvePoly->setPolygon(poly);
150 _curvePoly->setZValue(1);
151 }
152
153 // draws the base gray outline rectangle
154 void DeepWaterScene::drawGrid() {
155 if (_gridRect == 0) {
156 _gridRect = addRect(0, 0, _width, _height, QPen(Qt::black, 1.0), QBrush(Qt::gray));
157 }
158 _gridRect->setRect(
159 _width * _curve->getKLow(), 0, _width * _curve->getKHigh() - _width * _curve->getKLow(), _height);
160 _gridRect->setBrush(QBrush(_curve->inGrid() ? Qt::green : Qt::cyan));
161 _gridRect->setZValue(2);
162 _gridRect->setOpacity(0.25);
163 }
164
165 ExprDeepWater::ExprDeepWater(QWidget *parent)
166 : QWidget(parent), _scene(0), _resolutionEdit(0), _tileSizeEdit(0), _lengthCutoffEdit(0), _amplitudeEdit(0),
167 _windAngleEdit(0), _windSpeedEdit(0), _flowDirectionEdit(0), _directionalFactorExponentEdit(0),
168 _directionalReflectionDampingEdit(0), _sharpenEdit(0) {
169 QHBoxLayout *mainLayout = new QHBoxLayout();
170 mainLayout->setSpacing(2);
171 mainLayout->setMargin(4);
172
173 QWidget *edits = new QWidget;
174 QVBoxLayout *editsLayout = new QVBoxLayout;
175 editsLayout->setAlignment(Qt::AlignTop);
176 editsLayout->setSpacing(0);
177 editsLayout->setMargin(0);
178 edits->setLayout(editsLayout);
179
180 int editWidth = QFontMetrics(font()).width("[0,0,0]") + 8;
181
182 QWidget *resolution = new QWidget;
183 QHBoxLayout *resolutionLayout = new QHBoxLayout;
184 resolutionLayout->setSpacing(1);
185 resolutionLayout->setMargin(1);
186 resolution->setLayout(resolutionLayout);
187 _resolutionEdit = new DeepWaterLineEdit;
188 _resolutionEdit->setFixedWidth(editWidth);
189 QIntValidator *resolutionValidator = new QIntValidator(_resolutionEdit);
190 resolutionValidator->setBottom(1);
191 _resolutionEdit->setValidator(resolutionValidator);
192 _resolutionEdit->setFixedHeight(20);
193 resolutionLayout->addStretch(50);
194 QLabel *resolutionLabel = new QLabel("R");
195 resolutionLabel->setToolTip("Resolution");
196 resolutionLayout->addWidget(resolutionLabel);
197 resolutionLayout->addWidget(_resolutionEdit);
198
199 QWidget *tileSize = new QWidget;
200 QHBoxLayout *tileSizeLayout = new QHBoxLayout;
201 tileSizeLayout->setSpacing(1);
202 tileSizeLayout->setMargin(1);
203 tileSize->setLayout(tileSizeLayout);
204 _tileSizeEdit = new DeepWaterLineEdit;
205 _tileSizeEdit->setFixedWidth(editWidth);
206 _tileSizeEdit->setFixedHeight(20);
207 tileSizeLayout->addStretch(50);
208 QLabel *tileSizeLabel = new QLabel("TS");
209 tileSizeLabel->setToolTip("Tile Size");
210 tileSizeLayout->addWidget(tileSizeLabel);
211 tileSizeLayout->addWidget(_tileSizeEdit);
212
213 QWidget *lengthCutoff = new QWidget;
214 QHBoxLayout *lengthCutoffLayout = new QHBoxLayout;
215 lengthCutoffLayout->setSpacing(1);
216 lengthCutoffLayout->setMargin(1);
217 lengthCutoff->setLayout(lengthCutoffLayout);
218 _lengthCutoffEdit = new DeepWaterLineEdit;
219 _lengthCutoffEdit->setFixedWidth(editWidth);
220 _lengthCutoffEdit->setFixedHeight(20);
221 lengthCutoffLayout->addStretch(50);
222 QLabel *lengthCutoffLabel = new QLabel("LC");
223 lengthCutoffLabel->setToolTip("Length Cutoff");
224 lengthCutoffLayout->addWidget(lengthCutoffLabel);
225 lengthCutoffLayout->addWidget(_lengthCutoffEdit);
226
227 QWidget *amplitude = new QWidget;
228 QHBoxLayout *amplitudeLayout = new QHBoxLayout;
229 amplitudeLayout->setSpacing(1);
230 amplitudeLayout->setMargin(1);
231 amplitude->setLayout(amplitudeLayout);
232 _amplitudeEdit = new DeepWaterLineEdit;
233 _amplitudeEdit->setFixedWidth(editWidth);
234 _amplitudeEdit->setFixedHeight(20);
235 amplitudeLayout->addStretch(50);
236 QLabel *amplitudeLabel = new QLabel("A");
237 amplitudeLabel->setToolTip("Amplitude");
238 amplitudeLayout->addWidget(amplitudeLabel);
239 amplitudeLayout->addWidget(_amplitudeEdit);
240
241 QWidget *windAngle = new QWidget;
242 QHBoxLayout *windAngleLayout = new QHBoxLayout;
243 windAngleLayout->setSpacing(1);
244 windAngleLayout->setMargin(1);
245 windAngle->setLayout(windAngleLayout);
246 _windAngleEdit = new DeepWaterLineEdit;
247 _windAngleEdit->setFixedWidth(editWidth);
248 _windAngleEdit->setFixedHeight(20);
249 windAngleLayout->addStretch(50);
250 QLabel *windAngleLabel = new QLabel("WA");
251 windAngleLabel->setToolTip("Wind Angle");
252 windAngleLayout->addWidget(windAngleLabel);
253 windAngleLayout->addWidget(_windAngleEdit);
254
255 QWidget *windSpeed = new QWidget;
256 QHBoxLayout *windSpeedLayout = new QHBoxLayout;
257 windSpeedLayout->setSpacing(1);
258 windSpeedLayout->setMargin(1);
259 windSpeed->setLayout(windSpeedLayout);
260 _windSpeedEdit = new DeepWaterLineEdit;
261 _windSpeedEdit->setFixedWidth(editWidth);
262 _windSpeedEdit->setFixedHeight(20);
263 windSpeedLayout->addStretch(50);
264 QLabel *windSpeedLabel = new QLabel("WS");
265 windSpeedLabel->setToolTip("Wind Speed");
266 windSpeedLayout->addWidget(windSpeedLabel);
267 windSpeedLayout->addWidget(_windSpeedEdit);
268
269 QWidget *directionalFactorExponent = new QWidget;
270 QHBoxLayout *directionalFactorExponentLayout = new QHBoxLayout;
271 directionalFactorExponentLayout->setSpacing(1);
272 directionalFactorExponentLayout->setMargin(1);
273 directionalFactorExponent->setLayout(directionalFactorExponentLayout);
274 _directionalFactorExponentEdit = new DeepWaterLineEdit;
275 _directionalFactorExponentEdit->setFixedWidth(editWidth);
276 _directionalFactorExponentEdit->setFixedHeight(20);
277 directionalFactorExponentLayout->addStretch(50);
278 QLabel *directionalFactorExponentLabel = new QLabel("DFE");
279 directionalFactorExponentLabel->setToolTip("Directional Factor Exponent");
280 directionalFactorExponentLayout->addWidget(directionalFactorExponentLabel);
281 directionalFactorExponentLayout->addWidget(_directionalFactorExponentEdit);
282
283 QWidget *directionalReflectionDamping = new QWidget;
284 QHBoxLayout *directionalReflectionDampingLayout = new QHBoxLayout;
285 directionalReflectionDampingLayout->setSpacing(1);
286 directionalReflectionDampingLayout->setMargin(1);
287 directionalReflectionDamping->setLayout(directionalReflectionDampingLayout);
288 _directionalReflectionDampingEdit = new DeepWaterLineEdit;
289 _directionalReflectionDampingEdit->setFixedWidth(editWidth);
290 _directionalReflectionDampingEdit->setFixedHeight(20);
291 directionalReflectionDampingLayout->addStretch(50);
292 QLabel *directionalReflectionDampingLabel = new QLabel("DRD");
293 directionalReflectionDampingLabel->setToolTip("Directional Reflection Damping");
294 directionalReflectionDampingLayout->addWidget(directionalReflectionDampingLabel);
295 directionalReflectionDampingLayout->addWidget(_directionalReflectionDampingEdit);
296
297 QWidget *flowDirection = new QWidget;
298 QHBoxLayout *flowDirectionLayout = new QHBoxLayout;
299 flowDirectionLayout->setSpacing(1);
300 flowDirectionLayout->setMargin(1);
301 flowDirection->setLayout(flowDirectionLayout);
302 _flowDirectionEdit = new DeepWaterLineEdit;
303 _flowDirectionEdit->setFixedWidth(editWidth);
304 _flowDirectionEdit->setFixedHeight(20);
305 flowDirectionLayout->addStretch(50);
306 QLabel *flowDirectionLabel = new QLabel("FD");
307 flowDirectionLabel->setToolTip("Flow Direction");
308 flowDirectionLayout->addWidget(flowDirectionLabel);
309 flowDirectionLayout->addWidget(_flowDirectionEdit);
310
311 QWidget *sharpen = new QWidget;
312 QHBoxLayout *sharpenLayout = new QHBoxLayout;
313 sharpenLayout->setSpacing(1);
314 sharpenLayout->setMargin(1);
315 sharpen->setLayout(sharpenLayout);
316 _sharpenEdit = new DeepWaterLineEdit;
317 _sharpenEdit->setFixedWidth(editWidth);
318 _sharpenEdit->setFixedHeight(20);
319 sharpenLayout->addStretch(50);
320 QLabel *sharpenLabel = new QLabel("S");
321 sharpenLabel->setToolTip("Sharpen");
322 sharpenLayout->addWidget(sharpenLabel);
323 sharpenLayout->addWidget(_sharpenEdit);
324
325 QFrame *curveFrame = new QFrame;
326 curveFrame->setFrameShape(QFrame::Panel);
327 curveFrame->setFrameShadow(QFrame::Sunken);
328 curveFrame->setLineWidth(1);
329 QHBoxLayout *curveFrameLayout = new QHBoxLayout;
330 curveFrameLayout->setMargin(0);
331 DeepWaterGraphicsView *curveView = new DeepWaterGraphicsView;
332 curveView->setFrameShape(QFrame::Panel);
333 curveView->setFrameShadow(QFrame::Sunken);
334 curveView->setLineWidth(1);
335 curveView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
336 curveView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
337 _scene = new DeepWaterScene;
338 curveView->setScene(_scene);
339 curveView->setTransform(QTransform().scale(1, -1));
340 curveView->setRenderHints(QPainter::Antialiasing);
341 curveFrameLayout->addWidget(curveView);
342 curveFrame->setLayout(curveFrameLayout);
343
344 editsLayout->addWidget(resolution);
345 editsLayout->addWidget(tileSize);
346 editsLayout->addWidget(lengthCutoff);
347 editsLayout->addWidget(amplitude);
348 editsLayout->addWidget(windSpeed);
349 editsLayout->addWidget(directionalFactorExponent);
350 QFrame *line = new QFrame();
351 line->setToolTip("Parameters below this do not affect spectrum");
352 line->setFrameShape(QFrame::HLine);
353 line->setFrameShadow(QFrame::Sunken);
354 editsLayout->addWidget(line);
355 editsLayout->addWidget(windAngle);
356 editsLayout->addWidget(flowDirection);
357 editsLayout->addWidget(directionalReflectionDamping);
358 editsLayout->addWidget(sharpen);
359
360 mainLayout->addWidget(edits);
361 mainLayout->addWidget(curveFrame);
362 mainLayout->setStretchFactor(curveFrame, 100);
363 setLayout(mainLayout);
364
365 // SIGNALS
366
367 connect(_resolutionEdit, SIGNAL(returnPressed()), this, SLOT(resolutionChanged()));
368 connect(_resolutionEdit, SIGNAL(focusOut()), this, SLOT(resolutionChanged()));
369 connect(this, SIGNAL(resolutionChangedSignal(int)), _scene, SLOT(resolutionChanged(int)));
370 connect(_tileSizeEdit, SIGNAL(returnPressed()), this, SLOT(tileSizeChanged()));
371 connect(_tileSizeEdit, SIGNAL(focusOut()), this, SLOT(tileSizeChanged()));
372 connect(this, SIGNAL(tileSizeChangedSignal(double)), _scene, SLOT(tileSizeChanged(double)));
373 connect(_lengthCutoffEdit, SIGNAL(returnPressed()), this, SLOT(lengthCutoffChanged()));
374 connect(_lengthCutoffEdit, SIGNAL(focusOut()), this, SLOT(lengthCutoffChanged()));
375 connect(this, SIGNAL(lengthCutoffChangedSignal(double)), _scene, SLOT(lengthCutoffChanged(double)));
376 connect(_amplitudeEdit, SIGNAL(returnPressed()), this, SLOT(amplitudeChanged()));
377 connect(_amplitudeEdit, SIGNAL(focusOut()), this, SLOT(amplitudeChanged()));
378 connect(this, SIGNAL(amplitudeChangedSignal(double)), _scene, SLOT(amplitudeChanged(double)));
379 connect(_windAngleEdit, SIGNAL(returnPressed()), this, SLOT(windAngleChanged()));
380 connect(_windAngleEdit, SIGNAL(focusOut()), this, SLOT(windAngleChanged()));
381 connect(this, SIGNAL(windAngleChangedSignal(double)), _scene, SLOT(windAngleChanged(double)));
382 connect(_windSpeedEdit, SIGNAL(returnPressed()), this, SLOT(windSpeedChanged()));
383 connect(_windSpeedEdit, SIGNAL(focusOut()), this, SLOT(windSpeedChanged()));
384 connect(this, SIGNAL(windSpeedChangedSignal(double)), _scene, SLOT(windSpeedChanged(double)));
385 connect(_flowDirectionEdit, SIGNAL(returnPressed()), this, SLOT(flowDirectionChanged()));
386 connect(_flowDirectionEdit, SIGNAL(focusOut()), this, SLOT(flowDirectionChanged()));
387 connect(this, SIGNAL(flowDirectionChangedSignal(QString)), _scene, SLOT(flowDirectionChanged(QString)));
388 connect(_directionalFactorExponentEdit, SIGNAL(returnPressed()), this, SLOT(directionalFactorExponentChanged()));
389 connect(_directionalFactorExponentEdit, SIGNAL(focusOut()), this, SLOT(directionalFactorExponentChanged()));
390 connect(this,
391 SIGNAL(directionalFactorExponentChangedSignal(double)),
392 _scene,
393 SLOT(directionalFactorExponentChanged(double)));
394 connect(
395 _directionalReflectionDampingEdit, SIGNAL(returnPressed()), this, SLOT(directionalReflectionDampingChanged()));
396 connect(_directionalReflectionDampingEdit, SIGNAL(focusOut()), this, SLOT(directionalReflectionDampingChanged()));
397 connect(this,
398 SIGNAL(directionalReflectionDampingChangedSignal(double)),
399 _scene,
400 SLOT(directionalReflectionDampingChanged(double)));
401 connect(_sharpenEdit, SIGNAL(returnPressed()), this, SLOT(sharpenChanged()));
402 connect(_sharpenEdit, SIGNAL(focusOut()), this, SLOT(sharpenChanged()));
403 connect(this, SIGNAL(sharpenChangedSignal(double)), _scene, SLOT(sharpenChanged(double)));
404
405 // when the widget is resized, resize the curve widget
406 connect(curveView, SIGNAL(resizeSignal(int, int)), _scene, SLOT(resize(int, int)));
407 }
408
409 void ExprDeepWater::resolutionChanged() {
410 int val = QString(_resolutionEdit->text()).toInt();
411 emit resolutionChangedSignal(val);
412 }
413
414 void ExprDeepWater::tileSizeChanged() {
415 double val = QString(_tileSizeEdit->text()).toDouble();
416 emit tileSizeChangedSignal(val);
417 }
418
419 void ExprDeepWater::lengthCutoffChanged() {
420 double val = QString(_lengthCutoffEdit->text()).toDouble();
421 emit lengthCutoffChangedSignal(val);
422 }
423
424 void ExprDeepWater::amplitudeChanged() {
425 double val = QString(_amplitudeEdit->text()).toDouble();
426 emit amplitudeChangedSignal(val);
427 }
428
429 void ExprDeepWater::windAngleChanged() {
430 double val = QString(_windAngleEdit->text()).toDouble();
431 emit windAngleChangedSignal(val);
432 }
433
434 void ExprDeepWater::windSpeedChanged() {
435 double val = QString(_windSpeedEdit->text()).toDouble();
436 emit windSpeedChangedSignal(val);
437 }
438
439 void ExprDeepWater::flowDirectionChanged() { emit flowDirectionChangedSignal(_flowDirectionEdit->text()); }
440
441 void ExprDeepWater::directionalFactorExponentChanged() {
442 double val = QString(_directionalFactorExponentEdit->text()).toDouble();
443 emit directionalFactorExponentChangedSignal(val);
444 }
445
446 void ExprDeepWater::directionalReflectionDampingChanged() {
447 double val = QString(_directionalReflectionDampingEdit->text()).toDouble();
448 emit directionalReflectionDampingChangedSignal(val);
449 }
450
451 void ExprDeepWater::sharpenChanged() {
452 double val = QString(_sharpenEdit->text()).toDouble();
453 emit sharpenChangedSignal(val);
454 }
455
456 void ExprDeepWater::setParams(const SeDeepWaterParams &params) {
457 _scene->setParams(params);
458 _resolutionEdit->setText(QString::number(params.resolution));
459 _tileSizeEdit->setText(QString::number(params.tileSize));
460 _lengthCutoffEdit->setText(QString::number(params.lengthCutoff));
461 _amplitudeEdit->setText(QString::number(params.amplitude));
462 _windAngleEdit->setText(QString::number(params.windAngle));
463 _windSpeedEdit->setText(QString::number(params.windSpeed));
464 QString flowDirection = "[";
465 flowDirection += QString::number(params.flowDirection[0]) + "," + QString::number(params.flowDirection[1]) + "," +
466 QString::number(params.flowDirection[2]) + "]";
467 _flowDirectionEdit->setText(flowDirection);
468 _directionalFactorExponentEdit->setText(QString::number(params.directionalFactorExponent));
469 _directionalReflectionDampingEdit->setText(QString::number(params.directionalReflectionDamping));
470 _sharpenEdit->setText(QString::number(params.sharpen));
471 }
DeepWaterScene::setParams
void setParams(const SeDeepWaterParams &paramsIn)
Definition: ExprDeepWater.cpp:108
DeepWaterScene::rebuildDeepWater
void rebuildDeepWater()
Definition: ExprDeepWater.cpp:116
DeepWaterScene::sharpenChanged
void sharpenChanged(double val)
Definition: ExprDeepWater.cpp:103
ExprDeepWater::amplitudeChangedSignal
void amplitudeChangedSignal(double val)
ExprDeepWater::directionalFactorExponentChangedSignal
void directionalFactorExponentChangedSignal(double val)
SeDeepWaterParams::lengthCutoff
double lengthCutoff
Definition: ExprDeepWater.h:54
ExprDeepWater::resolutionChangedSignal
void resolutionChangedSignal(int val)
ExprDeepWater::lengthCutoffChangedSignal
void lengthCutoffChangedSignal(double val)
DeepWaterGraphicsView::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Definition: ExprDeepWater.cpp:34
DeepWaterScene::directionalReflectionDampingChanged
void directionalReflectionDampingChanged(double val)
Definition: ExprDeepWater.cpp:98
DeepWaterScene::_width
int _width
Definition: ExprDeepWater.h:241
DeepWaterScene
Definition: ExprDeepWater.h:197
DeepWaterLineEdit
Definition: ExprDeepWater.h:176
DeepWaterScene::flowDirectionChanged
void flowDirectionChanged(QString val)
Definition: ExprDeepWater.cpp:85
DeepWaterScene::directionalFactorExponentChanged
void directionalFactorExponentChanged(double val)
Definition: ExprDeepWater.cpp:93
DeepWaterScene::deepWaterChanged
void deepWaterChanged()
SeDeepWaterParams::tileSize
double tileSize
Definition: ExprDeepWater.h:53
ExprDeepWater::flowDirectionChanged
void flowDirectionChanged()
Definition: ExprDeepWater.cpp:439
DeepWaterScene::_curvePoly
QGraphicsPolygonItem * _curvePoly
Definition: ExprDeepWater.h:243
SeDeepWaterParams::resolution
int resolution
Definition: ExprDeepWater.h:52
SeDeepWater::getKLow
T getKLow()
Definition: ExprDeepWater.h:137
ExprDeepWater::_amplitudeEdit
DeepWaterLineEdit * _amplitudeEdit
Definition: ExprDeepWater.h:286
ExprDeepWater::windSpeedChangedSignal
void windSpeedChangedSignal(double val)
SeDeepWater::getKHigh
T getKHigh()
Definition: ExprDeepWater.h:142
ExprDeepWater::_lengthCutoffEdit
DeepWaterLineEdit * _lengthCutoffEdit
Definition: ExprDeepWater.h:285
DeepWaterScene::_baseRect
QGraphicsRectItem * _baseRect
Definition: ExprDeepWater.h:244
DeepWaterScene::T_CURVE
SeDeepWater< double > T_CURVE
Definition: ExprDeepWater.h:200
ExprDeepWater::ExprDeepWater
ExprDeepWater(QWidget *parent=0)
Definition: ExprDeepWater.cpp:165
DeepWaterScene::lengthCutoffChanged
void lengthCutoffChanged(double val)
Definition: ExprDeepWater.cpp:65
DeepWaterScene::tileSizeChanged
void tileSizeChanged(double val)
Definition: ExprDeepWater.cpp:60
ExprDeepWater::windSpeedChanged
void windSpeedChanged()
Definition: ExprDeepWater.cpp:434
DeepWaterScene::drawGrid
void drawGrid()
Definition: ExprDeepWater.cpp:154
SeDeepWaterParams::flowDirection
SeExpr2::Vec3d flowDirection
Definition: ExprDeepWater.h:60
ExprDeepWater.h
ExprDeepWater::windAngleChangedSignal
void windAngleChangedSignal(double val)
DeepWaterScene::_height
int _height
Definition: ExprDeepWater.h:242
SeDeepWater::getValue
T getValue(double param) const
Evaluates curve and returns full value.
Definition: ExprDeepWater.h:129
ExprDeepWater::setParams
void setParams(const SeDeepWaterParams &params)
Definition: ExprDeepWater.cpp:456
ExprDeepWater::_directionalFactorExponentEdit
DeepWaterLineEdit * _directionalFactorExponentEdit
Definition: ExprDeepWater.h:290
SeDeepWater::inGrid
bool inGrid()
Definition: ExprDeepWater.h:147
ExprDeepWater::amplitudeChanged
void amplitudeChanged()
Definition: ExprDeepWater.cpp:424
ExprDeepWater::_windAngleEdit
DeepWaterLineEdit * _windAngleEdit
Definition: ExprDeepWater.h:287
ExprDeepWater::sharpenChanged
void sharpenChanged()
Definition: ExprDeepWater.cpp:451
SeDeepWaterParams::windSpeed
double windSpeed
Definition: ExprDeepWater.h:57
ExprDeepWater::_directionalReflectionDampingEdit
DeepWaterLineEdit * _directionalReflectionDampingEdit
Definition: ExprDeepWater.h:291
DeepWaterScene::amplitudeChanged
void amplitudeChanged(double val)
Definition: ExprDeepWater.cpp:70
ExprDeepWater::tileSizeChanged
void tileSizeChanged()
Definition: ExprDeepWater.cpp:414
SeDeepWaterParams::amplitude
double amplitude
Definition: ExprDeepWater.h:55
ExprBuiltins.h
DeepWaterScene::params
SeDeepWaterParams params
Definition: ExprDeepWater.h:218
ExprDeepWater::_resolutionEdit
DeepWaterLineEdit * _resolutionEdit
Definition: ExprDeepWater.h:283
DeepWaterScene::drawPoly
void drawPoly()
Definition: ExprDeepWater.cpp:136
DeepWaterScene::_gridRect
QGraphicsRectItem * _gridRect
Definition: ExprDeepWater.h:245
SeDeepWater::setParams
void setParams(const SeDeepWaterParams &paramsIn)
Definition: ExprDeepWater.h:71
SeDeepWaterParams::windAngle
double windAngle
Definition: ExprDeepWater.h:56
DeepWaterScene::~DeepWaterScene
~DeepWaterScene()
Definition: ExprDeepWater.cpp:43
SeDeepWaterParams::sharpen
double sharpen
Definition: ExprDeepWater.h:61
ExprDeepWater::sharpenChangedSignal
void sharpenChangedSignal(double val)
SeDeepWaterParams::directionalFactorExponent
double directionalFactorExponent
Definition: ExprDeepWater.h:58
SeExpr2::Vec3d
Vec< double, 3, false > Vec3d
Definition: Vec.h:384
ExprDeepWater::_flowDirectionEdit
DeepWaterLineEdit * _flowDirectionEdit
Definition: ExprDeepWater.h:289
SeDeepWaterParams
Definition: ExprDeepWater.h:33
DeepWaterScene::windSpeedChanged
void windSpeedChanged(double val)
Definition: ExprDeepWater.cpp:80
DeepWaterGraphicsView
Definition: ExprDeepWater.h:161
ExprDeepWater::directionalFactorExponentChanged
void directionalFactorExponentChanged()
Definition: ExprDeepWater.cpp:441
SeDeepWater::generateSpectrum
void generateSpectrum()
Definition: ExprDeepWater.h:100
ExprDeepWater::windAngleChanged
void windAngleChanged()
Definition: ExprDeepWater.cpp:429
ExprDeepWater::lengthCutoffChanged
void lengthCutoffChanged()
Definition: ExprDeepWater.cpp:419
ExprDeepWater::directionalReflectionDampingChangedSignal
void directionalReflectionDampingChangedSignal(double val)
ExprDeepWater::_tileSizeEdit
DeepWaterLineEdit * _tileSizeEdit
Definition: ExprDeepWater.h:284
ExprDeepWater::flowDirectionChangedSignal
void flowDirectionChangedSignal(QString val)
ExprDeepWater::tileSizeChangedSignal
void tileSizeChangedSignal(double val)
SeDeepWaterParams::directionalReflectionDamping
double directionalReflectionDamping
Definition: ExprDeepWater.h:59
SeDeepWater
Definition: ExprDeepWater.h:67
ExprDeepWater::directionalReflectionDampingChanged
void directionalReflectionDampingChanged()
Definition: ExprDeepWater.cpp:446
DeepWaterScene::_curve
T_CURVE * _curve
Definition: ExprDeepWater.h:221
ExprDeepWater::_windSpeedEdit
DeepWaterLineEdit * _windSpeedEdit
Definition: ExprDeepWater.h:288
components
If a scalar is used in a vector it is replicated into the three components(e.g. 0.5 becomes[0.5, 0.5, 0.5]). &nbsp
DeepWaterGraphicsView::resizeSignal
void resizeSignal(int width, int height)
DeepWaterScene::windAngleChanged
void windAngleChanged(double val)
Definition: ExprDeepWater.cpp:75
ExprDeepWater::_scene
DeepWaterScene * _scene
Definition: ExprDeepWater.h:255
DeepWaterScene::resolutionChanged
void resolutionChanged(int val)
Definition: ExprDeepWater.cpp:55
DeepWaterScene::resize
void resize(const int width, const int height)
Definition: ExprDeepWater.cpp:45
DeepWaterScene::drawRect
void drawRect()
Definition: ExprDeepWater.cpp:127
x
</pre >< h3 > A simple variable reference</h3 > This is not a very interesting subclass of expression until we add some additional variables Variables on some applications may be very dynamic In this we only need x
Definition: tutorial.txt:108
DeepWaterScene::DeepWaterScene
DeepWaterScene()
Definition: ExprDeepWater.cpp:38
ExprDeepWater::resolutionChanged
void resolutionChanged()
Definition: ExprDeepWater.cpp:409
DeepWaterScene::emitDeepWaterChanged
void emitDeepWaterChanged()
Definition: ExprDeepWater.cpp:124
ExprDeepWater::_sharpenEdit
DeepWaterLineEdit * _sharpenEdit
Definition: ExprDeepWater.h:292