~ubuntu-branches/debian/sid/qspeakers/sid

« back to all changes in this revision

Viewing changes to portedbox.h

  • Committer: Package Import Robot
  • Author(s): Benoît Rouits
  • Date: 2016-10-25 21:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20161025212327-oyyitrn6c9ac6706
Tags: upstream-1.0
Import upstream version 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef PORTEDBOX_H
 
2
#define PORTEDBOX_H
 
3
 
 
4
#include <QDomElement>
 
5
 
 
6
#include "sealedbox.h"
 
7
#define K 0.732 /* correction factor for a half flanged disposed port */
 
8
 
 
9
class PortedBox : public Box
 
10
{
 
11
public:
 
12
    PortedBox(double volume = 0.01, double resfreq = 1, unsigned int portnum = 1, double portdiam = 0, double portlen = 0);
 
13
    void setBoxVolume(double vol);
 
14
    void setPortNum(unsigned int value);
 
15
    void setPortLen(double len);
 
16
    void setPortDiam(double diam);
 
17
    void setSlotWidth(double width);
 
18
    void setResFreq(double value);
 
19
 
 
20
    double getBoxVolume(void) const;
 
21
    unsigned int getPortNum() const;
 
22
    double getPortLen(void) const;
 
23
    double getPortDiam(void) const;
 
24
    double getSlotWidth() const;
 
25
    double getSlotHeight() const;
 
26
    double getResFreq() const;
 
27
 
 
28
    void updateSlots();
 
29
    void updatePorts(double sd, double xmax);
 
30
    void updatePortsLength();
 
31
 
 
32
    QDomElement toDomElement(QDomDocument& doc) const;
 
33
    void fromDomElement(const QDomElement& e);
 
34
    void render(QPainter *painter, const QRectF& area);
 
35
 
 
36
private:
 
37
    SealedBox box;
 
38
    double resFreq;
 
39
 
 
40
    unsigned int portNum;
 
41
    double portLen;
 
42
    double portDiam;
 
43
    double slotWidth;
 
44
};
 
45
 
 
46
#endif // PORTEDBOX_H