Grip-Reloaded
Grip version visualizaiton interface for DART (DynamicAnimationandRoboticsToolkits)
|
00001 /* 00002 * Copyright (c) 2014, Georgia Tech Research Corporation 00003 * All rights reserved. 00004 * 00005 * Author: Pete Vieira <pete.vieira@gatech.edu> 00006 * Date: Feb 2014 00007 * 00008 * Humanoid skeletonics 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 BODYNODE_VISUALS_H 00052 #define BODYNODE_VISUALS_H 00053 00054 // OpenSceneGraph includes 00055 #include <osg/MatrixTransform> 00056 #include <osg/CullFace> 00057 00058 // Local includes 00059 #include "../osgGolems/Axes.h" 00060 #include "../osgGolems/Line.h" 00061 00062 namespace osgDart { 00063 00068 class BodyNodeVisuals : public osg::MatrixTransform 00069 { 00070 public: 00074 BodyNodeVisuals(); 00075 00079 ~BodyNodeVisuals(); 00080 00085 void addJointAxis(); 00086 00091 void addBodyNodesAxes(); 00092 00098 void addCenterOfMass(); 00099 00104 osg::MatrixTransform* getJointAxisTF(); 00105 00110 osg::MatrixTransform* getBodyNodeAxesTF(); 00111 00117 void setJointAxisColor(const osg::Vec4 &color); 00118 00124 void setBodyNodeAxesColors(const osg::Vec4& xAxis, const osg::Vec4& yAxis, const osg::Vec4& zAxis); 00125 00130 void setLineWidth(float lineWidth); 00131 00132 00133 protected: 00138 osg::Geode* _makeJointAxis(); 00139 00144 osg::Geode* _makeBodyNodeAxes(); 00145 00151 void _setGeodeModes(osg::Geode* geode); 00152 00154 osg::MatrixTransform* _jointAxisTF; 00155 00157 osg::MatrixTransform* _bodyNodeAxesTF; 00158 00160 osgGolems::Line* _jointAxis; 00161 00163 osgGolems::Axes* _bodyNodeAxes; 00164 00166 osg::LineWidth* _lineWidth; 00167 00169 osg::CullFace* _cullFace; 00170 }; 00171 00172 } // end namespace osgDart 00173 00174 #endif // BODYNODE_VISUALS_H