Skip to content

Commit

Permalink
Merge pull request #151 from ckormanyos/syntax_and_images
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos authored Aug 29, 2024
2 parents 30c0613 + b27b4c4 commit eb11d6b
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ mandelbrot_vs2022.vcxproj.user
images/tmp/
MandelbrotDiscovery/MandelbrotDiscovery.vcxproj.user
MandelbrotDiscovery/mandelbrot_zooming.jpg
MandelbrotDiscovery/mandelbrot_zooming.png
Binary file removed MandelbrotDiscovery/circle_cyan.ico
Binary file not shown.
File renamed without changes.
68 changes: 47 additions & 21 deletions MandelbrotDiscovery/mandelbrot_discovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#ifndef MANDELBROT_DISCOVERY_2024_04_12_H
#define MANDELBROT_DISCOVERY_2024_04_12_H

#if !defined(NOMINMAX)
#define NOMINMAX
#endif

#include <geometry.h>
#include <utility.h>
Expand Down Expand Up @@ -75,7 +77,7 @@

static constexpr auto default_style() noexcept -> ::DWORD
{
return static_cast<::DWORD>(WS_CAPTION | WS_POPUP | WS_SYSMENU);
return static_cast<::DWORD>(WS_MINIMIZEBOX | WS_CAPTION | WS_POPUP | WS_SYSMENU);
}

auto get_handle_to_window() const noexcept -> const HWND { return my_handle_to_window; }
Expand Down Expand Up @@ -120,34 +122,40 @@
my_handle_to_instance,
nullptr);

auto create_window_is_ok = (my_handle_to_window != nullptr);
bool create_window_is_ok { my_handle_to_window != nullptr };

if(create_window_is_ok)
{
// Show the window.
const auto redraw_window_is_ok =
(::RedrawWindow(my_handle_to_window, nullptr, nullptr, static_cast<::UINT>(UINT8_C(0))) == TRUE);
const bool
redraw_window_is_ok
{
::RedrawWindow(my_handle_to_window, nullptr, nullptr, static_cast<::UINT>(UINT8_C(0))) == TRUE
};

create_window_is_ok = (redraw_window_is_ok && create_window_is_ok);

const auto show_window_result_is_ok =
(::ShowWindow(my_handle_to_window, SW_SHOW) == TRUE);
const bool show_window_result_is_ok { ::ShowWindow(my_handle_to_window, SW_SHOW) == TRUE };

create_window_is_ok = (show_window_result_is_ok && create_window_is_ok);
}

const auto handle_to_active_window = ::GetActiveWindow();
const ::HWND handle_to_active_window { ::GetActiveWindow() };

const auto create_window_result = ( create_window_is_ok
const bool
create_window_result
{
create_window_is_ok
&& (handle_to_active_window != nullptr)
&& (my_handle_to_window == handle_to_active_window));
&& (my_handle_to_window == handle_to_active_window)
};

return create_window_result;
}

static auto instance() -> mandelbrot_discovery&
{
static mandelbrot_discovery mandelbrot_discovery_instance;
static mandelbrot_discovery mandelbrot_discovery_instance { };

return mandelbrot_discovery_instance;
}
Expand All @@ -168,15 +176,16 @@

if(result_alloc_console_is_ok)
{
constexpr ::UINT pos_x =
constexpr ::UINT
pos_x
{
static_cast<::UINT>
(
screen_coordinate_x
+ client_width
+ static_cast<int>(INT8_C(24))
);
(screen_coordinate_x + client_width) + static_cast<int>(INT8_C(24))
)
};

::SetWindowPos(::GetConsoleWindow(), nullptr, pos_x, 64, 896, 512, SWP_NOZORDER);
::SetWindowPos(::GetConsoleWindow(), nullptr, pos_x, 64, 768, 512, SWP_NOZORDER);

