version 3.3

VRS::RemoteLookAt Class Reference

#include <vrs/qt3/remotelookat.h>

Inheritance diagram for VRS::RemoteLookAt:

VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  State {
  MasterState, SlaveState, IndependentState, MasterRequestedState,
  SlaveRequestedState
}
enum  Role { MasterRole, SlaveRole, IndependentRole }

Public Member Functions

 RemoteLookAt (LookAt *target, TwoPointConnection *connection, Canvas *canvas)
 ~RemoteLookAt ()
 VRS_SERIALIZABLE_CLASS_ENUM (State)
State getState () const
 VRS_SERIALIZABLE_CLASS_ENUM (Role)
void sendRoleRequest (Role role)
void answerRoleRequest (bool accept=true)
void registerRoleChangeCB (Callback1< Role > *cb)
void registerRoleChangeAnswerCB (Callback1< bool > *cb)
void registerIndependentCB (Callback *cb)
 VRS_TYPEINFO (RemoteLookAt, SharedObj)


Member Enumeration Documentation

Enumerator:
MasterState 
SlaveState 
IndependentState 
MasterRequestedState 
SlaveRequestedState 

Enumerator:
MasterRole 
SlaveRole 
IndependentRole 


Constructor & Destructor Documentation

VRS::RemoteLookAt::RemoteLookAt ( LookAt target,
TwoPointConnection connection,
Canvas canvas 
)

< A remote lookat enables camera control via TCP/IP-network. To establish a RemoteLookAt connection between two computers, do:

  • Establish a TwoPointConnection between the two computers
  • Construct RemoteLookAt objects on both computers passing the TwoPointConnections in the constructor.
  • On the one side the Role must be set to Master, on the other side to slave.
  • Both parties must come to an agreement about who is master and who is slave. Otherwise they act independently.
  • To get a specific role (master or slave) you need to request it by sendRoleRequest(role). Note that you do NOT have this rule at this moment. Instead, a message is sent to the RemoteLookAt of the other participant requesting the role. Here the request causes a call of the "role-change request" message. The role can only be changed if the other participant calls the "acceptRoleRequest()" method. Creates a RemoteLookAt using a given TCP/IP-connection. The canvas is needed for redisplay-calls only.

VRS::RemoteLookAt::~RemoteLookAt (  ) 


Member Function Documentation

VRS::RemoteLookAt::VRS_SERIALIZABLE_CLASS_ENUM ( State   ) 

State VRS::RemoteLookAt::getState (  )  const

Returns the current state.

VRS::RemoteLookAt::VRS_SERIALIZABLE_CLASS_ENUM ( Role   ) 

void VRS::RemoteLookAt::sendRoleRequest ( Role  role  ) 

Sends a role-change request message to the connected application. The role is changed when the "accept" message arrives. If the role is "Independent", the role is applied without waiting for acknowledgement. Note: If a role request has been sent, it MUST be answered until the next request can be send.

void VRS::RemoteLookAt::answerRoleRequest ( bool  accept = true  ) 

Called to accept an incoming role change request. If there is no request, it has no effect.

void VRS::RemoteLookAt::registerRoleChangeCB ( Callback1< Role > *  cb  ) 

The role-change callback is called when the other participant sends a role-change request. In this case the application should ask the user, whether he want to accept the requested role change. By answerRoleRequest() the application should answer the request. The passed parameter informs whether the connected application wants to be master or slave.

Note: Only one callback can be active. A callback is unregistered by call registerRoleChangeCB(NULL). The same applies for registerRoleChangeAnswerCB().

void VRS::RemoteLookAt::registerRoleChangeAnswerCB ( Callback1< bool > *  cb  ) 

The roleChangeAnswer callback is invoked when the RemoteLookAt receives an answer for a previously sent role-change request. The bool parameter is true if the request has been accepted, false otherwise.

void VRS::RemoteLookAt::registerIndependentCB ( Callback cb  ) 

The IndependentCallback is called if the other participant has switched from master or slave mode to independent mode.

VRS::RemoteLookAt::VRS_TYPEINFO ( RemoteLookAt  ,
SharedObj   
)


The documentation for this class was generated from the following file:

Generated on Tue May 22 06:00:26 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact