1 /* 2 * NodeComment.cpp 3 * 4 * Fake node to store comments in VRML files 5 * 6 * Copyright (C) 1999 Stephen F. White, 2004 J. "MUFTI" Scheurich 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., 675 Mass Ave, 21 * Cambridge, MA 02139, USA. 22 */ 23 24 #pragma once 25 26 #include "Node.h" 27 #include "ProtoMacros.h" 28 #include "Proto.h" 29 #include "SFMFTypes.h" 30 31 class ProtoComment : public Proto { 32 public: 33 ProtoComment(Scene *scene); 34 virtual Node *create(Scene *scene); 35 getType()36 virtual int getType() const { return VRML_COMMENT; } 37 38 FieldIndex comment; 39 }; 40 41 class NodeComment : public Node { 42 public: 43 NodeComment(Scene *scene, Proto *proto); 44 getProfile(void)45 virtual int getProfile(void) const { return PROFILE_CORE; } getX3dVersion(void)46 virtual int getX3dVersion(void) const { return 0; } copy()47 virtual Node *copy() const { return new NodeComment(*this); } 48 49 virtual int write(int filedes, int indent, bool avoidUse = false); 50 51 fieldMacros(MFString, comment, ProtoComment) 52 }; 53