Skip to content

Commit

Permalink
Update clang-format config
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed May 21, 2024
1 parent 4c38006 commit e969096
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 60 deletions.
12 changes: 6 additions & 6 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Left
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: None
Expand All @@ -12,13 +12,13 @@ AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
Expand Down Expand Up @@ -51,12 +51,12 @@ BreakInheritanceList: BeforeComma
BreakStringLiterals: true
ColumnLimit: 120
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
DisableFormat: false
FixNamespaceComments: true
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
Expand All @@ -69,7 +69,7 @@ PointerAlignment: Left
ReferenceAlignment: Left
ReflowComments: true
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
Expand Down
12 changes: 6 additions & 6 deletions src/ra/acoustics/stochastic_raytracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ auto StochasticRaytracing::randomRaysOnSphere(size_t count, std::mt19937& rng) -
auto StochasticRaytracing::getWallNormal(std::ptrdiff_t index) -> glm::dvec3
{
static constexpr auto surfaces = std::array{
glm::dvec3{1.0, 0.0, 0.0 },
glm::dvec3{-1.0, 0.0, 0.0 },
glm::dvec3{0.0, 1.0, 0.0 },
glm::dvec3{0.0, -1.0, 0.0 },
glm::dvec3{0.0, 0.0, 1.0 },
glm::dvec3{0.0, 0.0, -1.0},
glm::dvec3{ 1.0, 0.0, 0.0},
glm::dvec3{-1.0, 0.0, 0.0},
glm::dvec3{ 0.0, 1.0, 0.0},
glm::dvec3{ 0.0, -1.0, 0.0},
glm::dvec3{ 0.0, 0.0, 1.0},
glm::dvec3{ 0.0, 0.0, -1.0},
};

assert(index >= 0);
Expand Down
33 changes: 14 additions & 19 deletions src/ra/raum_akustik/tabs/absorber_simulation_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ PorousAbsorberSimulationEditor::PorousAbsorberSimulationEditor(juce::ValueTree v
_absorberSpecs.addSection(
"Atmospheric Environment",
juce::Array<juce::PropertyComponent*>{
new juce::SliderPropertyComponent{_temperature.getPropertyAsValue(), "Temperature (C)", 0.0, 100.0, 1.0 },
new juce::SliderPropertyComponent{_pressure.getPropertyAsValue(), "Pressure (Bar)", 0.0, 2.0, 0.01},
new juce::SliderPropertyComponent{_temperature.getPropertyAsValue(), "Temperature (C)", 0.0, 100.0, 1.0},
new juce::SliderPropertyComponent{ _pressure.getPropertyAsValue(), "Pressure (Bar)", 0.0, 2.0, 0.01},
}
);

Expand All @@ -38,37 +38,32 @@ PorousAbsorberSimulationEditor::PorousAbsorberSimulationEditor(juce::ValueTree v
juce::Array<juce::PropertyComponent*>{
new juce::SliderPropertyComponent{
_absorberThickness.getPropertyAsValue(),
"Thickness (mm)", 0.0,
1000.0, 1.0
},
"Thickness (mm)", 0.0,
1000.0, 1.0 },
new juce::SliderPropertyComponent{
_absorberFlowResisitivity.getPropertyAsValue(),
"Flow Resisitivity", 0.0,
40'000.0, 1.0
},
"Flow Resisitivity", 0.0,
40'000.0, 1.0 },
new juce::SliderPropertyComponent{
_absorberAngleOfIncidence.getPropertyAsValue(),
"Angle Of Incidence", 0.0,
90.0, 1.0
},
new juce::SliderPropertyComponent{_absorberAirGap.getPropertyAsValue(), "Air Gap (mm)", 0.0, 1000.0, 1.0},
"Angle Of Incidence", 0.0,
90.0, 1.0 },
new juce::SliderPropertyComponent{ _absorberAirGap.getPropertyAsValue(), "Air Gap (mm)", 0.0, 1000.0, 1.0},
}
);

_absorberSpecs.addSection(
"Plot",
juce::Array<juce::PropertyComponent*>{
new juce::SliderPropertyComponent{_plotNumPoints.getPropertyAsValue(), "Num Points", 0.0, 256.0, 1.0},
new juce::SliderPropertyComponent{_plotNumPoints.getPropertyAsValue(),"Num Points", 0.0,256.0, 1.0 },
new juce::SliderPropertyComponent{
_plotStartFrequency.getPropertyAsValue(),
"Start Frequency", 0.0,
60.0, 1.0
},
"Start Frequency", 0.0,
60.0, 1.0},
new juce::SliderPropertyComponent{
_plotOctaveSubdivision.getPropertyAsValue(),
"Octave Subdivisions", 0.0,
12.0, 1.0
},
"Octave Subdivisions", 0.0,
12.0, 1.0},
}
);

