00001 /****************************************************************************** 00002 * \file 00003 * 00004 * $Id: BoundingBox.h 676 2012-04-19 18:32:07Z xlokaj03 $ 00005 * 00006 * Copyright (C) Brno University of Technology 00007 * 00008 * This file is part of software developed by Robo@FIT group. 00009 * 00010 * Author: Tomas Lokaj (xlokaj03@stud.fit.vutbr.cz) 00011 * Supervised by: Michal Spanel (spanel@fit.vutbr.cz) 00012 * Date: 27.11.2011 00013 * 00014 * This file is free software: you can redistribute it and/or modify 00015 * it under the terms of the GNU Lesser General Public License as published by 00016 * the Free Software Foundation, either version 3 of the License, or 00017 * (at your option) any later version. 00018 * 00019 * This file is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 * GNU Lesser General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public License 00025 * along with this file. If not, see <http://www.gnu.org/licenses/>. 00026 */ 00027 00028 #pragma once 00029 #ifndef BOUNDINGBOX_H_ 00030 #define BOUNDINGBOX_H_ 00031 00032 #include "primitive.h" 00033 00034 #define BBOX_MIN_ALPHA 0.0 00035 #define BBOX_MAX_ALPHA 0.2 00036 00037 #define BOUNDING_BOX_CONTROL_NAME "bbox_control" 00038 00039 namespace srs_interaction_primitives 00040 { 00051 class BoundingBox : public Primitive 00052 { 00053 public: 00060 BoundingBox(InteractiveMarkerServerPtr server, std::string frame_id, std::string name); 00061 00065 BoundingBox() 00066 { 00067 } 00068 00072 void insert(); 00073 00077 void menuCallback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback); 00078 00082 void bboxCallback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback); 00083 00084 00089 std::string getAttachedObjectName() 00090 { 00091 return attached_object_name_; 00092 } 00093 00098 void setAttachedObjectName(std::string name) 00099 { 00100 attached_object_name_ = name; 00101 } 00102 00103 protected: 00104 visualization_msgs::Marker bounding_box_, wire_; 00105 std::string attached_object_name_; 00106 00107 void showBoundingBoxControl(bool show); 00108 00109 void createBoundingBoxControl(float trans_x, float trans_y, float trans_z); 00110 void createBoundingBoxControl(); 00111 void create(); 00112 void createMenu(); 00113 }; 00114 00115 } 00116 00117 #endif /* BOUNDINGBOX_H_ */ 00118