1 /*
2  * NodeNormal.h
3  *
4  * Copyright (C) 1999 Stephen F. White
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 
29 class ProtoNormal : public WonderlandExportProto {
30 public:
31                     ProtoNormal(Scene *scene);
32     virtual Node   *create(Scene *scene);
33 
getType()34     virtual int     getType() const { return VRML_NORMAL; }
getProfile(void)35     virtual int     getProfile(void) const { return PROFILE_INTERCHANGE; }
36 
isDeclaredInRwd_h()37     virtual bool    isDeclaredInRwd_h() { return true; }
38 
39     FieldIndex vector;
40 };
41 
42 class NodeNormal : public Node {
43 public:
44                     NodeNormal(Scene *scene, Proto *proto);
45 
getX3dVersion(void)46     virtual int     getX3dVersion(void) const { return 0; }
copy()47     virtual Node   *copy() const { return new NodeNormal(*this); }
48 
isInvalidChildNode(void)49     virtual bool    isInvalidChildNode(void) { return true; }
50 
51     virtual void    setField(int index, FieldValue *value, int cf = -1);
52 
53     virtual void    drawHandles(void);
54     virtual void    flip(int index);
55     virtual void    swap(int fromTo);
56 
57     fieldMacros(MFVec3f, vector, ProtoNormal)
58 };
59 
60