Skip to content

Commit

Permalink
Big update docs and syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Aug 28, 2024
1 parent 214279f commit f576f1e
Show file tree
Hide file tree
Showing 23 changed files with 246 additions and 230 deletions.
47 changes: 27 additions & 20 deletions MandelbrotDiscovery/Geometry.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Copyright Christopher Kormanyos 2024.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef GEOMETRY_2024_04_13_H
Expand All @@ -15,8 +15,8 @@
{
using value_type = T;

point_type(const value_type& x_val = value_type(),
const value_type& y_val = value_type())
explicit point_type(const value_type& x_val = value_type(),
const value_type& y_val = value_type())
: my_x(x_val),
my_y(y_val) { }

Expand All @@ -32,7 +32,7 @@

explicit rectangle_type(const point_type& center,
const value_type& dx_half,
const value_type& dy_half = dx_half)
const value_type& dy_half = dx_half) noexcept
: my_center (center),
my_dx_half(dx_half),
my_dy_half(dy_half) { }
Expand All @@ -41,8 +41,8 @@

auto operator*=(const int n) -> rectangle_type&
{
my_dx_half *= n;
my_dy_half *= n;
static_cast<void>(my_dx_half *= n);
static_cast<void>(my_dy_half *= n);

static_cast<void>(set_pixel_assoc(my_pixels_x, my_pixels_y));

Expand All @@ -51,38 +51,45 @@

auto operator/=(const int n) -> rectangle_type&
{
my_dx_half /= n;
my_dy_half /= n;
static_cast<void>(my_dx_half /= n);
static_cast<void>(my_dy_half /= n);

static_cast<void>(set_pixel_assoc(my_pixels_x, my_pixels_y));

return *this;
}

auto upper_left() const -> point_type
auto upper_left() const noexcept -> point_type
{
return
{
point_type
(
my_center.my_x - my_dx_half,
my_center.my_y + my_dy_half
};
);
}

auto lower_right() const -> point_type
auto lower_right() const noexcept -> point_type
{
return
{
point_type
(
my_center.my_x + my_dx_half,
my_center.my_y - my_dy_half
};
);
}

auto dx_half() const noexcept -> value_type
{
return my_dx_half;
}

auto recenter(const point_type& new_center) -> void
auto recenter(const point_type& new_center) noexcept -> void
{
my_center = new_center;
}

auto set_pixel_assoc(const int pa_x, const int pa_y) -> bool
auto set_pixel_assoc(const int pa_x, const int pa_y) noexcept -> bool
{
bool result_is_ok { };

Expand All @@ -103,7 +110,7 @@
return result_is_ok;
}

auto pixel_to_point(const int pa_x, const int pa_y, point_type& pt_val) const -> bool
auto pixel_to_point(const int pa_x, const int pa_y, point_type& pt_val) const noexcept -> bool
{
bool result_is_ok { };

Expand Down
Binary file modified MandelbrotDiscovery/MandelbrotDiscovery.ico
Binary file not shown.
Binary file modified MandelbrotDiscovery/MandelbrotDiscovery.rc
Binary file not shown.
14 changes: 10 additions & 4 deletions MandelbrotDiscovery/MandelbrotDiscovery.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,16 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\concurrency\parallel_for.h" />
<ClInclude Include="..\concurrency\stopwatch.h" />
<ClInclude Include="..\mandelbrot\mandelbrot.h" />
<ClInclude Include="..\mandelbrot\mandelbrot_color.h" />
<ClInclude Include="..\mandelbrot\mandelbrot_generator_perturbative.h" />
<ClInclude Include="..\mandelbrot\mandelbrot_generator_trivial.h" />
<ClInclude Include="..\mandelbrot\text_output.h" />
<ClInclude Include="geometry.h" />
<ClInclude Include="mandelbrot_discovery.h" />
<ClInclude Include="text.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="utility.h" />
</ItemGroup>
<ItemGroup>
Expand All @@ -102,11 +109,10 @@
<ResourceCompile Include="MandelbrotDiscovery.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="MandelbrotDiscovery.ico" />
<Image Include="small.ico" />
<None Include="readme.md" />
</ItemGroup>
<ItemGroup>
<None Include="readme.md" />
<Image Include="MandelbrotDiscovery.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
42 changes: 33 additions & 9 deletions MandelbrotDiscovery/MandelbrotDiscovery.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@
<Filter Include="_doc">
<UniqueIdentifier>{034a081b-19d0-421d-bc9e-64f78778af4c}</UniqueIdentifier>
</Filter>
<Filter Include="mandelbrot">
<UniqueIdentifier>{de0d8cae-70cf-4e55-9cc5-911309601a15}</UniqueIdentifier>
</Filter>
<Filter Include="concurrency">
<UniqueIdentifier>{dda69a90-a29e-43eb-96e8-d844de4988d2}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="mandelbrot_discovery.cpp">
<Filter>MandelbrotDiscovery</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="MandelbrotDiscovery.ico">
<Filter>MandelbrotDiscovery</Filter>
</Image>
<Image Include="small.ico">
<Filter>MandelbrotDiscovery</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ClInclude Include="mandelbrot_discovery.h">
<Filter>MandelbrotDiscovery</Filter>
Expand All @@ -32,7 +30,28 @@
<ClInclude Include="utility.h">
<Filter>MandelbrotDiscovery</Filter>
</ClInclude>
<ClInclude Include="text.h">
<ClInclude Include="..\mandelbrot\mandelbrot.h">
<Filter>mandelbrot</Filter>
</ClInclude>
<ClInclude Include="..\mandelbrot\mandelbrot_color.h">
<Filter>mandelbrot</Filter>
</ClInclude>
<ClInclude Include="..\mandelbrot\mandelbrot_generator_perturbative.h">
<Filter>mandelbrot</Filter>
</ClInclude>
<ClInclude Include="..\mandelbrot\mandelbrot_generator_trivial.h">
<Filter>mandelbrot</Filter>
</ClInclude>
<ClInclude Include="..\mandelbrot\text_output.h">
<Filter>mandelbrot</Filter>
</ClInclude>
<ClInclude Include="..\concurrency\stopwatch.h">
<Filter>concurrency</Filter>
</ClInclude>
<ClInclude Include="..\concurrency\parallel_for.h">
<Filter>concurrency</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>MandelbrotDiscovery</Filter>
</ClInclude>
</ItemGroup>
Expand All @@ -46,4 +65,9 @@
<Filter>_doc</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Image Include="MandelbrotDiscovery.ico">
<Filter>MandelbrotDiscovery</Filter>
</Image>
</ItemGroup>
</Project>
Binary file removed MandelbrotDiscovery/MandelbrotDiscovery_.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion MandelbrotDiscovery/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#define IDI_CIRCLE_CYAN 101
#define IDI_MANDELBROT_DISCO 101
23 changes: 13 additions & 10 deletions MandelbrotDiscovery/mandelbrot_discovery.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Copyright Christopher Kormanyos 2024.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#include <mandelbrot_discovery.h>
#include <resource.h>
#include <utility.h>

#include <boost/multiprecision/cpp_dec_float.hpp>

namespace local::cfg
{
constexpr int MANDELBROT_COORD_PNT_DIGITS10 = 112;
constexpr int MANDELBROT_ITERATION_DIGITS10 = 112;
constexpr int MANDELBROT_COORD_PNT_DIGITS10 = 132;
constexpr int MANDELBROT_ITERATION_DIGITS10 = 132;
constexpr int MANDELBROT_CALCULATION_PIXELS_X = 768;
constexpr int MANDELBROT_CALCULATION_PIXELS_Y = 768;

Expand All @@ -26,9 +27,9 @@ namespace local::cfg
static_assert(local::cfg::MANDELBROT_CALCULATION_PIXELS_X == local::cfg::MANDELBROT_CALCULATION_PIXELS_Y,
"Error: This program is only compilable for square geometry");

static_assert(utility::equal(local::cfg::MANDELBROT_POINT_DX_HALF,
local::cfg::MANDELBROT_POINT_DX_HALF + sizeof(local::cfg::MANDELBROT_POINT_DX_HALF),
local::cfg::MANDELBROT_POINT_DY_HALF),
static_assert(util::utility::equal(local::cfg::MANDELBROT_POINT_DX_HALF,
local::cfg::MANDELBROT_POINT_DX_HALF + sizeof(local::cfg::MANDELBROT_POINT_DX_HALF),
local::cfg::MANDELBROT_POINT_DY_HALF),
"Error: This program is only compilable for square geometry");

using mandelbrot_coord_pnt_type = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<local::cfg::MANDELBROT_COORD_PNT_DIGITS10>, boost::multiprecision::et_off>;
Expand All @@ -42,7 +43,9 @@ inline auto center_y() -> mandelbrot_coord_pnt_type { return mandelbrot_coord_pn
using local_window_type = mandelbrot_discovery<static_cast<int>(INT16_C(800)),
static_cast<int>(INT16_C(800)),
mandelbrot_coord_pnt_type,
mandelbrot_iteration_type>;
mandelbrot_iteration_type,
mandelbrot_discovery_detail::WindowTitleDefault,
IDI_MANDELBROT_DISCO>;

using point_type = typename local_window_type::point_type;
using rectangle_type = typename local_window_type::rectangle_type;
Expand Down
Loading

0 comments on commit f576f1e

Please sign in to comment.