// Get handles to the standard output and input.
console_output() = ::GetStdHandle(STD_OUTPUT_HANDLE);
Expand Down Expand Up @@ -210,17 +219,20 @@
{
::Sleep(static_cast<::DWORD>(UINT8_C(0)));

const auto get_message_result =
::GetMessage(&message, nullptr, static_cast<::UINT>(UINT8_C(0)), static_cast<::UINT>(UINT8_C(0)));
const ::BOOL
get_message_result
{
::GetMessage(&message, nullptr, static_cast<::UINT>(UINT8_C(0)), static_cast<::UINT>(UINT8_C(0)))
};

get_message_is_ok = (get_message_result == TRUE);

if(get_message_is_ok)
{
// Process Win32 API messages (via standard Windows message pump).

const bool translate_message_is_ok { (::TranslateMessage(&message) == TRUE) };
const bool dispatch_message_is_ok { (::DispatchMessage (&message) == TRUE) };
const bool translate_message_is_ok { ::TranslateMessage(&message) == TRUE };
const bool dispatch_message_is_ok { ::DispatchMessage (&message) == TRUE };

static_cast<void>(translate_message_is_ok);
static_cast<void>(dispatch_message_is_ok);
Expand Down Expand Up @@ -323,12 +335,26 @@
local_color_stretches,
text_out);

const auto execution_time = stopwatch_type::elapsed_time<float>(my_stopwatch);
const float iteration_time { stopwatch_type::elapsed_time<float>(my_stopwatch) };

const std::string
str_iteration_time
{
[&iteration_time]()
{
std::stringstream strm { };

strm << std::fixed << std::setprecision(1) << iteration_time;

return strm.str();
}()
};

const auto zoom_factor_p10 = ilogb(my_mandelbrot_zoom_factor);

write_string("mandelbrot_zoom: " + std::to_string(zoom_factor_p10) + "\n");
write_string("mandelbrot_iter: " + std::to_string(my_mandelbrot_iterations) + "\n");
write_string("iteration_time : " + str_iteration_time + "s\n");
}

