Choreonoid  1.8
GeneralSliderView.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_GENERAL_JOINT_SLIDER_VIEW_H
6 #define CNOID_BASE_GENERAL_JOINT_SLIDER_VIEW_H
7 
8 #include <cnoid/View>
9 #include "exportdecl.h"
10 
11 namespace cnoid {
12 
13 class CNOID_EXPORT GeneralSliderView : public View
14 {
15 public:
16  static void initializeClass(ExtensionManager* ext);
17  static GeneralSliderView* instance();
18 
20  virtual ~GeneralSliderView();
21 
22  class Slider : public Referenced
23  {
24  public:
25  virtual double value() const = 0;
26  virtual void setValue(double value, bool doSync = false) = 0;
28  virtual void setCallback(std::function<void(double value)> callback) = 0;
29  };
31 
32  SliderPtr getOrCreateSlider(
33  const std::string& name, double lower = 0.0, double upper = 999.0, int precision = 0);
34 
35  [[deprecated("Use the overload function without the owner parameter.")]]
36  SliderPtr getOrCreateSlider(
37  const std::string& owner, const std::string& name,
38  double lower = 0.0, double upper = 999.0, int precision = 0);
39 
40  [[deprecated("Do nothing")]]
41  void removeSlider(Slider* slider);
42 
43  [[deprecated("Do nothing")]]
44  void removeSliders(const std::string& owner);
45 
46  class Impl;
47 
48 protected:
49  virtual bool storeState(Archive& archive);
50  virtual bool restoreState(const Archive& archive);
51 
52 private:
53  Impl* impl;
54 };
55 
56 }
57 
58 #endif
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::View
Definition: View.h:27
cnoid::Archive
Definition: Archive.h:22
cnoid::GeneralSliderView
Definition: GeneralSliderView.h:13
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::GeneralSliderView::SliderPtr
ref_ptr< Slider > SliderPtr
Definition: GeneralSliderView.h:30
cnoid::GeneralSliderView::Slider
Definition: GeneralSliderView.h:22
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Referenced
Definition: Referenced.h:54