ArServerInfoDrawings Class Reference

#include <ArServerInfoDrawings.h>

List of all members.


Detailed Description

Service to provide clients with information about graphical figures to be displayed with the map.

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:

  1. Number of figures (4-byte integer)Then, for each figure, the following values are given
  2. For each figure:
    1. Figure name (null-terminated string)
    2. Shape ID (null-terminated string)
    3. Primary color:
      1. Unused (byte)
      2. Red (byte)
      3. Green (byte)
      4. Blue (byte)
    4. Shape size (4-byte integer)
    5. Layer number (4-byte integer)
    6. Suggested refresh time (4-byte integer)
    7. Secordary color:
      1. Unused (byte)
      2. Red (byte)
      3. Green (byte)
      4. Blue (byte)

This command is in the SensorInfo permission group for users.

Examples:

drawingsExample.cpp, drawingsExampleWithRobot.cpp, popupExample.cpp, and serverDemo.cpp.


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
ArServerBasemyServer


Constructor & Destructor Documentation

ArServerInfoDrawings::ArServerInfoDrawings ( ArServerBase server  ) 

Constructor.

ArServerInfoDrawings::~ArServerInfoDrawings (  )  [virtual]

Destructor.


Member Function Documentation

bool ArServerInfoDrawings::addDrawing ( ArDrawingData drawingData,
const char *  name,
ArFunctor2< ArServerClient *, ArNetPacket * > *  functor 
)

Adds a shape to the set of figures.

Note:
'name' must be unique. 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.

bool ArServerInfoDrawings::addRangeDevice ( ArRangeDevice rangeDevice  ) 

Adds a specific range device to be drawn (using its default shape).

bool ArServerInfoDrawings::addRobotsRangeDevices ( ArRobot robot  ) 

Adds all of the robot's range devices (using their default shape).

Examples:
serverDemo.cpp.

void ArServerInfoDrawings::netGetDrawingList ( ArServerClient client,
ArNetPacket packet 
)

void ArServerInfoDrawings::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 ArServerInfoDrawings::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 ArServerInfoDrawings::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).


Member Data Documentation

std::map<std::string, ArFunctor *, ArStrCaseCmpOp> ArServerInfoDrawings::myDrawingCallbacks [protected]

std::map<std::string, ArDrawingData *, ArStrCaseCmpOp> ArServerInfoDrawings::myDrawingDatas [protected]

ArFunctor2C<ArServerInfoDrawings, ArServerClient *, ArNetPacket *> ArServerInfoDrawings::myNetGetDrawingListCB [protected]

ArFunctor2C<ArServerInfoDrawings, ArServerClient *, ArNetPacket *> ArServerInfoDrawings::myNetListDrawingsCB [protected]

ArServerBase* ArServerInfoDrawings::myServer [protected]


The documentation for this class was generated from the following files:
Generated on Fri Jul 31 12:37:29 2009 for ArNetworking by  doxygen 1.4.7