1 /*
2  * NodeExample.h
3  *
4  * Copyright (C) 1999 Stephen F. White, 2006 J. "MUFTI" Scheurich
5  *
6  * Example of a minimal VRML97 node implementation
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program (see the file "COPYING" for details); if
20  * not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22  */
23 
24 #ifndef _NODE_EXAMPLE_H
25 #define _NODE_EXAMPLE_H
26 
27 #ifndef _NODE_H
28 #include "Node.h"
29 #endif
30 #ifndef _PROTO_MACROS_H
31 #include "ProtoMacros.h"
32 #endif
33 #ifndef _PROTO_H
34 #include "Proto.h"
35 #endif
36 
37 #include "SFMFTypes.h"
38 
39 class ProtoExample : public Proto {
40 public:
41 		    ProtoExample(Scene *scene);
42     virtual Node   *create(Scene *scene);
43 
44     FieldIndex field1;
45     FieldIndex field2;
46 };
47 
48 class NodeExample : public Node {
49 public:
50 		    NodeExample(Scene *scene, Proto *proto);
51 
getType()52     virtual int	    getType() const { return DUNE_EXAMPLE; }
copy()53     virtual Node   *copy() const { return new NodeExample(*this); }
54 
55     //replace SFExampleTyp or MFExampleTyp with something like SFBool or MFVec3f
56 
57     fieldMacros(SFExampleTyp, field1, ProtoExample)
58     fieldMacros(MFExampleTyp, field2, ProtoExample)
59 };
60 
61 #endif // _NODE_EXAMPLE_H
62