1 /*
2  * NodeReceiverPdu.h
3  *
4  * Copyright (C) 1999 Stephen F. White, 2008 J. "MUFTI" Scheurich
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program (see the file "COPYING" for details); if
18  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19  * Cambridge, MA 02139, USA.
20  */
21 
22 #pragma once
23 
24 #include "Node.h"
25 #include "ProtoMacros.h"
26 #include "Proto.h"
27 #include "SFMFTypes.h"
28 #include "DISCommonFields.h"
29 
30 class ProtoReceiverPdu : public Proto {
31 public:
32                     ProtoReceiverPdu(Scene *scene);
33     virtual Node   *create(Scene *scene);
34 
getType()35     virtual int     getType() const { return X3D_RECEIVER_PDU; }
36 
isX3dInternalProto(void)37     virtual bool    isX3dInternalProto(void) { return true; }
38 
39     disCommonBehaviorFieldIndex()
40     disCommonIdentificationFieldIndex()
41     disCommonCommunicationFieldIndex()
42     FieldIndex radioID;
43     FieldIndex receivedPower;
44     FieldIndex receiverState;
45     FieldIndex transmitterApplicationID;
46     FieldIndex transmitterEntityID;
47     FieldIndex transmitterRadioID;
48     FieldIndex transmitterSiteID;
49     FieldIndex whichGeometry;
50     FieldIndex bboxCenter;
51     FieldIndex bboxSize;
52 };
53 
54 class NodeReceiverPdu : public Node {
55 public:
56                     NodeReceiverPdu(Scene *scene, Proto *proto);
57 
getComponentName(void)58     virtual const char* getComponentName(void) const { return "DIS"; }
getComponentLevel(void)59     virtual int         getComponentLevel(void) const { return 1; }
getX3dVersion(void)60     virtual int     getX3dVersion(void) const { return 0; }
copy()61     virtual Node   *copy() const { return new NodeReceiverPdu(*this); }
62 
63     disCommonBehaviorFieldMacros(ProtoReceiverPdu)
64     disCommonIdentificationFieldMacros(ProtoReceiverPdu)
65     disCommonCommunicationFieldMacros(ProtoReceiverPdu)
66     fieldMacros(SFInt32, radioID,                  ProtoReceiverPdu)
67     fieldMacros(SFFloat, receivedPower,            ProtoReceiverPdu)
68     fieldMacros(SFInt32, receiverState,            ProtoReceiverPdu)
69     fieldMacros(SFInt32, transmitterApplicationID, ProtoReceiverPdu)
70     fieldMacros(SFInt32, transmitterEntityID,      ProtoReceiverPdu)
71     fieldMacros(SFInt32, transmitterRadioID,       ProtoReceiverPdu)
72     fieldMacros(SFInt32, transmitterSiteID,        ProtoReceiverPdu)
73     fieldMacros(SFInt32, whichGeometry,            ProtoReceiverPdu)
74     fieldMacros(SFVec3f, bboxCenter,               ProtoReceiverPdu)
75     fieldMacros(SFVec3f, bboxSize,                 ProtoReceiverPdu)
76 };
77 
78