Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpPlot.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2024 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * Plot curves.
32 */
33
38
39#ifndef VP_PLOT_H
40#define VP_PLOT_H
41
42#include <visp3/core/vpConfig.h>
43#include <visp3/core/vpDisplay.h>
44#include <visp3/gui/vpPlotGraph.h>
45
46#if defined(VISP_HAVE_DISPLAY)
47
49
116class VISP_EXPORT vpPlot
117{
118public:
120
121private:
122 vpDisplay *display;
123
124 unsigned int graphNbr;
125 vpPlotGraph *graphList;
126
127 unsigned int margei;
128 unsigned int margej;
129
130 float factori;
131 float factorj;
132
133 // private:
134 //#ifndef DOXYGEN_SHOULD_SKIP_THIS
135 // vpPlot(const vpPlot &)
136 // : I(), display(nullptr), graphNbr(0), graphList(nullptr), margei(0),
137 // margej(0),
138 // factori(0), factorj(0)
139 // {
140 // throw vpException(vpException::functionNotImplementedError, "Not
141 // implemented!");
142 // }
143 // vpPlot &operator=(const vpPlot &){
144 // throw vpException(vpException::functionNotImplementedError, "Not
145 // implemented!"); return *this;
146 // }
147 //#endif
148
149public:
150 vpPlot();
151 vpPlot(unsigned int nbGraph, unsigned int height = 700, unsigned int width = 700, int x = -1, int y = -1,
152 const std::string &title = "");
153 virtual ~vpPlot();
154 void closeDisplay();
155 void getPixelValue(bool block);
156 void init(unsigned int nbGraph, unsigned int height = 700, unsigned int width = 700, int x = -1, int y = -1,
157 const std::string &title = "");
158 void initGraph(unsigned int graphNum, unsigned int curveNbr);
159
160 void initRange(unsigned int graphNum, double xmin, double xmax, double ymin, double ymax);
161 void initRange(unsigned int graphNum, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
162 void navigate(void);
163
164 void plot(unsigned int graphNum, unsigned int curveNum, double x, double y);
165 void plot(unsigned int graphNum, double x, const vpColVector &v_y);
166 void plot(unsigned int graphNum, double x, const vpRowVector &v_y);
167 void plot(unsigned int graphNum, double x, const vpPoseVector &v_y);
168 void plot(unsigned int graphNum, double x, const vpTranslationVector &v_y);
169 void plot(unsigned int graphNum, double x, const vpRotationVector &v_y);
170 vpMouseButton::vpMouseButtonType plot(unsigned int graphNum, unsigned int curveNum, double x, double y, double z);
171 vpMouseButton::vpMouseButtonType plot(unsigned int graphNum, double x, const vpColVector &v_y,
172 const vpColVector &v_z);
173
174 void resetPointList(unsigned int graphNum);
175 void resetPointList(unsigned int graphNum, unsigned int curveNum);
176
177 void saveData(unsigned int graphNum, const std::string &dataFile, const std::string &title_prefix = "");
178 void setColor(unsigned int graphNum, unsigned int curveNum, vpColor color);
179 void setGraphThickness(unsigned int graphNum, unsigned int thickness);
180 void setGridThickness(unsigned int graphNum, unsigned int thickness);
181
188 void setFont(const std::string &font)
189 {
190 if (display->isInitialised())
191 vpDisplay::setFont(I, font.c_str());
192 }
193 void setLegend(unsigned int graphNum, unsigned int curveNum, const std::string &legend);
194 void setTitle(unsigned int graphNum, const std::string &title);
195 void setUnitX(unsigned int graphNum, const std::string &unitx);
196 void setUnitY(unsigned int graphNum, const std::string &unity);
197 void setUnitZ(unsigned int graphNum, const std::string &unitz);
198 void setThickness(unsigned int graphNum, unsigned int curveNum, unsigned int thickness);
199
200private:
201 void initNbGraph(unsigned int nbGraph);
202 void displayGrid();
203};
204
205END_VISP_NAMESPACE
206#endif
207
208#endif
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
Definition vpColor.h:157
Class that defines generic functionalities for display.
Definition vpDisplay.h:171
static void setFont(const vpImage< unsigned char > &I, const std::string &font)
Definition of the vpImage class member functions.
Definition vpImage.h:131
void setFont(const std::string &font)
Definition vpPlot.h:188
void closeDisplay()
Definition vpPlot.cpp:127
void initGraph(unsigned int graphNum, unsigned int curveNbr)
Definition vpPlot.cpp:212
vpImage< unsigned char > I
Definition vpPlot.h:119
vpPlot()
Definition vpPlot.cpp:58
void init(unsigned int nbGraph, unsigned int height=700, unsigned int width=700, int x=-1, int y=-1, const std::string &title="")
Definition vpPlot.cpp:97
void initRange(unsigned int graphNum, double xmin, double xmax, double ymin, double ymax)
Definition vpPlot.cpp:224
void setGridThickness(unsigned int graphNum, unsigned int thickness)
Definition vpPlot.cpp:617
void plot(unsigned int graphNum, unsigned int curveNum, double x, double y)
Definition vpPlot.cpp:279
void setColor(unsigned int graphNum, unsigned int curveNum, vpColor color)
Definition vpPlot.cpp:255
void navigate(void)
Definition vpPlot.cpp:458
void setGraphThickness(unsigned int graphNum, unsigned int thickness)
Definition vpPlot.cpp:602
void saveData(unsigned int graphNum, const std::string &dataFile, const std::string &title_prefix="")
Definition vpPlot.cpp:664
void resetPointList(unsigned int graphNum)
Definition vpPlot.cpp:574
void getPixelValue(bool block)
Definition vpPlot.cpp:496
Implementation of a pose vector and operations on poses.
Implementation of a generic rotation vector.
Implementation of row vector and the associated operations.
Class that consider the case of a translation vector.