Choreonoid  1.8
RangeCamera.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_RANGE_CAMERA_H
7 #define CNOID_BODY_RANGE_CAMERA_H
8 
9 #include "Camera.h"
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT RangeCamera : public Camera
15 {
16 public:
17  RangeCamera();
18  RangeCamera(const RangeCamera& org, bool copyStateOnly = false);
19 
20  virtual const char* typeName() const override;
21  void copyStateFrom(const RangeCamera& other);
22  virtual void copyStateFrom(const DeviceState& other) override;
23  virtual DeviceState* cloneState() const override;
24  virtual void forEachActualType(std::function<bool(const std::type_info& type)> func) override;
25  virtual void clearState() override;
26 
27  int numPoints() const { return points_->size(); }
28 
29  typedef std::vector<Vector3f> PointData;
30 
31  const PointData& points() const { return *points_; }
32  const PointData& constPoints() const { return *points_; }
33  PointData& points();
34  PointData& newPoints();
35 
41  double maxDistance() const { return maxDistance_; }
42  void setMaxDistance(double d) { maxDistance_ = d; }
43 
48  double minDistance() const { return minDistance_; }
49  void setMinDistance(double d) { minDistance_ = d; }
50 
51  bool isOrganized() const { return isOrganized_; }
52  void setOrganized(bool on);
53 
54  bool isDense() const { return isDense_; }
55  void setDense(bool on) { isDense_ = on; }
56 
57  std::shared_ptr<const PointData> sharedPoints() const { return points_; }
58 
64  void setPoints(std::shared_ptr<PointData>& points);
65 
66  void clearPoints();
67 
68  bool readSpecifications(const Mapping* info);
69  bool writeSpecifications(Mapping* info) const;
70 
71 protected:
72  virtual Referenced* doClone(CloneMap* cloneMap) const override;
73 
74 private:
75  std::shared_ptr<std::vector<Vector3f>> points_;
76  double minDistance_;
77  double maxDistance_;
78  bool isOrganized_;
79  bool isDense_;
80 
81  void copyRangeCameraStateFrom(const RangeCamera& other);
82 };
83 
85 
86 }
87 
88 #endif
cnoid::RangeCamera::sharedPoints
std::shared_ptr< const PointData > sharedPoints() const
Definition: RangeCamera.h:57
cnoid::Mapping
Definition: ValueTree.h:253
cnoid::RangeCamera::setDense
void setDense(bool on)
Definition: RangeCamera.h:55
cnoid::RangeCamera::maxDistance
double maxDistance() const
Definition: RangeCamera.h:41
cnoid::RangeCamera::points
const PointData & points() const
Definition: RangeCamera.h:31
cnoid::RangeCamera::constPoints
const PointData & constPoints() const
Definition: RangeCamera.h:32
cnoid::RangeCameraPtr
ref_ptr< RangeCamera > RangeCameraPtr
Definition: RangeCamera.h:84
cnoid::Camera
Definition: Camera.h:18
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::RangeCamera::minDistance
double minDistance() const
Definition: RangeCamera.h:48
cnoid::RangeCamera::isOrganized
bool isOrganized() const
Definition: RangeCamera.h:51
cnoid::RangeCamera::setMinDistance
void setMinDistance(double d)
Definition: RangeCamera.h:49
cnoid::RangeCamera
Definition: RangeCamera.h:14
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::CloneMap
Definition: CloneMap.h:13
cnoid::DeviceState
Definition: Device.h:20
cnoid::Referenced
Definition: Referenced.h:54
cnoid::RangeCamera::setMaxDistance
void setMaxDistance(double d)
Definition: RangeCamera.h:42
cnoid::RangeCamera::numPoints
int numPoints() const
Definition: RangeCamera.h:27
Camera.h
cnoid::RangeCamera::isDense
bool isDense() const
Definition: RangeCamera.h:54
cnoid::RangeCamera::PointData
std::vector< Vector3f > PointData
Definition: RangeCamera.h:29