| 1 | /* |
| 2 | * |
| 3 | * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * Further, this software is distributed without any warranty that it is |
| 16 | * free of the rightful claim of any third person regarding infringement |
| 17 | * or the like. Any license provided herein, whether implied or |
| 18 | * otherwise, applies only to this software file. Patent licenses, if |
| 19 | * any, provided herein do not apply to combinations of this program with |
| 20 | * other software, or any other product whatsoever. |
| 21 | * |
| 22 | * You should have received a copy of the GNU Lesser General Public |
| 23 | * License along with this library; if not, write to the Free Software |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 | * |
| 26 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, |
| 27 | * Mountain View, CA 94043, or: |
| 28 | * |
| 29 | * http://www.sgi.com |
| 30 | * |
| 31 | * For further information regarding this notice, see: |
| 32 | * |
| 33 | * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ |
| 34 | * |
| 35 | */ |
| 36 | |
| 37 | /* |
| 38 | * Copyright (C) 1995-96 Silicon Graphics, Inc. |
| 39 | * |
| 40 | _______________________________________________________________________ |
| 41 | ______________ S I L I C O N G R A P H I C S I N C . ____________ |
| 42 | | |
| 43 | | $Revision: 1.1.1.1 $ |
| 44 | | |
| 45 | | Classes: |
| 46 | | SoV2FontStyle |
| 47 | | |
| 48 | | Author(s) : David Mott |
| 49 | | |
| 50 | ______________ S I L I C O N G R A P H I C S I N C . ____________ |
| 51 | _______________________________________________________________________ |
| 52 | */ |
| 53 | |
| 54 | #include "SoV2FontStyle.h"cxx . . $ `<file>/lib/database/src/so/upgraders/SoV2FontStyle.h`/ |
| 55 | #include <Inventor/nodes/SoFontStyle.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoFontStyle.h`/ |
| 56 | #include <Inventor/elements/SoFontNameElement.h>cxx . . $ `<file>/lib/database/include/Inventor/elements/SoFontNameElement.h`/ |
| 57 | #include <Inventor/elements/SoFontSizeElement.h>cxx . . $ `<file>/lib/database/include/Inventor/elements/SoFontSizeElement.h`/ |
| 58 | #include <Inventor/errors/SoReadError.h>cxx . . $ `<file>/lib/database/include/Inventor/errors/SoReadError.h`/ |
| 59 | |
| 60 | SO_NODE_SOURCEcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:241:9`!(SoV2FontStyle); |
| 61 | |
| 62 | //////////////////////////////////////////////////////////////////////// |
| 63 | // |
| 64 | // Description: |
| 65 | // Default constructor |
| 66 | // |
| 67 | // Use: public |
| 68 | |
| 69 | SoV2FontStylecxx . . $ SoV2FontStyle#::SoV2FontStylecxx . . $ SoV2FontStyle#SoV2FontStyle(49f6e7a06ebc5aa8).() |
| 70 | // |
| 71 | //////////////////////////////////////////////////////////////////////// |
| 72 | { |
| 73 | SO_NODE_CONSTRUCTORcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:309:9`!(SoV2FontStyle); |
| 74 | |
| 75 | SO_NODE_ADD_FIELDcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:346:9`!(family, (SERIF)); |
| 76 | SO_NODE_ADD_FIELDcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:346:9`!(style, (NONE)); |
| 77 | SO_NODE_ADD_FIELDcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:346:9`!(name, (SoFontNameElement::getDefault())); |
| 78 | SO_NODE_ADD_FIELDcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:346:9`!(size, (SoFontSizeElement::getDefault())); |
| 79 | SO_NODE_ADD_FIELDcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:346:9`!(alternateRep, (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)); |
| 80 | |
| 81 | // Set up static info for enumerated type field |
| 82 | SO_NODE_DEFINE_ENUM_VALUEcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:378:9`!(Family, SERIF); |
| 83 | SO_NODE_DEFINE_ENUM_VALUEcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:378:9`!(Family, SANS); |
| 84 | SO_NODE_DEFINE_ENUM_VALUEcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:378:9`!(Family, TYPEWRITER); |
| 85 | |
| 86 | SO_NODE_DEFINE_ENUM_VALUEcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:378:9`!(Style, NONE); |
| 87 | SO_NODE_DEFINE_ENUM_VALUEcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:378:9`!(Style, BOLD); |
| 88 | SO_NODE_DEFINE_ENUM_VALUEcxx . . $ `lib/database/include/Inventor/nodes/SoSubNode.h:378:9`!(Style, ITALIC); |
| 89 | |
| 90 | // Set up info in enumerated type field |
| 91 | SO_NODE_SET_SF_ENUM_TYPEcxx . . $ `lib/database/include/Inventor/fields/SoSFEnum.h:155:9`!(family, Family); |
| 92 | SO_NODE_SET_SF_ENUM_TYPEcxx . . $ `lib/database/include/Inventor/fields/SoSFEnum.h:155:9`!(style, Style); |
| 93 | } |
| 94 | |
| 95 | //////////////////////////////////////////////////////////////////////// |
| 96 | // |
| 97 | // Description: |
| 98 | // Destructor. |
| 99 | // |
| 100 | // Use: private |
| 101 | |
| 102 | SoV2FontStylecxx . . $ SoV2FontStyle#::~cxx . . $ SoV2FontStyle#`~SoV2FontStyle`(49f6e7a06ebc5aa8).SoV2FontStylecxx . . $ SoV2FontStyle#() |
| 103 | // |
| 104 | //////////////////////////////////////////////////////////////////////// |
| 105 | { |
| 106 | } |
| 107 | |
| 108 | //////////////////////////////////////////////////////////////////////// |
| 109 | // |
| 110 | // Description: |
| 111 | // Create a version 2.1 FontStyle. |
| 112 | // |
| 113 | // Use: private |
| 114 | |
| 115 | SoNodecxx . . $ SoNode# * |
| 116 | SoV2FontStylecxx . . $ SoV2FontStyle#::createNewNodecxx . . $ SoV2FontStyle#createNewNode(37b0c20759e6fed3).() |
| 117 | // |
| 118 | //////////////////////////////////////////////////////////////////////// |
| 119 | { |
| 120 | SoFontStylecxx . . $ SoFontStyle# *result = SO_UPGRADER_CREATE_NEWcxx . . $ `lib/database/include/Inventor/misc/upgraders/SoUpgrader.h:161:9`!(SoFontStyle); |
| 121 | |
| 122 | // |
| 123 | // Inventor 2.0 did not have FontStyle. When we convert 2.1 to 2.0 files, |
| 124 | // the FontStyle gets written with an alternateRep. When we read that 2.0 |
| 125 | // file back into 2.1, we can discard the alternateRep. Programs written |
| 126 | // with 2.0 will gladly use the alternateRep. |
| 127 | // |
| 128 | |
| 129 | // Copy all fields as is (except alternateRep which is ignored) |
| 130 | SO_UPGRADER_COPY_FIELDcxx . . $ `lib/database/include/Inventor/misc/upgraders/SoUpgrader.h:156:9`!(name, result); |
| 131 | SO_UPGRADER_COPY_FIELDcxx . . $ `lib/database/include/Inventor/misc/upgraders/SoUpgrader.h:156:9`!(size, result); |
| 132 | SO_UPGRADER_COPY_FIELDcxx . . $ `lib/database/include/Inventor/misc/upgraders/SoUpgrader.h:156:9`!(family, result); |
| 133 | SO_UPGRADER_COPY_FIELDcxx . . $ `lib/database/include/Inventor/misc/upgraders/SoUpgrader.h:156:9`!(style, result); |
| 134 | |
| 135 | return result; |
| 136 | } |
| 137 | //////////////////////////////////////////////////////////////////////// |
| 138 | // |
| 139 | // Description: |
| 140 | // special upgrade method to read field description |
| 141 | // |
| 142 | // Use: public, internal, virtual |
| 143 | SbBoolcxx . . $ SbBool# |
| 144 | SoV2FontStylecxx . . $ SoV2FontStyle#::upgradecxx . . $ SoV2FontStyle#upgrade(2025cb8b3a26f0e3).(SoInputcxx . . $ SoInput# *in, const SbNamecxx . . $ SbName# &refName, SoBasecxx . . $ SoBase# *&result) |
| 145 | // |
| 146 | //////////////////////////////////////////////////////////////////////// |
| 147 | { |
| 148 | SbBoolcxx . . $ SbBool# isBinary = in->isBinarycxx . . $ SoInput#isBinary(b126dc7c1de90089).(); |
| 149 | if (in->isBinarycxx . . $ SoInput#isBinary(b126dc7c1de90089).()){ |
| 150 | SbStringcxx . . $ SbString# unknownStringcxx . . $ SbString#SbString(49f6e7a06ebc5aa8).; |
| 151 | SbBoolcxx . . $ SbBool# readOK = in->readcxx . . $ SoInput#read(279155daee2f202d).(unknownString); |
| 152 | if (!readOK || (unknownString !=cxx . . $ `operator!=`(7399b355b639fe1). "fields" )) { |
| 153 | SoReadErrorcxx . . $ SoReadError#::postcxx . . $ SoReadError#post(a08c53ae8c2fb13c).(in, "Problem upgrading vertex property ") ; |
| 154 | return FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 155 | } |
| 156 | } |
| 157 | SbBoolcxx . . $ SbBool# ret = SoUpgradercxx . . $ SoUpgrader#::upgradecxx . . $ SoUpgrader#upgrade(2025cb8b3a26f0e3).(in, refName, result); |
| 158 | |
| 159 | if (in->isBinarycxx . . $ SoInput#isBinary(b126dc7c1de90089).()){ |
| 160 | // Read a zero, which represents the number of children here |
| 161 | int dummy; |
| 162 | in->readcxx . . $ SoInput#read(795be11dee30bb15).(dummy); |
| 163 | } |
| 164 | |
| 165 | return ret; |
| 166 | } |