5 #ifndef CNOID_BASE_GRAPH_WIDGET_H 6 #define CNOID_BASE_GRAPH_WIDGET_H 8 #include <cnoid/Archive> 11 #include <boost/shared_ptr.hpp> 12 #include <boost/function.hpp> 22 class GraphDataHandler;
23 class GraphDataHandlerImpl;
24 class GraphWidgetImpl;
34 void setID(
int id) { this->
id = id; }
35 int getID()
const {
return id; }
37 void setColor(
float r,
float g,
float b);
38 void setLabel(
const std::string& label);
40 void setFrameProperties(
int numFrames,
double frameRate,
double offset = 0.0);
42 void setValueLimits(
double lower,
double upper);
43 void setVelocityLimits(
double lower,
double upper);
45 void addVerticalLine(
double x,
const std::string& label);
46 void addHorizontalLine(
double y,
const std::string& label);
52 void setDataRequestCallback(DataRequestCallback callback);
55 void setDataModifiedCallback(DataModifiedCallback callback);
61 friend class GraphWidgetImpl;
63 GraphDataHandlerImpl* impl;
74 void addDataHandler(GraphDataHandlerPtr handler);
75 void clearDataHandlers();
77 void setRenderingTypes(
bool showOriginalValues,
bool showVelocities,
bool showAccelerations);
78 void getRenderingTypes(
bool& showOriginalValues,
bool& showVelocities,
bool& showAccelerations);
80 bool setCursorPosition(
double pos);
82 void setTimeBarSyncMode(
bool on);
83 bool isTimeBarSyncMode();
89 void setVerticalValueRange(
double lower,
double upper);
90 void getVerticalValueRange(
double& lower,
double& upper);
92 void setLineWidth(
double width);
93 double getLineWidth();
95 void showRulers(
bool show);
98 void showLimits(
bool show);
101 void showGrid(
bool show);
104 void setGridSize(
double width,
double height);
105 void getGridSize(
double& width,
double& height);
107 void setControlPointStep(
int step,
int offset = 0);
108 void getControlPointStep(
int& step,
int& offset);
110 void highlightControlPoints(
bool on);
111 bool highlightsControlPoints();
114 void changeMode(
Mode mode);
121 QLabel& statusLabel();
123 bool saveImage(
const std::string& filename);
125 virtual bool storeState(
Archive& archive);
126 virtual bool restoreState(
const Archive& archive);
129 virtual bool eventFilter(QObject* obj, QEvent* event);
135 GraphWidgetImpl* impl;
boost::function< void(int frame, int size, double *out_values)> DataRequestCallback
Definition: GraphWidget.h:51
boost::function< void(int frame, int size, double *values)> DataModifiedCallback
Definition: GraphWidget.h:54
boost::shared_ptr< GraphDataHandler > GraphDataHandlerPtr
Definition: GraphWidget.h:24
Definition: GraphWidget.h:28
void setID(int id)
Definition: GraphWidget.h:34
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
int getID() const
Definition: GraphWidget.h:35
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37