1 /*
2 * NodeText3D.cpp
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 #include "stdafx.h"
23
24 #include "swt.h"
25 #include "NodeText3D.h"
26 #include "Proto.h"
27 #include "FieldValue.h"
28 #include "MFNode.h"
29 #include "SFVec3f.h"
30 #include "SFFloat.h"
31 #include "NodeShape.h"
32 #include "NodeAnchor.h"
33 #include "Scene.h"
34
ProtoText3D(Scene * scene)35 ProtoText3D::ProtoText3D(Scene *scene)
36 : ProtoText(scene, "Text3D")
37 {
38 depth.set(
39 addExposedField(SFFLOAT, "depth", new SFFloat(0.1f), new SFFloat(0.0f)));
40 setFieldFlags(depth, FF_KAMBI_ONLY);
41
42 addURLs(URL_KAMBI);
43 }
44
45 Node *
create(Scene * scene)46 ProtoText3D::create(Scene *scene)
47 {
48 return new NodeText3D(scene, this);
49 }
50
NodeText3D(Scene * scene,Proto * def)51 NodeText3D::NodeText3D(Scene *scene, Proto *def)
52 : NodeText(scene, def)
53 {
54 }
55
56 int
writeProto(int f)57 NodeText3D::writeProto(int f)
58 {
59 if (m_scene->isX3dXml())
60 return writeX3dProto(f);
61
62 RET_ONERROR( mywritestr(f ,"EXTERNPROTO Text3D[\n") )
63 TheApp->incSelectionLinenumber();
64 RET_ONERROR( writeProtoArguments(f) )
65 RET_ONERROR( mywritestr(f ," ]\n") )
66 TheApp->incSelectionLinenumber();
67 RET_ONERROR( mywritestr(f ,"[\n") )
68 TheApp->incSelectionLinenumber();
69 RET_ONERROR( mywritestr(f ," \"urn:castle-engine.sourceforge.net:node:Text3D\",\n") )
70 TheApp->incSelectionLinenumber();
71 RET_ONERROR( mywritestr(f ," \"http://castle-engine.sourceforge.net/fallback_prototypes.wrl#Text3D\",\n") )
72 TheApp->incSelectionLinenumber();
73 RET_ONERROR( mywritestr(f ,"]\n") )
74 TheApp->incSelectionLinenumber();
75 return 0;
76 }
77
78