/[qspeakers]/branches/qtcharts/portedbox.h
ViewVC logotype

Contents of /branches/qtcharts/portedbox.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 252 - (show annotations)
Mon Sep 21 21:59:01 2020 UTC (8 months, 4 weeks ago) by ben
File MIME type: text/plain
File size: 1389 byte(s)
version 1.4, fix slot port len
1 #ifndef PORTEDBOX_H
2 #define PORTEDBOX_H
3
4 #include <QDomElement>
5 #include <QDomDocument>
6 #include <QRectF>
7 #include <QPainter>
8
9 #include "sealedbox.h"
10 #define K 0.732 /* correction factor for a half flanged disposed port */
11
12 class PortedBox : public Box
13 {
14 public:
15 PortedBox(double volume = 0.01, double resfreq = 1, unsigned int portnum = 1, double portdiam = 0, double portlen = 0);
16 void setBoxVolume(double vol);
17 void setPortNum(unsigned int value);
18 void setPortLen(double len);
19 void setPortDiam(double diam);
20 void setSlotWidth(double width);
21 void setResFreq(double value);
22 void setSlotPortActivated(bool enable);
23
24 double getBoxVolume(void) const;
25 unsigned int getPortNum() const;
26 double getPortLen(void) const;
27 double getPortDiam(void) const;
28 bool getSlotPortActivated(void) const;
29 double getSlotWidth() const;
30 double getSlotHeight() const;
31 double getResFreq() const;
32
33 void updateSlots();
34 void updatePorts(double sd, double xmax);
35 void updatePortsLength();
36
37 QDomElement toDomElement(QDomDocument& doc) const;
38 void fromDomElement(const QDomElement& e);
39 void render(QPainter *painter, const QRectF& area) const;
40
41 private:
42 SealedBox box;
43 double resFreq;
44
45 unsigned int portNum;
46 double portLen;
47 double portDiam;
48 double slotWidth;
49 bool slotActivated;
50 };
51
52 #endif // PORTEDBOX_H

  ViewVC Help
Powered by ViewVC 1.1.26