Public Member Functions

VgMyPoiConfigurationSetter Class Reference

Interface for Objects that insert POIs into the map view. More...

Inheritance diagram for VgMyPoiConfigurationSetter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void setPoiCallback (const std::string &pIdentifier, VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback >const &pCallback)=0
 Sets a callback for a specific POI identifier.

Detailed Description

Interface for Objects that insert POIs into the map view.

Objects that implement this interfaces should declare static strings for every POIs (or categories) that reacts to click with distincts behaviors.

  --- HEADER FILE ---

  // Class that manages POIs (CRUD). Clicks on POIs with distinct catgory triggers 
  // different callbacks
  class VgMyPOIManager : public VgMyPoiConfigurationSetter
  {
    public:
    ...
    void addPoi(PoiData* pData);
    void setPoiCallback(const std::string& pIdentifier, Vg3DModule::VgIGeometryCallback* pCallback);
    ...
    static const std::string kHotelCategoryCallbackStringIdentifier; // "VgMyPOIManager_Hotel"
    static const std::string kGasStationCategoryCallbackStringIdentifier; // "VgMyPOIManager_GasStation"
    ...

    protected:
    ...
    std::map<std::string, Vg3DModule::VgIGeometryCallback*> mCallbacks;
    ...
    };
  
  --- IMPLEMENTATION FILE ---

  ...
  void VgMyPOIManager::setPoiCallback(const std::string& pIdentifier, Vg3DModule::VgIGeometryCallback* pCallback)
  {
      // Fills the mCallbacks map.
  }

  void VgMyPOIManager::addPoi(PoiData* pData)
  {
      // Fills the Vg3DModule::VgPointDescriptor
      Vg3DModule::VgPointDescriptor lMyPoiDescriptor;
      ... 
      // Sets the Vg3DModule::VgPointDescriptor callback given the POI category.
      swich(pData.category)
      {
        case Hotel:
            std::map<std::string, Vg3DModule::VgIGeometryCallback*>::iterator lItCallback;
            lItCallback = mCallbacks.find(kHotelCategoryCallbackStringIdentifier);
            if (lItCallback != mCallbacks.end())
            {
                // Sets the Vg3DModule::VgPointDescriptor callback
                lMyPoiDescriptor.callback = lItCallback->second;
            }
            break;
         case GasStation:
            // same with kGasStationCategoryCallbackStringIdentifier
            break;
         default:
            // Do nothing. No callback on clicks.
            break;
      }
  }
  ...

Member Function Documentation

virtual void VgMyPoiConfigurationSetter::setPoiCallback ( const std::string &  pIdentifier,
VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback >const &  pCallback 
) [pure virtual]

Sets a callback for a specific POI identifier.

Implemented in VgMyRoutingHelper.


The documentation for this class was generated from the following file:
VisioDevKit 2.0, Visioglobe® 2013