00001 /*************************************************************************** 00002 * Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) * 00003 * * 00004 * This file is part of the FreeCAD CAx development system. * 00005 * * 00006 * This library is free software; you can redistribute it and/or * 00007 * modify it under the terms of the GNU Library General Public * 00008 * License as published by the Free Software Foundation; either * 00009 * version 2 of the License, or (at your option) any later version. * 00010 * * 00011 * This library is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU Library General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU Library General Public * 00017 * License along with this library; see the file COPYING.LIB. If not, * 00018 * write to the Free Software Foundation, Inc., 59 Temple Place, * 00019 * Suite 330, Boston, MA 02111-1307, USA * 00020 * * 00021 ***************************************************************************/ 00022 00023 00024 #ifndef ROBOT_VIEWPROVIDERROBOTOBJECT_H 00025 #define ROBOT_VIEWPROVIDERROBOTOBJECT_H 00026 00027 #include <Inventor/VRMLnodes/SoVRMLTransform.h> 00028 #include <Gui/ViewProviderGeometryObject.h> 00029 #include <Gui/SoFCSelection.h> 00030 #include <Base/Placement.h> 00031 00032 class SoDragger; 00033 class SoJackDragger; 00034 class SoTrackballDragger; 00035 00036 namespace RobotGui 00037 { 00038 00039 class RobotGuiExport ViewProviderRobotObject : public Gui::ViewProviderGeometryObject 00040 { 00041 PROPERTY_HEADER(RobotGui::ViewProviderRobotObject); 00042 00043 public: 00045 ViewProviderRobotObject(); 00046 00048 ~ViewProviderRobotObject(); 00049 00050 App::PropertyBool Manipulator; 00051 00052 void attach(App::DocumentObject *pcObject); 00053 void setDisplayMode(const char* ModeName); 00054 std::vector<std::string> getDisplayModes() const; 00055 void updateData(const App::Property*); 00056 00057 virtual void onChanged(const App::Property* prop); 00058 00060 void setAxisTo(float A1,float A2,float A3,float A4,float A5,float A6,const Base::Placement &Tcp); 00061 00062 protected: 00063 static void sDraggerMotionCallback(void *data, SoDragger *dragger); 00064 void DraggerMotionCallback(SoDragger *dragger); 00065 00066 void setDragger(void); 00067 void resetDragger(void); 00068 00069 Gui::SoFCSelection * pcRobotRoot; 00070 Gui::SoFCSelection * pcSimpleRoot; 00071 SoGroup * pcOffRoot; 00072 00073 SoGroup * pcTcpRoot; 00074 SoTransform * pcTcpTransform; 00075 00076 //SoTrackballDragger * pcDragger; 00077 SoJackDragger * pcDragger; 00078 00079 // view provider of the toolshape if set 00080 Gui::ViewProvider *toolShape; 00081 00082 // Pointers to the robot axis nodes in the VRML model 00083 SoVRMLTransform *Axis1Node; 00084 SoVRMLTransform *Axis2Node; 00085 SoVRMLTransform *Axis3Node; 00086 SoVRMLTransform *Axis4Node; 00087 SoVRMLTransform *Axis5Node; 00088 SoVRMLTransform *Axis6Node; 00089 }; 00090 00091 } //namespace RobotGui 00092 00093 00094 #endif // ROBOT_VIEWPROVIDERROBOTOBJECT_H