From 298322cd64f635e19165ad4d4993db3f01fb743c Mon Sep 17 00:00:00 2001 From: "Yaroslav (PivovarovYV)" Date: Sun, 23 Apr 2023 23:37:05 +0300 Subject: [PATCH] build: erorr --- histogram.cpp | 1 + main.cpp | 8 +++++--- project3.depend | 25 +++++++++++++++++++++---- svg.cpp | 35 +++++++++++++++++++++++++++++++++++ svg.h | 7 +++++++ text.cpp | 1 + 6 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 svg.cpp create mode 100644 svg.h diff --git a/histogram.cpp b/histogram.cpp index ad249d2..7f0841e 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -3,6 +3,7 @@ #include #include "histogram.h" #include "histogram_internal.h" +#include using namespace std; void find_minmax(const vector numbers, double& min, double& max) { min = numbers[0]; diff --git a/main.cpp b/main.cpp index fe5b8f5..d3676af 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,9 @@ #include #include "histogram.h" #include "text.h" +#include "svg.h" +#include +#include using namespace std; @@ -36,7 +39,6 @@ int main() { Input in = input_data(); auto bins = make_histogram(in.numbers, in.bin_count); - show_histogram_text(bins, in.bin_count); - - + show_histogram_svg(bins); + return 0; } diff --git a/project3.depend b/project3.depend index 077cf6a..a0f7a3f 100644 --- a/project3.depend +++ b/project3.depend @@ -1,30 +1,47 @@ # depslib dependency file v1.0 -1682273367 source:c:\users\hp\desktop\lab-03\project3\main.cpp +1682281180 source:c:\users\hp\desktop\lab-03\project3\main.cpp "histogram.h" "text.h" + "svg.h" + + 1682271918 c:\users\hp\desktop\lab-03\project3\histogram.h -1682273878 source:c:\users\hp\desktop\lab-03\project3\histogram.cpp +1682280773 source:c:\users\hp\desktop\lab-03\project3\histogram.cpp "histogram.h" "histogram_internal.h" + -1682273206 source:c:\users\hp\desktop\lab-03\project3\text.cpp +1682280773 source:c:\users\hp\desktop\lab-03\project3\text.cpp "text.h" + 1682273446 c:\users\hp\desktop\lab-03\project3\text.h -1682273933 c:\users\hp\desktop\lab-03\project3\histogram_internal.h +1682275464 c:\users\hp\desktop\lab-03\project3\histogram_internal.h + + +1682280773 source:c:\users\hp\desktop\lab-03\project3\svg.cpp + + + + + + "svg.h" + + +1682278136 c:\users\hp\desktop\lab-03\project3\svg.h diff --git a/svg.cpp b/svg.cpp new file mode 100644 index 0000000..c590e2d --- /dev/null +++ b/svg.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include +#include "svg.h" +using namespace std; + + +void +svg_begin(double width, double height) { + cout << "\n"; + cout << "\n"; +} + +void +svg_end() { + cout << "\n"; +} +void +svg_text(double left, double baseline, string text) { + cout << "" << text << ""; +} + +void +show_histogram_svg(const vector& bins) { + svg_begin(400, 300); + svg_text(20, 20, to_string(bins[0])); + svg_end(); +} + diff --git a/svg.h b/svg.h new file mode 100644 index 0000000..e4a6fd8 --- /dev/null +++ b/svg.h @@ -0,0 +1,7 @@ +#ifndef SVG_H_INCLUDED +#define SVG_H_INCLUDED +#include +void +show_histogram_svg(const std::vector& bins); + +#endif // SVG_H_INCLUDED diff --git a/text.cpp b/text.cpp index fab929c..0fa641a 100644 --- a/text.cpp +++ b/text.cpp @@ -2,6 +2,7 @@ #include #include #include "text.h" +#include using namespace std; void show_histogram_text(vector bins, size_t bin_count ) {