static auto CALLBACK my_window_callback(::HWND handle_to_window,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 1996, 2022 - 2023.
// 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)
//

#define IDI_MANDELBROT_DISCO 101
#ifndef RESOURCE_2024_08_28_H
#define RESOURCE_2024_08_28_H

#define IDI_MANDELBROT_DISCO 101

#endif // RESOURCE_2024_08_28_H
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 MANDELBROT_CFG_MANDELBROT_60_SATELITE_REGION_01_2024_04_05_H
Expand Down
28 changes: 28 additions & 0 deletions mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_61_SATELITE_REGION_02.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
///////////////////////////////////////////////////////////////////////////////
// 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 MANDELBROT_CFG_MANDELBROT_61_SATELITE_REGION_02_2024_08_29_H
#define MANDELBROT_CFG_MANDELBROT_61_SATELITE_REGION_02_2024_08_29_H

constexpr char MANDELBROT_FILENAME_STRING[] = "MANDELBROT_61_SATELITE_REGION_02";

constexpr int MANDELBROT_COORD_PNT_DIGITS10 = 58;
constexpr int MANDELBROT_ITERATION_DIGITS10 = 58;
constexpr int MANDELBROT_CALCULATION_PIXELS_X = 2048;
constexpr int MANDELBROT_CALCULATION_PIXELS_Y = 2048;
constexpr int MANDELBROT_CALCULATION_ITERATIONS = 8000;

constexpr char MANDELBROT_POINT_DX_HALF[] = "1.15E-31";
constexpr char MANDELBROT_POINT_DY_HALF[] = "1.15E-31";
constexpr char MANDELBROT_POINT_CENTER_X[] = "-1.9771841957832528683253271547935727033203125";
constexpr char MANDELBROT_POINT_CENTER_Y[] = "+0.0003701587934278647349697471824343197265625";

#define MANDELBROT_GENERATOR_TYPE mandelbrot_generator_trivial // NOLINT(cppcoreguidelines-macro-usage)

#include <mandelbrot/cfg/mandelbrot_cfg.h>

#endif // MANDELBROT_CFG_MANDELBROT_61_SATELITE_REGION_02_2024_08_29_H
28 changes: 28 additions & 0 deletions mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_62_SATELITE_REGION_03.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
///////////////////////////////////////////////////////////////////////////////
// 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 MANDELBROT_CFG_MANDELBROT_62_SATELITE_REGION_03_2024_08_29_H
#define MANDELBROT_CFG_MANDELBROT_62_SATELITE_REGION_03_2024_08_29_H

constexpr char MANDELBROT_FILENAME_STRING[] = "MANDELBROT_62_SATELITE_REGION_03";

constexpr int MANDELBROT_COORD_PNT_DIGITS10 = 114;
constexpr int MANDELBROT_ITERATION_DIGITS10 = 24;
constexpr int MANDELBROT_CALCULATION_PIXELS_X = 2048;
constexpr int MANDELBROT_CALCULATION_PIXELS_Y = 2048;
constexpr int MANDELBROT_CALCULATION_ITERATIONS = 12000;

constexpr char MANDELBROT_POINT_DX_HALF[] = "1.45E-89";
constexpr char MANDELBROT_POINT_DY_HALF[] = "1.45E-89";
constexpr char MANDELBROT_POINT_CENTER_X[] = "-1.711024498065425783442616962887150075536644429276936212772197371643420276616709106166700677273062220703125";
constexpr char MANDELBROT_POINT_CENTER_Y[] = "+0.003998130357843762350089770108611803382417083111382471700501416344256825824943651749566227455277501953125";

#define MANDELBROT_GENERATOR_TYPE mandelbrot_generator_perturbative // NOLINT(cppcoreguidelines-macro-usage)

#include <mandelbrot/cfg/mandelbrot_cfg.h>

#endif // MANDELBROT_CFG_MANDELBROT_62_SATELITE_REGION_03_2024_08_29_H
8 changes: 4 additions & 4 deletions mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_99_TRY_POINTS.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2022 - 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 22022 - 024.
// 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 MANDELBROT_CFG_MANDELBROT_99_TRY_POINTS_2024_04_30_H
Expand Down
2 changes: 2 additions & 0 deletions mandelbrot_vs2022.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_45_SEAHORSE_OTHER_01_magnify51.h" />
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_50_TENDRIL_AREA_01.h" />
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_60_SATELITE_REGION_01.h" />
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_61_SATELITE_REGION_02.h" />
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_62_SATELITE_REGION_03.h" />
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_70_DOUADY_RABBIT_01.h" />
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_70_DOUADY_RABBIT_03.h" />
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_80_SEARCH_HALO_01.h" />
Expand Down
6 changes: 6 additions & 0 deletions mandelbrot_vs2022.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@
<ClInclude Include="mandelbrot\text_output.h">
<Filter>Source Files\mandelbrot</Filter>
</ClInclude>
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_61_SATELITE_REGION_02.h">
<Filter>Source Files\mandelbrot\cfg</Filter>
</ClInclude>
<ClInclude Include="mandelbrot\cfg\mandelbrot_cfg_MANDELBROT_62_SATELITE_REGION_03.h">
<Filter>Source Files\mandelbrot\cfg</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include=".clang-tidy" />
Expand Down
2 changes: 2 additions & 0 deletions test/test_mandelbrot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_45_SEAHORSE_OTHER_01_magnify51.h>
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_50_TENDRIL_AREA_01.h>
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_60_SATELITE_REGION_01.h>
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_61_SATELITE_REGION_02.h>
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_62_SATELITE_REGION_03.h>
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_70_DOUADY_RABBIT_01.h>
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_70_DOUADY_RABBIT_03.h>
//#include <mandelbrot/cfg/mandelbrot_cfg_MANDELBROT_80_SEARCH_HALO_01.h>
Expand Down

0 comments on commit eb11d6b

Please sign in to comment.