SPAOP
|
An abstract class for a GUI component that displays a two-dimensional view of WONDER sources and the speaker arrays. More...
#include <SourceDisplay.h>
Public Member Functions | |
SourceDisplay (const String &componentName=String::empty, int dotSize=10, int roomLineThickness=2, const Colour roomColour=Colours::yellow, const Colour bgColour=Colours::black) | |
Constructor. More... | |
virtual | ~SourceDisplay () |
Destructor. More... | |
void | paint (Graphics &g) |
Overriding juce::Component::paint, this will fill the display with its background colour and draw the speaker arrays. More... | |
void | setPositionDotSize (int diameter) |
Sets the size of the dot indicating the source's position. More... | |
int | getPositionDotSize () const |
Returns the size of the dot indicating the source's position (diameter in pixels). More... | |
bool | setRoom (std::shared_ptr< const wonder::Room > room) |
Sets the wonder::Room object that is used for painting the positions of the speaker arrays. More... | |
void | setShowNames (bool showNames) |
Sets whether the names of the sources shall be shown next to them. More... | |
bool | showsNames () const |
Returns the current showNames setting. More... | |
Public Member Functions inherited from wonderjuce::ComponentWithFocusPoint | |
ComponentWithFocusPoint (const String &componentName=String::empty) | |
Constructor. More... | |
virtual | ~ComponentWithFocusPoint () |
Destructor. More... | |
virtual Point< float > | getFocusPoint ()=0 |
Returns the "focus point", the point where this component shall be auto-centered (for example, when it is zoomed into). More... | |
virtual float | getFocusPointX ()=0 |
Returns the x-coordinate of the "focus point". More... | |
virtual float | getFocusPointY ()=0 |
Returns the y-coordinate of the "focus point". More... | |
Protected Member Functions | |
void | paintSource (Graphics &g, const wonder::Source &source, uint8_t alpha=0xFF) |
Paints a wonder::Source. More... | |
An abstract class for a GUI component that displays a two-dimensional view of WONDER sources and the speaker arrays.
The methods of ComponentWithFocusPoint, desired reactions to mouse-actions must be implemented in a derived class. Also, this class does not actually paint any sources, it only offers a paintSource method that must be called from derived classes.
wonderjuce::SourceDisplay::SourceDisplay | ( | const String & | componentName = String::empty , |
int | dotSize = 10 , |
||
int | roomLineThickness = 2 , |
||
const Colour | roomColour = Colours::yellow , |
||
const Colour | bgColour = Colours::black |
||
) |
Constructor.
componentName | The name of this component. |
dotSize | The size of the dot indicating the source's position (in pixels). |
roomLineThickness | The thickness of the line that indicates the speaker arrays (in pixels). |
roomColour | The colour of the speaker arrays. |
bgColour | The background colour. |
|
virtual |
Destructor.
int wonderjuce::SourceDisplay::getPositionDotSize | ( | ) | const |
Returns the size of the dot indicating the source's position (diameter in pixels).
void wonderjuce::SourceDisplay::paint | ( | Graphics & | g | ) |
Overriding juce::Component::paint, this will fill the display with its background colour and draw the speaker arrays.
In derived classes, this should be the called from their paint method before drawing any sources.
g | The graphics context to be used for drawing. |
|
protected |
Paints a wonder::Source.
Can be called from the paint methods of derived classes to paint sources (at their position, with their colour etc.).
g | The graphics context to be used for drawing. |
source | The source to be painted. |
alpha | The alpha-channel value for painting the source. This can be used for drawing semi-transparent sources. |
void wonderjuce::SourceDisplay::setPositionDotSize | ( | int | diameter | ) |
Sets the size of the dot indicating the source's position.
Various other sizes are determined by this (i.e. the size of the arrow indciating a plane wave source and the text size of the source names).
diameter | The dot's diameter in pixels. |
bool wonderjuce::SourceDisplay::setRoom | ( | std::shared_ptr< const wonder::Room > | room | ) |
Sets the wonder::Room object that is used for painting the positions of the speaker arrays.
room | A (reference-counted) shared pointer to the wonder::Room object used for painting the speaker arrays. |
void wonderjuce::SourceDisplay::setShowNames | ( | bool | showNames | ) |
Sets whether the names of the sources shall be shown next to them.
showNames | true if the names of the sources shall be shown next to them. |
bool wonderjuce::SourceDisplay::showsNames | ( | ) | const |
Returns the current showNames setting.
If this is true, the names of the sources are shown.