VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
exampleCreateObserver

This example shows how to create an observer.

To create an observer, you must first create an observer configuration.

// First, create an observer configuration that describes the observer to
// create. For this example, the default values are fine - we just need to
// supply a unique name.
makVrv::DtObserverConfiguration observerConfig("Example Observer");

The configuration is then added to the DtInputDriver, which will realize the observer immediately if the application is running, or realize it on start up.

// Then add the configuration to the input driver. Since we added the
// configuration the input driver will create this observer each time it
// is started.
vantageApp.de().driverManager().inputDriver().addObserverConfiguration(
observerConfig );

Building the Example

VR-Vantage includes pre-built versions of the example application. To build it yourself, follow the instructions at Building VR-Vantage Examples, Applications, and Plug-ins.

Running the Example

This example is an application. You can run it by running ./bin/exampleCreateObserver.exe (on Windows) or ./bin/exampleCreateObserver (on Linux). For more information about running examples, please see Running Applications and Examples.


exampleCreateObserver.cxx

/******************************************************************************
** Copyright (c) 2007 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
/******************************************************************************
** $RCSfile: exampleCreateObserver.cxx,v $ $Revision: 1.17 $ $State: Exp $
******************************************************************************/
#include <vrvCore/DtDe.h>
#include <boost/bind.hpp>
int main(int argc, char** argv)
{
// Create the Application.
makVrv::DtVrvApplication vantageApp(config);
makVrv::DtVantageIgCommandLineProcessor vantageCommandLineParser;
vantageApp.installCommandLineProcessor(&vantageCommandLineParser);
// Parse Command Line.
vantageApp.initialize(argc,argv);
// First, create an observer configuration that describes the observer to
// create. For this example, the default values are fine - we just need to
// supply a unique name.
makVrv::DtObserverConfiguration observerConfig("Example Observer");
// Then add the configuration to the input driver. Since we added the
// configuration the input driver will create this observer each time it
// is started.
vantageApp.de().driverManager().inputDriver().addObserverConfiguration(
observerConfig );
// Run.
vantageApp.run();
return 0;
}

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)