.. _program_listing_file_src_overlay.hpp: Program Listing for File overlay.hpp ==================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/overlay.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright 2021 Kenji Brameld // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef OVERLAY_HPP_ #define OVERLAY_HPP_ #include #include #include #include "pluginlib/class_loader.hpp" #include "rclcpp/clock.hpp" #include "msg_storage.hpp" // Forward Declaration namespace rclcpp { class Node; class GenericSubscription; class SerializedMessage; class Time; } class QPainter; namespace rqt_image_overlay_layer {class PluginInterface;} namespace rqt_image_overlay {class OverlayTimeInfo;} namespace rqt_image_overlay { class Overlay { public: Overlay( std::string pluginClass, pluginlib::ClassLoader & pluginLoader, const std::shared_ptr & node); void setTopic(std::string topic); void setEnabled(bool enabled); void setColor(QColor color); std::string getTopic() const; std::string getPluginClass() const; std::string getMsgType() const; std::string getReceivedStatus() const; QColor getColor() const; bool isEnabled() const; void overlay(QPainter & painter, const OverlayTimeInfo & overlayTimeInfo) const; private: const std::string pluginClass; const std::shared_ptr instance; const std::string msgType; std::string topic; bool enabled = true; QColor color; std::shared_ptr subscription; const std::shared_ptr & node; bool useHeaderTimestamp; MsgStorage> msgStorage; rclcpp::Clock systemClock{RCL_SYSTEM_TIME}; void msgCallback(std::shared_ptr msg); }; } // namespace rqt_image_overlay #endif // OVERLAY_HPP_