diff --git a/build/CMakeFiles/HLlib.dir/compiler_depend.internal b/build/CMakeFiles/HLlib.dir/compiler_depend.internal index 72acd14..74b7490 100644 --- a/build/CMakeFiles/HLlib.dir/compiler_depend.internal +++ b/build/CMakeFiles/HLlib.dir/compiler_depend.internal @@ -248,6 +248,21 @@ CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o /usr/include/c++/11.2.0/bits/stl_bvector.h /usr/include/c++/11.2.0/bits/vector.tcc /usr/include/c++/11.2.0/pstl/execution_defs.h + /home/noah/Documents/School/CS-7353_Analysis-of-Algorithms/HW/HW4/src/gnuplot_i.hpp + /usr/include/c++/11.2.0/sstream + /usr/include/c++/11.2.0/bits/sstream.tcc + /usr/include/c++/11.2.0/list + /usr/include/c++/11.2.0/bits/stl_list.h + /usr/include/c++/11.2.0/bits/allocated_ptr.h + /usr/include/c++/11.2.0/bits/list.tcc + /usr/include/unistd.h + /usr/include/bits/posix_opt.h + /usr/include/bits/environments.h + /usr/include/bits/confname.h + /usr/include/bits/getopt_posix.h + /usr/include/bits/getopt_core.h + /usr/include/bits/unistd_ext.h + /usr/include/linux/close_range.h /home/noah/Documents/School/CS-7353_Analysis-of-Algorithms/HW/HW4/src/HiddenLines.h /usr/include/c++/11.2.0/map /usr/include/c++/11.2.0/bits/stl_map.h diff --git a/build/CMakeFiles/HLlib.dir/compiler_depend.make b/build/CMakeFiles/HLlib.dir/compiler_depend.make index 314ddc3..26ee71a 100644 --- a/build/CMakeFiles/HLlib.dir/compiler_depend.make +++ b/build/CMakeFiles/HLlib.dir/compiler_depend.make @@ -247,6 +247,21 @@ CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o: ../src/HiddenLines.cpp \ /usr/include/c++/11.2.0/bits/stl_bvector.h \ /usr/include/c++/11.2.0/bits/vector.tcc \ /usr/include/c++/11.2.0/pstl/execution_defs.h \ + ../src/gnuplot_i.hpp \ + /usr/include/c++/11.2.0/sstream \ + /usr/include/c++/11.2.0/bits/sstream.tcc \ + /usr/include/c++/11.2.0/list \ + /usr/include/c++/11.2.0/bits/stl_list.h \ + /usr/include/c++/11.2.0/bits/allocated_ptr.h \ + /usr/include/c++/11.2.0/bits/list.tcc \ + /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h \ + /usr/include/bits/confname.h \ + /usr/include/bits/getopt_posix.h \ + /usr/include/bits/getopt_core.h \ + /usr/include/bits/unistd_ext.h \ + /usr/include/linux/close_range.h \ ../src/HiddenLines.h \ /usr/include/c++/11.2.0/map \ /usr/include/c++/11.2.0/bits/stl_map.h \ @@ -254,504 +269,534 @@ CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o: ../src/HiddenLines.cpp \ ../src/Line.h -/usr/include/c++/11.2.0/map: - -/usr/include/c++/11.2.0/bits/vector.tcc: - -/usr/include/c++/11.2.0/bits/stl_vector.h: - -/usr/include/c++/11.2.0/bits/stl_uninitialized.h: - -/usr/include/c++/11.2.0/vector: - -/usr/include/c++/11.2.0/bits/hashtable_policy.h: - -/usr/include/c++/11.2.0/bits/invoke.h: - -/usr/include/c++/11.2.0/bits/uses_allocator.h: - -/usr/include/c++/11.2.0/tuple: - -/usr/include/c++/11.2.0/bits/uniform_int_dist.h: - -/usr/include/c++/11.2.0/bits/stl_tempbuf.h: - -/usr/include/c++/11.2.0/bits/stl_heap.h: - -/usr/include/c++/11.2.0/tr1/poly_laguerre.tcc: - -/usr/include/c++/11.2.0/tr1/legendre_function.tcc: - -/usr/include/c++/11.2.0/tr1/exp_integral.tcc: - -/usr/include/c++/11.2.0/tr1/ell_integral.tcc: - -/usr/include/c++/11.2.0/tr1/beta_function.tcc: - -/usr/include/c++/11.2.0/tr1/bessel_function.tcc: - -/usr/include/c++/11.2.0/tr1/special_function_util.h: - -/usr/include/c++/11.2.0/tr1/gamma.tcc: - -/usr/include/c++/11.2.0/bits/specfun.h: - -/usr/include/bits/iscanonical.h: - -/usr/include/bits/mathcalls-helper-functions.h: - -/usr/include/c++/11.2.0/tr1/poly_hermite.tcc: - -/usr/include/bits/fp-fast.h: - -/usr/include/c++/11.2.0/array: - -/usr/include/bits/libm-simd-decl-stubs.h: - -/usr/include/bits/math-vector.h: - -/usr/include/c++/11.2.0/cmath: - -/usr/include/c++/11.2.0/bits/unordered_map.h: - -/usr/include/c++/11.2.0/math.h: - -/usr/include/c++/11.2.0/limits: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++io.h: - -/usr/include/c++/11.2.0/bits/stl_relops.h: - -/usr/include/c++/11.2.0/fstream: - -/usr/include/c++/11.2.0/ext/aligned_buffer.h: - -/usr/include/c++/11.2.0/bits/stl_bvector.h: - -/usr/include/c++/11.2.0/set: - -/usr/include/c++/11.2.0/bits/istream.tcc: - -/usr/include/c++/11.2.0/istream: - -/usr/include/c++/11.2.0/bits/locale_facets.tcc: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/ctype_inline.h: - -/usr/include/c++/11.2.0/bits/streambuf_iterator.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/ctype_base.h: - -/usr/include/c++/11.2.0/tr1/hypergeometric.tcc: - -/usr/include/c++/11.2.0/cwctype: - -/usr/include/c++/11.2.0/bits/basic_ios.h: - -/usr/include/c++/11.2.0/bits/std_function.h: - -/usr/include/c++/11.2.0/streambuf: - -/usr/include/c++/11.2.0/bits/locale_classes.tcc: - -/usr/include/c++/11.2.0/bits/charconv.h: - -/usr/include/bits/types/error_t.h: - -/usr/include/asm-generic/errno-base.h: - -/usr/include/bits/fp-logb.h: - -/usr/include/asm-generic/errno.h: - -/usr/include/linux/errno.h: - -/usr/include/errno.h: - -/usr/include/c++/11.2.0/bits/stl_multimap.h: - -/usr/include/c++/11.2.0/cerrno: - /usr/include/c++/11.2.0/bits/stl_map.h: -/usr/include/c++/11.2.0/bits/codecvt.h: - -/usr/include/bits/stdio.h: - -/usr/include/c++/11.2.0/bits/algorithmfwd.h: - -/usr/include/bits/types/struct_FILE.h: - -/usr/include/bits/types/__fpos64_t.h: - -/usr/include/c++/11.2.0/bits/std_abs.h: - -/usr/include/bits/stdlib-bsearch.h: - -/usr/include/alloca.h: - -/usr/include/bits/types/sigset_t.h: - -/usr/include/bits/select.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/error_constants.h: - -/usr/include/sys/select.h: - -/usr/include/bits/uintn-identity.h: - -/usr/include/endian.h: - -/usr/include/stdlib.h: - -/usr/include/asm/errno.h: - -/usr/include/c++/11.2.0/bits/string_view.tcc: - -/usr/include/c++/11.2.0/bits/functional_hash.h: - -/usr/include/c++/11.2.0/bits/stl_iterator.h: - -/usr/include/c++/11.2.0/bits/stl_pair.h: - -/usr/include/c++/11.2.0/bits/cpp_type_traits.h: - -/usr/include/bits/mathcalls-narrow.h: - -/usr/include/c++/11.2.0/bits/char_traits.h: - -/usr/include/c++/11.2.0/bits/hashtable.h: - -/usr/include/bits/waitstatus.h: - -/usr/include/bits/timesize.h: - -/usr/include/bits/endian.h: - -/usr/include/c++/11.2.0/ext/numeric_traits.h: - -/usr/include/wchar.h: - -../src/HiddenLines.cpp: - -/usr/include/c++/11.2.0/ext/alloc_traits.h: - -/usr/include/math.h: - -/usr/include/c++/11.2.0/bits/streambuf.tcc: - -/usr/include/c++/11.2.0/bits/exception.h: - -/usr/include/wctype.h: - -/usr/include/bits/errno.h: - -/usr/include/bits/timex.h: - -/usr/include/bits/types/locale_t.h: - -/usr/include/c++/11.2.0/bits/concept_check.h: - -/usr/include/bits/types/wint_t.h: - -/usr/include/c++/11.2.0/tr1/modified_bessel_func.tcc: - -/usr/include/c++/11.2.0/iosfwd: - -/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/stddef.h: - -/usr/include/c++/11.2.0/bits/exception_ptr.h: - -/usr/include/locale.h: - -/usr/include/c++/11.2.0/tr1/riemann_zeta.tcc: - -/usr/include/c++/11.2.0/bits/locale_facets.h: - -/usr/include/bits/types/__locale_t.h: - -/usr/include/c++/11.2.0/bits/hash_bytes.h: - -/usr/include/sched.h: - -/usr/include/c++/11.2.0/initializer_list: - -/usr/include/bits/long-double.h: - -/usr/include/c++/11.2.0/iostream: - -/usr/include/features-time64.h: - -/usr/include/c++/11.2.0/bits/nested_exception.h: - -/usr/include/bits/wordsize.h: - -/usr/include/c++/11.2.0/bits/stl_algobase.h: - -/usr/include/c++/11.2.0/new: - -/usr/include/gnu/stubs-64.h: - -/usr/include/c++/11.2.0/bits/stringfwd.h: - -/usr/include/c++/11.2.0/bits/stl_construct.h: - -/usr/include/c++/11.2.0/bits/functexcept.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++config.h: - -/usr/include/bits/stdint-uintn.h: - -/usr/include/c++/11.2.0/bits/cxxabi_init_exception.h: - -/usr/include/bits/sched.h: - -/usr/include/c++/11.2.0/bits/fstream.tcc: - -/usr/include/sys/cdefs.h: - -/usr/include/stdio.h: - -/usr/include/c++/11.2.0/bits/range_access.h: - -/usr/include/stdc-predef.h: - -/usr/include/c++/11.2.0/bits/stl_tree.h: - -/usr/include/c++/11.2.0/ext/type_traits.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/os_defines.h: - -/usr/include/bits/stdlib-float.h: - -/usr/include/bits/time64.h: - -/usr/include/c++/11.2.0/exception: - -/usr/include/c++/11.2.0/pstl/glue_algorithm_defs.h: - -/usr/include/bits/pthread_stack_min-dynamic.h: - -/usr/include/c++/11.2.0/bits/stl_set.h: - -/usr/include/c++/11.2.0/bits/move.h: - -/usr/include/c++/11.2.0/cctype: - -/usr/include/c++/11.2.0/bits/erase_if.h: - -/usr/include/bits/libc-header-start.h: - -/usr/include/c++/11.2.0/functional: - -/usr/include/c++/11.2.0/bits/stl_multiset.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/cpu_defines.h: - -/usr/include/bits/byteswap.h: - -/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/stdarg.h: - -/usr/include/c++/11.2.0/bits/ios_base.h: - -/usr/include/c++/11.2.0/bits/refwrap.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/gthr.h: - -/usr/include/c++/11.2.0/debug/assertions.h: - -/usr/include/bits/types/struct_sched_param.h: - -/usr/include/bits/types/mbstate_t.h: - -/usr/include/c++/11.2.0/pstl/pstl_config.h: - -/usr/include/c++/11.2.0/bits/node_handle.h: - -/usr/include/c++/11.2.0/bits/memoryfwd.h: - -/usr/include/c++/11.2.0/unordered_map: - -/usr/include/bits/flt-eval-method.h: - -/usr/include/c++/11.2.0/bits/basic_ios.tcc: - -/usr/include/bits/types/FILE.h: - -/usr/include/bits/types/__FILE.h: - -/usr/include/bits/wchar.h: - -/usr/include/c++/11.2.0/algorithm: - -/usr/include/c++/11.2.0/cwchar: - -/usr/include/bits/types/struct_tm.h: - -/usr/include/c++/11.2.0/bits/stl_iterator_base_funcs.h: +/usr/include/c++/11.2.0/map: ../src/HiddenLines.h: -/usr/include/c++/11.2.0/bits/postypes.h: +/usr/include/bits/getopt_core.h: -/usr/include/bits/floatn.h: +/usr/include/bits/pthreadtypes-arch.h: -/usr/include/c++/11.2.0/bits/ptr_traits.h: +/usr/include/c++/11.2.0/ext/new_allocator.h: -/usr/include/bits/types/time_t.h: +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++allocator.h: -/usr/include/c++/11.2.0/utility: +/usr/include/bits/unistd_ext.h: -/usr/include/c++/11.2.0/debug/debug.h: +/usr/include/c++/11.2.0/bits/basic_string.tcc: -/usr/include/c++/11.2.0/bits/predefined_ops.h: +/usr/include/c++/11.2.0/bits/stl_multimap.h: -/usr/include/c++/11.2.0/pstl/execution_defs.h: +/usr/include/c++/11.2.0/bits/allocator.h: -/usr/include/c++/11.2.0/type_traits: +/usr/include/c++/11.2.0/string: -/usr/include/bits/stdint-intn.h: +/usr/include/c++/11.2.0/bits/exception_defines.h: -/usr/include/bits/types/cookie_io_functions_t.h: +/usr/include/sys/single_threaded.h: -/usr/include/c++/11.2.0/cstdint: +/usr/include/c++/11.2.0/typeinfo: -/usr/include/c++/11.2.0/ext/string_conversions.h: +/usr/include/bits/setjmp.h: -/usr/include/c++/11.2.0/ios: +/usr/include/c++/11.2.0/clocale: -/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/stdint.h: +/usr/include/c++/11.2.0/bits/stl_algo.h: -/usr/include/stdint.h: +/usr/include/bits/types/struct_itimerspec.h: -/usr/include/c++/11.2.0/bits/cxxabi_forced.h: +/usr/include/bits/types/timer_t.h: -/usr/include/c++/11.2.0/bits/stl_function.h: - -/usr/include/bits/types.h: - -/usr/include/bits/typesizes.h: - -/usr/include/bits/cpu-set.h: - -/usr/include/c++/11.2.0/bits/ostream.tcc: - -/usr/include/bits/struct_mutex.h: - -/usr/include/c++/11.2.0/bits/localefwd.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/atomic_word.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++locale.h: - -/usr/include/bits/locale.h: - -/usr/include/bits/floatn-common.h: - -/usr/include/c++/11.2.0/ostream: - -/usr/include/c++/11.2.0/bits/alloc_traits.h: - -/usr/include/bits/waitflags.h: - -/usr/include/ctype.h: - -/usr/include/features.h: - -/usr/include/bits/endianness.h: - -/usr/include/c++/11.2.0/ext/atomicity.h: - -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/gthr-default.h: - -/usr/include/c++/11.2.0/stdexcept: - -/usr/include/pthread.h: - -/usr/include/bits/types/struct_timespec.h: - -/usr/include/time.h: - -/usr/include/bits/stdio_lim.h: - -/usr/include/bits/types/__mbstate_t.h: - -/usr/include/bits/time.h: - -/usr/include/bits/types/struct_timeval.h: - -/usr/include/bits/mathcalls.h: - -/usr/include/bits/types/__fpos_t.h: - -/usr/include/c++/11.2.0/bits/stl_iterator_base_types.h: - -/usr/include/bits/types/clock_t.h: - -/usr/include/bits/types/clockid_t.h: +/usr/include/c++/11.2.0/system_error: /usr/include/bits/atomic_wide_counter.h: /usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/basic_file.h: -/usr/include/c++/11.2.0/system_error: +/usr/include/bits/posix_opt.h: -/usr/include/c++/11.2.0/string_view: +/usr/include/bits/types/clock_t.h: -/usr/include/bits/types/timer_t.h: +/usr/include/c++/11.2.0/bits/stl_iterator_base_types.h: -/usr/include/bits/struct_rwlock.h: +/usr/include/bits/types/__fpos_t.h: -/usr/include/bits/types/struct_itimerspec.h: +/usr/include/bits/mathcalls.h: -/usr/include/bits/pthreadtypes.h: +/usr/include/bits/types/struct_timeval.h: -/usr/include/c++/11.2.0/bits/stl_algo.h: +/usr/include/bits/time.h: -/usr/include/c++/11.2.0/clocale: +/usr/include/bits/types/__mbstate_t.h: -/usr/include/bits/thread-shared-types.h: +/usr/include/bits/stdio_lim.h: -/usr/include/bits/setjmp.h: +/usr/include/time.h: -../src/Line.h: +/usr/include/bits/types/struct_timespec.h: -/usr/include/c++/11.2.0/typeinfo: - -/usr/include/bits/types/struct___jmp_buf_tag.h: - -/usr/include/bits/types/__sigset_t.h: - -/usr/include/sys/single_threaded.h: - -/usr/include/c++/11.2.0/cstdlib: - -/usr/include/c++/11.2.0/bits/exception_defines.h: - -/usr/include/c++/11.2.0/string: - -/usr/include/c++/11.2.0/bits/allocator.h: - -/usr/include/c++/11.2.0/bits/basic_string.tcc: +/usr/include/pthread.h: /usr/include/c++/11.2.0/bits/basic_string.h: +/usr/include/c++/11.2.0/stdexcept: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/gthr-default.h: + +/usr/include/bits/endianness.h: + +/usr/include/ctype.h: + +/usr/include/bits/waitflags.h: + +/usr/include/c++/11.2.0/bits/alloc_traits.h: + +/usr/include/bits/floatn-common.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++locale.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/11.2.0/bits/localefwd.h: + +/usr/include/bits/struct_mutex.h: + +/usr/include/c++/11.2.0/bits/ostream.tcc: + +/usr/include/bits/cpu-set.h: + +/usr/include/bits/typesizes.h: + +/usr/include/bits/types.h: + +/usr/include/c++/11.2.0/bits/stl_function.h: + /usr/include/bits/wctype-wchar.h: -/usr/include/c++/11.2.0/cstdio: +/usr/include/c++/11.2.0/bits/cxxabi_forced.h: -/usr/include/sys/types.h: +/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/stdint.h: -/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++allocator.h: +/usr/include/c++/11.2.0/ext/string_conversions.h: -/usr/include/c++/11.2.0/ext/new_allocator.h: +/usr/include/c++/11.2.0/cstdint: + +/usr/include/bits/types/clockid_t.h: + +/usr/include/bits/stdint-intn.h: + +/usr/include/c++/11.2.0/type_traits: /usr/include/c++/11.2.0/bits/ostream_insert.h: +/usr/include/c++/11.2.0/pstl/execution_defs.h: + +/usr/include/c++/11.2.0/bits/predefined_ops.h: + +/usr/include/c++/11.2.0/utility: + +/usr/include/bits/types/time_t.h: + +/usr/include/c++/11.2.0/bits/ptr_traits.h: + +/usr/include/bits/floatn.h: + +/usr/include/c++/11.2.0/bits/postypes.h: + +/usr/include/c++/11.2.0/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/11.2.0/algorithm: + +/usr/include/bits/types/FILE.h: + +/usr/include/c++/11.2.0/bits/basic_ios.tcc: + +/usr/include/bits/flt-eval-method.h: + +/usr/include/c++/11.2.0/unordered_map: + +/usr/include/c++/11.2.0/bits/memoryfwd.h: + +/usr/include/c++/11.2.0/debug/debug.h: + +/usr/include/c++/11.2.0/bits/node_handle.h: + +/usr/include/c++/11.2.0/pstl/pstl_config.h: + +/usr/include/bits/types/mbstate_t.h: + +/usr/include/bits/types/struct_sched_param.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/gthr.h: + +/usr/include/c++/11.2.0/bits/refwrap.h: + +/usr/include/bits/types/cookie_io_functions_t.h: + +/usr/include/c++/11.2.0/bits/ios_base.h: + +/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/stdarg.h: + +/usr/include/bits/byteswap.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/11.2.0/bits/stl_multiset.h: + +/usr/include/c++/11.2.0/functional: + +/usr/include/bits/libc-header-start.h: + +/usr/include/c++/11.2.0/bits/erase_if.h: + +/usr/include/c++/11.2.0/cctype: + +/usr/include/c++/11.2.0/bits/move.h: + +/usr/include/c++/11.2.0/bits/stl_set.h: + +/usr/include/bits/pthread_stack_min-dynamic.h: + +/usr/include/c++/11.2.0/pstl/glue_algorithm_defs.h: + +/usr/include/c++/11.2.0/exception: + +/usr/include/bits/time64.h: + +/usr/include/bits/stdlib-float.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/os_defines.h: + +/usr/include/c++/11.2.0/bits/stl_tree.h: + +/usr/include/stdc-predef.h: + +/usr/include/c++/11.2.0/list: + +/usr/include/c++/11.2.0/bits/range_access.h: + +/usr/include/sys/cdefs.h: + +/usr/include/c++/11.2.0/bits/fstream.tcc: + +/usr/include/c++/11.2.0/bits/sstream.tcc: + +/usr/include/features.h: + +/usr/include/bits/types/__FILE.h: + +/usr/include/bits/sched.h: + +/usr/include/c++/11.2.0/bits/cxxabi_init_exception.h: + +/usr/include/c++/11.2.0/bits/functexcept.h: + +/usr/include/c++/11.2.0/bits/stl_construct.h: + +/usr/include/c++/11.2.0/bits/stringfwd.h: + +/usr/include/c++/11.2.0/cstdio: + +/usr/include/gnu/stubs-64.h: + +/usr/include/c++/11.2.0/new: + +/usr/include/bits/types/struct_tm.h: + +/usr/include/c++/11.2.0/bits/stl_algobase.h: + +/usr/include/stdio.h: + +/usr/include/bits/wordsize.h: + +/usr/include/c++/11.2.0/ios: + +/usr/include/c++/11.2.0/bits/nested_exception.h: + +/usr/include/c++/11.2.0/backward/binders.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++config.h: + +/usr/include/features-time64.h: + +/usr/include/c++/11.2.0/ext/type_traits.h: + +/usr/include/bits/long-double.h: + +/usr/include/c++/11.2.0/ostream: + +/usr/include/c++/11.2.0/initializer_list: + +/usr/include/bits/types/__locale_t.h: + +/usr/include/c++/11.2.0/bits/locale_facets.h: + +/usr/include/c++/11.2.0/tr1/riemann_zeta.tcc: + +/usr/include/locale.h: + +/usr/include/c++/11.2.0/bits/exception_ptr.h: + +/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/stddef.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/c++/11.2.0/iosfwd: + +/usr/include/c++/11.2.0/tr1/modified_bessel_func.tcc: + +/usr/include/bits/types/locale_t.h: + +/usr/include/c++/11.2.0/bits/stl_list.h: + +/usr/include/bits/timex.h: + +/usr/include/bits/errno.h: + +/usr/include/c++/11.2.0/bits/exception.h: + +/usr/include/math.h: + +/usr/include/linux/close_range.h: + +../src/HiddenLines.cpp: + +/usr/include/c++/11.2.0/bits/list.tcc: + +/usr/include/wchar.h: + +/usr/include/sys/types.h: + +/usr/include/c++/11.2.0/ext/numeric_traits.h: + +/usr/include/bits/endian.h: + +/usr/include/bits/timesize.h: + +/usr/include/bits/types/struct___jmp_buf_tag.h: + +/usr/include/bits/wchar.h: + +/usr/include/c++/11.2.0/bits/allocated_ptr.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/c++/11.2.0/bits/hashtable.h: + +/usr/include/c++/11.2.0/bits/char_traits.h: + +/usr/include/bits/mathcalls-narrow.h: + +/usr/include/c++/11.2.0/bits/stl_pair.h: + +/usr/include/c++/11.2.0/bits/concept_check.h: + +/usr/include/c++/11.2.0/bits/stl_iterator.h: + +/usr/include/c++/11.2.0/bits/functional_hash.h: + +/usr/include/c++/11.2.0/bits/string_view.tcc: + +/usr/include/bits/stdint-uintn.h: + +/usr/include/asm/errno.h: + +/usr/include/stdlib.h: + +/usr/include/bits/uintn-identity.h: + +/usr/include/sys/select.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/error_constants.h: + +/usr/include/c++/11.2.0/string_view: + +/usr/include/bits/select.h: + +/usr/include/bits/types/sigset_t.h: + +/usr/include/c++/11.2.0/cstdlib: + +/usr/include/alloca.h: + +/usr/include/bits/stdlib-bsearch.h: + +/usr/include/c++/11.2.0/bits/std_abs.h: + +/usr/include/bits/types/__fpos64_t.h: + +/usr/include/c++/11.2.0/bits/algorithmfwd.h: + +/usr/include/bits/stdio.h: + +/usr/include/bits/locale.h: + +/usr/include/c++/11.2.0/bits/codecvt.h: + +/usr/include/c++/11.2.0/cerrno: + +/usr/include/bits/getopt_posix.h: + +/usr/include/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/bits/fp-logb.h: + +/usr/include/c++/11.2.0/sstream: + +/usr/include/c++/11.2.0/cwchar: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/bits/types/error_t.h: + /usr/include/gnu/stubs.h: -/usr/include/bits/pthreadtypes-arch.h: +/usr/include/c++/11.2.0/ext/atomicity.h: + +/usr/include/c++/11.2.0/bits/hash_bytes.h: + +/usr/include/c++/11.2.0/bits/charconv.h: + +/usr/include/c++/11.2.0/bits/locale_classes.tcc: + +/usr/include/bits/confname.h: + +/usr/include/bits/struct_rwlock.h: + +/usr/include/c++/11.2.0/streambuf: + +/usr/include/c++/11.2.0/bits/std_function.h: + +/usr/include/c++/11.2.0/cwctype: + +/usr/include/c++/11.2.0/tr1/hypergeometric.tcc: + +../src/Line.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/11.2.0/bits/streambuf_iterator.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/11.2.0/bits/locale_facets.tcc: + +/usr/include/bits/thread-shared-types.h: + +/usr/include/c++/11.2.0/istream: + +/usr/include/c++/11.2.0/bits/istream.tcc: + +../src/gnuplot_i.hpp: + +/usr/include/c++/11.2.0/iostream: + +/usr/include/c++/11.2.0/ext/alloc_traits.h: + +/usr/include/c++/11.2.0/set: + +/usr/include/c++/11.2.0/bits/stl_bvector.h: + +/usr/include/c++/11.2.0/bits/streambuf.tcc: + +/usr/include/c++/11.2.0/ext/aligned_buffer.h: + +/usr/include/c++/11.2.0/bits/stl_relops.h: /usr/include/c++/11.2.0/bits/locale_classes.h: -/usr/include/c++/11.2.0/backward/binders.h: +/usr/include/c++/11.2.0/limits: + +/usr/include/stdint.h: + +/usr/include/endian.h: + +/usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++io.h: + +/usr/include/c++/11.2.0/math.h: + +/usr/include/bits/types/wint_t.h: + +/usr/include/c++/11.2.0/bits/unordered_map.h: + +/usr/include/c++/11.2.0/cmath: + +/usr/include/bits/math-vector.h: + +/usr/include/bits/libm-simd-decl-stubs.h: + +/usr/include/c++/11.2.0/array: + +/usr/include/sched.h: + +/usr/include/wctype.h: + +/usr/include/bits/fp-fast.h: + +/usr/include/c++/11.2.0/tr1/poly_hermite.tcc: + +/usr/include/bits/mathcalls-helper-functions.h: + +/usr/include/c++/11.2.0/bits/specfun.h: + +/usr/include/c++/11.2.0/tr1/gamma.tcc: + +/usr/include/c++/11.2.0/tr1/special_function_util.h: + +/usr/include/c++/11.2.0/fstream: + +/usr/include/unistd.h: + +/usr/include/c++/11.2.0/tr1/bessel_function.tcc: + +/usr/include/c++/11.2.0/tr1/beta_function.tcc: + +/usr/include/c++/11.2.0/tr1/ell_integral.tcc: + +/usr/include/c++/11.2.0/tr1/exp_integral.tcc: + +/usr/include/c++/11.2.0/tr1/legendre_function.tcc: + +/usr/include/c++/11.2.0/tr1/poly_laguerre.tcc: + +/usr/include/c++/11.2.0/bits/stl_heap.h: + +/usr/include/bits/iscanonical.h: + +/usr/include/c++/11.2.0/bits/uniform_int_dist.h: + +/usr/include/c++/11.2.0/tuple: + +/usr/include/bits/types/__sigset_t.h: + +/usr/include/c++/11.2.0/bits/uses_allocator.h: + +/usr/include/c++/11.2.0/bits/cpp_type_traits.h: + +/usr/include/c++/11.2.0/bits/stl_tempbuf.h: + +/usr/include/c++/11.2.0/bits/invoke.h: + +/usr/include/c++/11.2.0/bits/basic_ios.h: + +/usr/include/c++/11.2.0/bits/hashtable_policy.h: + +/usr/include/c++/11.2.0/vector: + +/usr/include/c++/11.2.0/bits/stl_uninitialized.h: + +/usr/include/c++/11.2.0/bits/stl_vector.h: + +/usr/include/c++/11.2.0/debug/assertions.h: + +/usr/include/c++/11.2.0/bits/vector.tcc: + +/usr/include/bits/types/struct_FILE.h: + +/usr/include/bits/environments.h: diff --git a/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o b/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o index de6a8e7..37c4136 100644 Binary files a/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o and b/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o differ diff --git a/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o.d b/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o.d index 3058386..65c8555 100644 --- a/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o.d +++ b/build/CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o.d @@ -185,554 +185,15 @@ CMakeFiles/HLlib.dir/src/HiddenLines.cpp.o: \ /usr/include/c++/11.2.0/bits/stl_bvector.h \ /usr/include/c++/11.2.0/bits/vector.tcc \ /usr/include/c++/11.2.0/pstl/execution_defs.h \ - /home/noah/Documents/School/CS-7353_Analysis-of-Algorithms/HW/HW4/src/gnuplot-iostream.h \ + /home/noah/Documents/School/CS-7353_Analysis-of-Algorithms/HW/HW4/src/gnuplot_i.hpp \ /usr/include/c++/11.2.0/sstream /usr/include/c++/11.2.0/bits/sstream.tcc \ - /usr/include/c++/11.2.0/iomanip /usr/include/c++/11.2.0/locale \ - /usr/include/c++/11.2.0/bits/locale_facets_nonio.h \ - /usr/include/c++/11.2.0/ctime \ - /usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/time_members.h \ - /usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/messages_members.h \ - /usr/include/libintl.h \ - /usr/include/c++/11.2.0/bits/locale_facets_nonio.tcc \ - /usr/include/c++/11.2.0/bits/locale_conv.h \ - /usr/include/c++/11.2.0/bits/unique_ptr.h \ - /usr/include/c++/11.2.0/bits/quoted_string.h \ - /usr/include/c++/11.2.0/complex \ - /usr/include/boost/iostreams/device/file_descriptor.hpp \ - /usr/include/boost/cstdint.hpp /usr/include/boost/config.hpp \ - /usr/include/boost/config/user.hpp \ - /usr/include/boost/config/detail/select_compiler_config.hpp \ - /usr/include/boost/config/compiler/gcc.hpp \ - /usr/include/c++/11.2.0/cstddef \ - /usr/include/boost/config/detail/select_stdlib_config.hpp \ - /usr/include/c++/11.2.0/version \ - /usr/include/boost/config/stdlib/libstdcpp3.hpp /usr/include/unistd.h \ + /usr/include/c++/11.2.0/list /usr/include/c++/11.2.0/bits/stl_list.h \ + /usr/include/c++/11.2.0/bits/allocated_ptr.h \ + /usr/include/c++/11.2.0/bits/list.tcc /usr/include/unistd.h \ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ /usr/include/bits/confname.h /usr/include/bits/getopt_posix.h \ /usr/include/bits/getopt_core.h /usr/include/bits/unistd_ext.h \ /usr/include/linux/close_range.h \ - /usr/include/boost/config/detail/select_platform_config.hpp \ - /usr/include/boost/config/platform/linux.hpp \ - /usr/include/boost/config/detail/posix_features.hpp \ - /usr/include/boost/config/detail/suffix.hpp \ - /usr/include/boost/config/helper_macros.hpp \ - /usr/include/boost/config/detail/cxx_composite.hpp \ - /usr/include/boost/iostreams/categories.hpp \ - /usr/include/boost/iostreams/detail/config/auto_link.hpp \ - /usr/include/boost/config/auto_link.hpp \ - /usr/include/boost/iostreams/detail/config/dyn_link.hpp \ - /usr/include/boost/detail/workaround.hpp \ - /usr/include/boost/config/workaround.hpp \ - /usr/include/boost/iostreams/detail/config/windows_posix.hpp \ - /usr/include/boost/iostreams/detail/file_handle.hpp \ - /usr/include/boost/iostreams/detail/ios.hpp \ - /usr/include/boost/iostreams/detail/config/wide_streams.hpp \ - /usr/include/boost/iostreams/detail/path.hpp \ - /usr/include/c++/11.2.0/cstring /usr/include/string.h \ - /usr/include/strings.h /usr/include/boost/static_assert.hpp \ - /usr/include/boost/type.hpp /usr/include/boost/type_traits/is_same.hpp \ - /usr/include/boost/type_traits/integral_constant.hpp \ - /usr/include/boost/iostreams/positioning.hpp \ - /usr/include/boost/integer_traits.hpp /usr/include/boost/limits.hpp \ - /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include-fixed/limits.h \ - /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ - /usr/include/bits/uio_lim.h \ - /usr/include/boost/iostreams/detail/config/codecvt.hpp \ - /usr/include/boost/iostreams/detail/config/fpos.hpp \ - /usr/include/boost/iostreams/detail/config/disable_warnings.hpp \ - /usr/include/boost/iostreams/detail/config/enable_warnings.hpp \ - /usr/include/boost/shared_ptr.hpp \ - /usr/include/boost/smart_ptr/shared_ptr.hpp \ - /usr/include/boost/smart_ptr/detail/shared_count.hpp \ - /usr/include/boost/smart_ptr/bad_weak_ptr.hpp \ - /usr/include/boost/smart_ptr/detail/sp_counted_base.hpp \ - /usr/include/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp \ - /usr/include/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp \ - /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp \ - /usr/include/boost/smart_ptr/detail/sp_typeinfo_.hpp \ - /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp \ - /usr/include/boost/smart_ptr/detail/sp_noexcept.hpp \ - /usr/include/boost/checked_delete.hpp \ - /usr/include/boost/core/checked_delete.hpp \ - /usr/include/boost/core/addressof.hpp /usr/include/c++/11.2.0/memory \ - /usr/include/c++/11.2.0/bits/stl_raw_storage_iter.h \ - /usr/include/c++/11.2.0/bits/align.h /usr/include/c++/11.2.0/bit \ - /usr/include/c++/11.2.0/bits/shared_ptr.h \ - /usr/include/c++/11.2.0/bits/shared_ptr_base.h \ - /usr/include/c++/11.2.0/bits/allocated_ptr.h \ - /usr/include/c++/11.2.0/ext/concurrence.h \ - /usr/include/c++/11.2.0/bits/shared_ptr_atomic.h \ - /usr/include/c++/11.2.0/bits/atomic_base.h \ - /usr/include/c++/11.2.0/bits/atomic_lockfree_defines.h \ - /usr/include/c++/11.2.0/backward/auto_ptr.h \ - /usr/include/c++/11.2.0/pstl/glue_memory_defs.h \ - /usr/include/boost/smart_ptr/detail/sp_disable_deprecated.hpp \ - /usr/include/boost/throw_exception.hpp \ - /usr/include/boost/exception/exception.hpp \ - /usr/include/boost/assert/source_location.hpp \ - /usr/include/boost/current_function.hpp \ - /usr/include/boost/smart_ptr/detail/sp_convertible.hpp \ - /usr/include/boost/smart_ptr/detail/sp_nullptr_t.hpp \ - /usr/include/boost/assert.hpp /usr/include/assert.h \ - /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp \ - /usr/include/boost/smart_ptr/detail/spinlock.hpp \ - /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp \ - /usr/include/boost/smart_ptr/detail/yield_k.hpp \ - /usr/include/boost/smart_ptr/detail/sp_thread_pause.hpp \ - /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp \ - /usr/include/boost/config/pragma_message.hpp \ - /usr/include/boost/smart_ptr/detail/operator_bool.hpp \ - /usr/include/boost/smart_ptr/detail/local_sp_deleter.hpp \ - /usr/include/boost/smart_ptr/detail/local_counted_base.hpp \ - /usr/include/boost/config/abi_prefix.hpp \ - /usr/include/boost/config/abi_suffix.hpp \ - /usr/include/boost/iostreams/stream.hpp \ - /usr/include/boost/iostreams/constants.hpp \ - /usr/include/boost/iostreams/detail/char_traits.hpp \ - /usr/include/boost/iostreams/detail/config/overload_resolution.hpp \ - /usr/include/boost/iostreams/detail/config/gcc.hpp \ - /usr/include/boost/iostreams/detail/forward.hpp \ - /usr/include/boost/iostreams/detail/config/limits.hpp \ - /usr/include/boost/iostreams/detail/push_params.hpp \ - /usr/include/boost/preprocessor/arithmetic/dec.hpp \ - /usr/include/boost/preprocessor/config/config.hpp \ - /usr/include/boost/preprocessor/config/limits.hpp \ - /usr/include/boost/preprocessor/arithmetic/limits/dec_256.hpp \ - /usr/include/boost/preprocessor/arithmetic/inc.hpp \ - /usr/include/boost/preprocessor/arithmetic/limits/inc_256.hpp \ - /usr/include/boost/preprocessor/punctuation/comma_if.hpp \ - /usr/include/boost/preprocessor/control/if.hpp \ - /usr/include/boost/preprocessor/control/iif.hpp \ - /usr/include/boost/preprocessor/logical/bool.hpp \ - /usr/include/boost/preprocessor/logical/limits/bool_256.hpp \ - /usr/include/boost/preprocessor/facilities/empty.hpp \ - /usr/include/boost/preprocessor/punctuation/comma.hpp \ - /usr/include/boost/preprocessor/repetition/enum_binary_params.hpp \ - /usr/include/boost/preprocessor/cat.hpp \ - /usr/include/boost/preprocessor/repetition/repeat.hpp \ - /usr/include/boost/preprocessor/debug/error.hpp \ - /usr/include/boost/preprocessor/detail/auto_rec.hpp \ - /usr/include/boost/preprocessor/detail/limits/auto_rec_256.hpp \ - /usr/include/boost/preprocessor/tuple/eat.hpp \ - /usr/include/boost/preprocessor/repetition/limits/repeat_256.hpp \ - /usr/include/boost/preprocessor/tuple/elem.hpp \ - /usr/include/boost/preprocessor/facilities/expand.hpp \ - /usr/include/boost/preprocessor/facilities/overload.hpp \ - /usr/include/boost/preprocessor/variadic/size.hpp \ - /usr/include/boost/preprocessor/facilities/check_empty.hpp \ - /usr/include/boost/preprocessor/variadic/has_opt.hpp \ - /usr/include/boost/preprocessor/variadic/limits/size_64.hpp \ - /usr/include/boost/preprocessor/tuple/rem.hpp \ - /usr/include/boost/preprocessor/tuple/detail/is_single_return.hpp \ - /usr/include/boost/preprocessor/variadic/elem.hpp \ - /usr/include/boost/preprocessor/variadic/limits/elem_64.hpp \ - /usr/include/boost/preprocessor/repetition/enum_params.hpp \ - /usr/include/boost/preprocessor/repetition/repeat_from_to.hpp \ - /usr/include/boost/preprocessor/arithmetic/add.hpp \ - /usr/include/boost/preprocessor/control/while.hpp \ - /usr/include/boost/preprocessor/list/fold_left.hpp \ - /usr/include/boost/preprocessor/list/detail/fold_left.hpp \ - /usr/include/boost/preprocessor/control/expr_iif.hpp \ - /usr/include/boost/preprocessor/list/adt.hpp \ - /usr/include/boost/preprocessor/detail/is_binary.hpp \ - /usr/include/boost/preprocessor/detail/check.hpp \ - /usr/include/boost/preprocessor/logical/compl.hpp \ - /usr/include/boost/preprocessor/list/detail/limits/fold_left_256.hpp \ - /usr/include/boost/preprocessor/list/limits/fold_left_256.hpp \ - /usr/include/boost/preprocessor/list/fold_right.hpp \ - /usr/include/boost/preprocessor/list/detail/fold_right.hpp \ - /usr/include/boost/preprocessor/list/reverse.hpp \ - /usr/include/boost/preprocessor/facilities/identity.hpp \ - /usr/include/boost/preprocessor/list/detail/limits/fold_right_256.hpp \ - /usr/include/boost/preprocessor/logical/bitand.hpp \ - /usr/include/boost/preprocessor/control/detail/while.hpp \ - /usr/include/boost/preprocessor/control/detail/limits/while_256.hpp \ - /usr/include/boost/preprocessor/control/limits/while_256.hpp \ - /usr/include/boost/preprocessor/logical/bitor.hpp \ - /usr/include/boost/preprocessor/arithmetic/detail/is_maximum_number.hpp \ - /usr/include/boost/preprocessor/comparison/equal.hpp \ - /usr/include/boost/preprocessor/comparison/not_equal.hpp \ - /usr/include/boost/preprocessor/comparison/limits/not_equal_256.hpp \ - /usr/include/boost/preprocessor/arithmetic/detail/maximum_number.hpp \ - /usr/include/boost/preprocessor/arithmetic/detail/is_minimum_number.hpp \ - /usr/include/boost/preprocessor/logical/not.hpp \ - /usr/include/boost/preprocessor/arithmetic/sub.hpp \ - /usr/include/boost/preprocessor/logical/and.hpp \ - /usr/include/boost/iostreams/detail/iostream.hpp \ - /usr/include/boost/iostreams/detail/select.hpp \ - /usr/include/boost/type_traits/is_base_and_derived.hpp \ - /usr/include/boost/type_traits/intrinsics.hpp \ - /usr/include/boost/type_traits/detail/config.hpp \ - /usr/include/boost/version.hpp \ - /usr/include/boost/type_traits/remove_cv.hpp \ - /usr/include/boost/mpl/eval_if.hpp /usr/include/boost/mpl/if.hpp \ - /usr/include/boost/mpl/aux_/value_wknd.hpp \ - /usr/include/boost/mpl/aux_/static_cast.hpp \ - /usr/include/boost/mpl/aux_/config/workaround.hpp \ - /usr/include/boost/mpl/aux_/config/integral.hpp \ - /usr/include/boost/mpl/aux_/config/msvc.hpp \ - /usr/include/boost/mpl/aux_/config/eti.hpp \ - /usr/include/boost/mpl/aux_/na_spec.hpp \ - /usr/include/boost/mpl/lambda_fwd.hpp \ - /usr/include/boost/mpl/void_fwd.hpp \ - /usr/include/boost/mpl/aux_/adl_barrier.hpp \ - /usr/include/boost/mpl/aux_/config/adl.hpp \ - /usr/include/boost/mpl/aux_/config/intel.hpp \ - /usr/include/boost/mpl/aux_/config/gcc.hpp \ - /usr/include/boost/mpl/aux_/na.hpp /usr/include/boost/mpl/bool.hpp \ - /usr/include/boost/mpl/bool_fwd.hpp \ - /usr/include/boost/mpl/integral_c_tag.hpp \ - /usr/include/boost/mpl/aux_/config/static_constant.hpp \ - /usr/include/boost/mpl/aux_/na_fwd.hpp \ - /usr/include/boost/mpl/aux_/config/ctps.hpp \ - /usr/include/boost/mpl/aux_/config/lambda.hpp \ - /usr/include/boost/mpl/aux_/config/ttp.hpp \ - /usr/include/boost/mpl/int.hpp /usr/include/boost/mpl/int_fwd.hpp \ - /usr/include/boost/mpl/aux_/nttp_decl.hpp \ - /usr/include/boost/mpl/aux_/config/nttp.hpp \ - /usr/include/boost/mpl/aux_/integral_wrapper.hpp \ - /usr/include/boost/mpl/aux_/lambda_arity_param.hpp \ - /usr/include/boost/mpl/aux_/template_arity_fwd.hpp \ - /usr/include/boost/mpl/aux_/arity.hpp \ - /usr/include/boost/mpl/aux_/config/dtp.hpp \ - /usr/include/boost/mpl/aux_/preprocessor/params.hpp \ - /usr/include/boost/mpl/aux_/config/preprocessor.hpp \ - /usr/include/boost/preprocessor/comma_if.hpp \ - /usr/include/boost/preprocessor/repeat.hpp \ - /usr/include/boost/preprocessor/inc.hpp \ - /usr/include/boost/mpl/aux_/preprocessor/enum.hpp \ - /usr/include/boost/mpl/aux_/preprocessor/def_params_tail.hpp \ - /usr/include/boost/mpl/limits/arity.hpp \ - /usr/include/boost/preprocessor/identity.hpp \ - /usr/include/boost/preprocessor/empty.hpp \ - /usr/include/boost/mpl/aux_/config/overload_resolution.hpp \ - /usr/include/boost/mpl/aux_/lambda_support.hpp \ - /usr/include/boost/mpl/identity.hpp /usr/include/boost/mpl/void.hpp \ - /usr/include/boost/iostreams/stream_buffer.hpp \ - /usr/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp \ - /usr/include/boost/core/typeinfo.hpp \ - /usr/include/boost/core/demangle.hpp /usr/include/c++/11.2.0/cxxabi.h \ - /usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/cxxabi_tweaks.h \ - /usr/include/boost/iostreams/detail/error.hpp \ - /usr/include/boost/iostreams/detail/execute.hpp \ - /usr/include/boost/preprocessor/iteration/local.hpp \ - /usr/include/boost/preprocessor/slot/slot.hpp \ - /usr/include/boost/preprocessor/slot/detail/def.hpp \ - /usr/include/boost/utility/result_of.hpp \ - /usr/include/boost/type_traits/is_class.hpp \ - /usr/include/boost/type_traits/is_pointer.hpp \ - /usr/include/boost/type_traits/is_member_function_pointer.hpp \ - /usr/include/boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp \ - /usr/include/boost/type_traits/remove_reference.hpp \ - /usr/include/boost/type_traits/declval.hpp \ - /usr/include/boost/type_traits/add_rvalue_reference.hpp \ - /usr/include/boost/type_traits/is_void.hpp \ - /usr/include/boost/type_traits/is_reference.hpp \ - /usr/include/boost/type_traits/is_lvalue_reference.hpp \ - /usr/include/boost/type_traits/is_rvalue_reference.hpp \ - /usr/include/boost/type_traits/conditional.hpp \ - /usr/include/boost/type_traits/type_identity.hpp \ - /usr/include/boost/core/enable_if.hpp \ - /usr/include/boost/utility/detail/result_of_variadic.hpp \ - /usr/include/boost/preprocessor/iteration/detail/local.hpp \ - /usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp \ - /usr/include/boost/iostreams/detail/functional.hpp \ - /usr/include/boost/iostreams/close.hpp \ - /usr/include/boost/iostreams/flush.hpp \ - /usr/include/boost/iostreams/detail/dispatch.hpp \ - /usr/include/boost/iostreams/traits.hpp \ - /usr/include/boost/iostreams/detail/bool_trait_def.hpp \ - /usr/include/boost/iostreams/detail/template_params.hpp \ - /usr/include/boost/preprocessor/control/expr_if.hpp \ - /usr/include/boost/type_traits/detail/yes_no_type.hpp \ - /usr/include/boost/iostreams/detail/is_iterator_range.hpp \ - /usr/include/boost/iostreams/detail/select_by_size.hpp \ - /usr/include/boost/iostreams/detail/wrap_unwrap.hpp \ - /usr/include/boost/iostreams/detail/enable_if_stream.hpp \ - /usr/include/boost/utility/enable_if.hpp \ - /usr/include/boost/iostreams/traits_fwd.hpp /usr/include/boost/ref.hpp \ - /usr/include/boost/core/ref.hpp /usr/include/boost/mpl/or.hpp \ - /usr/include/boost/mpl/aux_/config/use_preprocessed.hpp \ - /usr/include/boost/mpl/aux_/nested_type_wknd.hpp \ - /usr/include/boost/mpl/aux_/include_preprocessed.hpp \ - /usr/include/boost/mpl/aux_/config/compiler.hpp \ - /usr/include/boost/preprocessor/stringize.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/or.hpp \ - /usr/include/boost/range/iterator_range.hpp \ - /usr/include/boost/range/iterator_range_core.hpp \ - /usr/include/boost/iterator/iterator_traits.hpp \ - /usr/include/c++/11.2.0/iterator \ - /usr/include/c++/11.2.0/bits/stream_iterator.h \ - /usr/include/boost/iterator/iterator_facade.hpp \ - /usr/include/boost/iterator/interoperable.hpp \ - /usr/include/boost/type_traits/is_convertible.hpp \ - /usr/include/boost/type_traits/is_complete.hpp \ - /usr/include/boost/type_traits/is_function.hpp \ - /usr/include/boost/type_traits/detail/is_function_cxx_11.hpp \ - /usr/include/boost/type_traits/is_array.hpp \ - /usr/include/boost/type_traits/is_arithmetic.hpp \ - /usr/include/boost/type_traits/is_integral.hpp \ - /usr/include/boost/type_traits/is_floating_point.hpp \ - /usr/include/boost/type_traits/is_abstract.hpp \ - /usr/include/boost/type_traits/add_lvalue_reference.hpp \ - /usr/include/boost/type_traits/add_reference.hpp \ - /usr/include/boost/iterator/detail/config_def.hpp \ - /usr/include/boost/iterator/detail/config_undef.hpp \ - /usr/include/boost/iterator/iterator_categories.hpp \ - /usr/include/boost/mpl/placeholders.hpp /usr/include/boost/mpl/arg.hpp \ - /usr/include/boost/mpl/arg_fwd.hpp \ - /usr/include/boost/mpl/aux_/na_assert.hpp \ - /usr/include/boost/mpl/assert.hpp /usr/include/boost/mpl/not.hpp \ - /usr/include/boost/mpl/aux_/yes_no.hpp \ - /usr/include/boost/mpl/aux_/config/arrays.hpp \ - /usr/include/boost/mpl/aux_/config/gpu.hpp \ - /usr/include/boost/mpl/aux_/config/pp_counter.hpp \ - /usr/include/boost/mpl/aux_/arity_spec.hpp \ - /usr/include/boost/mpl/aux_/arg_typedef.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/arg.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp \ - /usr/include/boost/iterator/detail/facade_iterator_category.hpp \ - /usr/include/boost/core/use_default.hpp /usr/include/boost/mpl/and.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/and.hpp \ - /usr/include/boost/type_traits/is_const.hpp \ - /usr/include/boost/detail/indirect_traits.hpp \ - /usr/include/boost/type_traits/is_volatile.hpp \ - /usr/include/boost/type_traits/is_member_pointer.hpp \ - /usr/include/boost/type_traits/remove_pointer.hpp \ - /usr/include/boost/detail/select_type.hpp \ - /usr/include/boost/iterator/detail/enable_if.hpp \ - /usr/include/boost/type_traits/add_const.hpp \ - /usr/include/boost/type_traits/add_pointer.hpp \ - /usr/include/boost/type_traits/remove_const.hpp \ - /usr/include/boost/type_traits/is_pod.hpp \ - /usr/include/boost/type_traits/is_scalar.hpp \ - /usr/include/boost/type_traits/is_enum.hpp \ - /usr/include/boost/mpl/always.hpp \ - /usr/include/boost/mpl/aux_/preprocessor/default_params.hpp \ - /usr/include/boost/mpl/apply.hpp /usr/include/boost/mpl/apply_fwd.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/apply_fwd.hpp \ - /usr/include/boost/mpl/apply_wrap.hpp \ - /usr/include/boost/mpl/aux_/has_apply.hpp \ - /usr/include/boost/mpl/has_xxx.hpp \ - /usr/include/boost/mpl/aux_/type_wrapper.hpp \ - /usr/include/boost/mpl/aux_/config/has_xxx.hpp \ - /usr/include/boost/mpl/aux_/config/msvc_typename.hpp \ - /usr/include/boost/preprocessor/array/elem.hpp \ - /usr/include/boost/preprocessor/array/data.hpp \ - /usr/include/boost/preprocessor/array/size.hpp \ - /usr/include/boost/preprocessor/repetition/enum_trailing_params.hpp \ - /usr/include/boost/mpl/aux_/config/has_apply.hpp \ - /usr/include/boost/mpl/aux_/msvc_never_true.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp \ - /usr/include/boost/mpl/lambda.hpp /usr/include/boost/mpl/bind.hpp \ - /usr/include/boost/mpl/bind_fwd.hpp \ - /usr/include/boost/mpl/aux_/config/bind.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp \ - /usr/include/boost/mpl/next.hpp /usr/include/boost/mpl/next_prior.hpp \ - /usr/include/boost/mpl/aux_/common_name_wknd.hpp \ - /usr/include/boost/mpl/protect.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/bind.hpp \ - /usr/include/boost/mpl/aux_/full_lambda.hpp \ - /usr/include/boost/mpl/quote.hpp \ - /usr/include/boost/mpl/aux_/has_type.hpp \ - /usr/include/boost/mpl/aux_/config/bcc.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/quote.hpp \ - /usr/include/boost/mpl/aux_/template_arity.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp \ - /usr/include/boost/mpl/aux_/preprocessed/gcc/apply.hpp \ - /usr/include/boost/range/functions.hpp \ - /usr/include/boost/range/begin.hpp /usr/include/boost/range/config.hpp \ - /usr/include/boost/range/iterator.hpp \ - /usr/include/boost/range/range_fwd.hpp \ - /usr/include/boost/range/mutable_iterator.hpp \ - /usr/include/boost/range/detail/extract_optional_type.hpp \ - /usr/include/boost/range/detail/msvc_has_iterator_workaround.hpp \ - /usr/include/boost/range/const_iterator.hpp \ - /usr/include/boost/range/end.hpp \ - /usr/include/boost/range/detail/implementation_help.hpp \ - /usr/include/boost/range/detail/common.hpp \ - /usr/include/boost/range/detail/sfinae.hpp \ - /usr/include/boost/range/size.hpp /usr/include/boost/range/size_type.hpp \ - /usr/include/boost/range/difference_type.hpp \ - /usr/include/boost/range/has_range_iterator.hpp \ - /usr/include/boost/range/concepts.hpp \ - /usr/include/boost/concept_check.hpp \ - /usr/include/boost/concept/assert.hpp \ - /usr/include/boost/concept/detail/general.hpp \ - /usr/include/boost/concept/detail/backward_compatibility.hpp \ - /usr/include/boost/concept/detail/has_constraints.hpp \ - /usr/include/boost/type_traits/conversion_traits.hpp \ - /usr/include/boost/concept/usage.hpp \ - /usr/include/boost/concept/detail/concept_def.hpp \ - /usr/include/boost/preprocessor/seq/for_each_i.hpp \ - /usr/include/boost/preprocessor/repetition/for.hpp \ - /usr/include/boost/preprocessor/repetition/detail/for.hpp \ - /usr/include/boost/preprocessor/repetition/detail/limits/for_256.hpp \ - /usr/include/boost/preprocessor/repetition/limits/for_256.hpp \ - /usr/include/boost/preprocessor/seq/seq.hpp \ - /usr/include/boost/preprocessor/seq/elem.hpp \ - /usr/include/boost/preprocessor/seq/limits/elem_256.hpp \ - /usr/include/boost/preprocessor/seq/size.hpp \ - /usr/include/boost/preprocessor/seq/limits/size_256.hpp \ - /usr/include/boost/preprocessor/seq/detail/is_empty.hpp \ - /usr/include/boost/preprocessor/seq/enum.hpp \ - /usr/include/boost/preprocessor/seq/limits/enum_256.hpp \ - /usr/include/boost/concept/detail/concept_undef.hpp \ - /usr/include/boost/iterator/iterator_concepts.hpp \ - /usr/include/boost/range/value_type.hpp \ - /usr/include/boost/range/detail/misc_concept.hpp \ - /usr/include/boost/type_traits/make_unsigned.hpp \ - /usr/include/boost/type_traits/is_signed.hpp \ - /usr/include/c++/11.2.0/climits \ - /usr/include/boost/type_traits/is_unsigned.hpp \ - /usr/include/boost/type_traits/add_volatile.hpp \ - /usr/include/boost/range/detail/has_member_size.hpp \ - /usr/include/boost/utility.hpp \ - /usr/include/boost/utility/base_from_member.hpp \ - /usr/include/boost/utility/binary.hpp \ - /usr/include/boost/preprocessor/control/deduce_d.hpp \ - /usr/include/boost/preprocessor/seq/cat.hpp \ - /usr/include/boost/preprocessor/seq/fold_left.hpp \ - /usr/include/boost/preprocessor/seq/limits/fold_left_256.hpp \ - /usr/include/boost/preprocessor/seq/transform.hpp \ - /usr/include/boost/preprocessor/arithmetic/mod.hpp \ - /usr/include/boost/preprocessor/arithmetic/detail/div_base.hpp \ - /usr/include/boost/preprocessor/comparison/less_equal.hpp \ - /usr/include/boost/preprocessor/arithmetic/detail/is_1_number.hpp \ - /usr/include/boost/utility/identity_type.hpp \ - /usr/include/boost/type_traits/function_traits.hpp \ - /usr/include/boost/core/noncopyable.hpp \ - /usr/include/boost/range/distance.hpp \ - /usr/include/boost/iterator/distance.hpp \ - /usr/include/boost/range/empty.hpp /usr/include/boost/range/rbegin.hpp \ - /usr/include/boost/range/reverse_iterator.hpp \ - /usr/include/boost/iterator/reverse_iterator.hpp \ - /usr/include/boost/iterator/iterator_adaptor.hpp \ - /usr/include/boost/range/rend.hpp \ - /usr/include/boost/range/algorithm/equal.hpp \ - /usr/include/boost/range/detail/safe_bool.hpp \ - /usr/include/boost/next_prior.hpp \ - /usr/include/boost/type_traits/has_plus.hpp \ - /usr/include/boost/type_traits/detail/has_binary_operator.hpp \ - /usr/include/boost/type_traits/make_void.hpp \ - /usr/include/boost/type_traits/has_plus_assign.hpp \ - /usr/include/boost/type_traits/has_minus.hpp \ - /usr/include/boost/type_traits/has_minus_assign.hpp \ - /usr/include/boost/iterator/advance.hpp \ - /usr/include/boost/range/iterator_range_io.hpp \ - /usr/include/boost/iostreams/detail/streambuf.hpp \ - /usr/include/boost/iostreams/operations_fwd.hpp \ - /usr/include/boost/iostreams/detail/adapter/non_blocking_adapter.hpp \ - /usr/include/boost/iostreams/read.hpp \ - /usr/include/boost/iostreams/char_traits.hpp \ - /usr/include/boost/iostreams/seek.hpp \ - /usr/include/boost/iostreams/write.hpp \ - /usr/include/boost/iostreams/detail/optional.hpp \ - /usr/include/boost/type_traits/aligned_storage.hpp \ - /usr/include/boost/type_traits/alignment_of.hpp \ - /usr/include/boost/type_traits/type_with_alignment.hpp \ - /usr/include/boost/iostreams/detail/streambuf/linked_streambuf.hpp \ - /usr/include/boost/iostreams/operations.hpp \ - /usr/include/boost/iostreams/imbue.hpp \ - /usr/include/boost/iostreams/input_sequence.hpp \ - /usr/include/boost/iostreams/optimal_buffer_size.hpp \ - /usr/include/boost/iostreams/output_sequence.hpp \ - /usr/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp \ - /usr/include/c++/11.2.0/cassert \ - /usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp \ - /usr/include/boost/iostreams/concepts.hpp \ - /usr/include/boost/iostreams/detail/default_arg.hpp \ - /usr/include/boost/iostreams/detail/call_traits.hpp \ - /usr/include/boost/iostreams/detail/config/unreachable_return.hpp \ - /usr/include/boost/iostreams/device/null.hpp \ - /usr/include/boost/iostreams/detail/buffer.hpp \ - /usr/include/boost/iostreams/checked_operations.hpp \ - /usr/include/boost/iostreams/get.hpp \ - /usr/include/boost/iostreams/put.hpp \ - /usr/include/boost/iostreams/detail/double_object.hpp \ - /usr/include/boost/call_traits.hpp \ - /usr/include/boost/detail/call_traits.hpp \ - /usr/include/boost/iostreams/detail/push.hpp \ - /usr/include/boost/iostreams/detail/adapter/range_adapter.hpp \ - /usr/include/boost/iostreams/pipeline.hpp \ - /usr/include/boost/iostreams/detail/resolve.hpp \ - /usr/include/boost/detail/is_incrementable.hpp \ - /usr/include/boost/type_traits/detail/bool_trait_undef.hpp \ - /usr/include/boost/iostreams/detail/adapter/mode_adapter.hpp \ - /usr/include/boost/iostreams/detail/adapter/output_iterator_adapter.hpp \ - /usr/include/boost/iostreams/detail/is_dereferenceable.hpp \ - /usr/include/boost/iostreams/device/array.hpp \ - /usr/include/boost/tuple/tuple.hpp \ - /usr/include/boost/tuple/detail/tuple_basic.hpp \ - /usr/include/boost/type_traits/cv_traits.hpp \ - /usr/include/boost/type_traits/add_cv.hpp \ - /usr/include/boost/type_traits/remove_volatile.hpp \ - /usr/include/boost/utility/swap.hpp /usr/include/boost/core/swap.hpp \ - /usr/include/boost/filesystem.hpp \ - /usr/include/boost/filesystem/config.hpp \ - /usr/include/boost/system/api_config.hpp \ - /usr/include/boost/filesystem/path.hpp \ - /usr/include/boost/filesystem/path_traits.hpp \ - /usr/include/boost/system/error_category.hpp \ - /usr/include/boost/system/detail/error_category.hpp \ - /usr/include/boost/system/detail/config.hpp \ - /usr/include/c++/11.2.0/atomic \ - /usr/include/boost/system/detail/error_category_impl.hpp \ - /usr/include/boost/system/detail/error_condition.hpp \ - /usr/include/boost/system/detail/generic_category.hpp \ - /usr/include/boost/system/detail/generic_category_message.hpp \ - /usr/include/boost/system/detail/enable_if.hpp \ - /usr/include/boost/system/detail/is_same.hpp \ - /usr/include/boost/system/detail/errc.hpp \ - /usr/include/boost/system/is_error_condition_enum.hpp \ - /usr/include/boost/system/detail/cerrno.hpp \ - /usr/include/boost/system/detail/append_int.hpp \ - /usr/include/boost/system/detail/snprintf.hpp \ - /usr/include/c++/11.2.0/cstdarg \ - /usr/include/boost/system/detail/error_code.hpp \ - /usr/include/boost/system/is_error_code_enum.hpp \ - /usr/include/boost/system/detail/system_category.hpp \ - /usr/include/boost/system/detail/system_category_impl.hpp \ - /usr/include/boost/system/detail/interop_category.hpp \ - /usr/include/boost/system/detail/std_category.hpp \ - /usr/include/boost/type_traits/decay.hpp \ - /usr/include/boost/type_traits/remove_bounds.hpp \ - /usr/include/boost/type_traits/remove_extent.hpp \ - /usr/include/c++/11.2.0/list /usr/include/c++/11.2.0/bits/stl_list.h \ - /usr/include/c++/11.2.0/bits/list.tcc \ - /usr/include/boost/filesystem/detail/header.hpp \ - /usr/include/boost/filesystem/detail/footer.hpp \ - /usr/include/boost/io/quoted.hpp \ - /usr/include/boost/io/detail/buffer_fill.hpp \ - /usr/include/boost/io/detail/ostream_guard.hpp \ - /usr/include/boost/io/ios_state.hpp /usr/include/boost/io_fwd.hpp \ - /usr/include/boost/functional/hash_fwd.hpp \ - /usr/include/boost/container_hash/hash_fwd.hpp \ - /usr/include/boost/filesystem/exception.hpp \ - /usr/include/boost/system/error_code.hpp \ - /usr/include/boost/system/error_condition.hpp \ - /usr/include/boost/system/errc.hpp \ - /usr/include/boost/system/generic_category.hpp \ - /usr/include/boost/system/system_category.hpp \ - /usr/include/boost/system/detail/throws.hpp \ - /usr/include/boost/system/system_error.hpp \ - /usr/include/boost/smart_ptr/intrusive_ptr.hpp \ - /usr/include/boost/config/no_tr1/functional.hpp \ - /usr/include/boost/smart_ptr/intrusive_ref_counter.hpp \ - /usr/include/boost/smart_ptr/detail/atomic_count.hpp \ - /usr/include/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp \ - /usr/include/boost/filesystem/directory.hpp \ - /usr/include/boost/filesystem/file_status.hpp \ - /usr/include/boost/detail/bitmask.hpp \ - /usr/include/boost/core/scoped_enum.hpp \ - /usr/include/boost/filesystem/operations.hpp \ - /usr/include/boost/filesystem/convenience.hpp \ - /usr/include/boost/filesystem/string_file.hpp \ - /usr/include/boost/filesystem/fstream.hpp \ /home/noah/Documents/School/CS-7353_Analysis-of-Algorithms/HW/HW4/src/HiddenLines.h \ /usr/include/c++/11.2.0/map /usr/include/c++/11.2.0/bits/stl_map.h \ /usr/include/c++/11.2.0/bits/stl_multimap.h \ diff --git a/build/libHLlib.a b/build/libHLlib.a index c28bfef..52e6ade 100644 Binary files a/build/libHLlib.a and b/build/libHLlib.a differ diff --git a/build/main b/build/main index 32012b9..0f450d4 100755 Binary files a/build/main and b/build/main differ diff --git a/src/HiddenLines.cpp b/src/HiddenLines.cpp index 9117850..a5640e8 100644 --- a/src/HiddenLines.cpp +++ b/src/HiddenLines.cpp @@ -9,8 +9,10 @@ #include #include -#include "gnuplot-iostream.h" +//#include "gnuplot-iostream.h" +#include "gnuplot_i.hpp" #include "HiddenLines.h" +void wait_for_key(); // Programm halts until keypress HL::HL() { @@ -110,6 +112,10 @@ std::vector HL::construct_HWprob(){ //Set to hold all our Lines std::set sorted_lines; std::vector lines; + Gnuplot g1("lines"); + g1.set_title("Original Lines"); + g1.set_xrange(-20,20); + g1.set_yrange(-40,40); //Hold our doubles from each line std::vector tmp_data; @@ -164,9 +170,13 @@ std::vector HL::construct_HWprob(){ line.set_vis_end(std::numeric_limits::max()); *it = line; } + + g1.plot_slope(line.get_slope(),line.get_ycept(), "Line "+std::to_string(line.get_id())); } std::cout << "-----------------------------------------------------" << std::endl; + wait_for_key(); + return lines; } @@ -293,3 +303,21 @@ std::vector remove_invis(std::vector &merged){ } return tmp_vis; } + +//GNUPlot +void wait_for_key () +{ +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) // every keypress registered, also arrow keys + std::cout << std::endl << "Press any key to continue..." << std::endl; + + FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); + _getch(); +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + std::cout << std::endl << "Press ENTER to continue..." << std::endl; + + std::cin.clear(); + std::cin.ignore(std::cin.rdbuf()->in_avail()); + std::cin.get(); +#endif + return; +} \ No newline at end of file diff --git a/src/gnuplot_i.hpp b/src/gnuplot_i.hpp new file mode 100644 index 0000000..15f5cdc --- /dev/null +++ b/src/gnuplot_i.hpp @@ -0,0 +1,2114 @@ +//////////////////////////////////////////////////////////////////////////////// +/// +/// \brief A C++ interface to gnuplot. +/// +/// +/// The interface uses pipes and so won't run on a system that doesn't have +/// POSIX pipe support Tested on Windows (MinGW and Visual C++) and Linux (GCC) +/// +/// Version history: +/// 0. C interface +/// by N. Devillard (27/01/03) +/// 1. C++ interface: direct translation from the C interface +/// by Rajarshi Guha (07/03/03) +/// 2. corrections for Win32 compatibility +/// by V. Chyzhdzenka (20/05/03) +/// 3. some member functions added, corrections for Win32 and Linux +/// compatibility +/// by M. Burgis (10/03/08) +/// +/// Requirements: +/// * gnuplot has to be installed (http://www.gnuplot.info/download.html) +/// * for Windows: set Path-Variable for Gnuplot path +/// (e.g. C:/program files/gnuplot/bin) +/// or set Gnuplot path with: +/// Gnuplot::set_GNUPlotPath(const std::string &path); +/// +//////////////////////////////////////////////////////////////////////////////// + + +#ifndef _GNUPLOT_PIPES_H_ +#define _GNUPLOT_PIPES_H_ + + +#include +#include +#include +#include +#include // for std::ostringstream +#include +#include +#include // for getenv() +#include // for std::list + + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) +//defined for 32 and 64-bit environments +#include // for _access(), _mktemp() +#define GP_MAX_TMP_FILES 27 // 27 temporary files it's Microsoft restriction +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) +//all UNIX-like OSs (Linux, *BSD, MacOSX, Solaris, ...) +#include // for access(), mkstemp() +#define GP_MAX_TMP_FILES 64 +#else +#error unsupported or unknown operating system +#endif + +//declare classes in global namespace + + +class GnuplotException : public std::runtime_error +{ +public: + GnuplotException(const std::string &msg) : std::runtime_error(msg) {} +}; + + + +class Gnuplot +{ +private: + + //---------------------------------------------------------------------------------- + // member data + ///\brief pointer to the stream that can be used to write to the pipe + FILE *gnucmd; + ///\brief validation of gnuplot session + bool valid; + ///\brief true = 2d, false = 3d + bool two_dim; + ///\brief number of plots in session + int nplots; + ///\brief functions and data are displayed in a defined styles + std::string pstyle; + ///\brief interpolate and approximate data in defined styles (e.g. spline) + std::string smooth; + ///\brief list of created tmpfiles + std::vector tmpfile_list; + + //---------------------------------------------------------------------------------- + // static data + ///\brief number of all tmpfiles (number of tmpfiles restricted) + static int tmpfile_num; + ///\brief name of executed GNUPlot file + static std::string m_sGNUPlotFileName; + ///\brief gnuplot path + static std::string m_sGNUPlotPath; + ///\brief standart terminal, used by showonscreen + static std::string terminal_std; + + //---------------------------------------------------------------------------------- + // member functions (auxiliary functions) + // --------------------------------------------------- + ///\brief get_program_path(); and popen(); + /// + /// \param --> void + /// + /// \return <-- void + // --------------------------------------------------- + void init(); + // --------------------------------------------------- + ///\brief creates tmpfile and returns its name + /// + /// \param tmp --> points to the tempfile + /// + /// \return <-- the name of the tempfile + // --------------------------------------------------- + std::string create_tmpfile(std::ofstream &tmp); + + //---------------------------------------------------------------------------------- + ///\brief gnuplot path found? + /// + /// \param --- + /// + /// \return <-- found the gnuplot path (yes == true, no == false) + // --------------------------------------------------------------------------------- + static bool get_program_path(); + + // --------------------------------------------------------------------------------- + ///\brief checks if file is available + /// + /// \param filename --> the filename + /// \param mode --> the mode [optional,default value = 0] + /// + /// \return file exists (yes == true, no == false) + // --------------------------------------------------------------------------------- + bool file_available(const std::string &filename); + + // --------------------------------------------------------------------------------- + ///\brief checks if file exists + /// + /// \param filename --> the filename + /// \param mode --> the mode [optional,default value = 0] + /// + /// \return file exists (yes == true, no == false) + // --------------------------------------------------------------------------------- + static bool file_exists(const std::string &filename, int mode=0); + +public: + + // ---------------------------------------------------------------------------- + /// \brief optional function: set Gnuplot path manual + /// attention: for windows: path with slash '/' not backslash '\' + /// + /// \param path --> the gnuplot path + /// + /// \return true on success, false otherwise + // ---------------------------------------------------------------------------- + static bool set_GNUPlotPath(const std::string &path); + + + // ---------------------------------------------------------------------------- + /// optional: set standart terminal, used by showonscreen + /// defaults: Windows - win, Linux - x11, Mac - aqua + /// + /// \param type --> the terminal type + /// + /// \return --- + // ---------------------------------------------------------------------------- + static void set_terminal_std(const std::string &type); + + //----------------------------------------------------------------------------- + // constructors + // ---------------------------------------------------------------------------- + + + ///\brief set a style during construction + Gnuplot(const std::string &style = "points"); + + /// plot a single std::vector at one go + Gnuplot(const std::vector &x, + const std::string &title = "", + const std::string &style = "points", + const std::string &labelx = "x", + const std::string &labely = "y"); + + /// plot pairs std::vector at one go + Gnuplot(const std::vector &x, + const std::vector &y, + const std::string &title = "", + const std::string &style = "points", + const std::string &labelx = "x", + const std::string &labely = "y"); + + /// plot triples std::vector at one go + Gnuplot(const std::vector &x, + const std::vector &y, + const std::vector &z, + const std::string &title = "", + const std::string &style = "points", + const std::string &labelx = "x", + const std::string &labely = "y", + const std::string &labelz = "z"); + + /// destructor: needed to delete temporary files + ~Gnuplot(); + + + //---------------------------------------------------------------------------------- + + /// send a command to gnuplot + Gnuplot& cmd(const std::string &cmdstr); + // ------------------------------------------------------------------------- + ///\brief Sends a command to an active gnuplot session, identical to cmd() + /// send a command to gnuplot using the << operator + /// + /// \param cmdstr --> the command string + /// + /// \return <-- a reference to the gnuplot object + // ------------------------------------------------------------------------- + inline Gnuplot& operator<<(const std::string &cmdstr) + { + cmd(cmdstr); + return(*this); + } + + + + //-------------------------------------------------------------------------- + // show on screen or write to file + + /// sets terminal type to terminal_std + Gnuplot& showonscreen(); // window output is set by default (win/x11/aqua) + + /// Saves a gnuplot to a file named filename. Defaults to saving pdf + Gnuplot& savetofigure(const std::string filename, + const std::string terminal="ps"); + + //-------------------------------------------------------------------------- + // set and unset + + /// set line style (some of these styles require additional information): + /// lines, points, linespoints, impulses, dots, steps, fsteps, histeps, + /// boxes, histograms, filledcurves + Gnuplot& set_style(const std::string &stylestr = "points"); + + /// interpolation and approximation of data, arguments: + /// csplines, bezier, acsplines (for data values > 0), sbezier, unique, frequency + /// (works only with plot_x, plot_xy, plotfile_x, plotfile_xy + /// (if smooth is set, set_style has no effekt on data plotting) + Gnuplot& set_smooth(const std::string &stylestr = "csplines"); + + // ---------------------------------------------------------------------- + /// \brief unset smooth + /// attention: smooth is not set by default + /// + /// \param --- + /// + /// \return <-- a reference to a gnuplot object + // ---------------------------------------------------------------------- + inline Gnuplot& unset_smooth() + { + smooth = ""; + return *this; + }; + + + /// scales the size of the points used in plots + Gnuplot& set_pointsize(const double pointsize = 1.0); + + /// turns grid on/off + inline Gnuplot& set_grid() + { + cmd("set grid"); + return *this; + }; + /// grid is not set by default + inline Gnuplot& unset_grid() + { + cmd("unset grid"); + return *this; + }; + + // ----------------------------------------------- + /// set the mulitplot mode + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& set_multiplot() + { + cmd("set multiplot") ; + return *this; + }; + + // ----------------------------------------------- + /// unsets the mulitplot mode + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& unset_multiplot() + { + cmd("unset multiplot"); + return *this; + }; + + + + /// set sampling rate of functions, or for interpolating data + Gnuplot& set_samples(const int samples = 100); + /// set isoline density (grid) for plotting functions as surfaces (for 3d plots) + Gnuplot& set_isosamples(const int isolines = 10); + + // -------------------------------------------------------------------------- + /// enables/disables hidden line removal for surface plotting (for 3d plot) + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // -------------------------------------------------------------------------- + Gnuplot& set_hidden3d() + { + cmd("set hidden3d"); + return *this; + }; + + // --------------------------------------------------------------------------- + /// hidden3d is not set by default + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // --------------------------------------------------------------------------- + inline Gnuplot& unset_hidden3d() + { + cmd("unset hidden3d"); + return *this; + }; + + /// enables/disables contour drawing for surfaces (for 3d plot) + /// base, surface, both + Gnuplot& set_contour(const std::string &position = "base"); + // -------------------------------------------------------------------------- + /// contour is not set by default, it disables contour drawing for surfaces + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ------------------------------------------------------------------ + inline Gnuplot& unset_contour() + { + cmd("unset contour"); + return *this; + }; + + // ------------------------------------------------------------ + /// enables/disables the display of surfaces (for 3d plot) + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ------------------------------------------------------------------ + inline Gnuplot& set_surface() + { + cmd("set surface"); + return *this; + }; + + // ---------------------------------------------------------- + /// surface is set by default, + /// it disables the display of surfaces (for 3d plot) + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ------------------------------------------------------------------ + inline Gnuplot& unset_surface() + { + cmd("unset surface"); + return *this; + } + + + /// switches legend on/off + /// position: inside/outside, left/center/right, top/center/bottom, nobox/box + Gnuplot& set_legend(const std::string &position = "default"); + + // ------------------------------------------------------------------ + /// \brief Switches legend off + /// attention:legend is set by default + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ------------------------------------------------------------------ + inline Gnuplot& unset_legend() + { + cmd("unset key"); + return *this; + } + + // ----------------------------------------------------------------------- + /// \brief sets and clears the title of a gnuplot session + /// + /// \param title --> the title of the plot [optional, default == ""] + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------------------------------- + inline Gnuplot& set_title(const std::string &title = "") + { + std::string cmdstr; + cmdstr = "set title \""; + cmdstr+=title; + cmdstr+="\""; + *this<set_title(); + return *this; + } + + + /// set x axis label + Gnuplot& set_ylabel(const std::string &label = "x"); + /// set y axis label + Gnuplot& set_xlabel(const std::string &label = "y"); + /// set z axis label + Gnuplot& set_zlabel(const std::string &label = "z"); + + /// set axis - ranges + Gnuplot& set_xrange(const double iFrom, + const double iTo); + /// set y-axis - ranges + Gnuplot& set_yrange(const double iFrom, + const double iTo); + /// set z-axis - ranges + Gnuplot& set_zrange(const double iFrom, + const double iTo); + /// autoscale axis (set by default) of xaxis + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& set_xautoscale() + { + cmd("set xrange restore"); + cmd("set autoscale x"); + return *this; + }; + + // ----------------------------------------------- + /// autoscale axis (set by default) of yaxis + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& set_yautoscale() + { + cmd("set yrange restore"); + cmd("set autoscale y"); + return *this; + }; + + // ----------------------------------------------- + /// autoscale axis (set by default) of zaxis + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& set_zautoscale() + { + cmd("set zrange restore"); + cmd("set autoscale z"); + return *this; + }; + + + /// turns on/off log scaling for the specified xaxis (logscale is not set by default) + Gnuplot& set_xlogscale(const double base = 10); + /// turns on/off log scaling for the specified yaxis (logscale is not set by default) + Gnuplot& set_ylogscale(const double base = 10); + /// turns on/off log scaling for the specified zaxis (logscale is not set by default) + Gnuplot& set_zlogscale(const double base = 10); + + // ----------------------------------------------- + /// turns off log scaling for the x axis + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& unset_xlogscale() + { + cmd("unset logscale x"); + return *this; + }; + + // ----------------------------------------------- + /// turns off log scaling for the y axis + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& unset_ylogscale() + { + cmd("unset logscale y"); + return *this; + }; + + // ----------------------------------------------- + /// turns off log scaling for the z axis + /// + /// \param --- + /// + /// \return <-- reference to the gnuplot object + // ----------------------------------------------- + inline Gnuplot& unset_zlogscale() + { + cmd("unset logscale z"); + return *this; + }; + + + /// set palette range (autoscale by default) + Gnuplot& set_cbrange(const double iFrom, const double iTo); + + + //-------------------------------------------------------------------------- + // plot + + /// plot a single std::vector: x + /// from file + Gnuplot& plotfile_x(const std::string &filename, + const unsigned int column = 1, + const std::string &title = ""); + /// from std::vector + template + Gnuplot& plot_x(const X& x, const std::string &title = ""); + + template + Gnuplot& plot_x(const std::vector< X > &x, const std::vector &title); + + + /// plot x,y pairs: x y + /// from file + Gnuplot& plotfile_xy(const std::string &filename, + const unsigned int column_x = 1, + const unsigned int column_y = 2, + const std::string &title = ""); + /// from data + template + Gnuplot& plot_xy(const X& x, const Y& y, const std::string &title = ""); + + + /// plot x,y pairs with dy errorbars: x y dy + /// from file + Gnuplot& plotfile_xy_err(const std::string &filename, + const unsigned int column_x = 1, + const unsigned int column_y = 2, + const unsigned int column_dy = 3, + const std::string &title = ""); + /// from data + template + Gnuplot& plot_xy_err(const X &x, const Y &y, const E &dy, + const std::string &title = ""); + + + /// plot x,y,z triples: x y z + /// from file + Gnuplot& plotfile_xyz(const std::string &filename, + const unsigned int column_x = 1, + const unsigned int column_y = 2, + const unsigned int column_z = 3, + const std::string &title = ""); + /// from std::vector + template + Gnuplot& plot_xyz(const X &x, + const Y &y, + const Z &z, + const std::string &title = ""); + + + + /// plot an equation of the form: y = ax + b, you supply a and b + Gnuplot& plot_slope(const double a, + const double b, + const std::string &title = ""); + + + /// plot an equation supplied as a std::string y=f(x), write only the + /// function f(x) not y the independent variable has to be x + /// binary operators: ** exponentiation, * multiply, / divide, + add, - + /// substract, % modulo + /// unary operators: - minus, ! factorial + /// elementary functions: rand(x), abs(x), sgn(x), ceil(x), floor(x), + /// int(x), imag(x), real(x), arg(x), sqrt(x), exp(x), log(x), log10(x), + /// sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), + /// sinh(x), cosh(x), tanh(x), asinh(x), acosh(x), atanh(x) + /// special functions: erf(x), erfc(x), inverf(x), gamma(x), igamma(a,x), + /// lgamma(x), ibeta(p,q,x), besj0(x), besj1(x), besy0(x), besy1(x), + /// lambertw(x) + /// statistical fuctions: norm(x), invnorm(x) + Gnuplot& plot_equation(const std::string &equation, + const std::string &title = ""); + + /// plot an equation supplied as a std::string z=f(x,y), write only the + /// function f(x,y) not z the independent variables have to be x and y + Gnuplot& plot_equation3d(const std::string &equation, + const std::string &title = ""); + + + /// plot image + Gnuplot& plot_image(const unsigned char *ucPicBuf, + const unsigned int iWidth, + const unsigned int iHeight, + const std::string &title = ""); + + + //-------------------------------------------------------------------------- + ///\brief replot repeats the last plot or splot command. + /// this can be useful for viewing a plot with different set options, + /// or when generating the same plot for several devices (showonscreen, + // savetofigure) + /// + /// \param --- + /// + /// \return --- + //-------------------------------------------------------------------------- + inline Gnuplot& replot(void) + { + if (nplots > 0) cmd("replot"); + return *this; + }; + + /// resets a gnuplot session (next plot will erase previous ones) + Gnuplot& reset_plot(); + + /// resets a gnuplot session and sets all variables to default + Gnuplot& reset_all(); + + /// deletes temporary files + void remove_tmpfiles(); + + // ------------------------------------------------------------------- + /// \brief Is the gnuplot session valid ?? + /// + /// + /// \param --- + /// + /// \return true if valid, false if not + // ------------------------------------------------------------------- + inline bool is_valid() + { + return(valid); + }; + +}; + +//------------------------------------------------------------------------------ +// +// initialize static data +// +int Gnuplot::tmpfile_num = 0; + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) +std::string Gnuplot::m_sGNUPlotFileName = "pgnuplot.exe"; +std::string Gnuplot::m_sGNUPlotPath = "C:/program files/gnuplot/bin/"; +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) +std::string Gnuplot::m_sGNUPlotFileName = "gnuplot"; +std::string Gnuplot::m_sGNUPlotPath = "/usr/local/bin/"; +#endif + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) +std::string Gnuplot::terminal_std = "windows"; +#elif ( defined(unix) || defined(__unix) || defined(__unix__) ) && !defined(__APPLE__) +std::string Gnuplot::terminal_std = "x11"; +#elif defined(__APPLE__) +std::string Gnuplot::terminal_std = "aqua"; +#endif + +//------------------------------------------------------------------------------ +// +// constructor: set a style during construction +// +inline Gnuplot::Gnuplot(const std::string &style) + :gnucmd(NULL) ,valid(false) ,two_dim(false) ,nplots(0) + +{ + init(); + set_style(style); +} + +//------------------------------------------------------------------------------ +// +// constructor: open a new session, plot a signal (x) +// +inline Gnuplot::Gnuplot(const std::vector &x, + const std::string &title, + const std::string &style, + const std::string &labelx, + const std::string &labely) + :gnucmd(NULL) ,valid(false) ,two_dim(false) ,nplots(0) +{ + init(); + + set_style(style); + set_xlabel(labelx); + set_ylabel(labely); + + plot_x(x,title); +} + + +//------------------------------------------------------------------------------ +// +// constructor: open a new session, plot a signal (x,y) +// +inline Gnuplot::Gnuplot(const std::vector &x, + const std::vector &y, + const std::string &title, + const std::string &style, + const std::string &labelx, + const std::string &labely) + :gnucmd(NULL) ,valid(false) ,two_dim(false) ,nplots(0) +{ + init(); + + set_style(style); + set_xlabel(labelx); + set_ylabel(labely); + + plot_xy(x,y,title); +} + + +//------------------------------------------------------------------------------ +// +// constructor: open a new session, plot a signal (x,y,z) +// +inline Gnuplot::Gnuplot(const std::vector &x, + const std::vector &y, + const std::vector &z, + const std::string &title, + const std::string &style, + const std::string &labelx, + const std::string &labely, + const std::string &labelz) + :gnucmd(NULL) ,valid(false) ,two_dim(false) ,nplots(0) +{ + init(); + + set_style(style); + set_xlabel(labelx); + set_ylabel(labely); + set_zlabel(labelz); + + plot_xyz(x,y,z,title); +} + + +//------------------------------------------------------------------------------ +// +/// Plots a 2d graph from a list of doubles: x +// +template +Gnuplot& Gnuplot::plot_x(const X& x, const std::string &title) +{ + if (x.size() == 0) + { + throw GnuplotException("std::vector too small"); + return *this; + } + + std::ofstream tmp; + std::string name = create_tmpfile(tmp); + if (name == "") + return *this; + + // + // write the data to file + // + for (unsigned int i = 0; i < x.size(); i++) + tmp << x[i] << std::endl; + + tmp.flush(); + tmp.close(); + + + plotfile_x(name, 1, title); + + return *this; +} + +template +Gnuplot& Gnuplot::plot_x(const std::vector< X > &x, const std::vector &title) +{ + if (x.size() == 0) // no check + { + throw GnuplotException("std::vector too small"); + return *this; + } + + + + int column = 1; + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == true) + cmdstr << "replot "; + else + cmdstr << "plot "; + + + for (unsigned int k = 0; k < x.size(); k++){ + cmdstr << "\'-\' using " << column; + if (title.size() == 0 || title[k] == "") + cmdstr << " notitle "; + else + cmdstr << " title \"" << title[k] << "\" "; + + if(smooth == "") + cmdstr << "with " << pstyle; + else + cmdstr << "smooth " << smooth; + + if (k != x.size()-1) cmdstr << ","; + } + + cmdstr << "\n"; + for (unsigned int k = 0; k < x.size(); k++){ + typename X::const_iterator it; + it = x[k].begin(); + for (; it != x[k].end(); it++) + cmdstr << (*it) << std::endl; + cmdstr << "e" << std::endl; + } + + // + // Do the actual plot + // + cmd(cmdstr.str()); //nplots++; two_dim = true; already in cmd(); + + + + + return *this; +} + + +//------------------------------------------------------------------------------ +// +/// Plots a 2d graph from a list of doubles: x y +// +template +Gnuplot& Gnuplot::plot_xy(const X& x, const Y& y, const std::string &title) +{ + if (x.size() == 0 || y.size() == 0) + { + throw GnuplotException("std::vectors too small"); + return *this; + } + + if (x.size() != y.size()) + { + throw GnuplotException("Length of the std::vectors differs"); + return *this; + } + + + std::ofstream tmp; + std::string name = create_tmpfile(tmp); + if (name == "") + return *this; + + // + // write the data to file + // + for (unsigned int i = 0; i < x.size(); i++) + tmp << x[i] << " " << y[i] << std::endl; + + tmp.flush(); + tmp.close(); + + + plotfile_xy(name, 1, 2, title); + + return *this; +} + +///----------------------------------------------------------------------------- +/// +/// plot x,y pairs with dy errorbars +/// +template +Gnuplot& Gnuplot::plot_xy_err(const X &x, + const Y &y, + const E &dy, + const std::string &title) +{ + if (x.size() == 0 || y.size() == 0 || dy.size() == 0) + { + throw GnuplotException("std::vectors too small"); + return *this; + } + + if (x.size() != y.size() || y.size() != dy.size()) + { + throw GnuplotException("Length of the std::vectors differs"); + return *this; + } + + + std::ofstream tmp; + std::string name = create_tmpfile(tmp); + if (name == "") + return *this; + + // + // write the data to file + // + for (unsigned int i = 0; i < x.size(); i++) + tmp << x[i] << " " << y[i] << " " << dy[i] << std::endl; + + tmp.flush(); + tmp.close(); + + + // Do the actual plot + plotfile_xy_err(name, 1, 2, 3, title); + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// Plots a 3d graph from a list of doubles: x y z +// +template +Gnuplot& Gnuplot::plot_xyz(const X &x, + const Y &y, + const Z &z, + const std::string &title) +{ + if (x.size() == 0 || y.size() == 0 || z.size() == 0) + { + throw GnuplotException("std::vectors too small"); + return *this; + } + + if (x.size() != y.size() || x.size() != z.size()) + { + throw GnuplotException("Length of the std::vectors differs"); + return *this; + } + + + std::ofstream tmp; + std::string name = create_tmpfile(tmp); + if (name == "") + return *this; + + // + // write the data to file + // + for (unsigned int i = 0; i < x.size(); i++) + tmp << x[i] << " " << y[i] << " " << z[i] < +void stringtok (Container &container, + std::string const &in, + const char * const delimiters = " \t\n") +{ + const std::string::size_type len = in.length(); + std::string::size_type i = 0; + + while ( i < len ) + { + // eat leading whitespace + i = in.find_first_not_of (delimiters, i); + + if (i == std::string::npos) + return; // nothing left but white space + + // find the end of the token + std::string::size_type j = in.find_first_of (delimiters, i); + + // push token + if (j == std::string::npos) + { + container.push_back (in.substr(i)); + return; + } + else + container.push_back (in.substr(i, j-i)); + + // set up for next loop + i = j + 1; + } + + return; +} + + +//------------------------------------------------------------------------------ +// +// Destructor: needed to delete temporary files +// +Gnuplot::~Gnuplot() +{ +// remove_tmpfiles(); + + // A stream opened by popen() should be closed by pclose() +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + if (_pclose(gnucmd) == -1) +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + if (pclose(gnucmd) == -1) +#endif + throw GnuplotException("Problem closing communication to gnuplot"); +} + + +//------------------------------------------------------------------------------ +// +// Resets a gnuplot session (next plot will erase previous ones) +// +Gnuplot& Gnuplot::reset_plot() +{ +// remove_tmpfiles(); + + nplots = 0; + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// resets a gnuplot session and sets all varibles to default +// +Gnuplot& Gnuplot::reset_all() +{ +// remove_tmpfiles(); + + nplots = 0; + cmd("reset"); + cmd("clear"); + pstyle = "points"; + smooth = ""; + showonscreen(); + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// Change the plotting style of a gnuplot session +// +Gnuplot& Gnuplot::set_style(const std::string &stylestr) +{ + if (stylestr.find("lines") == std::string::npos && + stylestr.find("points") == std::string::npos && + stylestr.find("linespoints") == std::string::npos && + stylestr.find("impulses") == std::string::npos && + stylestr.find("dots") == std::string::npos && + stylestr.find("steps") == std::string::npos && + stylestr.find("fsteps") == std::string::npos && + stylestr.find("histeps") == std::string::npos && + stylestr.find("boxes") == std::string::npos && // 1-4 columns of data are required + stylestr.find("filledcurves") == std::string::npos && + stylestr.find("histograms") == std::string::npos ) //only for one data column +// stylestr.find("labels") == std::string::npos && // 3 columns of data are required +// stylestr.find("xerrorbars") == std::string::npos && // 3-4 columns of data are required +// stylestr.find("xerrorlines") == std::string::npos && // 3-4 columns of data are required +// stylestr.find("errorbars") == std::string::npos && // 3-4 columns of data are required +// stylestr.find("errorlines") == std::string::npos && // 3-4 columns of data are required +// stylestr.find("yerrorbars") == std::string::npos && // 3-4 columns of data are required +// stylestr.find("yerrorlines") == std::string::npos && // 3-4 columns of data are required +// stylestr.find("boxerrorbars") == std::string::npos && // 3-5 columns of data are required +// stylestr.find("xyerrorbars") == std::string::npos && // 4,6,7 columns of data are required +// stylestr.find("xyerrorlines") == std::string::npos && // 4,6,7 columns of data are required +// stylestr.find("boxxyerrorbars") == std::string::npos && // 4,6,7 columns of data are required +// stylestr.find("financebars") == std::string::npos && // 5 columns of data are required +// stylestr.find("candlesticks") == std::string::npos && // 5 columns of data are required +// stylestr.find("vectors") == std::string::npos && +// stylestr.find("image") == std::string::npos && +// stylestr.find("rgbimage") == std::string::npos && +// stylestr.find("pm3d") == std::string::npos ) + { + pstyle = std::string("points"); + } + else + { + pstyle = stylestr; + } + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// smooth: interpolation and approximation of data +// +Gnuplot& Gnuplot::set_smooth(const std::string &stylestr) +{ + if (stylestr.find("unique") == std::string::npos && + stylestr.find("frequency") == std::string::npos && + stylestr.find("csplines") == std::string::npos && + stylestr.find("acsplines") == std::string::npos && + stylestr.find("bezier") == std::string::npos && + stylestr.find("sbezier") == std::string::npos ) + { + smooth = ""; + } + else + { + smooth = stylestr; + } + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// sets terminal type to windows / x11 +// +Gnuplot& Gnuplot::showonscreen() +{ + cmd("set output"); + cmd("set terminal " + Gnuplot::terminal_std); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// saves a gnuplot session to a postscript file +// +Gnuplot& Gnuplot::savetofigure(const std::string filename, + const std::string terminal) +{ + std::ostringstream cmdstr; + cmdstr << "set terminal " << terminal; + cmd(cmdstr.str() ); + + cmdstr.str(""); // Clear cmdstr + cmdstr << "set output \"" << filename << "\""; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// Switches legend on +// +Gnuplot& Gnuplot::set_legend(const std::string &position) +{ + std::ostringstream cmdstr; + cmdstr << "set key " << position; + + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// turns on log scaling for the x axis +// +Gnuplot& Gnuplot::set_xlogscale(const double base) +{ + std::ostringstream cmdstr; + + cmdstr << "set logscale x " << base; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// turns on log scaling for the y axis +// +Gnuplot& Gnuplot::set_ylogscale(const double base) +{ + std::ostringstream cmdstr; + + cmdstr << "set logscale y " << base; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// turns on log scaling for the z axis +// +Gnuplot& Gnuplot::set_zlogscale(const double base) +{ + std::ostringstream cmdstr; + + cmdstr << "set logscale z " << base; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// scales the size of the points used in plots +// +Gnuplot& Gnuplot::set_pointsize(const double pointsize) +{ + std::ostringstream cmdstr; + cmdstr << "set pointsize " << pointsize; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// set isoline density (grid) for plotting functions as surfaces +// +Gnuplot& Gnuplot::set_samples(const int samples) +{ + std::ostringstream cmdstr; + cmdstr << "set samples " << samples; + cmd(cmdstr.str()); + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// set isoline density (grid) for plotting functions as surfaces +// +Gnuplot& Gnuplot::set_isosamples(const int isolines) +{ + std::ostringstream cmdstr; + cmdstr << "set isosamples " << isolines; + cmd(cmdstr.str()); + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// enables contour drawing for surfaces set contour {base | surface | both} +// + +Gnuplot& Gnuplot::set_contour(const std::string &position) +{ + if (position.find("base") == std::string::npos && + position.find("surface") == std::string::npos && + position.find("both") == std::string::npos ) + { + cmd("set contour base"); + } + else + { + cmd("set contour " + position); + } + + return *this; +} + +//------------------------------------------------------------------------------ +// +// set labels +// +// set the xlabel +Gnuplot& Gnuplot::set_xlabel(const std::string &label) +{ + std::ostringstream cmdstr; + + cmdstr << "set xlabel \"" << label << "\""; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// set the ylabel +// +Gnuplot& Gnuplot::set_ylabel(const std::string &label) +{ + std::ostringstream cmdstr; + + cmdstr << "set ylabel \"" << label << "\""; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// set the zlabel +// +Gnuplot& Gnuplot::set_zlabel(const std::string &label) +{ + std::ostringstream cmdstr; + + cmdstr << "set zlabel \"" << label << "\""; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// set range +// +// set the xrange +Gnuplot& Gnuplot::set_xrange(const double iFrom, + const double iTo) +{ + std::ostringstream cmdstr; + + cmdstr << "set xrange[" << iFrom << ":" << iTo << "]"; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// set the yrange +// +Gnuplot& Gnuplot::set_yrange(const double iFrom, + const double iTo) +{ + std::ostringstream cmdstr; + + cmdstr << "set yrange[" << iFrom << ":" << iTo << "]"; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// set the zrange +// +Gnuplot& Gnuplot::set_zrange(const double iFrom, + const double iTo) +{ + std::ostringstream cmdstr; + + cmdstr << "set zrange[" << iFrom << ":" << iTo << "]"; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// set the palette range +// +Gnuplot& Gnuplot::set_cbrange(const double iFrom, + const double iTo) +{ + std::ostringstream cmdstr; + + cmdstr << "set cbrange[" << iFrom << ":" << iTo << "]"; + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// Plots a linear equation y=ax+b (where you supply the +// slope a and intercept b) +// +Gnuplot& Gnuplot::plot_slope(const double a, + const double b, + const std::string &title) +{ + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == true) + cmdstr << "replot "; + else + cmdstr << "plot "; + + cmdstr << a << " * x + " << b << " title \""; + + if (title == "") + cmdstr << "f(x) = " << a << " * x + " << b; + else + cmdstr << title; + + cmdstr << "\" with " << pstyle; + + // + // Do the actual plot + // + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// Plot an equation supplied as a std::string y=f(x) (only f(x) expected) +// +Gnuplot& Gnuplot::plot_equation(const std::string &equation, + const std::string &title) +{ + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == true) + cmdstr << "replot "; + else + cmdstr << "plot "; + + cmdstr << equation; + + if (title == "") + cmdstr << " notitle"; + else + cmdstr << " title \"" << title << "\""; + + cmdstr << " with " << pstyle; + + // + // Do the actual plot + // + cmd(cmdstr.str()); + + return *this; +} + +//------------------------------------------------------------------------------ +// +// plot an equation supplied as a std::string y=(x) +// +Gnuplot& Gnuplot::plot_equation3d(const std::string &equation, + const std::string &title) +{ + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == false) + cmdstr << "replot "; + else + cmdstr << "splot "; + + cmdstr << equation << " title \""; + + if (title == "") + cmdstr << "f(x,y) = " << equation; + else + cmdstr << title; + + cmdstr << "\" with " << pstyle; + + // + // Do the actual plot + // + cmd(cmdstr.str()); + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// Plots a 2d graph from a list of doubles (x) saved in a file +// +Gnuplot& Gnuplot::plotfile_x(const std::string &filename, + const unsigned int column, + const std::string &title) +{ + // + // check if file exists + // + file_available(filename); + + + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == true) + cmdstr << "replot "; + else + cmdstr << "plot "; + + cmdstr << "\"" << filename << "\" using " << column; + + if (title == "") + cmdstr << " notitle "; + else + cmdstr << " title \"" << title << "\" "; + + if(smooth == "") + cmdstr << "with " << pstyle; + else + cmdstr << "smooth " << smooth; + + // + // Do the actual plot + // + cmd(cmdstr.str()); //nplots++; two_dim = true; already in cmd(); + + return *this; +} + + + +//------------------------------------------------------------------------------ +// +// Plots a 2d graph from a list of doubles (x y) saved in a file +// +Gnuplot& Gnuplot::plotfile_xy(const std::string &filename, + const unsigned int column_x, + const unsigned int column_y, + const std::string &title) +{ + // + // check if file exists + // + file_available(filename); + + + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == true) + cmdstr << "replot "; + else + cmdstr << "plot "; + + cmdstr << "\"" << filename << "\" using " << column_x << ":" << column_y; + + if (title == "") + cmdstr << " notitle "; + else + cmdstr << " title \"" << title << "\" "; + + if(smooth == "") + cmdstr << "with " << pstyle; + else + cmdstr << "smooth " << smooth; + + // + // Do the actual plot + // + cmd(cmdstr.str()); + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// Plots a 2d graph with errorbars from a list of doubles (x y dy) in a file +// +Gnuplot& Gnuplot::plotfile_xy_err(const std::string &filename, + const unsigned int column_x, + const unsigned int column_y, + const unsigned int column_dy, + const std::string &title) +{ + // + // check if file exists + // + file_available(filename); + + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == true) + cmdstr << "replot "; + else + cmdstr << "plot "; + + cmdstr << "\"" << filename << "\" using " + << column_x << ":" << column_y << ":" << column_dy + << " with errorbars "; + + if (title == "") + cmdstr << " notitle "; + else + cmdstr << " title \"" << title << "\" "; + + // + // Do the actual plot + // + cmd(cmdstr.str()); + + return *this; +} + + +//------------------------------------------------------------------------------ +// +// Plots a 3d graph from a list of doubles (x y z) saved in a file +// +Gnuplot& Gnuplot::plotfile_xyz(const std::string &filename, + const unsigned int column_x, + const unsigned int column_y, + const unsigned int column_z, + const std::string &title) +{ + // + // check if file exists + // + file_available(filename); + + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == false) + cmdstr << "replot "; + else + cmdstr << "splot "; + + cmdstr << "\"" << filename << "\" using " << column_x << ":" << column_y + << ":" << column_z; + + if (title == "") + cmdstr << " notitle with " << pstyle; + else + cmdstr << " title \"" << title << "\" with " << pstyle; + + // + // Do the actual plot + // + cmd(cmdstr.str()); + + return *this; +} + + + +//------------------------------------------------------------------------------ +// +/// * note that this function is not valid for versions of GNUPlot below 4.2 +// +Gnuplot& Gnuplot::plot_image(const unsigned char * ucPicBuf, + const unsigned int iWidth, + const unsigned int iHeight, + const std::string &title) +{ + std::ofstream tmp; + std::string name = create_tmpfile(tmp); + if (name == "") + return *this; + + // + // write the data to file + // + int iIndex = 0; + for(unsigned int iRow = 0; iRow < iHeight; iRow++) + { + for(unsigned int iColumn = 0; iColumn < iWidth; iColumn++) + { + tmp << iColumn << " " << iRow << " " + << static_cast(ucPicBuf[iIndex++]) << std::endl; + } + } + + tmp.flush(); + tmp.close(); + + + std::ostringstream cmdstr; + // + // command to be sent to gnuplot + // + if (nplots > 0 && two_dim == true) + cmdstr << "replot "; + else + cmdstr << "plot "; + + if (title == "") + cmdstr << "\"" << name << "\" with image"; + else + cmdstr << "\"" << name << "\" title \"" << title << "\" with image"; + + // + // Do the actual plot + // + cmd(cmdstr.str()); + + return *this; +} + + + +//------------------------------------------------------------------------------ +// +// Sends a command to an active gnuplot session +// +Gnuplot& Gnuplot::cmd(const std::string &cmdstr) +{ + if( !(valid) ) + { + return *this; + } + + + // int fputs ( const char * str, FILE * stream ); + // writes the string str to the stream. + // The function begins copying from the address specified (str) until it + // reaches the terminating null character ('\0'). This final + // null-character is not copied to the stream. + fputs( (cmdstr+"\n").c_str(), gnucmd ); + + // int fflush ( FILE * stream ); + // If the given stream was open for writing and the last i/o operation was + // an output operation, any unwritten data in the output buffer is written + // to the file. If the argument is a null pointer, all open files are + // flushed. The stream remains open after this call. + fflush(gnucmd); + + + if( cmdstr.find("replot") != std::string::npos ) + { + return *this; + } + else if( cmdstr.find("splot") != std::string::npos ) + { + two_dim = false; + nplots++; + } + else if( cmdstr.find("plot") != std::string::npos ) + { + two_dim = true; + nplots++; + } + + return *this; +} + + + +//------------------------------------------------------------------------------ +// +// Opens up a gnuplot session, ready to receive commands +// +void Gnuplot::init() +{ + // char * getenv ( const char * name ); get value of environment variable + // Retrieves a C string containing the value of the environment variable + // whose name is specified as argument. If the requested variable is not + // part of the environment list, the function returns a NULL pointer. +#if ( defined(unix) || defined(__unix) || defined(__unix__) ) && !defined(__APPLE__) + if (getenv("DISPLAY") == NULL) + { + valid = false; + throw GnuplotException("Can't find DISPLAY variable"); + } +#endif + + + // if gnuplot not available + if (!Gnuplot::get_program_path()) + { + valid = false; + throw GnuplotException("Can't find gnuplot"); + } + + + // + // open pipe + // + std::string tmp = Gnuplot::m_sGNUPlotPath + "/" + + Gnuplot::m_sGNUPlotFileName; + + // FILE *popen(const char *command, const char *mode); + // The popen() function shall execute the command specified by the string + // command, create a pipe between the calling program and the executed + // command, and return a pointer to a stream that can be used to either read + // from or write to the pipe. +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + gnucmd = _popen(tmp.c_str(),"w"); +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + gnucmd = popen(tmp.c_str(),"w"); +#endif + + // popen() shall return a pointer to an open stream that can be used to read + // or write to the pipe. Otherwise, it shall return a null pointer and may + // set errno to indicate the error. + if (!gnucmd) + { + valid = false; + throw GnuplotException("Couldn't open connection to gnuplot"); + } + + nplots = 0; + valid = true; + smooth = ""; + + //set terminal type + showonscreen(); + + return; +} + + +//------------------------------------------------------------------------------ +// +// Find out if a command lives in m_sGNUPlotPath or in PATH +// +bool Gnuplot::get_program_path() +{ + // + // first look in m_sGNUPlotPath for Gnuplot + // + std::string tmp = Gnuplot::m_sGNUPlotPath + "/" + + Gnuplot::m_sGNUPlotFileName; + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + if ( Gnuplot::file_exists(tmp,0) ) // check existence +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + if ( Gnuplot::file_exists(tmp,1) ) // check existence and execution permission +#endif + { + return true; + } + + + // + // second look in PATH for Gnuplot + // + char *path; + // Retrieves a C string containing the value of environment variable PATH + path = getenv("PATH"); + + + if (path == NULL) + { + throw GnuplotException("Path is not set"); + return false; + } + else + { + std::list ls; + + //split path (one long string) into list ls of strings +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + stringtok(ls,path,";"); +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + stringtok(ls,path,":"); +#endif + + // scan list for Gnuplot program files + for (std::list::const_iterator i = ls.begin(); + i != ls.end(); ++i) + { + tmp = (*i) + "/" + Gnuplot::m_sGNUPlotFileName; +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + if ( Gnuplot::file_exists(tmp,0) ) // check existence +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + if ( Gnuplot::file_exists(tmp,1) ) // check existence and execution permission +#endif + { + Gnuplot::m_sGNUPlotPath = *i; // set m_sGNUPlotPath + return true; + } + } + + tmp = "Can't find gnuplot neither in PATH nor in \"" + + Gnuplot::m_sGNUPlotPath + "\""; + throw GnuplotException(tmp); + } +} + + + +//------------------------------------------------------------------------------ +// +// check if file exists +// +bool Gnuplot::file_exists(const std::string &filename, int mode) +{ + if ( mode < 0 || mode > 7) + { + throw std::runtime_error("In function \"Gnuplot::file_exists\": mode\ + has to be an integer between 0 and 7"); + return false; + } + + // int _access(const char *path, int mode); + // returns 0 if the file has the given mode, + // it returns -1 if the named file does not exist or is not accessible in + // the given mode + // mode = 0 (F_OK) (default): checks file for existence only + // mode = 1 (X_OK): execution permission + // mode = 2 (W_OK): write permission + // mode = 4 (R_OK): read permission + // mode = 6 : read and write permission + // mode = 7 : read, write and execution permission +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + if (_access(filename.c_str(), mode) == 0) +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + if (access(filename.c_str(), mode) == 0) +#endif + { + return true; + } + else + { + return false; + } + +} + +bool Gnuplot::file_available(const std::string &filename) +{ + std::ostringstream except; + if( Gnuplot::file_exists(filename,0) ) // check existence + { + if( !(Gnuplot::file_exists(filename,4)) ) // check read permission + { + except << "No read permission for File \"" << filename << "\""; + throw GnuplotException( except.str() ); + return false; + } + } + else + { + except << "File \"" << filename << "\" does not exist"; + throw GnuplotException( except.str() ); + return false; + } + return false; +} + + + +//------------------------------------------------------------------------------ +// +// Opens a temporary file +// +std::string Gnuplot::create_tmpfile(std::ofstream &tmp) +{ + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + char name[] = "gnuplotiXXXXXX"; //tmp file in working directory +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + char name[] = "/tmp/gnuplotiXXXXXX"; // tmp file in /tmp +#endif + + // + // check if maximum number of temporary files reached + // + if (Gnuplot::tmpfile_num == GP_MAX_TMP_FILES - 1) + { + std::ostringstream except; + except << "Maximum number of temporary files reached (" + << GP_MAX_TMP_FILES << "): cannot open more files" << std::endl; + + throw GnuplotException( except.str() ); + } + + // int mkstemp(char *name); + // shall replace the contents of the string pointed to by "name" by a unique + // filename, and return a file descriptor for the file open for reading and + // writing. Otherwise, -1 shall be returned if no suitable file could be + // created. The string in template should look like a filename with six + // trailing 'X' s; mkstemp() replaces each 'X' with a character from the + // portable filename character set. The characters are chosen such that the + // resulting name does not duplicate the name of an existing file at the + // time of a call to mkstemp() + + + // + // open temporary files for output + // +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) + if (_mktemp(name) == NULL) +#elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + if (mkstemp(name) == -1) +#endif + { + std::ostringstream except; + except << "Cannot create temporary file \"" << name << "\""; + throw GnuplotException(except.str()); + } + + tmp.open(name); + if (tmp.bad()) + { + std::ostringstream except; + except << "Cannot create temporary file \"" << name << "\""; + throw GnuplotException(except.str()); + } + + // + // Save the temporary filename + // + tmpfile_list.push_back(name); + Gnuplot::tmpfile_num++; + + return name; +} + +void Gnuplot::remove_tmpfiles() +{ + if ((tmpfile_list).size() > 0) + { + for (unsigned int i = 0; i < tmpfile_list.size(); i++) + { + + if( remove( tmpfile_list[i].c_str() ) != 0 ) + { + std::ostringstream except; + except << "Cannot remove temporary file \"" << tmpfile_list[i] << "\""; + throw GnuplotException(except.str()); + } + } + + Gnuplot::tmpfile_num -= static_cast(tmpfile_list.size()); + } +} +#endif \ No newline at end of file