7 #ifndef __VTKPLUSCOMMAND_H 8 #define __VTKPLUSCOMMAND_H 10 #include "vtkPlusServerExport.h" 20 #include "igtlMessageBase.h" 39 virtual void PrintSelf(ostream& os, vtkIndent indent);
48 virtual PlusStatus ReadConfiguration(vtkXMLDataElement* aConfig);
51 virtual PlusStatus WriteConfiguration(vtkXMLDataElement* aConfig);
57 vtkSetMacro(ClientId,
int);
58 vtkGetMacro(ClientId,
int);
65 virtual std::string GetDescription(
const std::string& commandName) = 0;
68 virtual void GetCommandNames(std::list<std::string>& cmdNames) = 0;
70 void SetMetaData(
const igtl::MessageBase::MetaDataMap& metaData);
72 vtkGetMacro(RespondWithCommandMessage,
bool);
73 vtkSetMacro(RespondWithCommandMessage,
bool);
75 vtkSetStdStringMacro(Name);
76 vtkGetStdStringMacro(Name);
78 vtkSetStdStringMacro(DeviceName);
79 vtkGetStdStringMacro(DeviceName);
81 vtkGetMacro(Id, uint32_t);
82 vtkSetMacro(Id, uint32_t);
97 static std::string GenerateReplyDeviceName(uint32_t uid);
105 static PlusStatus GenerateCommandDeviceName(
const std::string& uid, std::string& outDeviceName);
112 static bool IsCommandDeviceName(
const std::string&
deviceName);
119 static bool IsReplyDeviceName(
const std::string&
deviceName,
const std::string& uid = std::string(
""));
124 static std::string GetUidFromCommandDeviceName(
const std::string&
deviceName);
129 static std::string GetPrefixFromCommandDeviceName(
const std::string&
deviceName);
136 virtual vtkIGSIOTransformRepository* GetTransformRepository();
142 void QueueCommandResponse(
PlusStatus status,
const std::string&
message,
const std::string& error =
"",
const igtl::MessageBase::MetaDataMap* metaData =
nullptr);
This is an abstract superclass for commands in the OpenIGTLink network interface for Plus.
static const std::string DEVICE_NAME_COMMAND
Creates a PlusCommand from a string. If the commands are to be executed on the main thread then call ...
vtkPlusCommandProcessor * CommandProcessor
Manages devices that record image or positional data.
bool RespondWithCommandMessage
igtl::MessageBase::MetaDataMap MetaData
std::list< vtkSmartPointer< vtkPlusCommandResponse > > PlusCommandResponseList
PlusCommandResponseList CommandResponseQueue
static const std::string DEVICE_NAME_REPLY