Public Member Functions | Protected Member Functions | Protected Attributes
wcf::AnnotationCollection Class Reference

#include <annotation_collection.hpp>

Inheritance diagram for wcf::AnnotationCollection:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool add (const world_canvas_msgs::Annotation &annotation, const world_canvas_msgs::AnnotationData &annot_data)
 AnnotationCollection (const std::string &world, const std::string &srv_namespace="")
 AnnotationCollection (const FilterCriteria &criteria, const std::string &srv_namespace="")
bool clearMarkers (const std::string &topic)
bool filterBy (const FilterCriteria &criteria)
const
world_canvas_msgs::Annotation & 
getAnnotation (const UniqueIDmsg &id)
std::vector< UniqueIDmsggetAnnotationIDs ()
std::vector
< world_canvas_msgs::Annotation > 
getAnnotations (const std::string &name)
const std::vector
< world_canvas_msgs::Annotation > & 
getAnnotations ()
const
world_canvas_msgs::AnnotationData & 
getData (const world_canvas_msgs::Annotation &ann)
template<typename T >
unsigned int getData (std::vector< T > &data)
bool hasAnnotation (const UniqueIDmsg &id)
bool isSaved ()
bool load ()
bool loadData ()
visualization_msgs::Marker makeLabel (const visualization_msgs::Marker &marker)
visualization_msgs::Marker makeMarker (int id, const world_canvas_msgs::Annotation &ann)
bool publish (const std::string &topic_name, const std::string &topic_type="", bool by_server=false, bool as_list=false)
bool publishMarker (const std::string &topic, int marker_id, const world_canvas_msgs::Annotation &ann, bool clear_existing=true)
bool publishMarkers (const std::string &topic, bool clear_existing=true)
bool remove (const uuid_msgs::UniqueID &id)
bool save ()
bool update (const world_canvas_msgs::Annotation &annotation, const world_canvas_msgs::AnnotationData &annot_data)
virtual ~AnnotationCollection ()

Protected Member Functions

bool endsWith (const std::string &a, const std::string &b)
std::vector< UniqueIDmsggetAnnotsDataIDs ()
bool saveDeletes ()

Protected Attributes

std::vector
< world_canvas_msgs::Annotation > 
annotations
std::vector
< world_canvas_msgs::AnnotationData > 
annots_data
std::vector
< world_canvas_msgs::Annotation > 
annots_to_delete
FilterCriteria filter
ros::Publisher marker_pub
ros::Publisher markers_pub
ros::NodeHandle nh
bool saved

Detailed Description

Manages a collection of annotations and its associated data, initially empty. Annotations and data are retrieved from the world canvas server, filtered by the described parameters. This class can also publish the retrieved annotations and RViz visualization markers, mostly for debug purposes.

Definition at line 34 of file annotation_collection.hpp.


Constructor & Destructor Documentation

wcf::AnnotationCollection::AnnotationCollection ( const std::string &  world,
const std::string &  srv_namespace = "" 
)

Initializes the collection of annotations and associated data, initially empty.

Parameters:
world,:Annotations in this collection belong to this world.
srv_namespace,:World canvas handles can be found under this namespace.

Definition at line 22 of file annotation_collection.cpp.

wcf::AnnotationCollection::AnnotationCollection ( const FilterCriteria criteria,
const std::string &  srv_namespace = "" 
)

Initializes the collection of annotations and associated data, initially empty.

Parameters:
criteria,:Annotations filter criteria to pass to the server (must contain at least a valid world name).
srv_namespace,:World canvas handles can be found under this namespace.

Definition at line 28 of file annotation_collection.cpp.

Definition at line 36 of file annotation_collection.cpp.


Member Function Documentation

bool wcf::AnnotationCollection::add ( const world_canvas_msgs::Annotation &  annotation,
const world_canvas_msgs::AnnotationData &  annot_data 
)

Add an annotation with its data to the collection.

Parameters:
annotationannotation to add.
annot_dataannotation's data to add.
Returns:
True on success, false otherwise.

Definition at line 258 of file annotation_collection.cpp.

bool wcf::AnnotationCollection::clearMarkers ( const std::string &  topic)

Clears RViz visualization markers published on the given topic.

Parameters:
topic,:The topic on which to clear annotations markers.
Returns:
True on success, false otherwise.

Definition at line 386 of file annotation_collection.cpp.

bool wcf::AnnotationCollection::endsWith ( const std::string &  a,
const std::string &  b 
) [inline, protected]

Definition at line 60 of file annotation_collection.hpp.

Reload annotations collection, filtered by new selection criteria.

Parameters:
criteria,:Annotations filter criteria to pass to the server.
Returns:
True on success, false otherwise.

Definition at line 41 of file annotation_collection.cpp.

const world_canvas_msgs::Annotation & wcf::AnnotationCollection::getAnnotation ( const UniqueIDmsg id)

Return the annotation with the given unique id.

Parameters:
idTarget annotation id.
Returns:
Searched annotation.

Definition at line 607 of file annotation_collection.cpp.

Return unique IDs for the current annotations collection.

Returns:
Vector of unique IDs.

Definition at line 629 of file annotation_collection.cpp.

std::vector< world_canvas_msgs::Annotation > wcf::AnnotationCollection::getAnnotations ( const std::string &  name)

Return the annotations with the given name. Can be more than one, as we don't enforce uniqueness on annotation names.

Parameters:
nameTarget annotations name.
Returns:
Searched annotations.

Definition at line 618 of file annotation_collection.cpp.

const std::vector<world_canvas_msgs::Annotation>& wcf::AnnotationCollection::getAnnotations ( ) [inline]

