Draw_3D_API
Draw3D_api_interface.hh
Go to the documentation of this file.
1 /*
2 Copyright 2020 Arkadiusz Mielczarek
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 
6 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 
8 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 */
10 
11 #ifndef DR3D_API_INT_HH
12 #define DR3D_API_INT_HH
13 
14 #include <vector>
15 #include <string>
16 #include <iostream>
17 
28 namespace drawNS {
29 
35  class Point3D {
40  double data[3];
41  public:
45  Point3D() = delete;
52  Point3D(double x, double y, double z) : data{x,y,z} {}
58  const double & operator[](uint ind) const {
59  if (ind < 3)
60  return data[ind];
61  std::cerr << "operator[] dla Point3D poza zakresem" << std::endl;
62  exit(1);
63  };
69  double & operator[](uint ind) {
70  if (ind < 3)
71  return data[ind];
72  std::cerr << "operator[] dla Point3D poza zakresem" << std::endl;
73  exit(1);
74  };
75  };
76 
87  class Draw3DAPI {
88  protected:
98  public:
103  Draw3DAPI(int ref_time_ms = 0) : refresh_rate_ms(ref_time_ms) {}
104  /*
105  * \brief virtual destructor.
106  */
107  virtual ~Draw3DAPI() {};
115  virtual uint draw_line(const Point3D & point1, const Point3D & point2, const std::string & color = "black") = 0;
122  virtual uint draw_polygonal_chain(const std::vector<Point3D> & points, const std::string & color = "black") = 0;
129  virtual uint draw_polyhedron(const std::vector<std::vector<Point3D> > & points_map, const std::string & color = "black") = 0;
136  virtual uint draw_surface(const std::vector<std::vector<Point3D> > & points_map, const std::string & color = "black") = 0;
141  virtual void erase_shape(uint id) = 0;
147  virtual void change_shape_color(uint id, const std::string & color) = 0;
152  virtual void change_ref_time_ms(int ref_time_ms) = 0;
157  virtual void redraw() = 0;
158  };
159 
160 }
161 
162 #endif
int refresh_rate_ms
mode for ploting and time between auto-replots
Definition: Draw3D_api_interface.hh:97
Definition: OpenGL_API.hh:29
double & operator[](uint ind)
Acess operator.
Definition: Draw3D_api_interface.hh:69
virtual ~Draw3DAPI()
Definition: Draw3D_api_interface.hh:107
Abstract interface for drawing class Abstract class used as interface for 3D drawing class implementa...
Definition: Draw3D_api_interface.hh:87
const double & operator[](uint ind) const
Acess operator.
Definition: Draw3D_api_interface.hh:58
Point3D(double x, double y, double z)
Constructor.
Definition: Draw3D_api_interface.hh:52
Point3D()=delete
deleted non-parametric constructor to force using parametric.
Point in 3D Class represents point in 3D.
Definition: Draw3D_api_interface.hh:35
Draw3DAPI(int ref_time_ms=0)
Constructor.
Definition: Draw3D_api_interface.hh:103
Namespace for drawing tools - abstract interface and 3D point Namespace for drawing tools - abstract ...
Definition: Dr3D_gnuplot_api.hh:24