#include <pacs_client.h>
Nevrax France
Definition at line 52 of file pacs_client.h.
|
Constructor.
Definition at line 58 of file pacs_client.h.
00059 { 00060 // No connexion 00061 _Server=NULL; 00062 } |
|
Definition at line 64 of file pacs_client.h. References disconnect().
00065 { 00066 disconnect (); 00067 } |
|
Add a primitive in the service. Set the new primitive as current. No answer will be send by the service.
Definition at line 149 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and NLPACS::UMovePrimitive::TUserData.
|
|
Definition at line 577 of file pacs_client.h. References NLNET::CCallbackNetBase::addCallbackArray(), NLNET::CCallbackClient::connected(), NLNET::CBufClient::id(), nlassert, NLNET::PacsCallbackArray, NLNET::CBufSock::setAppId(), uint, and uint64.
00578 { 00579 // Create a connexion 00580 _Server = new CCallbackClient; 00581 00582 // Look up for PACS service 00583 CNamingClient::lookupAndConnect ("PS", *_Server); 00584 if (_Server->connected()) 00585 { 00586 // Add callback array 00587 _Server->addCallbackArray (PacsCallbackArray, sizeof (PacsCallbackArray) / sizeof (PacsCallbackArray[0])); 00588 00589 // This code can work only if sizeof (uint) == sizeof (void*) 00590 nlassert (sizeof (uint)==sizeof (void*)); 00591 _Server->id ()->setAppId ((uint64)(uint)this); 00592 00593 // Return ok 00594 return true; 00595 } 00596 else 00597 { 00598 return false; 00599 } 00600 } |
|
Definition at line 71 of file pacs_client.h. References NLNET::CCallbackClient::disconnect(). Referenced by ~CPacsClient().
|
|
Evaluate the collision on the servive. The service will answer this message with a triggerCallback message.
Definition at line 180 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and uint32.
|
|
Query the position and the speed of the primitive after an evalCollision message. The service will answer with a getPositionSpeedCallback message.
Definition at line 433 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and NLPACS::UMovePrimitive::TUserData.
|
|
This message is send by the service to answer the getPositionSpeed request.
Definition at line 486 of file pacs_client.h. References NLPACS::UMovePrimitive::TUserData. Referenced by NLNET::cbPacsAnswer().
00487 {} |
|
Make the current primitive a global move. This move is slow. Use it only for the first placement and for teleporting. No answer will be send by the service.
Definition at line 400 of file pacs_client.h. References _Message, and NLMISC::CMemStream::serial().
|
|
Prepare a new message You must call this method before do anything before sending the message. Definition at line 85 of file pacs_client.h. References _Message, NLNET::CMessage::clear(), NLNET_PACS_PROTOCOL_VERSION, NLMISC::IStream::serialCheck(), NLNET::CMessage::setType(), and uint32.
|
|
This call back is called when a message is coming. Used for synchronisation. Definition at line 448 of file pacs_client.h. Referenced by NLNET::cbPacsAnswer().
00449 {} |
|
Make a raytrace test on the service. The service will answer this message with a rayTestCallback message.
Definition at line 132 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and uint32.
|
|
This message is send by the service to answer the rayTest request.
Definition at line 457 of file pacs_client.h. References uint32. Referenced by NLNET::cbPacsAnswer().
00458 {} |
|
Make the current primitive a relative move. This move is fast. Use it for current move. Make first a relative move of all your primitives, then put a evalCollision message. Then you can query position and speed by posting getPositionSpeed message. No answer will be send by the service.
Definition at line 418 of file pacs_client.h. References _Message, and NLMISC::CMemStream::serial().
|
|
Remove a primitive from the service. No answer will be send by the service.
Definition at line 164 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and NLPACS::UMovePrimitive::TUserData.
|
|
Send the message You must call this method after initMessage and others calls to setup methods. Definition at line 97 of file pacs_client.h. References _Message, nlassert, NLNET::CCallbackClient::send(), and NLMISC::CMemStream::serial().
|
|
Set the attenuation factor of the current primitive on the service. No answer will be send by the service.
Definition at line 338 of file pacs_client.h. References _Message, and NLMISC::CMemStream::serial().
|
|
Set the collision mask of the current primitive on the service. No answer will be send by the service.
Definition at line 278 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and NLPACS::UMovePrimitive::TCollisionMask.
|
|
Set the current primitive on the service. The primitive stay current for the current message. No answer will be send by the service.
Definition at line 215 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and NLPACS::UMovePrimitive::TUserData.
|
|
Set the height of the current primitive on the service. For boxes and cylinders primitives. No answer will be send by the service.
Definition at line 369 of file pacs_client.h. References _Message, height, and NLMISC::CMemStream::serial().
|
|
Set the obstacle flag of the current primitive on the service. No answer will be send by the service.
Definition at line 308 of file pacs_client.h. References _Message, and NLMISC::CMemStream::serial().
|
|
Set the occlusion mask of the current primitive on the service. No answer will be send by the service.
Definition at line 293 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and NLPACS::UMovePrimitive::TCollisionMask.
|
|
Set the orientation the current primitive on the service. No answer will be send by the service.
Definition at line 323 of file pacs_client.h. References _Message, and NLMISC::CMemStream::serial().
|
|
Set the type of the current primitive on the service. No answer will be send by the service.
Definition at line 230 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), t, type, and uint32.
|
|
Set the radius of the current primitive on the service. For cylinders primitives. No answer will be send by the service.
Definition at line 384 of file pacs_client.h. References _Message, and NLMISC::CMemStream::serial().
|
|
Set the reaction type of the current primitive on the service. No answer will be send by the service.
Definition at line 246 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), t, type, and uint32.
|
|
Set the size of the current primitive on the service. Only for boxes primitives. No answer will be send by the service.
Definition at line 354 of file pacs_client.h. References _Message, depth, NLMISC::CMemStream::serial(), and width.
|
|
Set the trigger type of the current primitive on the service. No answer will be send by the service.
Definition at line 262 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), t, type, and uint32.
|
|
Test a move of a primitive on the service. The service will answer this message with a testMoveCallback message.
Definition at line 197 of file pacs_client.h. References _Message, NLMISC::CMemStream::serial(), and NLPACS::UMovePrimitive::TUserData.
|
|
This message is send by the service to answer the testMove request.
Definition at line 476 of file pacs_client.h. References NLPACS::UMovePrimitive::TUserData. Referenced by NLNET::cbPacsAnswer().
00477 {} |
|
This message is send by the service to answer the evalCollision request.
Definition at line 467 of file pacs_client.h. References uint32. Referenced by NLNET::cbPacsAnswer().
00468 {} |
|
Update method. Should be called evenly. Definition at line 113 of file pacs_client.h. References nlassert, and NLNET::CCallbackClient::update().
|
|
Definition at line 495 of file pacs_client.h.
00496 { 00497 // Get the client pointer 00498 CPacsClient *client=(CPacsClient*)(uint)from->appId (); 00499 00500 // Check stream 00501 msgin.serialCheck ((uint32)NLNET_PACS_PROTOCOL_VERSION); 00502 00503 // Message callback 00504 client->messageCallback (); 00505 00506 bool again; 00507 msgin.serial (again); 00508 00509 while (again) 00510 { 00511 // Read the message sub string 00512 std::string subMessage; 00513 msgin.serial (subMessage); 00514 00515 // This code can work only if sizeof (uint) == sizeof (void*) 00516 nlassert (sizeof (uint)==sizeof (void*)); 00517 00518 // Raytrace callback ? 00519 if (subMessage=="RY") 00520 { 00521 // Read test id and test result 00522 uint32 testId; 00523 bool testResult; 00524 msgin.serial (testId, testResult); 00525 00526 // Call the callback 00527 client->rayTestCallback (testId, testResult); 00528 } 00529 // Trigger callback ? 00530 else if (subMessage=="TR") 00531 { 00532 // Read eval id and trigger info 00533 uint32 evalId; 00534 std::vector<NLPACS::UTriggerInfo> triggerInfo; 00535 msgin.serial (evalId); 00536 msgin.serialCont (triggerInfo); 00537 00538 // Call the callback 00539 client->triggerCallback (evalId, triggerInfo); 00540 } 00541 // Test move callback ? 00542 else if (subMessage=="TM") 00543 { 00544 // Read the primitive id and test result 00545 NLPACS::UMovePrimitive::TUserData id; 00546 bool testResult; 00547 msgin.serial (id, testResult); 00548 00549 // Call the callback 00550 client->testMoveCallback (id, testResult); 00551 } 00552 // Test move callback ? 00553 else if (subMessage=="PS") 00554 { 00555 // Read the primitive id and test result 00556 NLPACS::UMovePrimitive::TUserData id; 00557 NLMISC::CVectorD position; 00558 NLMISC::CVectorD speed; 00559 msgin.serial (id, position, speed); 00560 00561 // Call the callback 00562 client->getPositionSpeedCallback (id, position, speed); 00563 } 00564 else 00565 NLMISC::nlError ("Pacs client: unkown sub message string"); 00566 00567 // Next message ? 00568 msgin.serial (again); 00569 } 00570 } |
|
This message is send by the service to answer the getPositionSpeed request.
Definition at line 491 of file pacs_client.h. Referenced by addPrimitive(), evalCollision(), getPositionSpeed(), globalMove(), initMessage(), rayTest(), relativeMove(), removePrimitive(), sendMessage(), setAbsorption(), setCollisionMask(), setCurrentPrimitive(), setHeight(), setObstacle(), setOcclusionMask(), setOrientation(), setPrimitiveType(), setRadius(), setReactionType(), setSize(), setTriggerType(), and testMove(). |
|
This message is send by the service to answer the getPositionSpeed request.
Definition at line 490 of file pacs_client.h. |