SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Room.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014 Martin Hansen
3  *
4  * This file is part of SPAOP (Spatial Audio Object Positioner).
5  *
6  * SPAOP is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * SPAOP is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with SPAOP. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef ROOM_H_INCLUDED
21 #define ROOM_H_INCLUDED
22 
23 #include <iostream>
24 #include <vector>
25 #include "WonderHeader.h"
26 
27 namespace wonder {
28 
35 class Room
36 {
37 public:
38 
40  struct Vertex
41  {
42  float x;
43  float y;
44  float z;
47  Vertex(): x(0), y(0), z(0){}
48 
50  Vertex(float xCoord, float yCoord, float zCoord):
51  x(xCoord), y(yCoord), z(zCoord){}
52  };
53 
59  Room(const std::string &name="", int nOfVertices = 0);
60 
62  virtual ~Room();
63 
67  const std::string& getName() const;
68 
70  int getNumberOfVertices() const;
71 
81  const Vertex& getVertex(int vertexNo) const;
82 
90  void setVertex(int vertexNo, const Vertex vertex);
91 
92 private:
93  std::string name_;
94  std::vector<Vertex> vertices_; // vertices
95 };
96 
97 }
98 
99 #endif // ROOM_H_INCLUDED
const Vertex & getVertex(int vertexNo) const
Returns a reference to a Vertex of the Room.
Definition: Room.cpp:43
float x
The x-coordinate.
Definition: Room.h:42
int getNumberOfVertices() const
Returns the number of vertices of the room.
Definition: Room.cpp:38
Vertex()
Constructor.
Definition: Room.h:47
float y
The y-coordinate.
Definition: Room.h:43
const std::string & getName() const
The name of the room as provided by cWONDER.
Definition: Room.cpp:33
A struct describing a vertex with its three coordinates.
Definition: Room.h:40
float z
The z-coordinate.
Definition: Room.h:44
Vertex(float xCoord, float yCoord, float zCoord)
Constructor.
Definition: Room.h:50
Room(const std::string &name="", int nOfVertices=0)
Constructor.
Definition: Room.cpp:24
virtual ~Room()
Destructor.
Definition: Room.cpp:29
A class containing the wonder-specific information about a room (name and vertices).
Definition: Room.h:35
void setVertex(int vertexNo, const Vertex vertex)
Updates a vertex of the room.
Definition: Room.cpp:54