1 /*
2  * NodeFillProperties.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 "DuneApp.h"
28 #include "SFMFTypes.h"
29 
30 class ProtoFillProperties : public Proto {
31 public:
32                     ProtoFillProperties(Scene *scene);
33     virtual Node   *create(Scene *scene);
34 
getType()35     virtual int     getType() const { return X3D_FILL_PROPERTIES; }
36 
isX3dInternalProto(void)37     virtual bool    isX3dInternalProto(void) { return true; }
38 
39     FieldIndex filled;
40     FieldIndex hatchColor;
41     FieldIndex hatched;
42     FieldIndex hatchStyle;
43 };
44 
45 
46 class NodeFillProperties : public Node {
47 public:
48                     NodeFillProperties(Scene *scene, Proto *proto);
49 
getComponentName(void)50     virtual const char* getComponentName(void) const { return "Shape"; }
getComponentLevel(void)51     virtual int         getComponentLevel(void) const { return 3; }
getX3dVersion(void)52     virtual int     getX3dVersion(void) const { return 0; }
copy()53     virtual Node   *copy() const { return new NodeFillProperties(*this); }
54 
isInvalidChildNode(void)55     virtual bool    isInvalidChildNode(void) { return true; }
56 
writeProto(int f)57     virtual int     writeProto(int f) { return writeX3dProto(f); }
58 
59     fieldMacros(SFBool,  filled,     ProtoFillProperties)
60     fieldMacros(SFColor, hatchColor, ProtoFillProperties)
61     fieldMacros(SFBool,  hatched,    ProtoFillProperties)
62     fieldMacros(SFInt32, hatchStyle, ProtoFillProperties)
63 };
64 
65