Return the current annotations collection.

Returns:
Vector of annotations.

Definition at line 249 of file annotation_collection.hpp.

Return data IDs for the current annotations collection. This method is private because is only necessary for loading annotations data from server, operation that must be transparent for the user.

Returns:
Vector of unique IDs.

Definition at line 639 of file annotation_collection.cpp.

const world_canvas_msgs::AnnotationData & wcf::AnnotationCollection::getData ( const world_canvas_msgs::Annotation &  ann)

Return the data for the given annotation.

Parameters:
anntarget annotation.
Returns:
Annotation's data.

Definition at line 650 of file annotation_collection.cpp.

template<typename T >
unsigned int wcf::AnnotationCollection::getData ( std::vector< T > &  data) [inline]

Return the data for annotations of the template type.

Parameters:
dataVector of annotation's data.
Returns:
The number of annotation's data returned.

Definition at line 266 of file annotation_collection.hpp.

Return true if there's an annotation with the given unique id.

Parameters:
idTarget annotation id.
Returns:
True if there's an annotation with the given unique id, false otherwise.

Definition at line 597 of file annotation_collection.cpp.

Returns:
True if current collection is saved, false otherwise.

Definition at line 119 of file annotation_collection.hpp.

Load annotations collection, filtered by current selection criteria.

Returns:
True on success, false otherwise.

Definition at line 94 of file annotation_collection.cpp.

Load associated data for the current annotations collection.

Returns:
True on success, false otherwise.

Definition at line 100 of file annotation_collection.cpp.

visualization_msgs::Marker wcf::AnnotationCollection::makeLabel ( const visualization_msgs::Marker &  marker)

Create a RViz visualization marker to add a label above the given marker.

Parameters:
markerMarker to create a label for.
Returns:
The created marker.

Definition at line 483 of file annotation_collection.cpp.

visualization_msgs::Marker wcf::AnnotationCollection::makeMarker ( int  id,
const world_canvas_msgs::Annotation &  ann 
)

Create a RViz visualization marker for the given annotation.

Parameters:
idId to add to the visual marker.
annAnnotation to create a marker for.
Returns:
The created marker.

Definition at line 465 of file annotation_collection.cpp.

bool wcf::AnnotationCollection::publish ( const std::string &  topic_name,
const std::string &  topic_type = "",
bool  by_server = false,
bool  as_list = false 
)

Publish the current annotation collection data, by this client or by the server. If no topic name is provided, all annotations must be of the same type (function will return with error otherwise). If it is, only annotation's data of the given type are published.

Parameters:
topic_name,:Where we must publish annotations data.
topic_type,:The message type to publish annotations data. Mandatory if as_list is true; ignored otherwise.
by_server,:Request the server to publish the annotations instead of this client.
as_list,:If true, annotations will be packed in a list before publishing, so topic_type must be an array of currently loaded annotations.
Returns:
True on success, false otherwise.

Definition at line 497 of file annotation_collection.cpp.

bool wcf::AnnotationCollection::publishMarker ( const std::string &  topic,
int  marker_id,
const world_canvas_msgs::Annotation &  ann,
bool  clear_existing = true 
)

Publish RViz visualization marker for the given annotation.

Parameters:
topicWhere we must publish annotation marker.
marker_idId to add to the visual marker.
annAnnotation to publish a marker for.
clear_existingDelete all markers previously published on this topic.
Returns:
True on success, false otherwise.

Definition at line 442 of file annotation_collection.cpp.

bool wcf::AnnotationCollection::publishMarkers ( const std::string &  topic,
bool  clear_existing = true 
)

Publish RViz visualization markers for the current collection of annotations.

Parameters:
topic,:Where we must publish annotations markers.
clear_existingDelete all markers previously published on this topic.
Returns:
True on success, false otherwise.

Definition at line 413 of file annotation_collection.cpp.

Remove an existing annotation and its data.

Parameters:
idTarget annotation's uuid.
Returns:
True on success, false otherwise.

Definition at line 349 of file annotation_collection.cpp.

Save current annotation collection with its data.

Returns:
True on success, false otherwise.

Definition at line 152 of file annotation_collection.cpp.

Definition at line 218 of file annotation_collection.cpp.

bool wcf::AnnotationCollection::update ( const world_canvas_msgs::Annotation &  annotation,
const world_canvas_msgs::AnnotationData &  annot_data 
)

Update an existing annotation and its data.

Parameters:
annotationannotation to update.
annot_dataannotation's data to update.
Returns:
True on success, false otherwise.

Definition at line 297 of file annotation_collection.cpp.


Member Data Documentation

std::vector<world_canvas_msgs::Annotation> wcf::AnnotationCollection::annotations [protected]

Definition at line 43 of file annotation_collection.hpp.

std::vector<world_canvas_msgs::AnnotationData> wcf::AnnotationCollection::annots_data [protected]

Definition at line 44 of file annotation_collection.hpp.

std::vector<world_canvas_msgs::Annotation> wcf::AnnotationCollection::annots_to_delete [protected]

Definition at line 46 of file annotation_collection.hpp.

Definition at line 41 of file annotation_collection.hpp.

Definition at line 38 of file annotation_collection.hpp.

Definition at line 39 of file annotation_collection.hpp.

Reimplemented from wcf::WorldCanvasClient.

Definition at line 37 of file annotation_collection.hpp.

Definition at line 47 of file annotation_collection.hpp.


The documentation for this class was generated from the following files:


world_canvas_client_cpp
Author(s): Jorge Santos
autogenerated on Thu Jun 6 2019 18:32:38