Grip-Reloaded
Grip version visualizaiton interface for DART (DynamicAnimationandRoboticsToolkits)
/home/pete/myRepos/grip2/qtWidgets/TreeView.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2014, Georgia Tech Research Corporation
00003  * All rights reserved.
00004  *
00005  * Author: Michael X. Grey <mxgrey@gatech.edu>
00006  * Date: Jan 2014
00007  *
00008  * Humanoid Robotics Lab      Georgia Institute of Technology
00009  * Director: Mike Stilman     http://www.golems.org
00010  *
00011  *
00012  * This file is provided under the following "BSD-style" License:
00013  *   Redistribution and use in source and binary forms, with or
00014  *   without modification, are permitted provided that the following
00015  *   conditions are met:
00016  *
00017  *   * Redistributions of source code must retain the above copyright
00018  *     notice, this list of conditions and the following disclaimer.
00019  *
00020  *   * Redistributions in binary form must reproduce the above
00021  *     copyright notice, this list of conditions and the following
00022  *     disclaimer in the documentation and/or other materials provided
00023  *     with the distribution.
00024  *
00025  *   * Neither the name of the Humanoid Robotics Lab nor the names of
00026  *     its contributors may be used to endorse or promote products
00027  *     derived from this software without specific prior written
00028  *     permission
00029  *
00030  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
00031  *   CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
00032  *   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00033  *   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00034  *   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
00035  *   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00036  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00037  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00038  *   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00039  *   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00040  *   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00041  *   ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00042  *   POSSIBILITY OF SUCH DAMAGE.
00043  */
00044 
00051 #ifndef TREE_VIEW_H
00052 #define TREE_VIEW_H
00053 
00054 // Qt includes
00055 #include <QDockWidget>
00056 
00057 // Local includes
00058 #include "ui_TreeView.h"
00059 #include "TreeViewReturn.h"
00060 #include "GripTab.h"
00061 
00062 // DART includes
00063 #include <dart/simulation/World.h>
00064 #include <dart/dynamics/BodyNode.h>
00065 
00069 namespace Ui {
00074     class TreeView;
00075 }
00076 
00082 class TreeView : public QDockWidget
00083 {
00085     Q_OBJECT
00086     
00087 public:
00088     explicit TreeView(QWidget *parent = 0, QList<GripTab*>* tabs = NULL);
00089     void populateTreeView(dart::simulation::World *world = NULL);
00090     void reset();
00091     ~TreeView();
00092     TreeViewReturn* getActiveItem();
00093 
00094 signals:
00095     void itemSelected(TreeViewReturn *active_item);
00096 
00097 private slots:
00098     void nameChangeBodyNodeJoint(int checkBoxState);
00099     void treeViewItemSelected(QTreeWidgetItem *item, int column);
00100     
00101 private:
00102     Ui::TreeView *_ui;
00103     QTreeWidget *_ui_treeWidget;
00104     QCheckBox *_ui_checkBox;
00105     TreeViewReturn *_activeItem;
00106     QList<GripTab*> *_tabs;
00107 
00108     QTreeWidgetItem* _addParent(dart::dynamics::Skeleton *skel, QIcon icon, int skeletonId);
00109     QTreeWidgetItem* _addChildItem(dart::dynamics::BodyNode* node, QTreeWidgetItem *parent, QIcon icon, int skeletonId);
00110     QTreeWidgetItem* _buildTree(dart::dynamics::BodyNode* node, QTreeWidgetItem *prev, QTreeWidgetItem *parent, bool chain, int skeletonId);
00111     void _nameJoint(QTreeWidgetItem* node);
00112     void _nameBodyNode(QTreeWidgetItem* node);
00113 
00114 }; // end class TreeView
00115 
00116 #endif // TREE_VIEW_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator