Choreonoid  1.8
PointSetItem.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_POINT_SET_ITEM_H
6 #define CNOID_BASE_POINT_SET_ITEM_H
7 
8 #include "Item.h"
9 #include "RenderableItem.h"
10 #include <cnoid/RectRegionMarker>
11 #include <cnoid/stdx/optional>
12 #include "exportdecl.h"
13 
14 namespace cnoid {
15 
16 class SgPointSet;
17 class PointSetItemImpl;
18 
19 class CNOID_EXPORT PointSetItem : public Item, public RenderableItem
20 {
21 public:
22  static void initializeClass(ExtensionManager* ext);
23 
24  PointSetItem();
25  PointSetItem(const PointSetItem& org);
26  virtual ~PointSetItem();
27 
28  virtual bool setName(const std::string& name) override;
29 
30  const SgPointSet* pointSet() const;
31  SgPointSet* pointSet();
32 
33  virtual void notifyUpdate() override;
34 
35  virtual SgNode* getScene() override;
36 
37  const Isometry3& offsetPosition() const;
38  void setOffsetPosition(const Isometry3& T);
39  SignalProxy<void(const Isometry3& T)> sigOffsetPositionChanged();
40  void notifyOffsetPositionChange(bool doNotifyScene = true);
41 
42  SgPointSet* getTransformedPointSet() const;
43 
44  [[deprecated("Use offsetPosition.")]]
45  const Isometry3& offsetTransform() const { return offsetPosition(); }
46  [[deprecated("Use setOffsetPosition.")]]
47  void setOffsetTransform(const Isometry3& T) { setOffsetPosition(T); }
48  [[deprecated("Use sigOffsetPositionChanged.")]]
49  SignalProxy<void(const Isometry3& T)> sigOffsetTransformChanged() { return sigOffsetPositionChanged(); }
50  [[deprecated("Use notifyOffsetPositionChange.")]]
51  void notifyOffsetTransformChange() { notifyOffsetPositionChange(); }
52 
54  POINT, VOXEL, N_RENDERING_MODES
55  };
56 
57  void setRenderingMode(int mode);
58  int renderingMode() const;
59 
60  void setPointSize(double size);
61  double pointSize() const;
62 
63  static double defaultVoxelSize();
64  double voxelSize() const;
65  void setVoxelSize(double size);
66 
67  void setEditable(bool on);
68  bool isEditable() const;
69 
70  int numAttentionPoints() const;
71  Vector3 attentionPoint(int index) const;
72  void clearAttentionPoints();
73  void addAttentionPoint(const Vector3& p);
74  SignalProxy<void()> sigAttentionPointsChanged();
75  void notifyAttentionPointChange();
76 
77  stdx::optional<Vector3> attentionPoint() const; // deprecated
78  SignalProxy<void()> sigAttentionPointChanged(); // deprecated
79  void clearAttentionPoint(); // deprecated
80  void setAttentionPoint(const Vector3& p); // deprecated
81 
82  void removePoints(const PolyhedralRegion& region);
83 
84  SignalProxy<void(const PolyhedralRegion& region)> sigPointsInRegionRemoved();
85 
86  virtual bool store(Archive& archive) override;
87  virtual bool restore(const Archive& archive) override;
88 
89 protected:
90  virtual Item* doDuplicate() const override;
91  virtual void doPutProperties(PutPropertyFunction& putProperty) override;
92 
93 private:
94  PointSetItemImpl* impl;
95  void initialize();
96 };
97 
99 }
100 
101 #endif
cnoid::PolyhedralRegion
Definition: PolyhedralRegion.h:13
Item.h
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::PointSetItem::sigOffsetTransformChanged
SignalProxy< void(const Isometry3 &T)> sigOffsetTransformChanged()
Definition: PointSetItem.h:49
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::PutPropertyFunction
Definition: PutPropertyFunction.h:51
cnoid::PointSetItem::RenderingMode
RenderingMode
Definition: PointSetItem.h:53
cnoid::Isometry3
Eigen::Isometry3d Isometry3
Definition: EigenTypes.h:73
cnoid::Archive
Definition: Archive.h:22
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::PointSetItemPtr
ref_ptr< PointSetItem > PointSetItemPtr
Definition: PointSetItem.h:98
RenderableItem.h
cnoid::PointSetItem::VOXEL
@ VOXEL
Definition: PointSetItem.h:54
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Item
Definition: Item.h:29
cnoid::RenderableItem
Definition: RenderableItem.h:11
cnoid::SgPointSet
Definition: SceneDrawables.h:636
cnoid::PointSetItem::offsetTransform
const Isometry3 & offsetTransform() const
Definition: PointSetItem.h:45
cnoid::PointSetItem::notifyOffsetTransformChange
void notifyOffsetTransformChange()
Definition: PointSetItem.h:51
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::PointSetItem::setOffsetTransform
void setOffsetTransform(const Isometry3 &T)
Definition: PointSetItem.h:47
cnoid::SgNode
Definition: SceneGraph.h:157
cnoid::PointSetItem
Definition: PointSetItem.h:19