Choreonoid  1.8
MultiPointSetItem.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_MULTI_POINT_SET_ITEM_H
6 #define CNOID_BASE_MULTI_POINT_SET_ITEM_H
7 
8 #include <cnoid/PointSetItem>
9 #include "exportdecl.h"
10 
11 namespace cnoid {
12 
13 class CNOID_EXPORT MultiPointSetItem : public Item, public RenderableItem
14 {
15 public:
16  static void initializeClass(ExtensionManager* ext);
17 
20  virtual ~MultiPointSetItem();
21 
23  ShowAll, ShowSelected, NumVisibilityModes
24  };
25  void setVisibilityMode(int mode);
26 
30  NumRenderingModes
31  };
32 
33  void setRenderingMode(int mode);
34  int renderingMode() const;
35 
36  void setPointSize(double size);
37  double pointSize() const;
38 
39  double voxelSize() const;
40  void setVoxelSize(double size);
41 
42  int numPointSetItems() const;
43  PointSetItem* pointSetItem(int index);
44  const PointSetItem* pointSetItem(int index) const;
45 
46  int numVisiblePointSetItems() const;
47  PointSetItem* visiblePointSetItem(int index);
48  const PointSetItem* visiblePointSetItem(int index) const;
49 
50  void selectSinglePointSetItem(int index);
51 
52  SignalProxy<void(int index)> sigPointSetItemAdded();
53  SignalProxy<void(int index)> sigPointSetUpdated();
54 
55  const Isometry3& offsetPosition() const;
56  void setOffsetPosition(const Isometry3& T);
57  SignalProxy<void(const Isometry3& T)> sigOffsetPositionChanged();
58  void notifyOffsetPositionChange();
59 
60  Isometry3 totalOffsetPositionOf(int index) const;
61  SgPointSetPtr getTransformedPointSet(int index) const;
62 
63  [[deprecated("Use offsetPosition.")]]
64  const Isometry3& topOffsetTransform() const { return offsetPosition(); }
65  [[deprecated("Use setOffsetPosition.")]]
66  void setTopOffsetTransform(const Isometry3& T) { return setOffsetPosition(T); }
67  [[deprecated("Use sigOffsetPositionChanged.")]]
68  SignalProxy<void(const Isometry3& T)> sigTopOffsetTransformChanged() { return sigOffsetPositionChanged(); }
69  [[deprecated("Use notifyOffsetPositionChange.")]]
70  void notifyTopOffsetTransformChange() { notifyOffsetPositionChange(); }
71  [[deprecated("Use totalOffsetPositionOf.")]]
72  Isometry3 offsetTransform(int index) const { return totalOffsetPositionOf(index); }
73 
74  int numAttentionPoints() const;
75  Vector3 attentionPoint(int index) const;
76  void clearAttentionPoints();
77  void addAttentionPoint(const Vector3& p);
78  SignalProxy<void()> sigAttentionPointsChanged();
79  void notifyAttentionPointChange();
80 
81  // RenderableItem
82  virtual SgNode* getScene() override;
83 
84  virtual bool store(Archive& archive) override;
85  virtual bool restore(const Archive& archive) override;
86 
87  bool startAutomaticSave(const std::string& filename);
88  void stopAutomaticSave();
89 
90  // deprecated. Use numVisiblePointSetItems();
91  int numActivePointSetItems() const;
92  // deprecated. Use visiblePointSetItem(int index);
93  PointSetItem* activePointSetItem(int index);
94  const PointSetItem* activePointSetItem(int index) const;
95 
96  class Impl;
97 
98 protected:
99  virtual Item* doDuplicate() const override;
100  virtual void doPutProperties(PutPropertyFunction& putProperty) override;
101 
102 private:
103  Impl* impl;
104  void initialize();
105 };
106 
108 }
109 
110 #endif
cnoid::MultiPointSetItem::ShowSelected
@ ShowSelected
Definition: MultiPointSetItem.h:23
cnoid::MultiPointSetItem::offsetTransform
Isometry3 offsetTransform(int index) const
Definition: MultiPointSetItem.h:72
cnoid::PointSetItem::POINT
@ POINT
Definition: PointSetItem.h:54
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::MultiPointSetItem::RenderingMode
RenderingMode
Definition: MultiPointSetItem.h:27
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::PutPropertyFunction
Definition: PutPropertyFunction.h:51
cnoid::Isometry3
Eigen::Isometry3d Isometry3
Definition: EigenTypes.h:73
cnoid::Archive
Definition: Archive.h:22
cnoid::MultiPointSetItem::notifyTopOffsetTransformChange
void notifyTopOffsetTransformChange()
Definition: MultiPointSetItem.h:70
cnoid::MultiPointSetItemPtr
ref_ptr< MultiPointSetItem > MultiPointSetItemPtr
Definition: MultiPointSetItem.h:107
cnoid::MultiPointSetItem::topOffsetTransform
const Isometry3 & topOffsetTransform() const
Definition: MultiPointSetItem.h:64
cnoid::ref_ptr< SgPointSet >
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::MultiPointSetItem::setTopOffsetTransform
void setTopOffsetTransform(const Isometry3 &T)
Definition: MultiPointSetItem.h:66
cnoid::MultiPointSetItem::sigTopOffsetTransformChanged
SignalProxy< void(const Isometry3 &T)> sigTopOffsetTransformChanged()
Definition: MultiPointSetItem.h:68
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::MultiPointSetItem::VisibilityMode
VisibilityMode
Definition: MultiPointSetItem.h:22
cnoid::MultiPointSetItem
Definition: MultiPointSetItem.h:13
cnoid::SgNode
Definition: SceneGraph.h:157
cnoid::PointSetItem
Definition: PointSetItem.h:19