Choreonoid  1.8
PositionTagGroupItem.h
Go to the documentation of this file.
1 #ifndef CNOID_BASE_POSITION_TAG_GROUP_ITEM_H
2 #define CNOID_BASE_POSITION_TAG_GROUP_ITEM_H
3 
4 #include "Item.h"
5 #include "RenderableItem.h"
6 #include "LocatableItem.h"
7 #include <vector>
8 #include "exportdecl.h"
9 
10 namespace cnoid {
11 
12 class PositionTagGroup;
13 
14 class CNOID_EXPORT PositionTagGroupItem : public Item, public RenderableItem, public LocatableItem
15 {
16 public:
17  static void initializeClass(ExtensionManager* ext);
18  static PositionTagGroupItem* findItemOf(PositionTagGroup* tagGroup);
19 
22  virtual ~PositionTagGroupItem();
23 
24  virtual bool setName(const std::string& name) override;
25 
26  const PositionTagGroup* tagGroup() const;
27  PositionTagGroup* tagGroup();
28 
29  const Isometry3& parentFramePosition() const;
30  const Isometry3& originOffset() const;
31  void setOriginOffset(const Isometry3& T_offset, bool requestPreview = true);
32  Isometry3 originPosition() const;
33  SignalProxy<void()> sigOriginOffsetPreviewRequested();
34  SignalProxy<void()> sigOriginOffsetUpdated();
35  void notifyOriginOffsetUpdate(bool requestPreview = true);
36 
37  void clearTagSelection();
38  void setTagSelected(int tagIndex, bool on = true);
39  bool checkTagSelected(int tagIndex) const;
40  const std::vector<int>& selectedTagIndices() const;
41  void setSelectedTagIndices(const std::vector<int>& indices);
42  SignalProxy<void()> sigTagSelectionChanged();
43 
44  // RenderableItem function
45  virtual SgNode* getScene() override;
46 
47  // LocatableItem function
48  virtual LocationProxyPtr getLocationProxy() override;
49 
50  double tagMarkerSize() const;
51  void setTagMarkerSize(double s);
52 
53  bool originMarkerVisibility() const;
54  void setOriginMarkerVisibility(bool on);
55 
56  bool edgeVisibility() const;
57  void setEdgeVisiblility(bool on);
58 
59  float transparency() const;
60  void setTransparency(float t);
61 
62  virtual bool store(Archive& archive) override;
63  virtual bool restore(const Archive& archive) override;
64 
65  class Impl;
66 
67 protected:
68  virtual Item* doDuplicate() const override;
69  virtual void onConnectedToRoot() override;
70  virtual void onDisconnectedFromRoot() override;
71  virtual bool onNewTreePositionCheck(
72  bool isManualOperation, std::function<void()>& out_callbackWhenAdded) override;
73  virtual void doPutProperties(PutPropertyFunction& putProperty) override;
74 
75 private:
76  Impl* impl;
77 };
78 
80 
81 }
82 
83 #endif
Item.h
cnoid::PositionTagGroupItemPtr
ref_ptr< PositionTagGroupItem > PositionTagGroupItemPtr
Definition: PositionTagGroupItem.h:79
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::PositionTagGroupItem
Definition: PositionTagGroupItem.h:14
LocatableItem.h
cnoid::ref_ptr< LocationProxy >
RenderableItem.h
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Item
Definition: Item.h:29
cnoid::RenderableItem
Definition: RenderableItem.h:11
cnoid::PositionTagGroup
Definition: PositionTagGroup.h:16
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::SgNode
Definition: SceneGraph.h:157
cnoid::LocatableItem
Definition: LocatableItem.h:62