VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtObjectDataInterfaceMenuItem

guiObjectDataInterface.cxx

/*******************************************************************************
** Copyright (c) 2012 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file guiObjectDataInterface.cxx
//This file defines the generic DT_DLL_VRF_PLUGIN_EXPORT_MACRO. Use that macro when
//you want to export symbols. Also, in your CMakeLists.txt file, make sure to
//define the VRFPLUGIN_EXPORTS define to tell the compiler to define the macro as an
//export
#include <vrvCore/DtDe.h>
#include <QtGui/QMenu>
#include <QApplication>
#include <QtGui/QLineEdit>
#include <boost/bind.hpp>
using namespace makVrf;
//This menu item will create and display the object information dialog which will be an example of
//how to use the DtObjectDataInterface class to retrieve information about an object
class DtObjectDataInterfaceMenuItem : public makVrv::DtMenuItem
{
public:
DtObjectDataInterfaceMenuItem(makVrv::DtDe& de)
: makVrv::DtMenuItem("DtObjectDataInterfaceMenuItem")
, myConsole(0)
, myDe(de)
{
}
virtual ~DtObjectDataInterfaceMenuItem()
{
delete myConsole;
}
//Build a menu item (via an action).
virtual QAction* createAction(makVrv::DtDe&, QWidget* parent)
{
return new QAction(tr("Data Console..."), parent);
}
protected:
void on_triggered()
{
QAction* action = dynamic_cast<QAction*>(sender());
QWidget* parent = 0;
if(action)
{
parent = action->parentWidget();
}
if (!myConsole)
{
myConsole = new DtGuiObjectDataConsole(myDe, parent);
}
myConsole->show();
myConsole->raise();
qApp->setActiveWindow(myConsole);
myConsole->myObject->setFocus();
}
protected:
makVrv::DtDe& myDe;
};
{
//First, register the creators with the menu
DtVrfMainMenu::instance(*de).registerMenuItem(new DtObjectDataInterfaceMenuItem(*de));
//Now, add the menu to the master mode configuration. mainMenu indicates that
//the example menu is going to be used as a top-level main menu rather than a
//sub-menu. Add it before the Task menu. To leave off the path will
//put the menu at the end of the menu bar
makVrv::DtMenuPath::mainMenu("DtObjectDataInterfaceControlMenu"),
//Now, add the DtRemoteControlMenuItem as an item of DtRemoteControlMenu
makVrv::DtMenuPath::mainMenu("DtObjectDataInterfaceControlMenu").item("DtObjectDataInterfaceMenuItem"));
return true;
}
{
info.pluginName = "Network Data Interface";
info.pluginDescription = "This example shows how to use the Network Data Interface classes to retrieve information about simulation objects.";
info.pluginVersion = "1.00";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
info.pluginContactPhone = "(617) 876 8085";
}

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)