00001 /* 00002 * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 00003 * http://octomap.github.com/ 00004 * 00005 * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 00006 * All rights reserved. 00007 * License (octovis): GNU GPL v2 00008 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 00009 * 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, but 00017 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00018 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 * for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License along 00022 * with this program; if not, write to the Free Software Foundation, Inc., 00023 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 */ 00025 00026 #ifndef SELECTIONBOX_H_ 00027 #define SELECTIONBOX_H_ 00028 00029 #include <qglviewer.h> 00030 00031 namespace octomap { 00032 class SelectionBox{ 00033 00034 public: 00035 SelectionBox(); 00036 virtual ~SelectionBox(); 00037 void draw(bool withNames = false); 00038 const qglviewer::ManipulatedFrame* frame (unsigned short i) const { return m_frames.at(i); } 00039 qglviewer::ManipulatedFrame* frame (unsigned short i) { return m_frames.at(i); } 00040 void getBBXMin(float& x, float& y, float& z) const; 00041 void getBBXMax(float& x, float& y, float& z) const; 00042 int getGrabbedFrame() const; 00043 00044 protected: 00045 void drawAxis(float length = 0.2f) const; 00046 00047 bool m_visible; 00048 std::vector<qglviewer::ManipulatedFrame*> m_frames; 00049 unsigned short m_selectedFrame; 00050 qglviewer::Vec m_minPt; 00051 qglviewer::Vec m_maxPt; 00052 float m_arrowLength; 00053 00054 }; 00055 00056 00057 00058 } 00059 00060 00061 00062 00063 #endif