#include <ArServerInfoDrawings.h>
Public Member Functions | |
bool | addDrawing (ArDrawingData *drawingData, const char *name, ArFunctor2< ArServerClient *, ArNetPacket * > *functor) |
Adds a shape to the set of figures. | |
bool | addRangeDevice (ArRangeDevice *rangeDevice) |
Adds a specific range device to be drawn (using its default shape). | |
bool | addRobotsRangeDevices (ArRobot *robot) |
Adds all of the robot's range devices (using their default shape). | |
ArServerInfoDrawings (ArServerBase *server) | |
Constructor. | |
void | netGetDrawingList (ArServerClient *client, ArNetPacket *packet) |
void | netListDrawings (ArServerClient *client, ArNetPacket *packet) |
Client callback: Puts the list of shapes that can be drawn and their metadata into a reply packet (internal use mostly). | |
void | netRangeDeviceCumulative (ArServerClient *client, ArNetPacket *packet, ArRangeDevice *device) |
Client callback utilit: Puts the cumulative buffer of the given range device into a reply packet (internal use mostly). | |
void | netRangeDeviceCurrent (ArServerClient *client, ArNetPacket *packet, ArRangeDevice *device) |
Client callback utility: Puts the current data for the given range device into a reply packet (internal use mostly). | |
virtual | ~ArServerInfoDrawings () |
Destructor. | |
Protected Attributes | |
std::map< std::string, ArFunctor *, ArStrCaseCmpOp > | myDrawingCallbacks |
std::map< std::string, ArDrawingData *, ArStrCaseCmpOp > | myDrawingDatas |
ArFunctor2C< ArServerInfoDrawings, ArServerClient *, ArNetPacket * > | myNetGetDrawingListCB |
ArFunctor2C< ArServerInfoDrawings, ArServerClient *, ArNetPacket * > | myNetListDrawingsCB |
ArServerBase * | myServer |
Use addDrawing() to add a figure, or use addRangeDevice() or addRobotsRangeDevice() to automatically create standard drawings for range devices.
Clients may use the listDrawings
data request to receive a list of figures and metadata about those figures. The reply packet to the listDrawings
request is as follows:
This command is in the SensorInfo
permission group for users.
drawingsExampleWithRobot.cpp, popupExample.cpp, and serverDemo.cpp.
Definition at line 71 of file ArServerInfoDrawings.h.
|
Constructor.
Definition at line 30 of file ArServerInfoDrawings.cpp. References ArServerBase::addData(), myNetGetDrawingListCB, myNetListDrawingsCB, and myServer. |
|
Destructor.
Definition at line 53 of file ArServerInfoDrawings.cpp. |
|
Adds a shape to the set of figures. If the name is unique, the given drawing data is stored to be returned in response to the "listDrawings" client request, and a new data request is created with the given name and functor. This functor must send a reply packet to the client containing a 4-byte integer indicating the number of coordinates or vertices in the figure, followed by a pair of 4-byte integers for each coordinate or vertex in global map space. For example, if drawingData describes a polyDots shape, then the functor must create a packet, add a 4-byte integer indicating the number of dots, then for each dot, add an integer for the X coordinate followed by an integer for the Y coordinate. Definition at line 71 of file ArServerInfoDrawings.cpp. References ArServerBase::addData(), ArLog::log(), myDrawingCallbacks, myDrawingDatas, and myServer. Referenced by addRangeDevice(), and main(). |
|
Adds a specific range device to be drawn (using its default shape).
Definition at line 147 of file ArServerInfoDrawings.cpp. References addDrawing(), ArLog::log(), myServer, netRangeDeviceCumulative(), and netRangeDeviceCurrent(). Referenced by addRobotsRangeDevices(), and main(). |
|
Adds all of the robot's range devices (using their default shape).
Definition at line 183 of file ArServerInfoDrawings.cpp. References addRangeDevice(), ArRangeDevice::lockDevice(), ArLog::log(), and ArRangeDevice::unlockDevice(). Referenced by main(). |
|
Definition at line 116 of file ArServerInfoDrawings.cpp. References ArBasePacket::byte4ToBuf(), client, ArNetPacket::empty(), myDrawingDatas, ArClientBase::sendPacketTcp(), ArBasePacket::strToBuf(), and ArBasePacket::uByte4ToBuf(). |
|
Client callback: Puts the list of shapes that can be drawn and their metadata into a reply packet (internal use mostly).
Definition at line 96 of file ArServerInfoDrawings.cpp. References ArBasePacket::byte4ToBuf(), client, myDrawingDatas, ArClientBase::sendPacketTcp(), ArBasePacket::strToBuf(), and ArBasePacket::uByte4ToBuf(). |
|
Client callback utilit: Puts the cumulative buffer of the given range device into a reply packet (internal use mostly).
Definition at line 236 of file ArServerInfoDrawings.cpp. References ArBasePacket::byte4ToBuf(), client, ArLog::log(), and ArClientBase::sendPacketUdp(). Referenced by addRangeDevice(). |
|
Client callback utility: Puts the current data for the given range device into a reply packet (internal use mostly).
Definition at line 206 of file ArServerInfoDrawings.cpp. References ArBasePacket::byte4ToBuf(), client, ArRangeDevice::getCurrentBuffer(), ArRangeDevice::lockDevice(), ArLog::log(), ArClientBase::sendPacketUdp(), and ArRangeDevice::unlockDevice(). Referenced by addRangeDevice(). |
|
Definition at line 102 of file ArServerInfoDrawings.h. Referenced by addDrawing(). |
|
Definition at line 101 of file ArServerInfoDrawings.h. Referenced by addDrawing(), netGetDrawingList(), and netListDrawings(). |
|
Definition at line 104 of file ArServerInfoDrawings.h. Referenced by ArServerInfoDrawings(). |
|
Definition at line 103 of file ArServerInfoDrawings.h. Referenced by ArServerInfoDrawings(). |
|
Definition at line 100 of file ArServerInfoDrawings.h. Referenced by addDrawing(), addRangeDevice(), and ArServerInfoDrawings(). |