Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

VRJugglerSharedData.C

Go to the documentation of this file.
00001 /***************************************************************************
00002 *cr
00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the
00004 *cr University of Illinois
00005 *cr All Rights Reserved
00006 *cr
00007 *cr VRJuggler patches contributed by Martijn Kragtwijk: m.kragtwijk@rug.nl
00008 *cr
00009 ***************************************************************************/
00010 
00011 /***************************************************************************
00012 * RCS INFORMATION:
00013 *
00014 * $RCSfile: VRJugglerSharedData.C,v $
00015 * $Author: johns $ $Locker: $ $State: Exp $
00016 * $Revision: 1.4 $ $Date: 2019年01月17日 21:21:02 $
00017 *
00018 ***************************************************************************
00019 * DESCRIPTION:
00020 * a VRJuggler specific data sharing code for VMD
00021 ***************************************************************************/
00022 #include <Inform.h>
00023 #include "VRJugglerSharedData.h"
00024 
00025 vpr::ReturnStatus VRJugglerSharedData::readObject(vpr::ObjectReader* reader)
00026 {
00027 unsigned numStrings = reader->readUint32(); // read nr of strings
00028 commandStrings.clear(); // clear old content (!)
00029 for (unsigned i=0;i<numStrings;i++ )
00030 {
00031 std::string command = reader->readString();// read the strings themselves
00032 //msgInfo << "read string:" << command.c_str() << sendmsg;
00033 commandStrings.push_back(command);
00034 }
00035 return vpr::ReturnStatus::Succeed;
00036 }
00037 
00038 vpr::ReturnStatus VRJugglerSharedData::writeObject(vpr::ObjectWriter* writer)
00039 {
00040 unsigned numStrings = commandStrings.size();
00041 writer->writeUint32(numStrings); // write nr of strings
00042 for (unsigned i=0;i<numStrings;i++ )
00043 {
00044 writer->writeString(commandStrings[i]); // write the strings themselves
00045 }
00046 commandStrings.clear(); // remove all content so we get a fresh start next frame!
00047 return vpr::ReturnStatus::Succeed;
00048 }
00049 
00050 
00051 void OsgNavigator::init()
00052 {
00053 vpr::GUID new_guid("44ab594b-1dfb-40c1-8bf3-9af7b7c0ac8a");
00054 mNavData.init(new_guid);
00055 
00056 // Could hardcode the hostname like the following, but it is better to rely 
00057 // on the ApplicationData configuration element to get the hostname.
00058 //std::string hostname = "crash";
00059 //mNavData.init(new_guid, hostname);
00060 }
00061 
00062 void OsgNavigator::update(float delta)
00063 {
00064 if(!mNavData.isLocal())
00065 {
00066 // std::cout << "Data is NOT local, returning.\n";
00067 return;
00068 }
00069 else
00070 {
00071 //std::cout << "Data IS local.\n";
00072 }
00073 
00074 // do something
00075 }
00076 
00077 
00078 

Generated on Mon Nov 17 02:47:28 2025 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002

AltStyle によって変換されたページ (->オリジナル) /