Expand Down
55 changes: 32 additions & 23 deletions src/ra/raum_akustik/tabs/room_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
namespace ra {

static constexpr auto Materials = std::array<std::pair<char const*, std::array<double, 10>>, 18>{
std::pair{"Painted concrete", std::array{0.01, 0.01, 0.01, 0.05, 0.06, 0.07, 0.09, 0.08, 0.08, 0.08} },
std::pair{"Coarse concrete", std::array{0.36, 0.36, 0.36, 0.44, 0.31, 0.29, 0.39, 0.25, 0.25, 0.25} },
std::pair{"Wood floor", std::array{0.15, 0.15, 0.15, 0.11, 0.1, 0.07, 0.06, 0.07, 0.07, 0.07} },
std::pair{"Vinyl flooring", std::array{0.03, 0.03, 0.03, 0.04, 0.05, 0.04, 0.05, 0.05, 0.05, 0.05} },
std::pair{"Window glass", std::array{0.35, 0.35, 0.35, 0.25, 0.18, 0.12, 0.07, 0.04, 0.04, 0.04} },
std::pair{"Plate glass", std::array{0.18, 0.18, 0.18, 0.06, 0.04, 0.03, 0.02, 0.02, 0.02, 0.02} },
std::pair{"6mm glass", std::array{0.1, 0.1, 0.1, 0.06, 0.04, 0.03, 0.02, 0.02, 0.02, 0.02} },
std::pair{"Brickwork", std::array{0.05, 0.05, 0.05, 0.04, 0.02, 0.04, 0.05, 0.05, 0.05, 0.05} },
std::pair{"Drapes 1/2 area. 15oz/sq yd", std::array{0.07, 0.07, 0.07, 0.37, 0.49, 0.81, 0.65, 0.54, 0.54, 0.54} },
std::pair{"Foam backed carpet on concrete", std::array{0.05, 0.05, 0.05, 0.16, 0.44, 0.7, 0.6, 0.4, 0.4, 0.4} },
std::pair{"Carpet + foam underlay on concrete", std::array{0.15, 0.15, 0.15, 0.25, 0.5, 0.6, 0.7, 0.8, 0.8, 0.8} },
std::pair{"Plaster on brick", std::array{0.013, 0.013, 0.013, 0.015, 0.02, 0.03, 0.04, 0.05, 0.05, 0.05}},
std::pair{"9mm Plasterboard over 20mm air gap", std::array{0.3, 0.3, 0.3, 0.2, 0.15, 0.05, 0.05, 0.05, 0.05, 0.05} },
std::pair{"Breeze block", std::array{0.25, 0.25, 0.25, 0.4, 0.6, 0.5, 0.75, 0.5, 0.5, 0.5} },
std::pair{"50mm Acoustic Foam", std::array{0.08, 0.08, 0.08, 0.25, 0.6, 0.9, 0.95, 0.9, 0.9, 0.9} },
std::pair{"100mm Acoustic Foam", std::array{0.2, 0.2, 0.2, 0.7, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99} },
std::pair{"50mm Mineral Wool (Med Density)", std::array{0.2, 0.2, 0.2, 0.45, 0.7, 0.8, 0.8, 0.8, 0.8, 0.8} },
std::pair{"LF panel absorber", std::array{0.28, 0.28, 0.28, 0.22, 0.17, 0.09, 0.1, 0.11, 0.11, 0.11} },
std::pair{ "Painted concrete", std::array{0.01, 0.01, 0.01, 0.05, 0.06, 0.07, 0.09, 0.08, 0.08, 0.08}},
std::pair{ "Coarse concrete", std::array{0.36, 0.36, 0.36, 0.44, 0.31, 0.29, 0.39, 0.25, 0.25, 0.25}},
std::pair{ "Wood floor", std::array{0.15, 0.15, 0.15, 0.11, 0.1, 0.07, 0.06, 0.07, 0.07, 0.07}},
std::pair{ "Vinyl flooring", std::array{0.03, 0.03, 0.03, 0.04, 0.05, 0.04, 0.05, 0.05, 0.05, 0.05}},
std::pair{ "Window glass", std::array{0.35, 0.35, 0.35, 0.25, 0.18, 0.12, 0.07, 0.04, 0.04, 0.04}},
std::pair{ "Plate glass", std::array{0.18, 0.18, 0.18, 0.06, 0.04, 0.03, 0.02, 0.02, 0.02, 0.02}},
std::pair{ "6mm glass", std::array{0.1, 0.1, 0.1, 0.06, 0.04, 0.03, 0.02, 0.02, 0.02, 0.02}},
std::pair{ "Brickwork", std::array{0.05, 0.05, 0.05, 0.04, 0.02, 0.04, 0.05, 0.05, 0.05, 0.05}},
std::pair{ "Drapes 1/2 area. 15oz/sq yd", std::array{0.07, 0.07, 0.07, 0.37, 0.49, 0.81, 0.65, 0.54, 0.54, 0.54}},
std::pair{ "Foam backed carpet on concrete", std::array{0.05, 0.05, 0.05, 0.16, 0.44, 0.7, 0.6, 0.4, 0.4, 0.4}},
std::pair{"Carpet + foam underlay on concrete", std::array{0.15, 0.15, 0.15, 0.25, 0.5, 0.6, 0.7, 0.8, 0.8, 0.8}},
std::pair{ "Plaster on brick", std::array{0.013, 0.013, 0.013, 0.015, 0.02, 0.03, 0.04, 0.05, 0.05, 0.05}},
std::pair{"9mm Plasterboard over 20mm air gap", std::array{0.3, 0.3, 0.3, 0.2, 0.15, 0.05, 0.05, 0.05, 0.05, 0.05}},
std::pair{ "Breeze block", std::array{0.25, 0.25, 0.25, 0.4, 0.6, 0.5, 0.75, 0.5, 0.5, 0.5}},
std::pair{ "50mm Acoustic Foam", std::array{0.08, 0.08, 0.08, 0.25, 0.6, 0.9, 0.95, 0.9, 0.9, 0.9}},
std::pair{ "100mm Acoustic Foam", std::array{0.2, 0.2, 0.2, 0.7, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99}},
std::pair{ "50mm Mineral Wool (Med Density)", std::array{0.2, 0.2, 0.2, 0.45, 0.7, 0.8, 0.8, 0.8, 0.8, 0.8}},
std::pair{ "LF panel absorber", std::array{0.28, 0.28, 0.28, 0.22, 0.17, 0.09, 0.1, 0.11, 0.11, 0.11}},
};

RoomEditor::RoomEditor(juce::ValueTree vt, juce::UndoManager* um)
Expand All @@ -43,9 +43,18 @@ auto RoomEditor::getRoomLayout() const -> RoomLayout
{
return {
RoomDimensions{_roomLength, _roomWidth, _roomHeight},
glm::dvec3(double{_leftX}, double{_leftY}, double{_leftZ} ),
glm::dvec3(double{_rightX}, double{_rightY}, double{_rightZ} ),
glm::dvec3(double{_listenX}, double{_listenY}, double{_listenZ} ),
glm::dvec3(double{_leftX},
double{_leftY},
double{_leftZ}
),
glm::dvec3(double{_rightX},
double{_rightY},
double{_rightZ}
),
glm::dvec3(double{_listenX},
double{_listenY},
double{_listenZ}
),
};
}

Expand Down Expand Up @@ -170,7 +179,7 @@ auto RoomEditor::buildProperties() -> void
"Room Dimensions",
juce::Array<juce::PropertyComponent*>{
new juce::SliderPropertyComponent{_roomLength.getPropertyAsValue(), "Length", 0.0, 10.0, 0.01},
new juce::SliderPropertyComponent{_roomWidth.getPropertyAsValue(), "Width", 0.0, 10.0, 0.01},
new juce::SliderPropertyComponent{ _roomWidth.getPropertyAsValue(), "Width", 0.0, 10.0, 0.01},
new juce::SliderPropertyComponent{_roomHeight.getPropertyAsValue(), "Height", 0.0, 10.0, 0.01},
}
);
Expand Down Expand Up @@ -207,7 +216,7 @@ auto RoomEditor::buildProperties() -> void
_renderProperties.addSection(
"First Reflections",
juce::Array<juce::PropertyComponent*>{
new juce::BooleanPropertyComponent{_renderLeftReflections.getPropertyAsValue(), "Left", "Draw"},
new juce::BooleanPropertyComponent{ _renderLeftReflections.getPropertyAsValue(), "Left", "Draw"},
new juce::BooleanPropertyComponent{_renderRightReflections.getPropertyAsValue(), "Right", "Draw"},
}
);
Expand Down
12 changes: 6 additions & 6 deletions src/ra/raum_akustik/tabs/stochastic_raytracing_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ auto StochasticRaytracingEditor::run() -> void
.floor = woodFloor,
};
auto const scattering = RoomScattering{
.front = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.back = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.left = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.right = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.ceiling = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.floor = {0.01, 0.01, 0.01, 0.05, 0.1, 0.2, 0.3, 0.5, 0.5, 0.5},
.front = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.back = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.left = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.right = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.ceiling = {0.05, 0.05, 0.05, 0.3, 0.4, 0.5, 0.55, 0.6, 0.6, 0.6},
.floor = {0.01, 0.01, 0.01, 0.05, 0.1, 0.2, 0.3, 0.5, 0.5, 0.5},
};

auto const room = StochasticRaytracing::Room{
Expand Down

0 comments on commit e969096

Please sign in to comment.