Go to the documentation of this file. 1 #ifndef CNOID_BODY_PLUGIN_DEVICE_OVERWRITE_ITEM_H
2 #define CNOID_BODY_PLUGIN_DEVICE_OVERWRITE_ITEM_H
5 #include <cnoid/LocatableItem>
6 #include <cnoid/RenderableItem>
7 #include "exportdecl.h"
15 class DeviceOverwriteItem;
23 const std::string&
id() {
return id_; }
31 : device_(device), item_(item), isNewDevice_(isNewDevice), isNewItem_(isNewItem) { }
32 explicit operator bool()
const {
return device_ !=
nullptr; }
34 template<
class DeviceType> DeviceType*
device() {
return dynamic_cast<DeviceType*
>(device_); }
46 DeviceInfo findOrCreateDevice(
BodyItem* bodyItem,
bool doCreateOverwriteItem =
false);
50 static bool restoreDeviceName(
Device* device,
const Mapping* info);
70 virtual bool setName(
const std::string& name)
override;
72 bool setDevice(
BodyItem* bodyItem,
Device* device,
bool isAdditionalDevice);
74 template<
class DeviceType> DeviceType*
device() {
75 return dynamic_cast<DeviceType*
>(device());
77 bool isAdditionalDevice()
const;
78 bool isPreExistingDevice()
const;
84 bool restoreOriginalDevice();
86 void setMediatorId(
const std::string&
id);
92 virtual SgNode* getScene()
override;
97 virtual Item* doDuplicate(
Item* duplicatedParentItem)
const override;
98 virtual void onDisconnectedFromBodyItem()
override;
100 virtual bool store(
Archive& archive)
override;
101 virtual bool restore(
const Archive& archive)
override;
Definition: ValueTree.h:253
Definition: ExtensionManager.h:23
Definition: PutPropertyFunction.h:51
ref_ptr< DeviceOverwriteMediator > DeviceOverwriteMediatorPtr
Definition: DeviceOverwriteItem.h:57
Definition: DeviceOverwriteItem.h:60
Definition: Referenced.h:103
Definition: BodyItem.h:28
Definition: AbstractSceneLoader.h:11
Definition: RenderableItem.h:11
ref_ptr< DeviceOverwriteItem > DeviceOverwriteItemPtr
Definition: DeviceOverwriteItem.h:107
Definition: Referenced.h:54
Definition: BodyElementOverwriteItem.h:15
Definition: SceneGraph.h:157
Definition: LocatableItem.h:62
DeviceType * device()
Definition: DeviceOverwriteItem.h:74